Skip to content
Juvix imports

module arch.node.net.transport_types;

import arch.node.types.basics open;
import arch.node.types.crypto open;
import arch.node.types.identities open;

Transport types

IPv4Address

syntax alias IPv4Address := Nat;

IPv6Address

syntax alias IPv6Address := Nat;

IPAddress

IPAddress : Type := Either IPv4Address IPv6Address;

TransportProtocol

Supported network transport protocols.

type TransportProtocol :=
| QUIC
| TLS
| WebTransport
| WebSocket
| TCP
| UDP;

TLSAddress

TLS or QUIC address.

type TLSAddress :=
mkTLSAddress@{
ip : IPAddress;
port : Nat;
cert_issuer : String;
};
ip
IP address
port
Port number
cert_issuer
TLS certificate issuer fingerprint

TransportAddress

type TransportAddress :=
| QUICAddr TLSAddress
| TLSAddr TLSAddress
| IPAddr IPAddress;

TransportOrderingPrefs

Transport ordering preferences for an outgoing message.

type TransportOrderingPrefs :=
| TransportOrdered
| TransportUnordered;

TransportReliabilityPrefs

Transport reliability preferences for an outgoing message.

type TransportReliabilityPrefs :=
| TransportReliable
| TransportUnreliable;

TransportSecurityPrefs

Transport ordering preferences for an outgoing message.

type TransportSecurityPrefs := TransportDirect;

TransportPrefs

Transport preferences for an outgoing message.

type TransportPrefs :=
mkTransportPrefs@{
ordering : TransportOrderingPrefs;
reliability : TransportReliabilityPrefs;
security : TransportSecurityPrefs;
};
ordering
Transport ordering preferences
reliability
Transport reliability preferences
security
Transport security preferences

SerializedMsg

Serialized message. Contains an EngineMsg.

type SerializedMsg := BARE ByteString;
Arguments
SerializedMsgBARE
BARE

EncryptedMsg

Serialized message encrypted with the specified algorithm. Contains a SerializedMsg.

type EncryptedMsg := EncryptedMsgNull ByteString;
Arguments
EncryptedMsgNull
No encryption.