github.com/amazechain/amc@v0.1.3/conf/genesis_config.go (about) 1 // Copyright 2022 The AmazeChain Authors 2 // This file is part of the AmazeChain library. 3 // 4 // The AmazeChain library is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU Lesser General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // The AmazeChain library is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU Lesser General Public License for more details. 13 // 14 // You should have received a copy of the GNU Lesser General Public License 15 // along with the AmazeChain library. If not, see <http://www.gnu.org/licenses/>. 16 17 package conf 18 19 import ( 20 "github.com/amazechain/amc/common/types" 21 "github.com/holiman/uint256" 22 23 "github.com/amazechain/amc/params" 24 ) 25 26 type Genesis struct { 27 Config *params.ChainConfig `json:"config" yaml:"config"` 28 Nonce uint64 `json:"nonce"` 29 Timestamp uint64 `json:"timestamp"` 30 ExtraData []byte `json:"extraData"` 31 GasLimit uint64 `json:"gasLimit" gencodec:"required"` 32 Difficulty *uint256.Int `json:"difficulty" gencodec:"required"` 33 Mixhash types.Hash `json:"mixHash"` 34 Coinbase types.Address `json:"coinbase"` 35 36 //Engine *ConsensusConfig `json:"engine" yaml:"engine"` 37 Miners []string `json:"miners" yaml:"miners"` 38 Alloc GenesisAlloc `json:"alloc" yaml:"alloc" gencodec:"required"` 39 40 // These fields are used for consensus tests. Please don't use them 41 // in actual genesis blocks. 42 Number uint64 `json:"number"` 43 GasUsed uint64 `json:"gasUsed"` 44 ParentHash types.Hash `json:"parentHash"` 45 BaseFee *uint256.Int `json:"baseFeePerGas"` 46 } 47 48 // GenesisAlloc specifies the initial state that is part of the genesis block. 49 type GenesisAlloc map[types.Address]GenesisAccount 50 51 type GenesisAccount struct { 52 //Address string `json:"address" toml:"address"` 53 Balance string `json:"balance"` 54 Code []byte `json:"code,omitempty"` 55 Storage map[types.Hash]types.Hash `json:"storage,omitempty"` 56 Nonce uint64 `json:"nonce,omitempty"` 57 }