aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zoo/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/zoo/main.go')
-rw-r--r--cmd/zoo/main.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/cmd/zoo/main.go b/cmd/zoo/main.go
index 195d5737c..cd33d4cee 100644
--- a/cmd/zoo/main.go
+++ b/cmd/zoo/main.go
@@ -4,6 +4,7 @@ import (
"flag"
"github.com/dexon-foundation/dexon/cmd/zoo/monkey"
+ "github.com/dexon-foundation/dexon/cmd/zoo/utils"
)
var key = flag.String("key", "", "private key path")
@@ -14,10 +15,21 @@ var batch = flag.Bool("batch", false, "monkeys will send transaction in batch")
var sleep = flag.Int("sleep", 500, "time in millisecond that monkeys sleep between each transaction")
var feeder = flag.Bool("feeder", false, "make this monkey a feeder")
var timeout = flag.Int("timeout", 0, "execution time limit after start")
+var shutdown = flag.String("shutdown", "", "shutdown the previously opened zoo")
func main() {
flag.Parse()
+ if *shutdown != "" {
+ utils.Shutdown(&utils.ShutdownConfig{
+ Key: *key,
+ Endpoint: *endpoint,
+ File: *shutdown,
+ Batch: *batch,
+ })
+ return
+ }
+
monkey.Init(&monkey.MonkeyConfig{
Key: *key,
Endpoint: *endpoint,