Documentation
¶
Index ¶
- Constants
- Variables
- type AddressListConfig
- type Chain
- type Fork
- type Forks
- func (f *Forks) At(block uint64) ForksInTime
- func (f *Forks) IsByzantium(block uint64) bool
- func (f *Forks) IsConstantinople(block uint64) bool
- func (f *Forks) IsEIP150(block uint64) bool
- func (f *Forks) IsEIP155(block uint64) bool
- func (f *Forks) IsEIP158(block uint64) bool
- func (f *Forks) IsHomestead(block uint64) bool
- func (f *Forks) IsLondon(block uint64) bool
- func (f *Forks) IsPetersburg(block uint64) bool
- type ForksInTime
- type Genesis
- type GenesisAccount
- type Params
- type Whitelists
Constants ¶
View Source
const ( // GenesisBaseFeeEM is the initial base fee elasticity multiplier for EIP-1559 blocks. GenesisBaseFeeEM = 2 // GenesisGasLimit is the default gas limit of the Genesis block. GenesisGasLimit uint64 = 4712388 // GenesisDifficulty is the default difficulty of the Genesis block. GenesisDifficulty uint64 = 131072 )
Variables ¶
View Source
var AllForksEnabled = &Forks{ Homestead: NewFork(0), EIP150: NewFork(0), EIP155: NewFork(0), EIP158: NewFork(0), Byzantium: NewFork(0), Constantinople: NewFork(0), Petersburg: NewFork(0), Istanbul: NewFork(0), London: NewFork(0), }
View Source
var ( // ErrBurnContractAddressMissing is the error when a contract address is not provided ErrBurnContractAddressMissing = errors.New("burn contract address missing") )
View Source
var ( // GenesisBaseFee is the initial base fee for EIP-1559 blocks. GenesisBaseFee = ethgo.Gwei(1).Uint64() )
Functions ¶
This section is empty.
Types ¶
type AddressListConfig ¶ added in v0.9.0
type Chain ¶
type Chain struct { Name string `json:"name"` Genesis *Genesis `json:"genesis"` Params *Params `json:"params"` Bootnodes []string `json:"bootnodes,omitempty"` }
Chain is the blockchain chain configuration
func ImportFromFile ¶
ImportFromFile imports a chain from a filepath
type Forks ¶
type Forks struct { Homestead *Fork `json:"homestead,omitempty"` Byzantium *Fork `json:"byzantium,omitempty"` Constantinople *Fork `json:"constantinople,omitempty"` Petersburg *Fork `json:"petersburg,omitempty"` Istanbul *Fork `json:"istanbul,omitempty"` London *Fork `json:"london,omitempty"` EIP150 *Fork `json:"EIP150,omitempty"` EIP158 *Fork `json:"EIP158,omitempty"` EIP155 *Fork `json:"EIP155,omitempty"` }
Forks specifies when each fork is activated
func (*Forks) At ¶
func (f *Forks) At(block uint64) ForksInTime
func (*Forks) IsByzantium ¶
func (*Forks) IsConstantinople ¶
func (*Forks) IsHomestead ¶
func (*Forks) IsPetersburg ¶
type ForksInTime ¶
type ForksInTime struct { Homestead, Byzantium, Constantinople, Petersburg, Istanbul, London, EIP150, EIP158, EIP155 bool }
type Genesis ¶
type Genesis struct { Config *Params `json:"config"` Nonce [8]byte `json:"nonce"` Timestamp uint64 `json:"timestamp"` ExtraData []byte `json:"extraData,omitempty"` GasLimit uint64 `json:"gasLimit"` Difficulty uint64 `json:"difficulty"` Mixhash types.Hash `json:"mixHash"` Coinbase types.Address `json:"coinbase"` Alloc map[types.Address]*GenesisAccount `json:"alloc,omitempty"` BaseFee uint64 `json:"baseFee"` BaseFeeEM uint64 `json:"baseFeeEM"` // Override StateRoot types.Hash // Only for testing Number uint64 `json:"number"` GasUsed uint64 `json:"gasUsed"` ParentHash types.Hash `json:"parentHash"` }
Genesis specifies the header fields, state of a genesis block
func (*Genesis) GenesisHeader ¶
GenesisHeader converts the initially defined genesis struct to a header
func (*Genesis) MarshalJSON ¶
MarshalJSON implements the json interface
func (*Genesis) UnmarshalJSON ¶
UnmarshalJSON implements the json interface
type GenesisAccount ¶
type GenesisAccount struct { Code []byte `json:"code,omitempty"` Storage map[types.Hash]types.Hash `json:"storage,omitempty"` Balance *big.Int `json:"balance,omitempty"` Nonce uint64 `json:"nonce,omitempty"` PrivateKey []byte `json:"secretKey,omitempty"` // for tests }
GenesisAccount is an account in the state of the genesis block.
func (*GenesisAccount) MarshalJSON ¶
func (g *GenesisAccount) MarshalJSON() ([]byte, error)
func (*GenesisAccount) UnmarshalJSON ¶
func (g *GenesisAccount) UnmarshalJSON(data []byte) error
type Params ¶
type Params struct { Forks *Forks `json:"forks"` ChainID int64 `json:"chainID"` Engine map[string]interface{} `json:"engine"` Whitelists *Whitelists `json:"whitelists,omitempty"` BlockGasTarget uint64 `json:"blockGasTarget"` // Access control configuration ContractDeployerAllowList *AddressListConfig `json:"contractDeployerAllowList,omitempty"` ContractDeployerBlockList *AddressListConfig `json:"contractDeployerBlockList,omitempty"` TransactionsAllowList *AddressListConfig `json:"transactionsAllowList,omitempty"` TransactionsBlockList *AddressListConfig `json:"transactionsBlockList,omitempty"` BridgeAllowList *AddressListConfig `json:"bridgeAllowList,omitempty"` BridgeBlockList *AddressListConfig `json:"bridgeBlockList,omitempty"` // Governance contract where the token will be sent to and burn in london fork BurnContract map[uint64]string `json:"burnContract"` }
Params are all the set of params for the chain
func (*Params) CalculateBurnContract ¶ added in v0.9.0
CalculateBurnContract calculates burn contract address for the given block number
type Whitelists ¶ added in v0.5.1
Whitelists specifies supported whitelists
Click to show internal directories.
Click to hide internal directories.