| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
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
- data EnvPeer (m ∷ Type → Type) = EnvPeer {
- epLeiosNotifyServer ∷ Channel m ByteString → m ()
- epLeiosNotifyClient ∷ Maybe (Channel m ByteString → m ())
- type LeiosNotifyCodec s = Codec (LeiosNotify LeiosPoint (Header Blk) LeiosVote) DeserialiseFailure (IOSim s) ByteString
- data NodeVsEnvConnection (m ∷ Type → Type) = NodeVsEnvConnection {
- connTerminate ∷ m ()
- connNodeInitiators ∷ Map MiniProtocolNum (STM m (Either SomeException NodeToNodeInitiatorResult))
- connNodeResponders ∷ Map MiniProtocolNum (STM m (Either SomeException ()))
- connPeerLeiosNotifyClient ∷ Maybe (STM m (Either SomeException ()))
- envLeiosNotifyCodec ∷ NodeUnderTest (IOSim s) → LeiosNotifyCodec s
- withNodeVsEnvConnection ∷ NodeUnderTest (IOSim s) → PeerAddr → EnvPeer (IOSim s) → (NodeVsEnvConnection (IOSim s) → IOSim s a) → IOSim s a
Documentation
data EnvPeer (m ∷ Type → Type) Source #
What a peer runs for LeiosNotify.
Constructors
| EnvPeer | |
Fields
| |
type LeiosNotifyCodec s = Codec (LeiosNotify LeiosPoint (Header Blk) LeiosVote) DeserialiseFailure (IOSim s) ByteString Source #
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
| |
envLeiosNotifyCodec ∷ NodeUnderTest (IOSim s) → LeiosNotifyCodec s Source #
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.