2023-12-08 13:44:16 +08:00
|
|
|
## Requirement
|
|
|
|
|
2024-01-19 16:44:56 +08:00
|
|
|
- nodejs >= v16.20.2
|
|
|
|
- npm >= v8.19.4
|
2023-12-08 13:44:16 +08:00
|
|
|
|
|
|
|
## Prepare
|
|
|
|
Recommend use [nvm](https://github.com/nvm-sh/nvm) to manage node version.
|
|
|
|
|
|
|
|
Install node.js dependency:
|
|
|
|
```shell script
|
|
|
|
npm install
|
|
|
|
```
|
|
|
|
## Run
|
2024-03-21 11:35:16 +08:00
|
|
|
### 1.Get Validator's Information: Version, MinGasPrice
|
2023-12-08 13:44:16 +08:00
|
|
|
mainnet validators version
|
|
|
|
```bash
|
|
|
|
npm run startMainnet
|
|
|
|
```
|
|
|
|
testnet validators version
|
|
|
|
```bash
|
|
|
|
npm run startTestnet
|
|
|
|
```
|
2024-03-21 11:35:16 +08:00
|
|
|
|
|
|
|
### 2.Get Transaction Count
|
2023-12-08 13:44:16 +08:00
|
|
|
```bash
|
2024-01-19 16:44:56 +08:00
|
|
|
node gettxcount.js --rpc ${url} --startNum ${start} --endNum ${end} --miner ${miner} (optional)
|
2024-06-28 13:48:17 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
### 3. Get Performance
|
|
|
|
```bash
|
|
|
|
node get_perf.js --rpc ${url} --startNum ${start} --endNum ${end}
|
|
|
|
```
|
|
|
|
output as following
|
|
|
|
```bash
|
|
|
|
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
|
2024-07-08 22:37:05 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
### 4. Get validators slash count
|
|
|
|
```bash
|
|
|
|
use the latest block
|
|
|
|
node getslashcount.js --Rpc ${ArchiveRpc}
|
|
|
|
use a block number
|
|
|
|
node getslashcount.js --Rpc ${ArchiveRpc} --Num ${blockNum}
|
|
|
|
```
|
|
|
|
|