Safe Haskell | None |
---|---|
Language | Haskell2010 |
Infrastructure required to run a node
The definitions in this module are independent from any specific protocol.
Synopsis
- type ImmutableDbSerialiseConstraints blk = ( EncodeDisk blk blk, DecodeDisk blk ( ByteString -> blk), DecodeDiskDep ( NestedCtxt Header ) blk, ReconstructNestedCtxt Header blk, HasBinaryBlockInfo blk)
- type LgrDbSerialiseConstraints blk = ( Serialise ( HeaderHash blk), EncodeDisk blk ( LedgerState blk), DecodeDisk blk ( LedgerState blk), EncodeDisk blk ( AnnTip blk), DecodeDisk blk ( AnnTip blk), EncodeDisk blk ( ChainDepState ( BlockProtocol blk)), DecodeDisk blk ( ChainDepState ( BlockProtocol blk)))
- class ( ImmutableDbSerialiseConstraints blk, LgrDbSerialiseConstraints blk, VolatileDbSerialiseConstraints blk, EncodeDiskDep ( NestedCtxt Header ) blk) => SerialiseDiskConstraints blk
- type VolatileDbSerialiseConstraints blk = ( EncodeDisk blk blk, DecodeDisk blk ( ByteString -> blk), DecodeDiskDep ( NestedCtxt Header ) blk, HasNestedContent Header blk, HasBinaryBlockInfo blk)
-
class
(
ConvertRawHash
blk,
SerialiseNodeToNode
blk blk,
SerialiseNodeToNode
blk (
Header
blk),
SerialiseNodeToNode
blk (
Serialised
blk),
SerialiseNodeToNode
blk (
SerialisedHeader
blk),
SerialiseNodeToNode
blk (
GenTx
blk),
SerialiseNodeToNode
blk (
GenTxId
blk)) =>
SerialiseNodeToNodeConstraints
blk
where
- estimateBlockSize :: Header blk -> SizeInBytes
- class ( Typeable blk, ConvertRawHash blk, SerialiseNodeToClient blk blk, SerialiseNodeToClient blk ( Serialised blk), SerialiseNodeToClient blk ( GenTx blk), SerialiseNodeToClient blk ( GenTxId blk), SerialiseNodeToClient blk SlotNo , SerialiseNodeToClient blk ( ApplyTxErr blk), SerialiseNodeToClient blk ( SomeSecond BlockQuery blk), SerialiseResult blk ( BlockQuery blk)) => SerialiseNodeToClientConstraints blk
- class ( LedgerSupportsProtocol blk, InspectLedger blk, HasHardForkHistory blk, LedgerSupportsMempool blk, HasTxId ( GenTx blk), QueryLedger blk, SupportedNetworkProtocolVersion blk, ConfigSupportsNode blk, ConvertRawHash blk, CommonProtocolParams blk, HasBinaryBlockInfo blk, SerialiseDiskConstraints blk, SerialiseNodeToNodeConstraints blk, SerialiseNodeToClientConstraints blk, LedgerSupportsPeerSelection blk, NodeInitStorage blk, BlockSupportsMetrics blk, Show ( CannotForge blk), Show ( ForgeStateInfo blk), Show ( ForgeStateUpdateError blk), ShowProxy blk, ShowProxy ( ApplyTxErr blk), ShowProxy ( GenTx blk), ShowProxy ( Header blk), ShowProxy ( BlockQuery blk), ShowProxy ( TxId ( GenTx blk))) => RunNode blk
SerialiseDisk
type ImmutableDbSerialiseConstraints blk = ( EncodeDisk blk blk, DecodeDisk blk ( ByteString -> blk), DecodeDiskDep ( NestedCtxt Header ) blk, ReconstructNestedCtxt Header blk, HasBinaryBlockInfo blk) Source #
EncodeDisk
and
DecodeDisk
constraints needed for the ImmutableDB.
type LgrDbSerialiseConstraints blk = ( Serialise ( HeaderHash blk), EncodeDisk blk ( LedgerState blk), DecodeDisk blk ( LedgerState blk), EncodeDisk blk ( AnnTip blk), DecodeDisk blk ( AnnTip blk), EncodeDisk blk ( ChainDepState ( BlockProtocol blk)), DecodeDisk blk ( ChainDepState ( BlockProtocol blk))) Source #
EncodeDisk
and
DecodeDisk
constraints needed for the LgrDB.
class ( ImmutableDbSerialiseConstraints blk, LgrDbSerialiseConstraints blk, VolatileDbSerialiseConstraints blk, EncodeDiskDep ( NestedCtxt Header ) blk) => SerialiseDiskConstraints blk Source #
All the serialisation related constraints needed by the ChainDB.
Instances
type VolatileDbSerialiseConstraints blk = ( EncodeDisk blk blk, DecodeDisk blk ( ByteString -> blk), DecodeDiskDep ( NestedCtxt Header ) blk, HasNestedContent Header blk, HasBinaryBlockInfo blk) Source #
EncodeDisk
and
DecodeDisk
constraints needed for the VolatileDB.
SerialiseNodeToNode
class ( ConvertRawHash blk, SerialiseNodeToNode blk blk, SerialiseNodeToNode blk ( Header blk), SerialiseNodeToNode blk ( Serialised blk), SerialiseNodeToNode blk ( SerialisedHeader blk), SerialiseNodeToNode blk ( GenTx blk), SerialiseNodeToNode blk ( GenTxId blk)) => SerialiseNodeToNodeConstraints blk where Source #
Serialisation constraints needed by the node-to-node protocols
estimateBlockSize :: Header blk -> SizeInBytes Source #
An upper bound on the size in bytes of the block corresponding to the header. This can be an overestimate, but not an underestimate.
The block fetch client uses this to estimate how bytes will be in flight. This is also used to limit the number of bytes accepted when downloading a block.
This is part of this class as it depends on the node-to-node serialisation format used for blocks.
Instances
SerialiseNodeToClient
class ( Typeable blk, ConvertRawHash blk, SerialiseNodeToClient blk blk, SerialiseNodeToClient blk ( Serialised blk), SerialiseNodeToClient blk ( GenTx blk), SerialiseNodeToClient blk ( GenTxId blk), SerialiseNodeToClient blk SlotNo , SerialiseNodeToClient blk ( ApplyTxErr blk), SerialiseNodeToClient blk ( SomeSecond BlockQuery blk), SerialiseResult blk ( BlockQuery blk)) => SerialiseNodeToClientConstraints blk Source #
Serialisation constraints needed by the node-to-client protocols
Instances
RunNode
class ( LedgerSupportsProtocol blk, InspectLedger blk, HasHardForkHistory blk, LedgerSupportsMempool blk, HasTxId ( GenTx blk), QueryLedger blk, SupportedNetworkProtocolVersion blk, ConfigSupportsNode blk, ConvertRawHash blk, CommonProtocolParams blk, HasBinaryBlockInfo blk, SerialiseDiskConstraints blk, SerialiseNodeToNodeConstraints blk, SerialiseNodeToClientConstraints blk, LedgerSupportsPeerSelection blk, NodeInitStorage blk, BlockSupportsMetrics blk, Show ( CannotForge blk), Show ( ForgeStateInfo blk), Show ( ForgeStateUpdateError blk), ShowProxy blk, ShowProxy ( ApplyTxErr blk), ShowProxy ( GenTx blk), ShowProxy ( Header blk), ShowProxy ( BlockQuery blk), ShowProxy ( TxId ( GenTx blk))) => RunNode blk Source #
Instances
( CanHardFork xs, SupportedNetworkProtocolVersion ( HardForkBlock xs), SerialiseHFC xs) => RunNode ( HardForkBlock xs) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Node |