Documentation ¶
Index ¶
- type BitArray
- type Block
- type BlockMeta
- type BlockStoreStateJSON
- type Commit
- type ConsensusLogMessage
- type ConsensusLogMessageInterface
- type ConsensusMessage
- type Data
- type DefaultSigner
- type EventDataRoundState
- type GenesisDoc
- type GenesisValidator
- type Header
- type MsgInfo
- type Part
- type PartSetHeader
- type PrivValidator
- type RoundStepType
- type Signer
- type State
- type TimeoutInfo
- type Tx
- type Txs
- type Validator
- type ValidatorSet
- type Vote
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockMeta ¶
type BlockMeta struct { Hash []byte `json:"hash"` // The block hash Header *Header `json:"header"` // The block's Header PartsHeader PartSetHeader `json:"parts_header"` // The PartSetHeader, for transfer }
type BlockStoreStateJSON ¶
type BlockStoreStateJSON struct {
Height int
}
type Commit ¶
type Commit struct { // NOTE: The Precommits are in order of address to preserve the bonded ValidatorSet order. // Any peer with a block can gossip precommits by index with a peer without recalculating the // active ValidatorSet. Precommits []*Vote `json:"precommits"` // contains filtered or unexported fields }
type ConsensusLogMessage ¶
type ConsensusLogMessage struct { Time time.Time `json:"time"` Msg ConsensusLogMessageInterface `json:"msg"` }
cswal
type ConsensusLogMessageInterface ¶
type ConsensusLogMessageInterface interface{}
type ConsensusMessage ¶
type ConsensusMessage interface{}
type Data ¶
type Data struct { // Txs that will be applied by state @ block.Height+1. // NOTE: not all txs here are valid. We're just agreeing on the order first. // This means that block.AppHash does not include these txs. Txs Txs `json:"txs"` // contains filtered or unexported fields }
type DefaultSigner ¶
type DefaultSigner struct {
// contains filtered or unexported fields
}
Implements Signer
func NewDefaultSigner ¶
func NewDefaultSigner(priv crypto.PrivKey) *DefaultSigner
type EventDataRoundState ¶
type EventDataRoundState struct { Height int `json:"height"` Round int `json:"round"` Step string `json:"step"` // private, not exposed to websockets RoundState interface{} `json:"-"` }
0x01
type GenesisDoc ¶
type GenesisDoc struct { GenesisTime time.Time `json:"genesis_time"` ChainID string `json:"chain_id"` Validators []GenesisValidator `json:"validators"` AppHash []byte `json:"app_hash"` }
func GenesisDocFromJSON ¶
func GenesisDocFromJSON(jsonBlob []byte) (genState *GenesisDoc)
type GenesisValidator ¶
type Header ¶
type Header struct { ChainID string `json:"chain_id"` Height int `json:"height"` Time time.Time `json:"time"` NumTxs int `json:"num_txs"` LastBlockHash []byte `json:"last_block_hash"` LastBlockParts PartSetHeader `json:"last_block_parts"` LastCommitHash []byte `json:"last_commit_hash"` DataHash []byte `json:"data_hash"` ValidatorsHash []byte `json:"validators_hash"` AppHash []byte `json:"app_hash"` // state merkle root of txs from the previous block }
type MsgInfo ¶
type MsgInfo struct { Msg ConsensusMessage `json:"msg"` PeerKey string `json:"peer_key"` }
0x02
type Part ¶
type Part struct { Index int `json:"index"` Bytes []byte `json:"bytes"` Proof merkle.SimpleProof `json:"proof"` // contains filtered or unexported fields }
type PartSetHeader ¶
type PrivValidator ¶
type PrivValidator struct { Address []byte `json:"address"` PubKey crypto.PubKey `json:"pub_key"` LastHeight int `json:"last_height"` LastRound int `json:"last_round"` LastStep int8 `json:"last_step"` LastSignature crypto.Signature `json:"last_signature"` // so we dont lose signatures LastSignBytes []byte `json:"last_signbytes"` // so we dont lose signatures // PrivKey should be empty if a Signer other than the default is being used. PrivKey crypto.PrivKey `json:"priv_key"` Signer `json:"-"` // contains filtered or unexported fields }
func LoadPrivValidator ¶
func LoadPrivValidator(filePath string) *PrivValidator
type RoundStepType ¶
type RoundStepType uint8 // These must be numeric, ordered.
type State ¶
type State struct { GenesisDoc *GenesisDoc ChainID string LastBlockHeight int // Genesis state has this set to 0. So, Block(H=0) does not exist. LastBlockHash []byte LastBlockParts PartSetHeader LastBlockTime time.Time Validators *ValidatorSet LastValidators *ValidatorSet AppHash []byte // contains filtered or unexported fields }
type TimeoutInfo ¶
type TimeoutInfo struct { Duration time.Duration `json:"duration"` Height int `json:"height"` Round int `json:"round"` Step RoundStepType `json:"step"` }
0x03 internally generated messages which may update the state
type ValidatorSet ¶
type ValidatorSet struct { Validators []*Validator // NOTE: persisted via reflect, must be exported. // contains filtered or unexported fields }
type Vote ¶
type Vote struct { Height int `json:"height"` Round int `json:"round"` Type byte `json:"type"` BlockHash []byte `json:"block_hash"` // empty if vote is nil. BlockPartsHeader PartSetHeader `json:"block_parts_header"` // zero if vote is nil. Signature crypto.SignatureEd25519 `json:"signature"` }
Click to show internal directories.
Click to hide internal directories.