module arch.node.engines.shard;

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

import arch.node.engines.shard_config open public;
import arch.node.engines.shard_messages open public;
import arch.node.engines.shard_environment open public;
import arch.node.engines.shard_behaviour open public;

import arch.node.types.anoma as Anoma open;

open shard_config_example;
open shard_environment_example;

ShardEngine (KVSKey KVSDatum Executable ProgramState : Type) : Type :=
  Engine
    ShardCfg
    (ShardLocalState KVSKey KVSDatum)
    ShardMailboxState
    ShardTimerHandle
    ShardActionArguments
    (Anoma.PreMsg KVSKey KVSDatum Executable)
    (Anoma.PreCfg KVSKey KVSDatum Executable)
    (Anoma.PreEnv KVSKey KVSDatum Executable ProgramState);

exampleShardEngine : ShardEngine String String ByteString String :=
  mkEngine@{
    cfg := shardCfg;
    env := shardEnv;
    behaviour := shardBehaviour;
  };