Documentation ¶
Index ¶
- func IsVoteTypeValid(t VoteType) bool
- func RegisterConsensusMessages(cdc *amino.Codec)
- type AppState
- type Commit
- func (commit *Commit) Bytes() []byte
- func (commit *Commit) Digest() []byte
- func (commit *Commit) FirstPrecommit() *Vote
- func (commit *Commit) GetByIndex(index int) *Vote
- func (commit *Commit) GetSignature() []byte
- func (commit *Commit) GetSigner() PubKey
- func (commit *Commit) Height() int64
- func (commit *Commit) IsCommit() bool
- func (commit *Commit) Round() int
- func (commit *Commit) SetSignature(sig []byte)
- func (commit *Commit) SetSigner(key PubKey)
- func (commit *Commit) Size() int
- func (commit *Commit) String() string
- func (commit *Commit) Type() byte
- func (commit *Commit) ValidateBasic() error
- type ConsensusMessage
- type FetchVotesReq
- func (fvr *FetchVotesReq) Bytes() []byte
- func (fvr *FetchVotesReq) Digest() []byte
- func (fvr *FetchVotesReq) GetSignature() []byte
- func (fvr *FetchVotesReq) GetSigner() PubKey
- func (fvr *FetchVotesReq) SetSignature(sig []byte)
- func (fvr *FetchVotesReq) SetSigner(key PubKey)
- func (fvr *FetchVotesReq) String() string
- func (fvr *FetchVotesReq) ValidateBasic() error
- type FetchVotesRsp
- func (fvr *FetchVotesRsp) Bytes() []byte
- func (fvr *FetchVotesRsp) Digest() []byte
- func (fvr *FetchVotesRsp) GetSignature() []byte
- func (fvr *FetchVotesRsp) GetSigner() PubKey
- func (fvr *FetchVotesRsp) SetSignature(sig []byte)
- func (fvr *FetchVotesRsp) SetSigner(key PubKey)
- func (fvr *FetchVotesRsp) String() string
- func (fvr *FetchVotesRsp) ValidateBasic() error
- type ProposedData
- type PubKey
- type Vote
- func (vote *Vote) Bytes() []byte
- func (v *Vote) Copy() *Vote
- func (v *Vote) Digest() []byte
- func (v *Vote) GetSignature() []byte
- func (v *Vote) GetSigner() PubKey
- func (v *Vote) SetSignature(sig []byte)
- func (v *Vote) SetSigner(key PubKey)
- func (vote *Vote) String() string
- func (vote *Vote) ValidateBasic() error
- type VoteType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsVoteTypeValid ¶
IsVoteTypeValid returns true if t is a valid vote type.
func RegisterConsensusMessages ¶
func RegisterConsensusMessages(cdc *amino.Codec)
Types ¶
type AppState ¶
type AppState struct { // The first height that reaches bft consensus is 1, so LastHeight // should be 0 at genesis LastHeight int64 LastProposedData ProposedData LastCommitTime time.Time // the latest AppHash we've received from calling abci.Commit() AppHash []byte }
type Commit ¶
type Commit struct { ProposedData ProposedData `json:"proposed_data"` Prev ProposedData `json:"prev"` Precommits []*Vote `json:"precommits"` CommitTime time.Time `json:"committime"` Address PubKey `json:"address"` Signature []byte `json:"signature"` }
Commit contains the evidence that a block was committed by a set of validators.
func (*Commit) FirstPrecommit ¶
FirstPrecommit returns the first non-nil precommit in the commit. If all precommits are nil, it returns an empty precommit with height 0.
func (*Commit) GetByIndex ¶
GetByIndex returns the vote corresponding to a given validator index
func (*Commit) GetSignature ¶
func (*Commit) SetSignature ¶
func (*Commit) ValidateBasic ¶
ValidateBasic performs basic validation that doesn't involve state data. Does not actually check the cryptographic signatures.
type ConsensusMessage ¶
type ConsensusMessage interface { ValidateBasic() error Digest() []byte SetSigner(key PubKey) SetSignature(sig []byte) GetSigner() PubKey GetSignature() []byte Bytes() []byte String() string }
ConsensusMessage is a message that can be sent and received on the ConsensusReactor
func DecodeConsensusMsg ¶
func DecodeConsensusMsg(bz []byte) (msg ConsensusMessage, err error)
type FetchVotesReq ¶
type FetchVotesReq struct { Type VoteType `json:"type"` Height int64 `json:"height"` Round int `json:"round"` // Invoker indicates who wants the votes Invoker PubKey `json:"invoker"` // Voters indicates the validators from whom @Invoker currently receive vote Voters []PubKey `json:"voters"` Time time.Time `json:"time"` Signature []byte `json:"signature"` }
func (*FetchVotesReq) Bytes ¶
func (fvr *FetchVotesReq) Bytes() []byte
func (*FetchVotesReq) Digest ¶
func (fvr *FetchVotesReq) Digest() []byte
func (*FetchVotesReq) GetSignature ¶
func (fvr *FetchVotesReq) GetSignature() []byte
func (*FetchVotesReq) GetSigner ¶
func (fvr *FetchVotesReq) GetSigner() PubKey
func (*FetchVotesReq) SetSignature ¶
func (fvr *FetchVotesReq) SetSignature(sig []byte)
func (*FetchVotesReq) SetSigner ¶
func (fvr *FetchVotesReq) SetSigner(key PubKey)
func (*FetchVotesReq) String ¶
func (fvr *FetchVotesReq) String() string
func (*FetchVotesReq) ValidateBasic ¶
func (fvr *FetchVotesReq) ValidateBasic() error
ValidateBasic performs basic validation that doesn't involve state data. Does not actually check the cryptographic signatures.
type FetchVotesRsp ¶
type FetchVotesRsp struct { Type VoteType `json:"type"` Height int64 `json:"height"` Round int `json:"round"` Responser PubKey `json:"responser"` MissingVotes []*Vote `json:"missing_votes"` Time time.Time `json:"time"` Signature []byte `json:"signature"` }
func (*FetchVotesRsp) Bytes ¶
func (fvr *FetchVotesRsp) Bytes() []byte
func (*FetchVotesRsp) Digest ¶
func (fvr *FetchVotesRsp) Digest() []byte
func (*FetchVotesRsp) GetSignature ¶
func (fvr *FetchVotesRsp) GetSignature() []byte
func (*FetchVotesRsp) GetSigner ¶
func (fvr *FetchVotesRsp) GetSigner() PubKey
func (*FetchVotesRsp) SetSignature ¶
func (fvr *FetchVotesRsp) SetSignature(sig []byte)
func (*FetchVotesRsp) SetSigner ¶
func (fvr *FetchVotesRsp) SetSigner(key PubKey)
func (*FetchVotesRsp) String ¶
func (fvr *FetchVotesRsp) String() string
func (*FetchVotesRsp) ValidateBasic ¶
func (fvr *FetchVotesRsp) ValidateBasic() error
ValidateBasic performs basic validation that doesn't involve state data. Does not actually check the cryptographic signatures.
type ProposedData ¶
type ProposedData [32]byte
var NilData ProposedData
func (ProposedData) IsNil ¶
func (pd ProposedData) IsNil() bool
type Vote ¶
type Vote struct { Type VoteType `json:"type"` Height int64 `json:"height"` Round int `json:"round"` Timestamp time.Time `json:"timestamp"` Proposed ProposedData `json:"proposed_data"` // zero if vote is nil. Prev ProposedData `json:"prev"` Address PubKey `json:"pub_key"` Signature []byte `json:"signature"` }
Vote represents a prevote, precommit from validators for consensus.
func NewVote ¶
func NewVote(t VoteType, height int64, round int, proposed *ProposedData, prev *ProposedData) *Vote
func (*Vote) GetSignature ¶
func (*Vote) SetSignature ¶
func (*Vote) ValidateBasic ¶
ValidateBasic performs basic validation.