bsc/cmd/jsutils
2024-07-16 17:10:16 +08:00
..
check_blobtx.js utils: add check_blobtx.js (#2463) 2024-05-15 18:17:57 +08:00
faucet_request.js jsutils: faucet successful requests within blocks (#2470) 2024-05-23 15:08:36 +08:00
get_perf.js cmd/jsutils: add a tool to get performance between a range of blocks (#2513) 2024-06-28 13:48:17 +08:00
getslashcount.js cmd/jsutill: add log about validator name (#2583) 2024-07-16 17:10:16 +08:00
gettxcount.js cmd/jsutil: dump MinGasPrice for validator (#2314) 2024-03-21 11:35:16 +08:00
getvalidatorversion.js cmd/jsutil: dump MinGasPrice for validator (#2314) 2024-03-21 11:35:16 +08:00
package.json cmd/jsutils: add 2 tools get validator version and block txs number (#2036) 2023-12-08 13:44:16 +08:00
README.md cmd/jsutils: add a tool to get slash count (#2569) 2024-07-08 22:37:05 +08:00

Requirement

  • nodejs >= v16.20.2
  • npm >= v8.19.4

Prepare

Recommend use nvm to manage node version.

Install node.js dependency:

    npm install

Run

1.Get Validator's Information: Version, MinGasPrice

mainnet validators version

    npm run startMainnet

testnet validators version

    npm run startTestnet

2.Get Transaction Count

node gettxcount.js --rpc ${url} --startNum ${start} --endNum ${end} --miner ${miner} (optional)

3. Get Performance

node get_perf.js --rpc ${url} --startNum ${start} --endNum ${end}

output as following

Get the performance between [ 19470 , 19670 )
txCountPerBlock = 3142.81 txCountTotal = 628562 BlockCount = 200 avgBlockTime = 3.005 inturnBlocksRatio = 0.975
txCountPerSecond = 1045.8602329450914 avgGasUsedPerBlock = 250.02062627 avgGasUsedPerSecond =  83.20153952412646

4. Get validators slash count

use the latest block 
node getslashcount.js --Rpc ${ArchiveRpc} 
use a block number
node getslashcount.js --Rpc ${ArchiveRpc} --Num ${blockNum}