aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-11-26 10:00:31 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-12 12:19:09 +0800
commitf79bf330b4b649ea74d54faf749214c14f32af9c (patch)
tree1cf494fda8e45813c6e4062a587dfd3ecf1d5a54 /cmd
parentb4f183ba63e3ab5dccc6371faaa57c77b61e967b (diff)
downloaddexon-f79bf330b4b649ea74d54faf749214c14f32af9c.tar.gz
dexon-f79bf330b4b649ea74d54faf749214c14f32af9c.tar.zst
dexon-f79bf330b4b649ea74d54faf749214c14f32af9c.zip
core: various changes on tps tuning (#46)
Diffstat (limited to 'cmd')
-rw-r--r--cmd/monkey/monkey.go5
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)
}