do not contact beacon if not in peer discovery mode

add a -P option to disable peer discovery in deploy.sh

Signed-off-by: Leo Chen <leo@harmony.one>
pull/153/head
Leo Chen 6 years ago
parent 4102079236
commit c111fd19cf
  1. 16
      client/txgen/main.go
  2. 4
      deploy.sh

@ -170,13 +170,15 @@ func main() {
// Start the client server to listen to leader's message
go clientNode.StartServer()
for _, leader := range shardIDLeaderMap {
log.Debug("Client Join Shard", "leader", leader)
go clientNode.JoinShard(leader)
// wait for 3 seconds for client to send ping message to leader
time.Sleep(3 * time.Second)
clientNode.StopPing <- struct{}{}
clientNode.State = node.NodeJoinedShard
if *peerDiscovery {
for _, leader := range shardIDLeaderMap {
log.Debug("Client Join Shard", "leader", leader)
go clientNode.JoinShard(leader)
// wait for 3 seconds for client to send ping message to leader
time.Sleep(3 * time.Second)
clientNode.StopPing <- struct{}{}
clientNode.State = node.NodeJoinedShard
}
}
// Transaction generation process

@ -31,6 +31,7 @@ USAGE: $ME [OPTIONS] config_file_name
-h print this help message
-p use peer discovery (default: $PEER)
-P do not use peer discovery
-d enable db support (default: $DB)
-t toggle txgen (default: $TXGEN)
-D duration txgen run duration (default: $DURATION)
@ -57,10 +58,11 @@ MIN=5
SHARDS=2
KILLPORT=9004
while getopts "hpdtD:m:s:k:" option; do
while getopts "hpdtD:m:s:k:P" option; do
case $option in
h) usage ;;
p) PEER='-peer_discovery' ;;
P) PEER= ;;
d) DB='-db_supported' ;;
t) TXGEN=$OPTARG ;;
D) DURATION=$OPTARG ;;

Loading…
Cancel
Save