Skip to content

Failure

[10 of 17] Compiling arch.node.engines.commitment [11 of 17] Compiling arch.node.engines.commitment_behaviour [15 of 17] Compiling arch.node.engines.commitment_environment /home/runner/work/nspec/nspec/docs/arch/node/engines/commitment_environment.juvix.md:99:7-11: error: Unexpected argument node


icon: octicons/gear-16 search: exclude: false categories: - engine tags: - commitment-engine - engine-definition


Juvix imports
module arch.node.engines.commitment;

import prelude open;
import arch.node.types.engine open;

import arch.node.engines.commitment_messages open public;
import arch.node.engines.commitment_environment open public;
import arch.node.engines.commitment_behaviour open public;
open commitment_environment_example;

Commitment Engine

The Commitment engine is responsible for generating commitments (signatures) by a particular identity. Commitment engine instances are generated by the Identity Management Engine when an identity is generated or connected.

Purpose

The Commitment Engine maintains signing capabilities for a specific identity and handles commitment (signature) requests for that identity. Only the original caller and anyone to whom they pass the engine instance reference can send messages to the instance and generate commitments by the corresponding identity.

Components

Type

CommitmentEngine : Type := Engine
  CommitmentLocalState
  CommitmentMailboxState
  CommitmentTimerHandle
  CommitmentMatchableArgument
  CommitmentActionLabel
  CommitmentPrecomputation;

Example of a commitment engine

exampleCommitmentEngine : CommitmentEngine :=
  mkEngine@{
    initEnv := commitmentEnvironment;
    behaviour := commitmentBehaviour;
  };

where commitmentEnvironment is defined as follows:

axiom dummyExternalIdentity : ExternalIdentity;

axiom dummyIDBackend : Backend;

axiom dummySigningKey : SigningKey;

commitmentEnvironment : CommitmentEnvironment :=
mkEngineEnvironment@{
name := "commitment";
localState :=
mkCommitmentLocalState@{
signer :=
mkSigner@{
sign := \{_ x := Ed25519Signature};
};
backend := BackendLocalMemory;
};
mailboxCluster := Map.empty;
acquaintances := Set.empty;
timers := [];
};

and commitmentBehaviour is defined as follows:

commitmentBehaviour : CommitmentBehaviour :=
mkEngineBehaviour@{
guards := [commitGuard];
action := commitmentAction;
conflictSolver := commitmentConflictSolver;
};
(Wiki) links on this page