- Processor 2x E5-2660 @ 2.2GHz / 3GHz Turbo 16 Cores / 32 thread
- Ram 96 GB DDR3
- Disk 960 GB SSD
- Bandwidth 1Gbit Port: 200TB Transfer
- Operating System Ubuntu 18.04 (Bionic)
- A network of 5 nodes was run.
- All nodes used the same IP, but different ports
- All nodes had mining turned on; each was a block producer.
- 5000 accounts were loaded in the genesis block with 1000 FTM each
- 5000 native coin txs were submitted to the network as fast as possible
- Each tx moved 1 FTM between two different randomly chosen accounts
- The number of accounts was chosen to be equal to the number of total txs so that there would be a low chance of a tx getting rejected due to another transaction from the same account still pending.
-
Tests are taken starting from 1000 tps to 3000 tps for 10 seconds. Time between the start of the test and the last block to process txs from the test was measured.
-
Total Txs = Spam rate * duration = = Avg TPS
1000 = 100 * 10 = 11 2000 = 200 * 10 = 10 3000 = (100 * 10) * 3 terminals = 9
-
Estimated average tps is 10 TPS
Instructions to recreate this test
-
https://github.com/Fantom-foundation/lachesis_launch/blob/master/docs/launch-private-network.md. The network setup is built by referencing this.
-
Install required tools and dependencies.
-
Start a local network of 5 validators.
-
Go into the go-opera installed folder.
-
cd go-opera/demo.
-
Before starting the network, configure the network settings first as in steps no.3 to 5.
-
To start the network.
N=5 ./start.sh
-
To stop the network.
./stop.sh
-
To clean the network.
./clean.sh
-
You can attach the RPC endpoint of the first node with the following command.
go run ../cmd/opera attach http://localhost:4000
-
Some commands useful for getting information from the running node.
- admin.nodeInfo
- net.peerCount
- ftm.accounts
- ftm.getBlock(1)
- ftm.blockNumber
- ftm.getBalance(eth.accounts[0])
- ftm.sendTransaction({from:eth.accounts[0], to:0x50F6D9E5771361Ec8b95D6cfb8aC186342B70120, value:1000})
-
-
Scripts Repo used for running transactions to the network.
- https://gitlab.com/shardeum/smart-contract-platform-comparison/fantom
- cd spam-client && npm install
- generate_accounts.js is for creating multiple accounts.
- spam.js is for running transactions to the network and checking the average tps of each spam.
-
Generate multiple accounts. Add these addresses in the genesis file to reserve some balance.
- npx hardhat generate --accounts [number]
- Copy the public addresses from the publicAddresses.json and add them as in step no.6 to get some funds.
- The spam-client will use their private keys from privateAddresses.json.
-
Configure the Genesis block settings. Edit go-opera/integration/makegenesis/genesis.go file. Add the following code in the FakeGenesisStore function.
var owner common.Address if num != 0 { owner = validators[0].Address } accounts := []string{ "0x86F35CD204dfFAbAB4FD25FE139F99Db2BD5E05c", ...Public Addresses "0x57C7462b105dE5b62c5Eea80E047Bd5DbDae80BA"} for _, acc := range accounts { genStore.SetEvmAccount(common.HexToAddress(acc), genesis.Account{ Code: []byte{}, Balance: balance, Nonce: 0, }) }
-
Start the local network as described in step no.2(4).
-
Spam the transactions. After each spam, follow step no. 9 to check the average tps.
npx hardhat spam --tps [number] --duration [number]
- npx hardnat spam --tps 100 --duration 5
- After the spam, take latest block number before spamming and totalTxs submitted to check average TPS of the spam.
-
Check the average tps of each spam.
- Get the latestBlockBeforeSpamming from the spam terminal.
- Get the total submitted Txs 10. e.g. if spamming with --tps 100 --duration 5 will be 500 txs
- npx hardhat check_tps --startblock [block_number] --txs [total-txs] --output [name.json]
- e.g. npx hardhat check_tps --startblock 238 -- txs 500 โ output s238t500.json