Networking topic

Networking

Consensus over a network the app owns: a NetNode turns gossip and timeouts into relays to send, a SecureSession protects each link, and PeerMesh runs a deterministic in-memory mesh.

Classes

AddressBook Networking
The peers a node knows: self signed records saying where each validator is reached and which keys authenticate it. add is the trusted local path; merge is the peer exchange boundary, which verifies every record and never overwrites a known id. Encoded books are canonical, so two nodes that learned the same peers hold byte identical books.
NetNode Networking
A validator or observer running BFT consensus over a gossip mesh, with no socket and no clock of its own. Every input returns an Outbound: send each relay to that peer over your transport, arm each timeout for a duration you choose, and feed what arrives back through onGossip and onTimeout. Blocks carry the transactions from setTransactions when this node proposes.
NoiseSession Networking
A Noise_XX_25519_ChaChaPoly_SHA256 link for peers that speak Noise, with a post quantum identity proof bound to the handshake hash. The initiator sends handshakeMessage, the responder answers with its own, the initiator returns completeInitiator's result, then each side sends identityProof and checks the other's with verifyIdentityProof. Authentication is post quantum; confidentiality is X25519, so use SecureSession when post quantum confidentiality is required. Always pin peerIdentity against the keys you expect.
PeerMesh Networking
A deterministic in-memory mesh of NetNodes for tests and single process networks: relays go in emission order, timeouts fire only when none pends.
SecureSession Networking
A confidential, mutually authenticated, post quantum hybrid link between two peers. Create one with AviaryNetwork.initiateSecureSession or AviaryNetwork.acceptSecureSession, exchange the handshake messages, then wrap every frame with encrypt and decrypt. Always check peerIdentity against the peers you expect: the handshake proves the peer holds that key, not that it is the peer you wanted.

Extensions

AviaryNetwork on Aviary Networking
Consensus over a network the app owns: nodes that return what to send and what to arm, and the authenticated session that protects each link.
AviaryNoise on Aviary Networking
Noise XX sessions with a post quantum identity proof, over a transport the app owns.
AviaryPeering on Aviary Networking
Self signed peer records and the address books that collect them.
NetNodeQueries on NetNode Networking
Read only views of a networked node's chain and mesh.

Enums

ConsensusStep Networking
The step of a consensus round a timeout belongs to.

Typedefs

AdmissionChallenge = ({Uint8List nonce, Uint8List wire}) Networking
An admission challenge: keep nonce, send wire to the peer.
NoiseIdentity = ({KeyPairBytes noiseStatic, KeyPairBytes sig}) Networking
A Noise identity: the X25519 static pair and the hybrid signature pair.
Outbound = ({List<Relay> relays, List<TimeoutRequest> timeouts}) Networking
What a NetNode wants done after an input: relays to send and timers to arm. The duration of a timer is the caller's choice.
PeerRecordInfo = ({String host, int id, Uint8List kemPublic, int port, Uint8List prekey, Uint8List sigPublic}) Networking
A peer record's fields, read back from its encoding.
Relay = ({Uint8List message, int to}) Networking
A gossip message to send to one peer.
SecureIdentity = ({KeyPairBytes kem, KeyPairBytes sig}) Networking
A long term peer identity: a hybrid KEM pair to receive handshakes and a hybrid signature pair to authenticate.
TimeoutRequest = ({int round, ConsensusStep step}) Networking
A consensus timer to arm; when it fires, call NetNode.onTimeout.