| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.Node
Contents
Description
Run the whole Node
Intended for qualified import.
Synopsis
- data DiffusionTracers = DiffusionTracers {
- dtIpSubscriptionTracer :: Tracer IO (WithIPList (SubscriptionTrace SockAddr))
- dtDnsSubscriptionTracer :: Tracer IO (WithDomainName (SubscriptionTrace SockAddr))
- dtDnsResolverTracer :: Tracer IO (WithDomainName DnsTrace)
- dtMuxTracer :: Tracer IO (WithMuxBearer (ConnectionId SockAddr) MuxTrace)
- dtMuxLocalTracer :: Tracer IO (WithMuxBearer (ConnectionId LocalAddress) MuxTrace)
- dtHandshakeTracer :: Tracer IO HandshakeTr
- dtHandshakeLocalTracer :: Tracer IO HandshakeTr
- dtErrorPolicyTracer :: Tracer IO (WithAddr SockAddr ErrorPolicyTrace)
- dtLocalErrorPolicyTracer :: Tracer IO (WithAddr LocalAddress ErrorPolicyTrace)
- dtAcceptPolicyTracer :: Tracer IO AcceptConnectionsPolicyTrace
- data DiffusionArguments = DiffusionArguments {}
- run :: forall blk. RunNode blk => RunNodeArgs blk -> IO ()
- data RunNodeArgs blk = RunNodeArgs {
- rnTraceConsensus :: Tracers IO RemoteConnectionId LocalConnectionId blk
- rnTraceNTN :: Tracers IO RemoteConnectionId blk DeserialiseFailure
- rnTraceNTC :: Tracers IO LocalConnectionId blk DeserialiseFailure
- rnTraceDB :: Tracer IO (TraceEvent blk)
- rnTraceDiffusion :: DiffusionTracers
- rnDiffusionArguments :: DiffusionArguments
- rnNetworkMagic :: NetworkMagic
- rnDatabasePath :: FilePath
- rnProtocolInfo :: ProtocolInfo IO blk
- rnCustomiseChainDbArgs :: ChainDbArgs Identity IO blk -> ChainDbArgs Identity IO blk
- rnCustomiseNodeArgs :: NodeArgs IO RemoteConnectionId LocalConnectionId blk -> NodeArgs IO RemoteConnectionId LocalConnectionId blk
- rnNodeToNodeVersions :: Map NodeToNodeVersion (BlockNodeToNodeVersion blk)
- rnNodeToClientVersions :: Map NodeToClientVersion (BlockNodeToClientVersion blk)
- rnNodeKernelHook :: ResourceRegistry IO -> NodeKernel IO RemoteConnectionId LocalConnectionId blk -> IO ()
- rnMaxClockSkew :: ClockSkew
- 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, NodeInitStorage blk, Show (CannotForge blk), Show (ForgeStateInfo blk), Show (ForgeStateUpdateError blk), ShowProxy blk, ShowProxy (ApplyTxErr blk), ShowProxy (GenTx blk), ShowProxy (Header blk), ShowProxy (Query blk), ShowProxy (TxId (GenTx blk))) => RunNode blk
- type Tracers m remotePeer localPeer blk = Tracers' remotePeer localPeer blk (Tracer m)
- data Tracers' remotePeer localPeer blk f = Tracers {
- chainSyncClientTracer :: f (TraceChainSyncClientEvent blk)
- chainSyncServerHeaderTracer :: f (TraceChainSyncServerEvent blk)
- chainSyncServerBlockTracer :: f (TraceChainSyncServerEvent blk)
- blockFetchDecisionTracer :: f [TraceLabelPeer remotePeer (FetchDecision [Point (Header blk)])]
- blockFetchClientTracer :: f (TraceLabelPeer remotePeer (TraceFetchClientState (Header blk)))
- blockFetchServerTracer :: f (TraceBlockFetchServerEvent blk)
- txInboundTracer :: f (TraceLabelPeer remotePeer (TraceTxSubmissionInbound (GenTxId blk) (GenTx blk)))
- txOutboundTracer :: f (TraceLabelPeer remotePeer (TraceTxSubmissionOutbound (GenTxId blk) (GenTx blk)))
- localTxSubmissionServerTracer :: f (TraceLocalTxSubmissionServerEvent blk)
- mempoolTracer :: f (TraceEventMempool blk)
- forgeTracer :: f (TraceLabelCreds (TraceForgeEvent blk))
- blockchainTimeTracer :: f TraceBlockchainTimeEvent
- forgeStateInfoTracer :: f (TraceLabelCreds (ForgeStateInfo blk))
- keepAliveClientTracer :: f (TraceKeepAliveClient remotePeer)
- data TraceEvent blk
- = TraceAddBlockEvent (TraceAddBlockEvent blk)
- | TraceReaderEvent (TraceReaderEvent blk)
- | TraceCopyToImmutableDBEvent (TraceCopyToImmutableDBEvent blk)
- | TraceGCEvent (TraceGCEvent blk)
- | TraceInitChainSelEvent (TraceInitChainSelEvent blk)
- | TraceOpenEvent (TraceOpenEvent blk)
- | TraceIteratorEvent (TraceIteratorEvent blk)
- | TraceLedgerEvent (TraceEvent blk)
- | TraceLedgerReplayEvent (TraceLedgerReplayEvent blk)
- | TraceImmutableDBEvent (TraceEvent blk)
- | TraceVolatileDBEvent (TraceEvent blk)
- data ProtocolInfo m b = ProtocolInfo {
- pInfoConfig :: TopLevelConfig b
- pInfoInitLedger :: ExtLedgerState b
- pInfoBlockForging :: [m (BlockForging m b)]
- data ChainDbArgs f m blk = ChainDbArgs {
- cdbHasFSImmutableDB :: SomeHasFS m
- cdbHasFSVolatileDB :: SomeHasFS m
- cdbHasFSLgrDB :: SomeHasFS m
- cdbImmutableDbValidation :: ValidationPolicy
- cdbVolatileDbValidation :: BlockValidationPolicy
- cdbMaxBlocksPerFile :: BlocksPerFile
- cdbParamsLgrDB :: HKD f LedgerDbParams
- cdbDiskPolicy :: HKD f DiskPolicy
- cdbTopLevelConfig :: HKD f (TopLevelConfig blk)
- cdbChunkInfo :: HKD f ChunkInfo
- cdbCheckIntegrity :: HKD f (blk -> Bool)
- cdbGenesis :: HKD f (m (ExtLedgerState blk))
- cdbCheckInFuture :: HKD f (CheckInFuture m blk)
- cdbImmutableDbCacheConfig :: CacheConfig
- cdbTracer :: Tracer m (TraceEvent blk)
- cdbTraceLedger :: Tracer m (LedgerDB' blk)
- cdbRegistry :: HKD f (ResourceRegistry m)
- cdbGcDelay :: DiffTime
- cdbGcInterval :: DiffTime
- cdbBlocksToAddSize :: Word
- data NodeArgs m remotePeer localPeer blk = NodeArgs {
- tracers :: Tracers m remotePeer localPeer blk
- registry :: ResourceRegistry m
- cfg :: TopLevelConfig blk
- btime :: BlockchainTime m
- chainDB :: ChainDB m blk
- initChainDB :: StorageConfig blk -> InitChainDB m blk -> m ()
- blockFetchSize :: Header blk -> SizeInBytes
- blockForging :: [BlockForging m blk]
- maxTxCapacityOverride :: MaxTxCapacityOverride
- mempoolCapacityOverride :: MempoolCapacityBytesOverride
- miniProtocolParameters :: MiniProtocolParameters
- blockFetchConfiguration :: BlockFetchConfiguration
- keepAliveRng :: StdGen
- data NodeKernel m remotePeer localPeer blk = NodeKernel {
- getChainDB :: ChainDB m blk
- getMempool :: Mempool m blk TicketNo
- getTopLevelConfig :: TopLevelConfig blk
- getFetchClientRegistry :: FetchClientRegistry remotePeer (Header blk) blk m
- getNodeCandidates :: StrictTVar m (Map remotePeer (StrictTVar m (AnchoredFragment (Header blk))))
- getTracers :: Tracers m remotePeer localPeer blk
- data MaxTxCapacityOverride
- data MempoolCapacityBytesOverride
- data IPSubscriptionTarget = IPSubscriptionTarget {
- ispIps :: ![SockAddr]
- ispValency :: !Int
- data DnsSubscriptionTarget = DnsSubscriptionTarget {
- dstDomain :: !Domain
- dstPort :: !PortNumber
- dstValency :: !Int
- data ConnectionId addr = ConnectionId {
- localAddress :: !addr
- remoteAddress :: !addr
- type RemoteConnectionId = ConnectionId SockAddr
- openChainDB :: forall blk. RunNode blk => Tracer IO (TraceEvent blk) -> ResourceRegistry IO -> CheckInFuture IO blk -> FilePath -> TopLevelConfig blk -> ExtLedgerState blk -> (ChainDbArgs Identity IO blk -> ChainDbArgs Identity IO blk) -> IO (ChainDB IO blk)
- mkChainDbArgs :: forall blk. RunNode blk => Tracer IO (TraceEvent blk) -> ResourceRegistry IO -> CheckInFuture IO blk -> FilePath -> TopLevelConfig blk -> ExtLedgerState blk -> ChunkInfo -> ChainDbArgs Identity IO blk
- mkNodeArgs :: forall blk. RunNode blk => ResourceRegistry IO -> TopLevelConfig blk -> [IO (BlockForging IO blk)] -> Tracers IO RemoteConnectionId LocalConnectionId blk -> BlockchainTime IO -> ChainDB IO blk -> IO (NodeArgs IO RemoteConnectionId LocalConnectionId blk)
- nodeArgsEnforceInvariants :: NodeArgs m RemoteConnectionId LocalConnectionId blk -> NodeArgs m RemoteConnectionId LocalConnectionId blk
Documentation
data DiffusionTracers #
Constructors
data DiffusionArguments #
Constructors
| DiffusionArguments | |
Fields
| |
run :: forall blk. RunNode blk => RunNodeArgs blk -> IO () Source #
Start a node.
This opens the ChainDB, sets up the NodeKernel and initialises the
network layer.
This function runs forever unless an exception is thrown.
Exposed by run
data RunNodeArgs blk Source #
Arguments required by runNode
Constructors
| RunNodeArgs | |
Fields
| |
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, NodeInitStorage blk, Show (CannotForge blk), Show (ForgeStateInfo blk), Show (ForgeStateUpdateError blk), ShowProxy blk, ShowProxy (ApplyTxErr blk), ShowProxy (GenTx blk), ShowProxy (Header blk), ShowProxy (Query 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 | |
type Tracers m remotePeer localPeer blk = Tracers' remotePeer localPeer blk (Tracer m) Source #
A record of Tracers for the node.
data Tracers' remotePeer localPeer blk f Source #
Constructors
Instances
| (forall a. Semigroup (f a)) => Semigroup (Tracers' remotePeer localPeer blk f) Source # | |
Defined in Ouroboros.Consensus.Node.Tracers Methods (<>) :: Tracers' remotePeer localPeer blk f -> Tracers' remotePeer localPeer blk f -> Tracers' remotePeer localPeer blk f # sconcat :: NonEmpty (Tracers' remotePeer localPeer blk f) -> Tracers' remotePeer localPeer blk f # stimes :: Integral b => b -> Tracers' remotePeer localPeer blk f -> Tracers' remotePeer localPeer blk f # | |
data TraceEvent blk Source #
Trace type for the various events of the ChainDB.
Constructors
Instances
data ProtocolInfo m b Source #
Data required to run the specified protocol.
Constructors
| ProtocolInfo | |
Fields
| |
Instances
| Functor m => Isomorphic (ProtocolInfo m) Source # | |
Defined in Ouroboros.Consensus.HardFork.Combinator.Unary Methods project :: NoHardForks blk => ProtocolInfo m (HardForkBlock '[blk]) -> ProtocolInfo m blk Source # inject :: NoHardForks blk => ProtocolInfo m blk -> ProtocolInfo m (HardForkBlock '[blk]) Source # | |
data ChainDbArgs f m blk Source #
Constructors
| ChainDbArgs | |
Fields
| |
data NodeArgs m remotePeer localPeer blk Source #
Arguments required when initializing a node
Constructors
| NodeArgs | |
Fields
| |
data NodeKernel m remotePeer localPeer blk Source #
Interface against running relay node
Constructors
| NodeKernel | |
Fields
| |
data MaxTxCapacityOverride Source #
The maximum transaction capacity of a block is computed by taking the max block size from the protocol parameters in the current ledger state and subtracting the size of the header.
It is possible to override this maximum transaction capacity with a lower value. We ignore higher values than the ledger state's max block size. Such blocks would be rejected by the ledger anyway.
Constructors
| NoMaxTxCapacityOverride | Don't override the maximum transaction capacity as computed from the current ledger state. |
| MaxTxCapacityOverride !Word32 | Use the following maximum size in bytes for the transaction capacity of a block. |
data MempoolCapacityBytesOverride Source #
An override for the default MempoolCapacityBytes which is 2x the
maximum transaction capacity (see MaxTxCapacityOverride)
Constructors
| NoMempoolCapacityBytesOverride | Use 2x the maximum transaction capacity of a block. This will change dynamically with the protocol parameters adopted in the current ledger. |
| MempoolCapacityBytesOverride !MempoolCapacityBytes | Use the following |
Instances
| Eq MempoolCapacityBytesOverride Source # | |
Defined in Ouroboros.Consensus.Mempool.Impl Methods (==) :: MempoolCapacityBytesOverride -> MempoolCapacityBytesOverride -> Bool # (/=) :: MempoolCapacityBytesOverride -> MempoolCapacityBytesOverride -> Bool # | |
| Show MempoolCapacityBytesOverride Source # | |
Defined in Ouroboros.Consensus.Mempool.Impl Methods showsPrec :: Int -> MempoolCapacityBytesOverride -> ShowS # show :: MempoolCapacityBytesOverride -> String # showList :: [MempoolCapacityBytesOverride] -> ShowS # | |
data IPSubscriptionTarget Source #
Constructors
| IPSubscriptionTarget | |
Fields
| |
Instances
| Eq IPSubscriptionTarget | |
Defined in Ouroboros.Network.Subscription.Ip Methods (==) :: IPSubscriptionTarget -> IPSubscriptionTarget -> Bool # (/=) :: IPSubscriptionTarget -> IPSubscriptionTarget -> Bool # | |
| Show IPSubscriptionTarget | |
Defined in Ouroboros.Network.Subscription.Ip Methods showsPrec :: Int -> IPSubscriptionTarget -> ShowS # show :: IPSubscriptionTarget -> String # showList :: [IPSubscriptionTarget] -> ShowS # | |
data DnsSubscriptionTarget Source #
Constructors
| DnsSubscriptionTarget | |
Fields
| |
Instances
| Eq DnsSubscriptionTarget | |
Defined in Ouroboros.Network.Subscription.Dns Methods (==) :: DnsSubscriptionTarget -> DnsSubscriptionTarget -> Bool # (/=) :: DnsSubscriptionTarget -> DnsSubscriptionTarget -> Bool # | |
| Show DnsSubscriptionTarget | |
Defined in Ouroboros.Network.Subscription.Dns Methods showsPrec :: Int -> DnsSubscriptionTarget -> ShowS # show :: DnsSubscriptionTarget -> String # showList :: [DnsSubscriptionTarget] -> ShowS # | |
data ConnectionId addr Source #
Connection is identified by local and remote address.
TODO: the type variable which this data type fills in is called peerid. We
should renamed to connectionId.
Constructors
| ConnectionId | |
Fields
| |
Instances
type RemoteConnectionId = ConnectionId SockAddr #
Internal helpers
Arguments
| :: forall blk. RunNode blk | |
| => Tracer IO (TraceEvent blk) | |
| -> ResourceRegistry IO | |
| -> CheckInFuture IO blk | |
| -> FilePath | Database path |
| -> TopLevelConfig blk | |
| -> ExtLedgerState blk | Initial ledger |
| -> (ChainDbArgs Identity IO blk -> ChainDbArgs Identity IO blk) | Customise the |
| -> IO (ChainDB IO blk) |
Arguments
| :: forall blk. RunNode blk | |
| => Tracer IO (TraceEvent blk) | |
| -> ResourceRegistry IO | |
| -> CheckInFuture IO blk | |
| -> FilePath | Database path |
| -> TopLevelConfig blk | |
| -> ExtLedgerState blk | Initial ledger |
| -> ChunkInfo | |
| -> ChainDbArgs Identity IO blk |
mkNodeArgs :: forall blk. RunNode blk => ResourceRegistry IO -> TopLevelConfig blk -> [IO (BlockForging IO blk)] -> Tracers IO RemoteConnectionId LocalConnectionId blk -> BlockchainTime IO -> ChainDB IO blk -> IO (NodeArgs IO RemoteConnectionId LocalConnectionId blk) Source #
nodeArgsEnforceInvariants :: NodeArgs m RemoteConnectionId LocalConnectionId blk -> NodeArgs m RemoteConnectionId LocalConnectionId blk Source #
We allow the user running the node to customise the NodeArgs through
rnCustomiseNodeArgs, but there are some limits to some values. This
function makes sure we don't exceed those limits and that the values are
consistent.