Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cardano.Api.Network
Synopsis
- data NetworkId
- newtype NetworkMagic = NetworkMagic {}
- fromNetworkMagic :: NetworkMagic -> NetworkId
- toNetworkMagic :: NetworkId -> NetworkMagic
- mainnetNetworkMagic :: NetworkMagic
- data LedgerPeerSnapshot where
- LedgerPeerSnapshotV1 (WithOrigin SlotNo, [(AccPoolStake, (PoolStake, NonEmpty RelayAccessPoint))])
- pattern LedgerPeerSnapshot :: (WithOrigin SlotNo, [(AccPoolStake, (PoolStake, NonEmpty RelayAccessPoint))]) -> LedgerPeerSnapshot
- data Target point
- = VolatileTip
- | SpecificPoint point
- | ImmutableTip
- newtype Serialised (a :: k) = Serialised {}
- data SubmitResult reason
- = SubmitSuccess
- | SubmitFail reason
- toByronProtocolMagicId :: NetworkId -> ProtocolMagicId
- toByronNetworkMagic :: NetworkId -> NetworkMagic
- toByronRequiresNetworkMagic :: NetworkId -> RequiresNetworkMagic
- toShelleyNetwork :: NetworkId -> Network
- fromShelleyNetwork :: Network -> NetworkMagic -> NetworkId
Network types
newtype NetworkMagic Source #
NetworkMagic is used to differentiate between different networks during the initial handshake.
Constructors
NetworkMagic | |
Fields |
Instances
network
reexports
data LedgerPeerSnapshot Source #
The type of big ledger peers that is serialised or later provided by node configuration for the networking layer to connect to when syncing.
Constructors
LedgerPeerSnapshotV1 (WithOrigin SlotNo, [(AccPoolStake, (PoolStake, NonEmpty RelayAccessPoint))]) | Internal use for version 1, use pattern synonym for public API |
Bundled Patterns
pattern LedgerPeerSnapshot :: (WithOrigin SlotNo, [(AccPoolStake, (PoolStake, NonEmpty RelayAccessPoint))]) -> LedgerPeerSnapshot | Public API to access snapshot data. Currently access to only most recent version is available. Nonetheless, serialisation from the node into JSON is supported for older versions via internal api so that newer CLI can still support older node formats. |
Instances
FromJSON LedgerPeerSnapshot | |
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type Methods parseJSON :: Value -> Parser LedgerPeerSnapshot # parseJSONList :: Value -> Parser [LedgerPeerSnapshot] # | |
ToJSON LedgerPeerSnapshot | |
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type Methods toJSON :: LedgerPeerSnapshot -> Value # toEncoding :: LedgerPeerSnapshot -> Encoding # toJSONList :: [LedgerPeerSnapshot] -> Value # toEncodingList :: [LedgerPeerSnapshot] -> Encoding # omitField :: LedgerPeerSnapshot -> Bool # | |
Show LedgerPeerSnapshot | |
FromCBOR LedgerPeerSnapshot | |
ToCBOR LedgerPeerSnapshot | |
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type Methods toCBOR :: LedgerPeerSnapshot -> Encoding Source # encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy LedgerPeerSnapshot -> Size Source # encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [LedgerPeerSnapshot] -> Size Source # | |
Eq LedgerPeerSnapshot | |
Defined in Ouroboros.Network.PeerSelection.LedgerPeers.Type Methods (==) :: LedgerPeerSnapshot -> LedgerPeerSnapshot -> Bool Source # (/=) :: LedgerPeerSnapshot -> LedgerPeerSnapshot -> Bool Source # |
Constructors
VolatileTip | The tip of the volatile chain Cannot fail to be acquired. |
SpecificPoint point | A specified point Fails to be acquired if the point is not between
|
ImmutableTip | The tip of the immutable chain Cannot fail to be acquired. Requires at least |
Instances
Foldable Target | |||||
Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type Methods fold :: Monoid m => Target m -> m Source # foldMap :: Monoid m => (a -> m) -> Target a -> m Source # foldMap' :: Monoid m => (a -> m) -> Target a -> m Source # foldr :: (a -> b -> b) -> b -> Target a -> b Source # foldr' :: (a -> b -> b) -> b -> Target a -> b Source # foldl :: (b -> a -> b) -> b -> Target a -> b Source # foldl' :: (b -> a -> b) -> b -> Target a -> b Source # foldr1 :: (a -> a -> a) -> Target a -> a Source # foldl1 :: (a -> a -> a) -> Target a -> a Source # toList :: Target a -> [a] Source # null :: Target a -> Bool Source # length :: Target a -> Int Source # elem :: Eq a => a -> Target a -> Bool Source # maximum :: Ord a => Target a -> a Source # minimum :: Ord a => Target a -> a Source # | |||||
Traversable Target | |||||
Functor Target | |||||
Generic (Target point) | |||||
Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type Associated Types
| |||||
Show point => Show (Target point) | |||||
NFData point => NFData (Target point) | |||||
Eq point => Eq (Target point) | |||||
Ord point => Ord (Target point) | |||||
Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type Methods compare :: Target point -> Target point -> Ordering Source # (<) :: Target point -> Target point -> Bool Source # (<=) :: Target point -> Target point -> Bool Source # (>) :: Target point -> Target point -> Bool Source # (>=) :: Target point -> Target point -> Bool Source # max :: Target point -> Target point -> Target point Source # min :: Target point -> Target point -> Target point Source # | |||||
type Rep (Target point) | |||||
Defined in Ouroboros.Network.Protocol.LocalStateQuery.Type type Rep (Target point) = D1 ('MetaData "Target" "Ouroboros.Network.Protocol.LocalStateQuery.Type" "ouroboros-network-protocols-0.14.0.1-2ee06c4b8f9af1ec89a881193864771e11036eab1a452efff80be4f517c8d84d" 'False) (C1 ('MetaCons "VolatileTip" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "SpecificPoint" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 point)) :+: C1 ('MetaCons "ImmutableTip" 'PrefixI 'False) (U1 :: Type -> Type))) |
newtype Serialised (a :: k) Source #
An already serialised value
When streaming blocks/header from disk to the network, there is often no need to deserialise them, as we'll just end up serialising them again when putting them on the wire.
Constructors
Serialised | |
Fields |
Instances
StandardHash block => StandardHash (Serialised block :: Type) | |
Defined in Ouroboros.Network.Block | |
ShowProxy a => ShowProxy (Serialised a :: Type) | |
Defined in Ouroboros.Network.Block | |
DecodeDiskDepIx f blk => DecodeDisk blk (GenDepPair (Serialised :: Type -> Type) (f blk)) | |
Defined in Ouroboros.Consensus.Storage.Serialisation Methods decodeDisk :: CodecConfig blk -> forall s. Decoder s (GenDepPair (Serialised :: Type -> Type) (f blk)) Source # | |
EncodeDiskDepIx f blk => EncodeDisk blk (GenDepPair (Serialised :: Type -> Type) (f blk)) | |
Defined in Ouroboros.Consensus.Storage.Serialisation Methods encodeDisk :: CodecConfig blk -> GenDepPair (Serialised :: Type -> Type) (f blk) -> Encoding Source # | |
Show (Serialised a) | |
Defined in Ouroboros.Network.Block | |
Eq (Serialised a) | |
Defined in Ouroboros.Network.Block Methods (==) :: Serialised a -> Serialised a -> Bool Source # (/=) :: Serialised a -> Serialised a -> Bool Source # | |
Serialise (Serialised a) | CBOR-in-CBOR TODO: replace with encodeEmbeddedCBOR from cborg-0.2.4 once it is available, since that will be faster. TODO: Avoid converting to a strict ByteString, as that requires copying O(n) in case the lazy ByteString consists of more than one chunks. |
Defined in Ouroboros.Network.Block Methods encode :: Serialised a -> Encoding decode :: Decoder s (Serialised a) encodeList :: [Serialised a] -> Encoding decodeList :: Decoder s [Serialised a] | |
type HeaderHash (Serialised block :: Type) | |
Defined in Ouroboros.Network.Block |
data SubmitResult reason Source #
Isomorphic with Maybe but with a name that better describes its purpose and usage.
Constructors
SubmitSuccess | |
SubmitFail reason |
Instances
Functor SubmitResult | |
Defined in Ouroboros.Network.Protocol.LocalTxSubmission.Type Methods fmap :: (a -> b) -> SubmitResult a -> SubmitResult b Source # (<$) :: a -> SubmitResult b -> SubmitResult a Source # | |
Show a => Show (SubmitResult a) Source # | |
Defined in Cardano.Api.Internal.Orphans.Serialisation | |
Eq reason => Eq (SubmitResult reason) | |
Defined in Ouroboros.Network.Protocol.LocalTxSubmission.Type Methods (==) :: SubmitResult reason -> SubmitResult reason -> Bool Source # (/=) :: SubmitResult reason -> SubmitResult reason -> Bool Source # |
Internal conversion functions
toShelleyNetwork :: NetworkId -> Network Source #
fromShelleyNetwork :: Network -> NetworkMagic -> NetworkId Source #