ouroboros-consensus
Safe HaskellNone
LanguageHaskell2010

Test.Consensus.Leios.Environment

Description

The node's peers, as run by the Leios node-vs-environment tests.

A peer connects to the node as the node's diffusion layer would have it: over an in-memory bearer, the two run the handshake and then a mux each. The node's end runs its whole negotiated bundle, starting every initiator as for a hot peer and every responder as the bundle says. The peer's end answers each of the node's initiators:

  • KeepAlive and PeerSharing with the servers a node runs;
  • ChainSync by finding the intersection at genesis and then never sending a header;
  • BlockFetch and TxSubmission by never saying anything, which is all the node sees of a peer with nothing to offer;
  • LeiosNotify with whatever the test gives it.
Synopsis

Documentation

data EnvPeer (m ∷ Type → Type) Source #

What a peer runs for LeiosNotify.

Constructors

EnvPeer 

Fields

data NodeVsEnvConnection (m ∷ Type → Type) Source #

A connection from the node to a peer, once the handshake has settled on a version.

Constructors

NodeVsEnvConnection 

Fields

withNodeVsEnvConnection ∷ NodeUnderTest (IOSim s) → PeerAddr → EnvPeer (IOSim s) → (NodeVsEnvConnection (IOSim s) → IOSim s a) → IOSim s a Source #

Connect the node to the peer at the given address, run the body, then shut both ends down.