Documentation ¶
Index ¶
- Constants
- func CanonicalTime(t time.Time) string
- type ABCIResponses
- type Address
- type Block
- type BlockGossip
- type BlockID
- type BlockMeta
- type BlockSize
- type BlockStoreStateJSON
- type CanonicalJSONBlockID
- type CanonicalJSONOnceProposal
- type CanonicalJSONOnceVote
- type CanonicalJSONPartSetHeader
- type CanonicalJSONProposal
- type CanonicalJSONVote
- type Commit
- type ConsensusParams
- type ConsensusParamsInfo
- type Data
- type DuplicateVoteEvidence
- func (dve *DuplicateVoteEvidence) Address() []byte
- func (dve *DuplicateVoteEvidence) Equal(ev Evidence) bool
- func (dve *DuplicateVoteEvidence) Hash() []byte
- func (dve *DuplicateVoteEvidence) Height() int64
- func (dve *DuplicateVoteEvidence) Index() int
- func (dve *DuplicateVoteEvidence) String() string
- func (dve *DuplicateVoteEvidence) Verify(chainID string) error
- type EventDataRoundState
- type Evidence
- type EvidenceData
- type EvidenceInfo
- type EvidenceList
- type EvidenceParams
- type GenesisDoc
- type GenesisValidator
- type Header
- type Heartbeat
- type Part
- type PartSet
- type PartSetHeader
- type PrivValidatorFS
- type Proposal
- type State
- type Tx
- type TxSize
- type Txs
- type Validator
- type ValidatorSet
- type ValidatorsInfo
- type Vote
Constants ¶
View Source
const TimeFormat = wire.RFC3339Millis
Variables ¶
This section is empty.
Functions ¶
func CanonicalTime ¶
Types ¶
type ABCIResponses ¶
type ABCIResponses struct { DeliverTx []*abci.ResponseDeliverTx EndBlock *abci.ResponseEndBlock }
ABCIResponse
func (*ABCIResponses) Bytes ¶
func (a *ABCIResponses) Bytes() []byte
type Block ¶
type Block struct { *Header `json:"header"` *Data `json:"data"` Evidence EvidenceData `json:"evidence"` LastCommit *Commit `json:"last_commit"` }
func (*Block) MakePartSet ¶
type BlockGossip ¶
type BlockGossip struct {
BlockPartSizeBytes int `json:"block_part_size_bytes"` // NOTE: must not be 0
}
type BlockID ¶
type BlockID struct { Hash cmn.HexBytes `json:"hash"` PartsHeader PartSetHeader `json:"parts"` }
type BlockStoreStateJSON ¶
type BlockStoreStateJSON struct {
Height int64
}
type CanonicalJSONBlockID ¶
type CanonicalJSONBlockID struct { Hash cmn.HexBytes `json:"hash,omitempty"` PartsHeader CanonicalJSONPartSetHeader `json:"parts,omitempty"` }
func CanonicalBlockID ¶
func CanonicalBlockID(blockID BlockID) CanonicalJSONBlockID
type CanonicalJSONOnceProposal ¶
type CanonicalJSONOnceProposal struct { ChainID string `json:"chain_id"` Proposal CanonicalJSONProposal `json:"proposal"` }
type CanonicalJSONOnceVote ¶
type CanonicalJSONOnceVote struct { ChainID string `json:"chain_id"` Vote CanonicalJSONVote `json:"vote"` }
type CanonicalJSONPartSetHeader ¶
func CanonicalPartSetHeader ¶
func CanonicalPartSetHeader(psh PartSetHeader) CanonicalJSONPartSetHeader
type CanonicalJSONProposal ¶
type CanonicalJSONProposal struct { BlockPartsHeader CanonicalJSONPartSetHeader `json:"block_parts_header"` Height int64 `json:"height"` POLBlockID CanonicalJSONBlockID `json:"pol_block_id"` POLRound int `json:"pol_round"` Round int `json:"round"` Timestamp string `json:"timestamp"` }
func CanonicalProposal ¶
func CanonicalProposal(proposal *Proposal) CanonicalJSONProposal
type CanonicalJSONVote ¶
type CanonicalJSONVote struct { BlockID CanonicalJSONBlockID `json:"block_id"` Height int64 `json:"height"` Round int `json:"round"` Timestamp string `json:"timestamp"` Type byte `json:"type"` }
func CanonicalVote ¶
func CanonicalVote(vote *Vote) CanonicalJSONVote
type ConsensusParams ¶
type ConsensusParams struct { BlockSize `json:"block_size_params"` TxSize `json:"tx_size_params"` BlockGossip `json:"block_gossip_params"` EvidenceParams `json:"evidence_params"` }
type ConsensusParamsInfo ¶
type ConsensusParamsInfo struct { ConsensusParams ConsensusParams LastHeightChanged int64 }
ConsensusParamsInfo
func (ConsensusParamsInfo) Bytes ¶
func (params ConsensusParamsInfo) Bytes() []byte
type DuplicateVoteEvidence ¶
func (*DuplicateVoteEvidence) Address ¶
func (dve *DuplicateVoteEvidence) Address() []byte
Address returns the address of the validator.
func (*DuplicateVoteEvidence) Equal ¶
func (dve *DuplicateVoteEvidence) Equal(ev Evidence) bool
Equal checks if two pieces of evidence are equal.
func (*DuplicateVoteEvidence) Hash ¶
func (dve *DuplicateVoteEvidence) Hash() []byte
Hash returns the hash of the evidence.
func (*DuplicateVoteEvidence) Height ¶
func (dve *DuplicateVoteEvidence) Height() int64
Height returns the height this evidence refers to.
func (*DuplicateVoteEvidence) Index ¶
func (dve *DuplicateVoteEvidence) Index() int
Index returns the index of the validator.
func (*DuplicateVoteEvidence) String ¶
func (dve *DuplicateVoteEvidence) String() string
func (*DuplicateVoteEvidence) Verify ¶
func (dve *DuplicateVoteEvidence) Verify(chainID string) error
Verify returns an error if the two votes aren't conflicting. To be conflicting, they must be from the same validator, for the same H/R/S, but for different blocks.
type EventDataRoundState ¶
type Evidence ¶
type Evidence interface { Height() int64 // height of the equivocation Address() []byte // address of the equivocating validator Index() int // index of the validator in the validator set Hash() []byte // hash of the evidence Verify(chainID string) error // verify the evidence Equal(Evidence) bool // check equality of evidence String() string }
type EvidenceData ¶
type EvidenceData struct { Evidence EvidenceList `json:"evidence"` // contains filtered or unexported fields }
type EvidenceInfo ¶
type EvidenceList ¶
type EvidenceList []Evidence
type EvidenceParams ¶
type EvidenceParams struct {
MaxAge int64 `json:"max_age"` // only accept new evidence more recent than this
}
type GenesisDoc ¶
type GenesisDoc struct { GenesisTime time.Time `json:"genesis_time"` ChainID string `json:"chain_id"` ConsensusParams *ConsensusParams `json:"consensus_params,omitempty"` Validators []GenesisValidator `json:"validators"` AppHash cmn.HexBytes `json:"app_hash"` AppStateJSON json.RawMessage `json:"app_state,omitempty"` AppOptions json.RawMessage `json:"app_options,omitempty"` // DEPRECATED }
func GenesisDocFromJSON ¶
func GenesisDocFromJSON(jsonBlob []byte) (*GenesisDoc, error)
func MakeGenesisDocFromFile ¶
func MakeGenesisDocFromFile(genDocFile string) (*GenesisDoc, error)
type GenesisValidator ¶
type Header ¶
type Header struct { // basic block info ChainID string `json:"chain_id"` Height int64 `json:"height"` Time time.Time `json:"time"` NumTxs int64 `json:"num_txs"` // prev block info LastBlockID BlockID `json:"last_block_id"` TotalTxs int64 `json:"total_txs"` // hashes of block data LastCommitHash cmn.HexBytes `json:"last_commit_hash"` // commit from validators from the last block DataHash cmn.HexBytes `json:"data_hash"` // transactions // hashes from the app output from the prev block ValidatorsHash cmn.HexBytes `json:"validators_hash"` // validators for the current block ConsensusHash cmn.HexBytes `json:"consensus_hash"` // consensus params for current block AppHash cmn.HexBytes `json:"app_hash"` // state after txs from the previous block LastResultsHash cmn.HexBytes `json:"last_results_hash"` // root hash of all results from the txs from the previous block // consensus info EvidenceHash cmn.HexBytes `json:"evidence_hash"` // evidence included in the block }
type Part ¶
type Part struct { Index int `json:"index"` Bytes cmn.HexBytes `json:"bytes"` Proof merkle.SimpleProof `json:"proof"` // contains filtered or unexported fields }
type PartSet ¶
type PartSet struct {
// contains filtered or unexported fields
}
func NewPartSetFromData ¶
type PartSetHeader ¶
func (PartSetHeader) Equals ¶
func (psh PartSetHeader) Equals(other PartSetHeader) bool
type PrivValidatorFS ¶
type PrivValidatorFS struct { Address Address `json:"address"` PubKey gco.PubKey `json:"pub_key"` LastHeight int64 `json:"last_height"` LastRound int `json:"last_round"` LastStep int8 `json:"last_step"` LastSignature gco.Signature `json:"last_signature,omitempty"` // so we dont lose signatures LastSignBytes cmn.HexBytes `json:"last_signbytes,omitempty"` // so we dont lose signatures PrivKey gco.PrivKey `json:"priv_key"` // contains filtered or unexported fields }
func LoadPrivValidator ¶
func LoadPrivValidator(filePath string) *PrivValidatorFS
func (*PrivValidatorFS) Save ¶
func (pv *PrivValidatorFS) Save()
Save persists the PrivValidatorFS to disk.
type Proposal ¶
type Proposal struct { Height int64 `json:"height"` Round int `json:"round"` Timestamp time.Time `json:"timestamp"` BlockPartsHeader PartSetHeader `json:"block_parts_header"` POLRound int `json:"pol_round"` // -1 if null. POLBlockID BlockID `json:"pol_block_id"` // zero if null. Signature crypto.Signature `json:"signature"` }
type State ¶
type State struct { ChainID string LastBlockHeight int64 LastBlockTotalTx int64 LastBlockID BlockID LastBlockTime time.Time Validators *ValidatorSet LastValidators *ValidatorSet LastHeightValidatorsChanged int64 ConsensusParams ConsensusParams LastHeightConsensusParamsChanged int64 LastResultsHash []byte AppHash []byte }
type Validator ¶
type ValidatorSet ¶
type ValidatorSet struct { // NOTE: persisted via reflect, must be exported. Validators []*Validator `json:"validators"` Proposer *Validator `json:"proposer"` // contains filtered or unexported fields }
func (*ValidatorSet) Copy ¶
func (valSet *ValidatorSet) Copy() *ValidatorSet
type ValidatorsInfo ¶
type ValidatorsInfo struct { ValidatorSet *ValidatorSet LastHeightChanged int64 }
ValidatorsInfo
func (*ValidatorsInfo) Bytes ¶
func (valInfo *ValidatorsInfo) Bytes() []byte
type Vote ¶
type Vote struct { ValidatorAddress Address `json:"validator_address"` ValidatorIndex int `json:"validator_index"` Height int64 `json:"height"` Round int `json:"round"` Timestamp time.Time `json:"timestamp"` Type byte `json:"type"` BlockID BlockID `json:"block_id"` // zero if vote is nil. Signature gco.Signature `json:"signature"` }
Click to show internal directories.
Click to hide internal directories.