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-04 22:18:40 +0800 |
commit | d41cb421d755b8f0bca87b7476f26aa4b879b9d9 (patch) | |
tree | 7da174da1766185d858f4ed1129d6ab768ce7fac /cmd/zoo/main.go | |
parent | d70173e0f1bbf8705cce9df2acc93f7d18f71ed3 (diff) | |
download | dexon-d41cb421d755b8f0bca87b7476f26aa4b879b9d9.tar dexon-d41cb421d755b8f0bca87b7476f26aa4b879b9d9.tar.gz dexon-d41cb421d755b8f0bca87b7476f26aa4b879b9d9.tar.bz2 dexon-d41cb421d755b8f0bca87b7476f26aa4b879b9d9.tar.lz dexon-d41cb421d755b8f0bca87b7476f26aa4b879b9d9.tar.xz dexon-d41cb421d755b8f0bca87b7476f26aa4b879b9d9.tar.zst dexon-d41cb421d755b8f0bca87b7476f26aa4b879b9d9.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, |