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

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

Loading…
Cancel
Save