Documentation ¶
Overview ¶
The purpose of this package is to run the consensus protocol as a goroutine and communicate with all the related components.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsGr ¶
type ConsGr struct {
// contains filtered or unexported fields
}
func New ¶
func New( ctx context.Context, chainID isc.ChainID, chainStore state.Store, dkShare tcrypto.DKShare, logIndex *cmt_log.LogIndex, myNodeIdentity *cryptolib.KeyPair, procCache *processors.Cache, mempool Mempool, stateMgr StateMgr, net peering.NetworkProvider, recoveryTimeout time.Duration, redeliveryPeriod time.Duration, printStatusPeriod time.Duration, chainMetrics metrics.IChainConsensusMetrics, log *logger.Logger, ) *ConsGr
type Mempool ¶
type Mempool interface { ConsensusProposalAsync(ctx context.Context, aliasOutput *isc.AliasOutputWithID) <-chan []*isc.RequestRef ConsensusRequestsAsync(ctx context.Context, requestRefs []*isc.RequestRef) <-chan []isc.Request }
type Output ¶
type Output struct { Status cons.OutputStatus // Can only be Completed | Skipped. Result *cons.Result // Result of the consensus. }
type StateMgr ¶
type StateMgr interface { // State manager has to return a signal via the return channel when it // ensures all the needed blocks for the specified AliasOutput is present // in the database. Context is used to cancel a request. ConsensusStateProposal( ctx context.Context, aliasOutput *isc.AliasOutputWithID, ) <-chan interface{} // State manager has to ensure all the data needed for the specified alias // output (presented as aliasOutputID+stateCommitment) is present in the DB. ConsensusDecidedState( ctx context.Context, aliasOutput *isc.AliasOutputWithID, ) <-chan state.State // State manager has to persistently store the block and respond only after // the block was flushed to the disk. A WAL can be used for that as well. ConsensusProducedBlock( ctx context.Context, block state.StateDraft, ) <-chan state.Block }
State manager has to implement this interface.
Click to show internal directories.
Click to hide internal directories.