Documentation ¶
Index ¶
Constants ¶
const ABCIPubKeyTypeEd25519 = "ed25519"
const (
// MaxChainIDLen is a maximum length of the chain ID.
MaxChainIDLen = 50
)
Variables ¶
var Cdc = codec.New()
Replace amino codec with sdk codec to avoid an explicit amino import in go.mod. This will use a different version of amino from tendermint v0.32, but they are backwards compatible.
Functions ¶
func RegisterBlockAmino ¶
Types ¶
type BlockParams ¶
type BlockParams struct { MaxBytes int64 `json:"max_bytes"` MaxGas int64 `json:"max_gas"` // Minimum time increment between consecutive blocks (in milliseconds) // Not exposed to the application. TimeIotaMs int64 `json:"time_iota_ms"` }
BlockParams define limits on the block size and gas plus minimum time between blocks.
func DefaultBlockParams ¶
func DefaultBlockParams() BlockParams
DefaultBlockParams returns a default BlockParams.
type ConsensusParams ¶
type ConsensusParams struct { Block BlockParams `json:"block"` Evidence EvidenceParams `json:"evidence"` Validator ValidatorParams `json:"validator"` }
ConsensusParams contains consensus critical parameters that determine the validity of blocks.
func DefaultConsensusParams ¶
func DefaultConsensusParams() *ConsensusParams
// DefaultConsensusParams returns a default ConsensusParams.
type EvidenceParams ¶
type EvidenceParams struct {
MaxAge int64 `json:"max_age"` // only accept new evidence more recent than this
}
EvidenceParams determine how we handle evidence of malfeasance.
func DefaultEvidenceParams ¶
func DefaultEvidenceParams() EvidenceParams
DefaultEvidenceParams Params returns a default EvidenceParams.
type GenesisDoc ¶
type GenesisDoc struct { GenesisTime time.Time `json:"genesis_time"` ChainID string `json:"chain_id"` ConsensusParams *ConsensusParams `json:"consensus_params,omitempty"` Validators []types.GenesisValidator `json:"validators,omitempty"` // v0.33 GenesisValidator is backwards compatible with v0.32 AppHash tmbytes.HexBytes `json:"app_hash"` // moved from `common` to `bytes` as they are the same between v0.32 and v0.33 AppState json.RawMessage `json:"app_state,omitempty"` }
GenesisDoc defines the initial conditions for a tendermint blockchain, in particular its validator set.
func GenesisDocFromFile ¶
func GenesisDocFromFile(genDocFile string) (*GenesisDoc, error)
GenesisDocFromFile reads JSON data from a file and unmarshalls it into a GenesisDoc.
func GenesisDocFromJSON ¶
func GenesisDocFromJSON(jsonBlob []byte) (*GenesisDoc, error)
GenesisDocFromJSON unmarshalls JSON data into a GenesisDoc.
func (*GenesisDoc) ValidateAndComplete ¶
func (genDoc *GenesisDoc) ValidateAndComplete() error
ValidateAndComplete checks that all necessary fields are present and fills in defaults for optional fields left empty
type ValidatorParams ¶
type ValidatorParams struct {
PubKeyTypes []string `json:"pub_key_types"`
}
ValidatorParams restrict the public key types validators can use. NOTE: uses ABCI pubkey naming, not Amino names.
func DefaultValidatorParams ¶
func DefaultValidatorParams() ValidatorParams
DefaultValidatorParams returns a default ValidatorParams, which allows only ed25519 pubkeys.