aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei-Ning Huang <aitjcize@gmail.com>2018-11-12 11:34:02 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 13:49:56 +0800
commitd89df904e4e9c485e2edff20ab523d441811c034 (patch)
treed539e577764d3013e21782d9381de6f247e2d06c
parent8bb6abd7f40e88a18148799c9a8b4a42f7cc4aab (diff)
downloaddexon-d89df904e4e9c485e2edff20ab523d441811c034.tar.gz
dexon-d89df904e4e9c485e2edff20ab523d441811c034.tar.zst
dexon-d89df904e4e9c485e2edff20ab523d441811c034.zip
params: fix genesis block config and use testnet for test (#10)
-rw-r--r--core/genesis.go6
-rw-r--r--params/config.go8
-rw-r--r--test/genesis.json20
-rwxr-xr-xtest/run_test.sh5
4 files changed, 22 insertions, 17 deletions
diff --git a/core/genesis.go b/core/genesis.go
index cc3a0750c..8cd6b4807 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 e080f1572..253575c50 100644
--- a/params/config.go
+++ b/params/config.go
@@ -46,7 +46,7 @@ var (
PetersburgBlock: 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,
@@ -56,7 +56,7 @@ var (
PhiRatio: 667000,
NotarySetSize: 4,
DKGSetSize: 4,
- RoundInterval: 99999999999,
+ RoundInterval: 600000,
MinBlockInterval: 900,
},
}
@@ -84,7 +84,7 @@ var (
PetersburgBlock: 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,
@@ -94,7 +94,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 \