oldgenesis

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2022 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ABCIPubKeyTypeEd25519 = "ed25519"
)
View Source
const (
	// MaxChainIDLen is a maximum length of the chain ID.
	MaxChainIDLen = 50
)

Variables

View Source
var ABCIPubKeyTypesToAminoNames = map[string]string{
	ABCIPubKeyTypeEd25519: ed25519.PubKeyName,
}

Functions

This section is empty.

Types

type ConsensusParams

type ConsensusParams struct {
	Block     tmproto.BlockParams     `json:"block"`
	Evidence  EvidenceParams          `json:"evidence"`
	Validator tmproto.ValidatorParams `json:"validator"`
}

ConsensusParams contains consensus critical parameters that determine the validity of blocks.

func DefaultConsensusParams

func DefaultConsensusParams() *ConsensusParams

func (*ConsensusParams) Validate

func (params *ConsensusParams) Validate() error

Validate validates the ConsensusParams to ensure all values are within their allowed limits, and returns an error if they are not.

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      []tmtypes.GenesisValidator `json:"validators,omitempty"`
	AppHash         tmbytes.HexBytes           `json:"app_hash"`
	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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL