diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-05-04 22:18:40 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-05-05 15:16:56 +0800 |
commit | 1b001e352b89f367c5d8ed87d811f3fcf3b2e98a (patch) | |
tree | 03b59684886c6e8d0aa9f31b45923db3c2f62d54 /cmd/zoo/main.go | |
parent | c9ed25eee48be99752f71bfcaf0461768b19b2f0 (diff) | |
download | dexon-1b001e352b89f367c5d8ed87d811f3fcf3b2e98a.tar dexon-1b001e352b89f367c5d8ed87d811f3fcf3b2e98a.tar.gz dexon-1b001e352b89f367c5d8ed87d811f3fcf3b2e98a.tar.bz2 dexon-1b001e352b89f367c5d8ed87d811f3fcf3b2e98a.tar.lz dexon-1b001e352b89f367c5d8ed87d811f3fcf3b2e98a.tar.xz dexon-1b001e352b89f367c5d8ed87d811f3fcf3b2e98a.tar.zst dexon-1b001e352b89f367c5d8ed87d811f3fcf3b2e98a.zip |
zoo: refacter and save keys (#403)
Diffstat (limited to 'cmd/zoo/main.go')
-rw-r--r-- | cmd/zoo/main.go | 12 |
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, |