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. 2
      client/txgen/main.go
  2. 4
      deploy.sh

@ -170,6 +170,7 @@ func main() {
// Start the client server to listen to leader's message
go clientNode.StartServer()
if *peerDiscovery {
for _, leader := range shardIDLeaderMap {
log.Debug("Client Join Shard", "leader", leader)
go clientNode.JoinShard(leader)
@ -178,6 +179,7 @@ func main() {
clientNode.StopPing <- struct{}{}
clientNode.State = node.NodeJoinedShard
}
}
// Transaction generation process
time.Sleep(10 * time.Second) // wait for nodes to be ready

@ -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