Juvix imports
module arch.node.net.transport;
import arch.node.net.transport_messages open;
import arch.node.net.transport_config open;
import arch.node.net.transport_environment open;
import arch.node.net.transport_behaviour open;
import arch.node.types.basics open;
import arch.node.types.engine open;
import arch.node.types.anoma as Anoma open;
open transport_config_example;
open transport_environment_example;
Transport Engine¶
Purpose¶
The Transport engine is responsible for establishing and accepting transport connections via one of the Transport Protocol engines, each of which responsible for a specific transport protocol, such as QUIC or TLS.
Engine Components¶
- Transport Messages
- Transport Config
- Transport Environment
- Transport Behaviour
Type¶
TransportEngine : Type :=
Engine
TransportLocalCfg
TransportLocalState
TransportMailboxState
TransportTimerHandle
TransportActionArguments
Anoma.Msg
Anoma.Cfg
Anoma.Env;
Instantiation¶
transportEngine : TransportEngine :=
mkEngine@{
cfg := transportCfg;
env := transportEnv;
behaviour := transportBehaviour;
};
Where transportCfg
is defined as follows:
transportCfg : TransportCfg :=
mkEngineCfg@{
node := Curve25519PubKey "0xabcd1234";
name := "transport";
cfg := mkTransportLocalCfg;
};
transportEnv
is defined as follows:
transportEnv : TransportEnv :=
mkEngineEnv@{
localState := mkTransportLocalState;
mailboxCluster := Map.empty;
acquaintances := Set.empty;
timers := [];
};
and transportBehaviour
is defined as follows:
transportBehaviour : TransportBehaviour :=
mkEngineBehaviour@{
guards := First [exampleReplyGuard];
};