bsc/cmd/jsutils
2024-08-05 16:48:33 +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 BEP-341: Validators can produce consecutive blocks (#2482) 2024-07-23 13:55:45 +08:00
getchainstatus.js utils: add GetTopAddr to analyse large traffic (#2629) 2024-08-05 16:48:33 +08:00
getslashcount.js cmd/jsutill: add log about validator name (#2583) 2024-07-16 17:10: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 consensus/parlia: add GetJustifiedNumber and GetFinalizedNumber (#2591) 2024-07-19 10:20:53 +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 justifiedBlocksRatio = 0.98
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}