From a89d87711058af88d92e6df998aecc2bdbd89ce7 Mon Sep 17 00:00:00 2001 From: Rongjian Lan Date: Sat, 15 Dec 2018 02:46:41 -0800 Subject: [PATCH] Lower the tx load on txgen --- client/txgen/main.go | 2 +- client/txgen/txgen/account_txs_generator.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/txgen/main.go b/client/txgen/main.go index 1e0d58d00..5c98e36de 100644 --- a/client/txgen/main.go +++ b/client/txgen/main.go @@ -218,7 +218,7 @@ func main() { lock.Unlock() subsetCounter++ - time.Sleep(10000 * time.Millisecond) + time.Sleep(60000 * time.Millisecond) } } else { for { diff --git a/client/txgen/txgen/account_txs_generator.go b/client/txgen/txgen/account_txs_generator.go index 4521b8943..d9af7d655 100644 --- a/client/txgen/txgen/account_txs_generator.go +++ b/client/txgen/txgen/account_txs_generator.go @@ -21,15 +21,15 @@ type Settings struct { func GenerateSimulatedTransactionsAccount(shardID int, dataNodes []*node.Node, setting Settings) (types.Transactions, types.Transactions) { _ = setting // TODO: take use of settings node := dataNodes[shardID] - txs := make([]*types.Transaction, 1000) + txs := make([]*types.Transaction, 100) for i := 0; i < 100; i++ { baseNonce := node.Worker.GetCurrentState().GetNonce(crypto.PubkeyToAddress(node.TestBankKeys[i].PublicKey)) - for j := 0; j < 10; j++ { + for j := 0; j < 1; j++ { randomUserKey, _ := crypto.GenerateKey() randomUserAddress := crypto.PubkeyToAddress(randomUserKey.PublicKey) tx, _ := types.SignTx(types.NewTransaction(baseNonce+uint64(j), randomUserAddress, uint32(shardID), big.NewInt(1000), params.TxGas, nil, nil), types.HomesteadSigner{}, node.TestBankKeys[i]) - txs[i*10+j] = tx + txs[i*1+j] = tx } } return txs, nil