genesis

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LocalGenesisConfigJSON = `` /* 1091-byte string literal not displayed */

Functions

This section is empty.

Types

type Allocation

type Allocation struct {
	Balance   *big.Int    `json:"balance"`
	Threshold uint16      `json:"threshold"`
	Keepers   signer.Keys `json:"keepers"`
}

type ChainConfig

type ChainConfig struct {
	ChainID        uint64     `json:"chainID"`
	MaxTotalSupply *big.Int   `json:"maxTotalSupply"`
	Message        string     `json:"message"`
	FeeConfig      *FeeConfig `json:"feeConfig"`

	// external assignment fields
	FeeConfigs    []*FeeConfig `json:"feeConfigs"`
	FeeConfigID   ids.DataID   `json:"feeConfigID"`
	NameServiceID ids.ModelID  `json:"nameServiceID"`
}

func (*ChainConfig) AppendFeeConfig

func (c *ChainConfig) AppendFeeConfig(data []byte) (*FeeConfig, error)

func (*ChainConfig) Fee

func (c *ChainConfig) Fee(height uint64) *FeeConfig

func (*ChainConfig) IsNameService

func (c *ChainConfig) IsNameService(id ids.ModelID) bool

type FeeConfig

type FeeConfig struct {
	StartHeight            uint64                  `cbor:"sh" json:"startHeight"`
	MinGasPrice            uint64                  `cbor:"min" json:"minGasPrice"`
	MaxGasPrice            uint64                  `cbor:"max" json:"maxGasPrice"`
	MaxTxGas               uint64                  `cbor:"mtg" json:"maxTxGas"`
	GasRebateRate          uint64                  `cbor:"grr" json:"gasRebateRate"`
	MinTokenPledge         *big.Int                `cbor:"mtp" json:"minTokenPledge"`
	MinStakePledge         *big.Int                `cbor:"msp" json:"minStakePledge"`
	NonTransferableBalance *big.Int                `cbor:"ntb" json:"nonTransferableBalance"`
	Builders               ids.IDList[ids.Address] `cbor:"bs" json:"builders"`
}

func (*FeeConfig) SyntacticVerify

func (cfg *FeeConfig) SyntacticVerify() error

func (*FeeConfig) ValidBuilder

func (cfg *FeeConfig) ValidBuilder(builder ids.Address) error

type Genesis

type Genesis struct {
	Chain ChainConfig                 `json:"chain"`
	Alloc map[ids.Address]*Allocation `json:"alloc"`
}

func FromJSON

func FromJSON(data []byte) (*Genesis, error)

func (*Genesis) ToTxs

func (g *Genesis) ToTxs() (ld.Txs, error)

Jump to

Keyboard shortcuts

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