minor change

pull/510/head
Rongjian Lan 6 years ago
parent 337e19d2b4
commit 18491389be
  1. 2
      cmd/harmony.go
  2. 2
      node/staking.go
  3. 5
      test/deploy.sh

@ -231,7 +231,7 @@ func main() {
panic("unable to new host in harmony") panic("unable to new host in harmony")
} }
log.Info("HARMONY", "multiaddress", fmt.Sprintf("/ip4/%s/tcp/%s/p2p/%s", *ip, *port, host.GetID().Pretty())) log.Info("New Harmony Node...", "multiaddress", fmt.Sprintf("/ip4/%s/tcp/%s/p2p/%s", *ip, *port, host.GetID().Pretty()))
host.AddPeer(&leader) host.AddPeer(&leader)

@ -43,7 +43,7 @@ func (node *Node) UpdateStakingList(block *types.Block) error {
//This means its a new node that is staking the first time. //This means its a new node that is staking the first time.
node.CurrentStakes[currentSender] = value node.CurrentStakes[currentSender] = value
} }
case withdrawFuncSignature: //withdaw, currently: 0x2e1a7d4d case withdrawFuncSignature: //withdraw, currently: 0x2e1a7d4d
value := decodeStakeCall(data) value := decodeStakeCall(data)
if isPresent { if isPresent {
if node.CurrentStakes[currentSender] > value { if node.CurrentStakes[currentSender] > value {

@ -154,14 +154,17 @@ NUM_NN=0
while IFS='' read -r line || [[ -n "$line" ]]; do while IFS='' read -r line || [[ -n "$line" ]]; do
IFS=' ' read ip port mode shardID <<< $line IFS=' ' read ip port mode shardID <<< $line
if [ "$mode" == "leader" ]; then if [ "$mode" == "leader" ]; then
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_OPT $HMY_OPT2 $HMY_OPT3 -key /tmp/$ip-$port.key -is_leader 2>&1 | tee -a $LOG_FILE &
fi fi
if [ "$mode" == "validator" ]; then 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_OPT $HMY_OPT2 $HMY_OPT3 -key /tmp/$ip-$port.key 2>&1 | tee -a $LOG_FILE &
fi fi
sleep 0.5 sleep 0.5
if [[ "$mode" == "newnode" && "$SYNC" == "true" ]]; then if [[ "$mode" == "newnode" && "$SYNC" == "true" ]]; then
(( NUM_NN += 35 )) (( 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 ) & (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 ) &
fi fi
done < $config done < $config

Loading…
Cancel
Save