genesis

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LocalGenesisConfigJSON = `` /* 981-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   util.DataID  `json:"feeConfigID"`
	NameServiceID util.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 util.ModelID) bool

type FeeConfig

type FeeConfig struct {
	StartHeight    uint64                        `json:"startHeight"`
	MinGasPrice    uint64                        `json:"minGasPrice"`
	MaxGasPrice    uint64                        `json:"maxGasPrice"`
	MaxTxGas       uint64                        `json:"maxTxGas"`
	GasRebateRate  uint64                        `json:"gasRebateRate"`
	MinTokenPledge *big.Int                      `json:"minTokenPledge"`
	MinStakePledge *big.Int                      `json:"minStakePledge"`
	Builders       util.IDList[util.StakeSymbol] `json:"builders"`
}

func (*FeeConfig) SyntacticVerify

func (cfg *FeeConfig) SyntacticVerify() error

func (*FeeConfig) ValidBuilder

func (cfg *FeeConfig) ValidBuilder(builder util.StakeSymbol) error

type Genesis

type Genesis struct {
	Chain ChainConfig                  `json:"chain"`
	Alloc map[util.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