diff options
author | Wei-Ning Huang <w@dexon.org> | 2019-01-13 16:21:17 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-03-12 12:19:09 +0800 |
commit | ba71563f6844a574bdfa9da5585bdae4a9958677 (patch) | |
tree | bf474a36438acec5a799f1777de15ac7341bb359 /test | |
parent | cae038236416efd8a3436664024f9cadee741512 (diff) | |
download | dexon-ba71563f6844a574bdfa9da5585bdae4a9958677.tar.gz dexon-ba71563f6844a574bdfa9da5585bdae4a9958677.tar.zst dexon-ba71563f6844a574bdfa9da5585bdae4a9958677.zip |
consensus: implement DEXON cryptoeconomics v4.0 (#145)
Diffstat (limited to 'test')
-rw-r--r-- | test/genesis.json | 14 | ||||
-rw-r--r-- | test/keygen.go | 12 | ||||
-rwxr-xr-x | test/run_test.sh | 24 |
3 files changed, 20 insertions, 30 deletions
diff --git a/test/genesis.json b/test/genesis.json index c053120f5..ce3526883 100644 --- a/test/genesis.json +++ b/test/genesis.json @@ -1,7 +1,8 @@ { "config": { - "chainId": 238, + "chainId": 237, "homesteadBlock": 0, + "daoForkBlock": 0, "daoForkSupport": true, "eip150Block": 0, "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000", @@ -14,7 +15,9 @@ "owner": "0xbf8c48a620bacc46907f9b89732d25e47a2d7cf7", "minStake": "0x152d02c7e14af6800000", "lockupPeriod": 259200000, - "blockReward": "0xde0b6b3a7640000", + "miningVelocity": 0.1875, + "nextHalvingSupply": "0x813f3978f89409844000000", + "lastHalvedAmount": "0x4d8c55aefb8c05b5c000000", "blockGasLimit": 40000000, "numChains": 6, "lambdaBA": 250, @@ -24,7 +27,7 @@ "notarySetSize": 4, "dkgSetSize": 4, "roundInterval": 600000, - "minBlockInterval": 900, + "minBlockInterval": 1000, "fineValues": [ "0x21e19e0c9bab2400000", "0x21e19e0c9bab2400000", @@ -96,5 +99,8 @@ "url": "https://dexon.org" } } - } + }, + "number": "0x0", + "gasUsed": "0x0", + "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000" } diff --git a/test/keygen.go b/test/keygen.go index b98d70751..e7441e146 100644 --- a/test/keygen.go +++ b/test/keygen.go @@ -24,15 +24,7 @@ var preFundAddresss = []string{ } func main() { - data, err := ioutil.ReadFile(genesisFile) - if err != nil { - panic(err) - } - - genesis := new(core.Genesis) - if err := json.Unmarshal(data, &genesis); err != nil { - panic(err) - } + genesis := core.DefaultGenesisBlock() // Clear previous allocation. genesis.Alloc = make(map[common.Address]core.GenesisAccount) @@ -71,7 +63,7 @@ func main() { fmt.Printf("Created account %s\n", address.String()) } - data, err = json.MarshalIndent(genesis, "", " ") + data, err := json.MarshalIndent(genesis, "", " ") if err != nil { panic(err) } diff --git a/test/run_test.sh b/test/run_test.sh index a2280cc7d..ccbdbf9fc 100755 --- a/test/run_test.sh +++ b/test/run_test.sh @@ -1,17 +1,9 @@ #!/bin/bash -if [ "$1" != "--testnet" ] && [ "$1" != "--taipei" ]; then - echo 'invalid network specified' - exit 1 -fi - -NETWORK="${1}" - -if [ "$2" == "--local" ]; then - NETWORK="${NETWORK} --bootnodes enode://0478aa13c91aa0db8e93b668313b7eb0532fbdb24f64772375373b14dbe326c238ad09ab4469f6442c9a9753f1275aeec2e531912c14a958ed1feb4ae7e227ef@127.0.0.1:30301" - # Start bootnode. - bootnode -nodekey keystore/bootnode.key --verbosity=9 > bootnode.log 2>&1 & -fi +NETWORK="--bootnodes enode://0478aa13c91aa0db8e93b668313b7eb0532fbdb24f64772375373b14dbe326c238ad09ab4469f6442c9a9753f1275aeec2e531912c14a958ed1feb4ae7e227ef@127.0.0.1:30301" +GENESIS="genesis.json" +# Start bootnode. +bootnode -nodekey keystore/bootnode.key --verbosity=9 > bootnode.log 2>&1 & GDEX=../build/bin/gdex @@ -34,10 +26,10 @@ let dmoment=`date +%s`+7 # A standalone RPC server for accepting RPC requests. datadir=$PWD/Dexon.rpc rm -rf $datadir -$GDEX --datadir=$datadir init genesis.json +$GDEX --datadir=$datadir init ${GENESIS} $GDEX \ ${NETWORK} \ - --verbosity=4 \ + --verbosity=3 \ --gcmode=archive \ --datadir=$datadir --nodekey=keystore/rpc.key \ --rpc --rpcapi=eth,net,web3,debug \ @@ -52,11 +44,11 @@ $GDEX \ for i in $(seq 0 3); do datadir=$PWD/Dexon.$i rm -rf $datadir - $GDEX --datadir=$datadir init genesis.json + $GDEX --datadir=$datadir init ${GENESIS} $GDEX \ ${NETWORK} \ --bp \ - --verbosity=4 \ + --verbosity=3 \ --gcmode=archive \ --datadir=$datadir --nodekey=keystore/test$i.key \ --port=$((30305 + $i)) \ |