ouroboros-consensus-0.1.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Node

Description

Run the whole Node

Intended for qualified import.

Synopsis

Documentation

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

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

Tracers 

Fields

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 #

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.

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

Methods

(==) :: TraceEvent blk -> TraceEvent blk -> Bool #

(/=) :: TraceEvent blk -> TraceEvent blk -> Bool #

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

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

Methods

showsPrec :: Int -> TraceEvent blk -> ShowS #

show :: TraceEvent blk -> String #

showList :: [TraceEvent blk] -> ShowS #

Generic (TraceEvent blk) Source # 
Instance details

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

Associated Types

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

Methods

from :: TraceEvent blk -> Rep (TraceEvent blk) x #

to :: Rep (TraceEvent blk) x -> TraceEvent blk #

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.0-GfJNvFcM6lj2s5utKAUPEp" 'False) (((C1 ('MetaCons "TraceAddBlockEvent" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TraceAddBlockEvent blk))) :+: C1 ('MetaCons "TraceReaderEvent" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TraceReaderEvent 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 (TraceLedgerReplayEvent 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 ProtocolInfo m b Source #

Data required to run the specified protocol.

Instances

Instances details
Functor m => Isomorphic (ProtocolInfo m) Source # 
Instance details

Defined in Ouroboros.Consensus.HardFork.Combinator.Unary

data ChainDbArgs f m blk Source #

Constructors

ChainDbArgs 

Fields

data NodeArgs m remotePeer localPeer blk Source #

Arguments required when initializing a node

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 MempoolCapacityBytes.

data IPSubscriptionTarget Source #

Constructors

IPSubscriptionTarget 

Fields

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

Instances details
Eq addr => Eq (ConnectionId addr) 
Instance details

Defined in Ouroboros.Network.ConnectionId

Methods

(==) :: ConnectionId addr -> ConnectionId addr -> Bool #

(/=) :: ConnectionId addr -> ConnectionId addr -> Bool #

Ord addr => Ord (ConnectionId addr) 
Instance details

Defined in Ouroboros.Network.ConnectionId

Methods

compare :: ConnectionId addr -> ConnectionId addr -> Ordering #

(<) :: ConnectionId addr -> ConnectionId addr -> Bool #

(<=) :: ConnectionId addr -> ConnectionId addr -> Bool #

(>) :: ConnectionId addr -> ConnectionId addr -> Bool #

(>=) :: ConnectionId addr -> ConnectionId addr -> Bool #

max :: ConnectionId addr -> ConnectionId addr -> ConnectionId addr #

min :: ConnectionId addr -> ConnectionId addr -> ConnectionId addr #

Show addr => Show (ConnectionId addr) 
Instance details

Defined in Ouroboros.Network.ConnectionId

Methods

showsPrec :: Int -> ConnectionId addr -> ShowS #

show :: ConnectionId addr -> String #

showList :: [ConnectionId addr] -> ShowS #

Generic (ConnectionId addr) 
Instance details

Defined in Ouroboros.Network.ConnectionId

Associated Types

type Rep (ConnectionId addr) :: Type -> Type #

Methods

from :: ConnectionId addr -> Rep (ConnectionId addr) x #

to :: Rep (ConnectionId addr) x -> ConnectionId addr #

Hashable a => Hashable (ConnectionId a) 
Instance details

Defined in Ouroboros.Network.ConnectionId

Typeable addr => NoThunks (ConnectionId addr) 
Instance details

Defined in Ouroboros.Network.ConnectionId

type Rep (ConnectionId addr) 
Instance details

Defined in Ouroboros.Network.ConnectionId

type Rep (ConnectionId addr) = D1 ('MetaData "ConnectionId" "Ouroboros.Network.ConnectionId" "ouroboros-network-framework-0.1.0.0-GDSz6nFKgk03Oam7emNxwN" 'False) (C1 ('MetaCons "ConnectionId" 'PrefixI 'True) (S1 ('MetaSel ('Just "localAddress") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 addr) :*: S1 ('MetaSel ('Just "remoteAddress") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 addr)))

Internal helpers

openChainDB Source #

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 ChainDbArgs

-> IO (ChainDB IO blk) 

mkChainDbArgs Source #

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.