Documentation ¶
Index ¶
- func AggregatePublicKeys(pk ...*cryptography.Bls12381PublicKey) kyber.Point
- func AggregateSignatures(sigs ...[]byte) ([]byte, error)
- type BlockMsg
- type Consensus
- type ConsensusMsg
- type ConsensusMsgBlock
- type ConsensusMsgEvidence
- type ConsensusMsgNewRound
- type ConsensusMsgProposal
- type ConsensusMsgType
- type ConsensusMsgVote
- type MemPool
- type Msg
- type MsgType
- type Option
- type State
- type Step
- type Tracer
- type TxList
- type TxMemPool
- type TxMsg
- type VoteType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AggregatePublicKeys ¶
func AggregatePublicKeys(pk ...*cryptography.Bls12381PublicKey) kyber.Point
func AggregateSignatures ¶
Types ¶
type Consensus ¶
type Consensus struct {
// contains filtered or unexported fields
}
func NewConsensus ¶
NewConsensus initiates a new consensus engine by checking if the genesis has been fully applied to the metadata store, setting up the round timeouts and restores the current consensus state from the metadata store
type ConsensusMsg ¶
type ConsensusMsg struct { Type ConsensusMsgType `msgpack:"t"` NewRound *ConsensusMsgNewRound `msgpack:"n,omitempty"` Proposal *ConsensusMsgProposal `msgpack:"p,omitempty"` Vote *ConsensusMsgVote `msgpack:"v,omitempty"` Block *ConsensusMsgBlock `msgpack:"b,omitempty"` Evidence *ConsensusMsgEvidence `msgpack:"e,omitempty"` }
type ConsensusMsgBlock ¶
type ConsensusMsgEvidence ¶
type ConsensusMsgEvidence struct { ConsensusMsgVote Accepted bool `msgpack:"a"` }
type ConsensusMsgNewRound ¶
type ConsensusMsgProposal ¶
type ConsensusMsgType ¶
type ConsensusMsgType uint8
const ( ConsensusMsgTypeNewRound ConsensusMsgType = iota + 1 ConsensusMsgTypeProposal ConsensusMsgTypeVote ConsensusMsgTypeBlock ConsensusMsgTypeEvidence )
type ConsensusMsgVote ¶
type MemPool ¶
MemPool provides a means of storing new TXs that are NOT in the current block chain. The MemPool is to provide TXs in sequental time as stated by the TX, not but the time received
type Msg ¶
type Msg struct { Type MsgType `msgpack:"t"` From peer.ID `msgpack:"p"` Chain []byte `msgpack:"c"` Tx *TxMsg `msgpack:"tx,omitempty"` Block *BlockMsg `msgpack:"bl,omitempty"` Consensus *ConsensusMsg `msgpack:"cn,omitempty"` Timestamp time.Time `msgpack:"ts"` Signature []byte `msgpack:"s"` Key []byte `msgpack:"k,omptempty"` }
type Option ¶
func WithBeaconSource ¶
func WithBlockStore ¶
func WithGenesis ¶
func WithGenesis(g *storage.GenesisInfo) Option
func WithSigningKey ¶
func WithSigningKey(priv *cryptography.Bls12381PrivateKey) Option
func WithValidator ¶
type State ¶
type State struct { AmProposer bool Proposer string Height uint64 Round uint32 Step Step Block cid.Cid ParentBlock cid.Cid PreVotes map[peer.ID]*Msg PreCommits map[peer.ID]*Msg PreVotesEvidence map[string]*ConsensusMsgEvidence PreCommitsEvidence map[string]*ConsensusMsgEvidence // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.