Documentation ¶
Index ¶
- type ChainType
- type Genesis
- func (gen *Genesis) Accounts() map[crypto.Address]*account.Account
- func (gen *Genesis) ChainType() ChainType
- func (gen *Genesis) GenesisTime() time.Time
- func (gen *Genesis) Hash() hash.Hash
- func (gen *Genesis) MarshalJSON() ([]byte, error)
- func (gen *Genesis) Params() *GenesisParams
- func (gen *Genesis) SaveToFile(file string) error
- func (gen *Genesis) TotalSupply() amount.Amount
- func (gen *Genesis) UnmarshalJSON(bs []byte) error
- func (gen *Genesis) Validators() []*validator.Validator
- type GenesisParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Genesis ¶
type Genesis struct {
// contains filtered or unexported fields
}
Genesis is stored in the state database.
func LoadFromFile ¶
LoadFromFile loads genesis object from a JSON file.
func MainnetGenesis ¶ added in v1.0.0
func MainnetGenesis() *Genesis
func MakeGenesis ¶
func TestnetGenesis ¶ added in v0.11.0
func TestnetGenesis() *Genesis
func (*Genesis) GenesisTime ¶
func (*Genesis) MarshalJSON ¶
func (*Genesis) Params ¶
func (gen *Genesis) Params() *GenesisParams
func (*Genesis) SaveToFile ¶
SaveToFile saves the genesis into a JSON file.
func (*Genesis) TotalSupply ¶ added in v0.15.0
func (*Genesis) UnmarshalJSON ¶
func (*Genesis) Validators ¶
type GenesisParams ¶ added in v1.5.0
type GenesisParams struct { BlockVersion uint8 `cbor:"1,keyasint" json:"block_version"` BlockIntervalInSecond int `cbor:"2,keyasint" json:"block_interval_in_second"` CommitteeSize int `cbor:"3,keyasint" json:"committee_size"` BlockReward amount.Amount `cbor:"4,keyasint" json:"block_reward"` TransactionToLiveInterval uint32 `cbor:"5,keyasint" json:"transaction_to_live_interval"` BondInterval uint32 `cbor:"6,keyasint" json:"bond_interval"` UnbondInterval uint32 `cbor:"7,keyasint" json:"unbond_interval"` SortitionInterval uint32 `cbor:"8,keyasint" json:"sortition_interval"` FeeFraction float64 `cbor:"9,keyasint" json:"fee_fraction"` // Deprecated: Replaced by fix fee MinimumFee amount.Amount `cbor:"10,keyasint" json:"minimum_fee"` // Deprecated: Replaced by fix fee MaximumFee amount.Amount `cbor:"11,keyasint" json:"maximum_fee"` // Deprecated: Replaced by fix fee MinimumStake amount.Amount `cobr:"12,keyasint" json:"minimum_stake"` MaximumStake amount.Amount `cbor:"13,keyasint" json:"maximum_stake"` }
func DefaultGenesisParams ¶ added in v1.5.0
func DefaultGenesisParams() *GenesisParams
func (*GenesisParams) BlockInterval ¶ added in v1.5.0
func (p *GenesisParams) BlockInterval() time.Duration
Click to show internal directories.
Click to hide internal directories.