diff --git a/.stakingkey b/.stakingkey new file mode 100644 index 000000000..8264175a7 --- /dev/null +++ b/.stakingkey @@ -0,0 +1 @@ +f0410de27dcd1f3dc068d38085d6f1a9e5cebdabe72c7dd5d9447604adaac810 \ No newline at end of file diff --git a/cmd/harmony.go b/cmd/harmony.go index 40cc398de..a7f197e30 100644 --- a/cmd/harmony.go +++ b/cmd/harmony.go @@ -204,6 +204,9 @@ func main() { currentNode.Role = node.NewNode currentNode.AccountKey = stakingPriKey + // TODO: refactor the creation of blockchain out of node.New() + consensus.ChainReader = currentNode.Blockchain() + if *isBeacon { if role == "leader" { currentNode.Role = node.BeaconLeader diff --git a/consensus/consensus.go b/consensus/consensus.go index fef870ffa..fae1fd17c 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -167,6 +167,7 @@ func (consensus *Consensus) GetNextRnd() ([32]byte, [32]byte, error) { } // New creates a new Consensus object +// TODO: put shardId into chain reader's chain config func New(host p2p.Host, ShardID string, peers []p2p.Peer, leader p2p.Peer) *Consensus { consensus := Consensus{} consensus.host = host diff --git a/test/deploy.sh b/test/deploy.sh index d5b2a9c0b..2c6b68f16 100755 --- a/test/deploy.sh +++ b/test/deploy.sh @@ -138,30 +138,18 @@ NUM_NN=0 while IFS='' read -r line || [[ -n "$line" ]]; do IFS=' ' read ip port mode shardID <<< $line if [ "$mode" == "leader" ]; then -<<<<<<< HEAD echo "launching leader ..." - $DRYRUN $ROOT/bin/harmony -ip $ip -port $port -log_folder $log_folder $DB -min_peers $MIN $HMY_OPT $HMY_OPT2 $HMY_OPT3 -key /tmp/$ip-$port.key -is_leader 2>&1 | tee -a $LOG_FILE & + $DRYRUN $ROOT/bin/harmony -ip $ip -port $port -log_folder $log_folder $DB -min_peers $MIN $HMY_OPT2 $HMY_OPT3 -key /tmp/$ip-$port.key -is_leader 2>&1 | tee -a $LOG_FILE & fi if [ "$mode" == "validator" ]; then echo "launching validator ..." - $DRYRUN $ROOT/bin/harmony -ip $ip -port $port -log_folder $log_folder $DB -min_peers $MIN $HMY_OPT $HMY_OPT2 $HMY_OPT3 -key /tmp/$ip-$port.key 2>&1 | tee -a $LOG_FILE & + $DRYRUN $ROOT/bin/harmony -ip $ip -port $port -log_folder $log_folder $DB -min_peers $MIN $HMY_OPT2 $HMY_OPT3 -key /tmp/$ip-$port.key 2>&1 | tee -a $LOG_FILE & fi sleep 0.5 if [[ "$mode" == "newnode" && "$SYNC" == "true" ]]; then (( NUM_NN += 10 )) echo "launching new node ..." - (sleep $NUM_NN; $DRYRUN $ROOT/bin/harmony -ip $ip -port $port -log_folder $log_folder $DB -min_peers $MIN $HMY_OPT $HMY_OPT2 $HMY_OPT3 -key /tmp/$ip-$port.key 2>&1 | tee -a $LOG_FILE ) & -======= - $DRYRUN $ROOT/bin/harmony -ip $ip -port $port -log_folder $log_folder $DB -min_peers $MIN $HMY_OPT2 $HMY_OPT3 -key /tmp/$ip-$port.key -is_leader 2>&1 | tee -a $LOG_FILE & - fi - if [ "$mode" == "validator" ]; then - $DRYRUN $ROOT/bin/harmony -ip $ip -port $port -log_folder $log_folder $DB -min_peers $MIN $HMY_OPT2 $HMY_OPT3 -key /tmp/$ip-$port.key 2>&1 | tee -a $LOG_FILE & - fi - sleep 0.5 - if [[ "$mode" == "newnode" && "$SYNC" == "true" ]]; then - (( NUM_NN += 35 )) (sleep $NUM_NN; $DRYRUN $ROOT/bin/harmony -ip $ip -port $port -log_folder $log_folder $DB -min_peers $MIN $HMY_OPT2 $HMY_OPT3 -key /tmp/$ip-$port.key 2>&1 | tee -a $LOG_FILE ) & ->>>>>>> 06d1c76ced939e98205257f39ce379789193369b fi done < $config