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