Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConsensusJournalNotFound = errors.New("ErrConsensusJournalNotFound")
Functions ¶
This section is empty.
Types ¶
type ConsensusJournal ¶
type ConsensusJournal interface { // GetID just returns the ID of the current Consensus Journal. GetID() ID // // GetLogIndex returns the next non-decided log index for this journal. GetLogIndex() LogIndex // // Returns a persistence-supported version of the local view. GetLocalView() LocalView // // Notify, when a particular log index has been completed (decided). ConsensusReached(logIndex LogIndex) // // Upon reception of F+1 Log indexes higher that ours, we have to move // to the next log index That's to catch up with the chain, if a consensus // has failed in some way for us (e.g. maybe this node was down or restarted). // // It is safe here to count own message, because our own log index // will not be bigger that ours :) PeerLogIndexReceived(peerIndex uint16, peerLogIndex LogIndex) bool }
ConsensusJournal tracks the consensus instances (the consensus log). Its main purpose is to record, which instances have already been done.
type ID ¶
type ID [iotago.Ed25519AddressBytesLength]byte
ConsensusJournal instances are per ChainID ⨉ CommitteeAddress. This ID represents that.
type LocalView ¶
type LocalView interface { // // Returns alias output to produce next transaction on, or nil if we should wait. // In the case of nil, we either wait for the first AO to receive, or we are // still recovering from a TX rejection. GetBaseAliasOutputID() *iotago.OutputID // // Corresponds to the `ao_received` event in the specification. AliasOutputReceived(confirmed *isc.AliasOutputWithID) // // Corresponds to the `tx_rejected` event in the specification. AliasOutputRejected(rejected *isc.AliasOutputWithID) // // Corresponds to the `tx_posted` event in the specification. AliasOutputPublished(consumed, published *isc.AliasOutputWithID) // // For serialization. AsBytes() ([]byte, error) }
func NewLocalView ¶
func NewLocalView() LocalView
func NewLocalViewFromBytes ¶
type LogIndex ¶
type LogIndex uint32
func (*LogIndex) AsStringKey ¶
For the Nonce Instance mostly. Can be removed after moving stuff to GPA.
func (*LogIndex) AsUint64Key ¶
For the ACS runner mostly. Can be removed after moving stuff to GPA.
type Registry ¶
type Registry interface { LoadConsensusJournal(id ID) (LogIndex, LocalView, error) // Can return ErrConsensusJournalNotFound SaveConsensusJournalLogIndex(id ID, logIndex LogIndex) error SaveConsensusJournalLocalView(id ID, localView LocalView) error }
RegistryProvider has to be provided for the ConsensusJournal and should implement the persistent store.
Click to show internal directories.
Click to hide internal directories.