mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
adding configs
This commit is contained in:
parent
2b9910992c
commit
a456f9c876
4 changed files with 42 additions and 0 deletions
|
|
@ -628,6 +628,9 @@ func MakeDataDir(ctx *cli.Context) string {
|
||||||
if ctx.GlobalBool(RinkebyFlag.Name) {
|
if ctx.GlobalBool(RinkebyFlag.Name) {
|
||||||
return filepath.Join(path, "rinkeby")
|
return filepath.Join(path, "rinkeby")
|
||||||
}
|
}
|
||||||
|
if ctx.GlobalBool(GoerliFlag.Name) {
|
||||||
|
return filepath.Join(path, "goerli")
|
||||||
|
}
|
||||||
return path
|
return path
|
||||||
}
|
}
|
||||||
Fatalf("Cannot determine default data directory, please set manually (--datadir)")
|
Fatalf("Cannot determine default data directory, please set manually (--datadir)")
|
||||||
|
|
@ -682,6 +685,8 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
|
||||||
urls = params.TestnetBootnodes
|
urls = params.TestnetBootnodes
|
||||||
case ctx.GlobalBool(RinkebyFlag.Name):
|
case ctx.GlobalBool(RinkebyFlag.Name):
|
||||||
urls = params.RinkebyBootnodes
|
urls = params.RinkebyBootnodes
|
||||||
|
case ctx.GlobalBool(GoerliFLag.Name):
|
||||||
|
urls = params.GoerliBootnodes
|
||||||
case cfg.BootstrapNodes != nil:
|
case cfg.BootstrapNodes != nil:
|
||||||
return // already set, don't apply defaults.
|
return // already set, don't apply defaults.
|
||||||
}
|
}
|
||||||
|
|
@ -1346,6 +1351,8 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis {
|
||||||
genesis = core.DefaultRinkebyGenesisBlock()
|
genesis = core.DefaultRinkebyGenesisBlock()
|
||||||
case ctx.GlobalBool(DeveloperFlag.Name):
|
case ctx.GlobalBool(DeveloperFlag.Name):
|
||||||
Fatalf("Developer chains are ephemeral")
|
Fatalf("Developer chains are ephemeral")
|
||||||
|
case ctx.GlobalBool(GoerliFLag.Name):
|
||||||
|
genesis = core.DefaultGoerliGenesisBlock()
|
||||||
}
|
}
|
||||||
return genesis
|
return genesis
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -333,6 +333,19 @@ func DefaultRinkebyGenesisBlock() *Genesis {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: @priom: Define the correct values of each field
|
||||||
|
// DefaultGoerliGenesisBlock returns the Goerli network genesis block
|
||||||
|
func DefaultGoerliGenesisBlock() *Genesis {
|
||||||
|
return &Genesis {
|
||||||
|
Config: params.GoerliChainConfig,
|
||||||
|
Timestamp: ,
|
||||||
|
ExtraData: hexutil.MustDecode(""),
|
||||||
|
GasLimit: ,
|
||||||
|
Difficulty: big.NewInt(),
|
||||||
|
Alloc: decodePrealloc(goerliAllocData),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// DeveloperGenesisBlock returns the 'geth --dev' genesis block. Note, this must
|
// DeveloperGenesisBlock returns the 'geth --dev' genesis block. Note, this must
|
||||||
// be seeded with the
|
// be seeded with the
|
||||||
func DeveloperGenesisBlock(period uint64, faucet common.Address) *Genesis {
|
func DeveloperGenesisBlock(period uint64, faucet common.Address) *Genesis {
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,11 @@ var RinkebyBootnodes = []string{
|
||||||
"enode://b6b28890b006743680c52e64e0d16db57f28124885595fa03a562be1d2bf0f3a1da297d56b13da25fb992888fd556d4c1a27b1f39d531bde7de1921c90061cc6@159.89.28.211:30303", // AKASHA
|
"enode://b6b28890b006743680c52e64e0d16db57f28124885595fa03a562be1d2bf0f3a1da297d56b13da25fb992888fd556d4c1a27b1f39d531bde7de1921c90061cc6@159.89.28.211:30303", // AKASHA
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Goerli testnet BootNodes
|
||||||
|
var GoerliBootnodes = []string {
|
||||||
|
"",
|
||||||
|
}
|
||||||
|
|
||||||
// DiscoveryV5Bootnodes are the enode URLs of the P2P bootstrap nodes for the
|
// DiscoveryV5Bootnodes are the enode URLs of the P2P bootstrap nodes for the
|
||||||
// experimental RLPx v5 topic-discovery network.
|
// experimental RLPx v5 topic-discovery network.
|
||||||
var DiscoveryV5Bootnodes = []string{
|
var DiscoveryV5Bootnodes = []string{
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,22 @@ var (
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GoerliChainConfig contains chain parameters for Goerli Testnet node
|
||||||
|
GoerliChainConfig = &ChainConfig{
|
||||||
|
ChainID: big.NewInt(4),
|
||||||
|
HomesteadBlock: big.NewInt(1),
|
||||||
|
DAOForkBlock: nil,
|
||||||
|
DAOForkSupport: true,
|
||||||
|
EIP150Block: big.NewInt(2),
|
||||||
|
EIP150Hash: common.HexToHash(""),
|
||||||
|
EIP155Block: big.NewInt(3),
|
||||||
|
EIP158Block: big.NewInt(3),
|
||||||
|
ByzantiumBlock: big.NewInt(),
|
||||||
|
ConstantinopleBlock: nil,
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// AllEthashProtocolChanges contains every protocol change (EIPs) introduced
|
// AllEthashProtocolChanges contains every protocol change (EIPs) introduced
|
||||||
// and accepted by the Ethereum core developers into the Ethash consensus.
|
// and accepted by the Ethereum core developers into the Ethash consensus.
|
||||||
//
|
//
|
||||||
|
|
@ -123,6 +139,7 @@ type ChainConfig struct {
|
||||||
// Various consensus engines
|
// Various consensus engines
|
||||||
Ethash *EthashConfig `json:"ethash,omitempty"`
|
Ethash *EthashConfig `json:"ethash,omitempty"`
|
||||||
Clique *CliqueConfig `json:"clique,omitempty"`
|
Clique *CliqueConfig `json:"clique,omitempty"`
|
||||||
|
Aura *AuraConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
// EthashConfig is the consensus engine configs for proof-of-work based sealing.
|
// EthashConfig is the consensus engine configs for proof-of-work based sealing.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue