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, validatorAgentID isc.AgentID, recoveryTimeout time.Duration, redeliveryPeriod time.Duration, printStatusPeriod time.Duration, chainMetrics *metrics.ChainConsensusMetrics, pipeMetrics *metrics.ChainPipeMetrics, log *logger.Logger, ) *ConsGr
type ConsensusID ¶
type ConsensusID [iotago.Ed25519AddressBytesLength + 4]byte
func NewConsensusID ¶
func NewConsensusID(cmtAddr *iotago.Ed25519Address, logIndex *cmt_log.LogIndex) ConsensusID
type Mempool ¶
type Mempool interface { ConsensusProposalAsync(ctx context.Context, aliasOutput *isc.AliasOutputWithID, consensusID ConsensusID) <-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.
type VM ¶
type VM interface {
ConsensusRunTask(ctx context.Context, task *vm.VMTask) <-chan *vm.VMTaskResult
}
func NewVMAsync ¶
func NewVMAsync(metrics *metrics.ChainConsensusMetrics, log *logger.Logger) VM
Click to show internal directories.
Click to hide internal directories.