Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Hydra.Network.Ouroboros
Description
Ouroboros-based implementation of Network
interface.
This implements a dumb FireForget
protocol and maintains one connection to each peer.
Contrary to other protocols implemented in Ouroboros, this is a push-based protocol.
Synopsis
- withOuroborosNetwork :: forall msg. (ToCBOR msg, FromCBOR msg) => Tracer IO (WithHost (TraceOuroborosNetwork msg)) -> Host -> [Host] -> NetworkCallback msg IO -> (Network IO msg -> IO ()) -> IO ()
- withIOManager :: WithIOManager
- data TraceOuroborosNetwork msg
- data PortNumber
- data Host = Host {
- hostname :: Text
- port :: PortNumber
- type NetworkComponent m msg a = NetworkCallback msg m -> (Network m msg -> m a) -> m a
- type NetworkCallback msg m = msg -> m ()
- newtype Network m msg = Network {
- broadcast :: msg -> m ()
- encodeTraceSendRecvFireForget :: forall msg. ToJSON msg => TraceSendRecv (FireForget msg) -> [Pair]
Documentation
withOuroborosNetwork :: forall msg. (ToCBOR msg, FromCBOR msg) => Tracer IO (WithHost (TraceOuroborosNetwork msg)) -> Host -> [Host] -> NetworkCallback msg IO -> (Network IO msg -> IO ()) -> IO () Source #
withIOManager :: WithIOManager #
data TraceOuroborosNetwork msg Source #
Instances
data PortNumber #
Instances
Constructors
Host | |
Fields
|
Instances
Arbitrary Host Source # | |
FromJSON Host Source # | |
Defined in Hydra.Network | |
ToJSON Host Source # | |
Defined in Hydra.Network Methods toEncoding :: Host -> Encoding toJSONList :: [Host] -> Value toEncodingList :: [Host] -> Encoding | |
Generic Host Source # | |
Read Host Source # | |
Show Host Source # | |
FromCBOR Host Source # | |
ToCBOR Host Source # | |
Defined in Hydra.Network Methods encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy Host -> Size encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [Host] -> Size | |
Eq Host Source # | |
Ord Host Source # | |
type Rep Host Source # | |
Defined in Hydra.Network type Rep Host = D1 ('MetaData "Host" "Hydra.Network" "hydra-node-0.13.0-HKlbaPrFKjs2dhEMwn7ono" 'False) (C1 ('MetaCons "Host" 'PrefixI 'True) (S1 ('MetaSel ('Just "hostname") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "port") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PortNumber))) |
type NetworkComponent m msg a = NetworkCallback msg m -> (Network m msg -> m a) -> m a Source #
A type tying both inbound and outbound messages sending in a single Component.
type NetworkCallback msg m = msg -> m () Source #
Handle to interface for inbound messages.
newtype Network m msg Source #
Handle to interface with the hydra network and send messages "off chain".
encodeTraceSendRecvFireForget :: forall msg. ToJSON msg => TraceSendRecv (FireForget msg) -> [Pair] Source #