diff options
author | Wei-Ning Huang <aitjcize@gmail.com> | 2018-11-12 11:34:02 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2018-12-19 20:54:27 +0800 |
commit | 68eeeb7eade3d621cc2ea0e08c95a869301fb1bf (patch) | |
tree | 7490130c95d48b0492b0b72937dd9e4e913b65d1 | |
parent | 5d077053161c4c60f83519aa9e27aa49ee5ad51f (diff) | |
download | dexon-68eeeb7eade3d621cc2ea0e08c95a869301fb1bf.tar.gz dexon-68eeeb7eade3d621cc2ea0e08c95a869301fb1bf.tar.zst dexon-68eeeb7eade3d621cc2ea0e08c95a869301fb1bf.zip |
params: fix genesis block config and use testnet for test (#10)
-rw-r--r-- | core/genesis.go | 6 | ||||
-rw-r--r-- | params/config.go | 8 | ||||
-rw-r--r-- | test/genesis.json | 20 | ||||
-rwxr-xr-x | test/run_test.sh | 5 |
4 files changed, 22 insertions, 17 deletions
diff --git a/core/genesis.go b/core/genesis.go index 748a602e1..245fe9fff 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -382,7 +382,7 @@ func DefaultGenesisBlock() *Genesis { return &Genesis{ Config: params.MainnetChainConfig, Timestamp: 1540024964, - Nonce: 42, + Nonce: 0x42, ExtraData: hexutil.MustDecode("0x5765692d4e696e6720536f6e696320426f6a696520323031382d31302d32302e"), GasLimit: 8000000, Difficulty: big.NewInt(1), @@ -394,9 +394,9 @@ func DefaultGenesisBlock() *Genesis { func DefaultTestnetGenesisBlock() *Genesis { return &Genesis{ Config: params.TestnetChainConfig, - Nonce: 42, + Nonce: 0x42, ExtraData: hexutil.MustDecode("0x3535353535353535353535353535353535353535353535353535353535353535"), - GasLimit: 16777216, + GasLimit: 8000000, Difficulty: big.NewInt(1), Alloc: decodePrealloc(testnetAllocData), } diff --git a/params/config.go b/params/config.go index f59e01a84..ec7405d53 100644 --- a/params/config.go +++ b/params/config.go @@ -45,7 +45,7 @@ var ( ConstantinopleBlock: big.NewInt(0), Dexcon: &DexconConfig{ GenesisCRSText: "In DEXON, we trust.", - Owner: common.HexToAddress("7C3c31B19395A5e2627F921Cc2802560B71f1caB"), + Owner: common.HexToAddress("BF8C48A620bacc46907f9B89732D25E47A2D7Cf7"), BlockReward: big.NewInt(1e18), BlockGasLimit: 80000000, NumChains: 4, @@ -55,7 +55,7 @@ var ( PhiRatio: 667000, NotarySetSize: 4, DKGSetSize: 4, - RoundInterval: 99999999999, + RoundInterval: 600000, MinBlockInterval: 900, }, } @@ -82,7 +82,7 @@ var ( ConstantinopleBlock: nil, Dexcon: &DexconConfig{ GenesisCRSText: "In DEXON, we trust.", - Owner: common.HexToAddress("7C3c31B19395A5e2627F921Cc2802560B71f1caB"), + Owner: common.HexToAddress("BF8C48A620bacc46907f9B89732D25E47A2D7Cf7"), BlockReward: big.NewInt(1e18), BlockGasLimit: 80000000, NumChains: 4, @@ -92,7 +92,7 @@ var ( PhiRatio: 667000, NotarySetSize: 4, DKGSetSize: 4, - RoundInterval: 99999999999, + RoundInterval: 600000, MinBlockInterval: 900, }, } diff --git a/test/genesis.json b/test/genesis.json index 32a3bcfa0..8a4761e93 100644 --- a/test/genesis.json +++ b/test/genesis.json @@ -1,33 +1,35 @@ { "config": { - "chainId": 237, + "chainId": 238, "homesteadBlock": 0, + "daoForkBlock": 0, + "daoForkSupport": true, "eip150Block": 0, "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000", "eip155Block": 0, "eip158Block": 0, + "byzantiumBlock": 0, "dexcon": { "genesisCRSText": "In DEXON, we trust.", "owner": "0xBF8C48A620bacc46907f9B89732D25E47A2D7Cf7", - "blockReward": "1000000000000000000", + "blockReward": "0xde0b6b3a7640000", "blockGasLimit": 80000000, "numChains": 4, "lambdaBA": 250, - "lambdaDKG": 4000, + "lambdaDKG": 2500, "k": 0, "phiRatio": 667000, "notarySetSize": 4, "dkgSetSize": 4, "roundInterval": 600000, - "minBlockInterval": 900, - "maxBlockInterval": 1100 + "minBlockInterval": 900 } }, "nonce": "0x42", - "timestamp": "0x596a5b14", - "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", - "gasLimit": "0x2fefd800", - "difficulty": "0x20000", + "timestamp": "0x0", + "extraData": "0x3535353535353535353535353535353535353535353535353535353535353535", + "gasLimit": "0x7a1200", + "difficulty": "0x1", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "coinbase": "0x0000000000000000000000000000000000000000", "alloc": { diff --git a/test/run_test.sh b/test/run_test.sh index 66387e703..219157ed9 100755 --- a/test/run_test.sh +++ b/test/run_test.sh @@ -29,8 +29,11 @@ for i in $(seq 0 3); do datadir=$PWD/Dexon.$i rm -rf $datadir $GDEX --datadir=$datadir init genesis.json - $GDEX --verbosity=4 --gcmode=archive \ + $GDEX \ + --testnet \ --bp \ + --verbosity=4 \ + --gcmode=archive \ --datadir=$datadir --nodekey=test$i.nodekey \ --port=$((30305 + $i)) \ --rpc --rpcapi=eth,net,web3,debug \ |