Merge conflict

pull/148/head
Rongjian Lan 6 years ago
parent 276d314dd1
commit fab7023718
  1. 7
      deploy.sh
  2. 4
      node/node.go

@ -51,7 +51,7 @@ EOU
PEER=-peer_discovery PEER=-peer_discovery
DB= DB=
TXGEN=true TXGEN=false
DURATION=90 DURATION=90
MIN=5 MIN=5
SHARDS=2 SHARDS=2
@ -62,7 +62,7 @@ while getopts "hpdtD:m:s:k:" option; do
h) usage ;; h) usage ;;
p) PEER='-peer_discovery' ;; p) PEER='-peer_discovery' ;;
d) DB='-db_supported' ;; d) DB='-db_supported' ;;
t) TXGEN=false ;; t) TXGEN=$OPTARG ;;
D) DURATION=$OPTARG ;; D) DURATION=$OPTARG ;;
m) MIN=$OPTARG ;; m) MIN=$OPTARG ;;
s) SHARDS=$OPTARG ;; s) SHARDS=$OPTARG ;;
@ -122,6 +122,7 @@ done < $config
echo "launching txgen ..." echo "launching txgen ..."
if [ "$TXGEN" == "true" ]; then if [ "$TXGEN" == "true" ]; then
echo "launching txgen ..."
if [ -z "$PEER" ]; then if [ -z "$PEER" ]; then
./bin/txgen -config_file $config -log_folder $log_folder -duration $DURATION ./bin/txgen -config_file $config -log_folder $log_folder -duration $DURATION
else else
@ -129,4 +130,4 @@ if [ "$TXGEN" == "true" ]; then
fi fi
fi fi
cleanup # cleanup

@ -4,6 +4,7 @@ import (
"bytes" "bytes"
"crypto/ecdsa" "crypto/ecdsa"
"encoding/gob" "encoding/gob"
"encoding/hex"
"fmt" "fmt"
"math/big" "math/big"
"math/rand" "math/rand"
@ -305,6 +306,7 @@ func New(host host.Host, consensus *bft.Consensus, db *hdb.LDBDatabase) *Node {
testBankKey, _ := ecdsa.GenerateKey(crypto.S256(), reader) testBankKey, _ := ecdsa.GenerateKey(crypto.S256(), reader)
testBankAddress := crypto.PubkeyToAddress(testBankKey.PublicKey) testBankAddress := crypto.PubkeyToAddress(testBankKey.PublicKey)
testBankFunds := big.NewInt(8000000000000000000) testBankFunds := big.NewInt(8000000000000000000)
fmt.Println(hex.EncodeToString(crypto.FromECDSA(testBankKey)))
genesisAloc[testBankAddress] = core.GenesisAccount{Balance: testBankFunds} genesisAloc[testBankAddress] = core.GenesisAccount{Balance: testBankFunds}
node.TestBankKeys = append(node.TestBankKeys, testBankKey) node.TestBankKeys = append(node.TestBankKeys, testBankKey)
} }
@ -337,7 +339,7 @@ func New(host host.Host, consensus *bft.Consensus, db *hdb.LDBDatabase) *Node {
// Logger // Logger
node.log = log.New() node.log = log.New()
if consensus.IsLeader { if consensus != nil && consensus.IsLeader {
node.State = NodeLeader node.State = NodeLeader
} else { } else {
node.State = NodeInit node.State = NodeInit

Loading…
Cancel
Save