Skip to content

Commit

Permalink
Fix Goerli Params and Genesis (#25)
Browse files Browse the repository at this point in the history
* params: fix goerli aura params

* params: remove period and epoch from aura config

* core: fix goerli genesis

* cmd/utils: fix goerli flags
  • Loading branch information
5chdn authored and dutterbutter committed Sep 8, 2018
1 parent 65ae9c9 commit 1f6086d
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 20 deletions.
5 changes: 3 additions & 2 deletions cmd/utils/flags.go
Expand Up @@ -714,6 +714,8 @@ func setBootstrapNodesV5(ctx *cli.Context, cfg *p2p.Config) {
}
case ctx.GlobalBool(RinkebyFlag.Name):
urls = params.RinkebyBootnodes
case ctx.GlobalBool(GoerliFlag.Name):
urls = params.GoerliBootnodes
case cfg.BootstrapNodesV5 != nil:
return // already set, don't apply defaults.
}
Expand Down Expand Up @@ -981,7 +983,6 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) {
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "testnet")
case ctx.GlobalBool(RinkebyFlag.Name):
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "rinkeby")
// setting Goerli default datadir
case ctx.GlobalBool(GoerliFlag.Name):
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "goerli")
}
Expand Down Expand Up @@ -1124,7 +1125,7 @@ func SetShhConfig(ctx *cli.Context, stack *node.Node, cfg *whisper.Config) {
// SetEthConfig applies eth-related command line flags to the config.
func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
// Avoid conflicting network flags
checkExclusive(ctx, DeveloperFlag, TestnetFlag, RinkebyFlag)
checkExclusive(ctx, DeveloperFlag, TestnetFlag, RinkebyFlag, GoerliFlag)
checkExclusive(ctx, LightServFlag, SyncModeFlag, "light")

ks := stack.AccountManager().Backends(keystore.KeyStoreType)[0].(*keystore.KeyStore)
Expand Down
10 changes: 5 additions & 5 deletions core/genesis.go
Expand Up @@ -333,14 +333,14 @@ func DefaultRinkebyGenesisBlock() *Genesis {
}
}
//Need alloc data
// DefaultGoerliGenesisBlock returns the Rinkeby network genesis block.
// DefaultGoerliGenesisBlock returns the Goerli network genesis block.
func DefaultGoerliGenesisBlock() *Genesis {
return &Genesis{
Config: params.GoerliChainConfig,
Timestamp: 1492009146,
ExtraData: hexutil.MustDecode("0x52657370656374206d7920617574686f7269746168207e452e436172746d616e42eb768f2244c8811c63729a21a3569731535f067ffc57839b00206d1ad20c69a1981b489f772031b279182d99e65703f0076e4812653aab85fca0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
GasLimit: 4700000,
Difficulty: big.NewInt(1),
Timestamp: 0,
ExtraData: hexutil.MustDecode("0x"),
GasLimit: 6000000,
Difficulty: big.NewInt(131072),
Alloc: decodePrealloc(goerliAllocData),
}
}
Expand Down
1 change: 0 additions & 1 deletion core/genesis_alloc.go

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions mobile/params.go
Expand Up @@ -50,6 +50,15 @@ func RinkebyGenesis() string {
return string(enc)
}

// GoerliGenesis returns the JSON spec to use for the Goerli test network
func GoerliGenesis() string {
enc, err := json.Marshal(core.DefaultGoerliGenesisBlock())
if err != nil {
panic(err)
}
return string(enc)
}

// FoundationBootnodes returns the enode URLs of the P2P bootstrap nodes operated
// by the foundation running the V5 discovery protocol.
func FoundationBootnodes() *Enodes {
Expand Down
22 changes: 10 additions & 12 deletions params/config.go
Expand Up @@ -19,7 +19,6 @@ package params
import (
"fmt"
"math/big"

"github.com/ethereum/go-ethereum/common"
)

Expand All @@ -28,7 +27,7 @@ var (
MainnetGenesisHash = common.HexToHash("0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3")
TestnetGenesisHash = common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d")
RinkebyGenesisHash = common.HexToHash("0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177")
GoerliGenesisHash = common.HexToHash("0X0000000000000000000000000000000000000000000000000000000000000000")
GoerliGenesisHash = common.HexToHash("0x4a982649dec9992d0c83d195a81670bfcbe769436a900bab113371a25d7ad4ab")
)

var (
Expand Down Expand Up @@ -83,20 +82,19 @@ var (
// GoerliChainConfig contains the chain parameters to run a node on the Goerli test network.
GoerliChainConfig = &ChainConfig{
ChainID: big.NewInt(6382),
HomesteadBlock: big.NewInt(2),
HomesteadBlock: big.NewInt(0),
DAOForkBlock: nil,
DAOForkSupport: true,
EIP150Block: big.NewInt(2),
EIP150Hash: common.HexToHash("0X0000000000000000000000000000000000000000000000000000000000000000"),
EIP155Block: big.NewInt(3),
EIP158Block: big.NewInt(3),
ByzantiumBlock: big.NewInt(1035301),
DAOForkSupport: false,
// EIP150Block: big.NewInt(0),
// EIP150Hash: common.HexToHash("0X0000000000000000000000000000000000000000000000000000000000000000"),
EIP155Block: big.NewInt(0),
EIP158Block: big.NewInt(0),
ByzantiumBlock: big.NewInt(0),
ConstantinopleBlock: nil,
Aura: &AuraConfig{
Period: 4,
Epoch: 30000,
Authorities: []common.Address{
common.HexToAddress("0x540a9fe3d2381016dec8ffba7235c6fb00b0f942"),
common.HexToAddress("0x0082a7bf6aaadab094061747872243059c3c6a07"),
common.HexToAddress("0x00faa37564140c1a5e96095f05466b9f73441e44"),
},
Difficulty: big.NewInt(131072),
},
Expand Down

0 comments on commit 1f6086d

Please sign in to comment.