ouroboros-consensus-0.1.0.1: Consensus layer for the Ouroboros blockchain protocol
Safe Haskell None
Language Haskell2010

Ouroboros.Consensus.Node

Description

Run the whole Node

Intended for qualified import.

Synopsis

Documentation

run :: forall blk p2p. RunNode blk => RunNodeArgs IO RemoteAddress LocalAddress blk p2p -> StdRunNodeArgs IO blk p2p -> IO () Source #

Combination of runWith and stdLowLevelRunArgsIO

runWith :: forall m addrNTN addrNTC versionDataNTN versionDataNTC blk p2p. ( RunNode blk, IOLike m, MonadTime m, MonadTimer m, Hashable addrNTN, Ord addrNTN, Typeable addrNTN) => RunNodeArgs m addrNTN addrNTC blk p2p -> LowLevelRunNodeArgs m addrNTN addrNTC versionDataNTN versionDataNTC blk p2p -> m () 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.

Standard arguments

data StdRunNodeArgs m blk (p2p :: P2P ) Source #

Higher-level arguments that can determine the LowLevelRunNodeArgs under some usual assumptions for realistic use cases such as in cardano-node .

See stdLowLevelRunNodeArgsIO .

stdWithCheckedDB Source #

Arguments

:: forall blk a. ( StandardHash blk, Typeable blk)
=> Proxy blk
-> FilePath
-> NetworkMagic
-> ( LastShutDownWasClean -> ( ChainDB IO blk -> IO a -> IO a) -> IO a)

Body action with last shutdown was clean.

-> IO a

Check the DB marker, lock the DB and look for the clean shutdown marker.

Run the body action with the DB locked.

P2P Switch

Exposed by run et al

newtype RelativeMountPoint Source #

A relative path for a MountPoint

The root is determined by context.

data TraceEvent blk Source #

Trace type for the various events of the ChainDB.

Instances

Instances details
( HasHeader blk, Eq ( Header blk), LedgerSupportsProtocol blk, InspectLedger blk) => Eq ( TraceEvent blk) Source #
Instance details

Defined in Ouroboros.Consensus.Storage.ChainDB.Impl.Types

( HasHeader blk, Show ( Header blk), LedgerSupportsProtocol blk, InspectLedger blk) => Show ( TraceEvent blk) Source #
Instance details

Defined in Ouroboros.Consensus.Storage.ChainDB.Impl.Types

Generic ( TraceEvent blk) Source #
Instance details

Defined in Ouroboros.Consensus.Storage.ChainDB.Impl.Types

Associated Types

type Rep ( TraceEvent blk) :: Type -> Type Source #

type Rep ( TraceEvent blk) Source #
Instance details

Defined in Ouroboros.Consensus.Storage.ChainDB.Impl.Types

type Rep ( TraceEvent blk) = D1 (' MetaData "TraceEvent" "Ouroboros.Consensus.Storage.ChainDB.Impl.Types" "ouroboros-consensus-0.1.0.1-DT4Cvwf63DZKctsEvaJqCU" ' False ) ((( C1 (' MetaCons "TraceAddBlockEvent" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( TraceAddBlockEvent blk))) :+: C1 (' MetaCons "TraceFollowerEvent" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( TraceFollowerEvent blk)))) :+: ( C1 (' MetaCons "TraceCopyToImmutableDBEvent" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( TraceCopyToImmutableDBEvent blk))) :+: ( C1 (' MetaCons "TraceGCEvent" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( TraceGCEvent blk))) :+: C1 (' MetaCons "TraceInitChainSelEvent" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( TraceInitChainSelEvent blk)))))) :+: (( C1 (' MetaCons "TraceOpenEvent" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( TraceOpenEvent blk))) :+: ( C1 (' MetaCons "TraceIteratorEvent" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( TraceIteratorEvent blk))) :+: C1 (' MetaCons "TraceLedgerEvent" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( TraceEvent blk))))) :+: ( C1 (' MetaCons "TraceLedgerReplayEvent" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( TraceReplayEvent blk))) :+: ( C1 (' MetaCons "TraceImmutableDBEvent" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( TraceEvent blk))) :+: C1 (' MetaCons "TraceVolatileDBEvent" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( TraceEvent blk)))))))

data HardForkBlockchainTimeArgs m blk Source #

Constructors

HardForkBlockchainTimeArgs

Fields

data LowLevelRunNodeArgs m addrNTN addrNTC versionDataNTN versionDataNTC blk (p2p :: P2P ) Source #

Arguments that usually only tests directly specify.

A non-testing invocation probably wouldn't explicitly provide these values to runWith . The cardano-node , for example, instead calls the run abbreviation, which uses stdLowLevelRunNodeArgsIO to indirectly specify these low-level values from the higher-level StdRunNodeArgs .

Constructors

LowLevelRunNodeArgs

Fields

data NodeKernel m remotePeer localPeer blk Source #

Interface against running relay node

Constructors

NodeKernel

Fields

data RunNodeArgs m addrNTN addrNTC blk (p2p :: P2P ) Source #

Arguments expected from any invocation of runWith , whether by deployed code, tests, etc.

Constructors

RunNodeArgs

Fields

type Tracers m remotePeer localPeer blk = Tracers' remotePeer localPeer blk ( Tracer m) Source #

A record of Tracer s for the node.

data Tracers' remotePeer localPeer blk f Source #

Instances

Instances details
( forall a. Semigroup (f a)) => Semigroup ( Tracers' remotePeer localPeer blk f) Source #
Instance details

Defined in Ouroboros.Consensus.Node.Tracers

Methods

(<>) :: Tracers' remotePeer localPeer blk f -> Tracers' remotePeer localPeer blk f -> Tracers' remotePeer localPeer blk f Source #

sconcat :: NonEmpty ( Tracers' remotePeer localPeer blk f) -> Tracers' remotePeer localPeer blk f Source #

stimes :: Integral b => b -> Tracers' remotePeer localPeer blk f -> Tracers' remotePeer localPeer blk f Source #

Internal helpers

nodeKernelArgsEnforceInvariants :: NodeKernelArgs m ( ConnectionId addrNTN) ( ConnectionId addrNTC) blk -> NodeKernelArgs m ( ConnectionId addrNTN) ( ConnectionId addrNTC) blk Source #

We allow the user running the node to customise the NodeKernelArgs through llrnCustomiseNodeKernelArgs , but there are some limits to some values. This function makes sure we don't exceed those limits and that the values are consistent.