Documentation ¶
Overview ¶
Code generated for package chain by go-bindata DO NOT EDIT. (@generated) sources: chain/chains/foundation.json chain/chains/goerli.json chain/chains/ibft.json chain/chains/test.json
Index ¶
- Variables
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func MustAsset(name string) []byte
- func ResolveNetworkID(id uint) string
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- 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) IsDetroit(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) IsOnDetroit(block uint64) bool
- func (f *Forks) IsOnPortland(block uint64) bool
- func (f *Forks) IsOnPreportland(block uint64) bool
- func (f *Forks) IsPetersburg(block uint64) bool
- func (f *Forks) IsPortland(block uint64) bool
- type ForksInTime
- type Genesis
- type GenesisAccount
- type Params
Constants ¶
This section is empty.
Variables ¶
var ( // GenesisGasLimit is the default gas limit of the Genesis block. GenesisGasLimit uint64 = 4712388 // GenesisDifficulty is the default difficulty of the Genesis block. GenesisDifficulty = big.NewInt(131072) )
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), Preportland: NewFork(10000), Portland: NewFork(10222), Detroit: NewFork(40562), }
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func ResolveNetworkID ¶
ResolveNetworkID returns the name of the network or the string of the id if it is not found
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type Chain ¶
type Chain struct { Name string `json:"name"` Genesis *Genesis `json:"genesis"` Params *Params `json:"params"` Bootnodes []string `json:"bootnodes,omitempty"` Staticnodes []string `json:"staticnodes,omitempty"` }
Chain is the blockchain chain configuration
func ImportFromFile ¶
ImportFromFile imports a chain from a filepath
func ImportFromName ¶
ImportFromName imports a chain from the precompiled json chains (i.e. foundation)
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"` EIP150 *Fork `json:"EIP150,omitempty"` EIP158 *Fork `json:"EIP158,omitempty"` EIP155 *Fork `json:"EIP155,omitempty"` Preportland *Fork `json:"pre-portland,omitempty"` // test hardfork only in some test networks Portland *Fork `json:"portland,omitempty"` // bridge hardfork Detroit *Fork `json:"detroit,omitempty"` // pos hardfork }
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) IsOnDetroit ¶ added in v1.2.0
func (*Forks) IsOnPortland ¶ added in v1.1.2
func (*Forks) IsOnPreportland ¶ added in v1.2.0
func (*Forks) IsPetersburg ¶
func (*Forks) IsPortland ¶ added in v1.1.2
type ForksInTime ¶
type ForksInTime struct { Homestead, Byzantium, Constantinople, Petersburg, Istanbul, EIP150, EIP158, EIP155, Preportland, Portland, Detroit 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"` // 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 int `json:"chainID"` Engine map[string]interface{} `json:"engine"` BlockGasTarget uint64 `json:"blockGasTarget"` BlackList []string `json:"blackList,omitempty"` DDOSProtection bool `json:"ddosProtection,omitempty"` DestructiveContracts []string `json:"destructiveContracts,omitempty"` }
Params are all the set of params for the chain