diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-11-26 10:00:31 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:54 +0800 |
commit | 622ae7fe3ef067d4f395937a9bb0f783a7c1e6c7 (patch) | |
tree | 995b1db1cb20fc0fecb240338d089f0c49d1d986 /cmd | |
parent | c11db35c2d3f5ca5f4b5749294e154f10ef6b1c1 (diff) | |
download | dexon-622ae7fe3ef067d4f395937a9bb0f783a7c1e6c7.tar.gz dexon-622ae7fe3ef067d4f395937a9bb0f783a7c1e6c7.tar.zst dexon-622ae7fe3ef067d4f395937a9bb0f783a7c1e6c7.zip |
core: various changes on tps tuning (#46)
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/monkey/monkey.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cmd/monkey/monkey.go b/cmd/monkey/monkey.go index f55d195a6..b312ea473 100644 --- a/cmd/monkey/monkey.go +++ b/cmd/monkey/monkey.go @@ -128,7 +128,6 @@ func (m *Monkey) prepareTx(ctx *transferContext) *types.Transaction { func (m *Monkey) transfer(ctx *transferContext) { tx := m.prepareTx(ctx) - fmt.Println("Sending TX", "fullhash", tx.Hash().String()) err := m.client.SendTransaction(context.Background(), tx) if err != nil { panic(err) @@ -139,7 +138,6 @@ func (m *Monkey) batchTransfer(ctxs []*transferContext) { txs := make([]*types.Transaction, len(ctxs)) for i, ctx := range ctxs { txs[i] = m.prepareTx(ctx) - fmt.Println("Sending TX", "fullhash", txs[i].Hash().String()) } err := m.client.SendTransactions(context.Background(), txs) @@ -236,7 +234,6 @@ func (m *Monkey) Crazy() { fmt.Println("Performing random transfers ...") nonce := uint64(0) for { - fmt.Println("nonce", nonce) ctxs := make([]*transferContext, len(m.keys)) for i, key := range m.keys { to := crypto.PubkeyToAddress(m.keys[rand.Int()%len(m.keys)].PublicKey) @@ -256,6 +253,8 @@ func (m *Monkey) Crazy() { if *batch { m.batchTransfer(ctxs) } + fmt.Printf("Sent %d transactions, nonce = %d\n", len(m.keys), nonce) + nonce += 1 time.Sleep(time.Duration(*sleep) * time.Millisecond) } |