Skip to content
daryl edited this page May 24, 2023 · 9 revisions

Welcome to the ckbstats wiki!

How to deploy

Minimum requirements

Components Version Description
Node ≥ v16.19.0 NodeJs programming language
CKB ≥ v0.101.0 CKB Nodes

Run ckbstats

Run CKB node

First we need a ckb node, quick start reference.

Clone and install dependencies

In the second step we need to clone the code and install the dependencies

$ git clone https://github.com/Daryl-L/ckbstats.git
$ cd ckbstats
$ yarn

server

Modify or create the .env file in packages/server

$ vim packages/server/.env

Save the following to an .env file

SERVER_PORT=3002
CKB_NETWORK=AGGRON
CKB_INDEXER_URL=https://mainnet.ckb.dev/index
CKB_RPC_URL=https://mainnet.ckb.dev/rpc

Start Service

$ yarn server

agent

It is not necessary if you only want to launch the website.

Modify or create the .env file in file in packages/agent

$ vim packages/agent/.env

Save the following to an .env file

SERVER_PORT=3002
CKB_NETWORK=AGGRON
CKB_INDEXER_URL=http://10.10.10.149:32365
CKB_RPC_URL=http://10.10.10.158:31123
CKBSTATS_URL=http://localhost:3002/report
CKBSTATS_NAME=test1

Start Service

$ yarn agent

ui

Finally, we should start ui.

Modify or create the .env file in packages/ui

$ vim packages/ui/.env

Save the following to an .env file

REACT_APP_SERVER_URL=your server api url
PORT=3001

Start Service

$ yarn ui

Datasource

chart

BEST BLOCK: the latest block number from rpc get_block_by_number.

UNCLES: the uncles from rpc get_block_by_number.

LAST BLOCK: the current timestamp sub the block timestamp from rpc get_block_by_number.

AVG BLOCK TIME: the average block times in one epoch.

AVG NETWORK HASHRATE: difficulty from rpc get_blockchain_info to mod the average block time.

DIFFICULTY: difficulty from rpc get_blockchain_info.

BLOCK TIME: a set of time for past 50 blocks.

UNCLE COUNT: a set of uncles for past 50 blocks.

BLOCK PROPAGATION: latency from rpc ping_peers.

TRANSACTIONS: transactions from rpc get_block_by_number.

GAS SPENDING: txsFee from rpc get_block_economic_state.

DIFFICULTIS: a set of difficulties for past 50 epoches.

node list

name: miner defined

version: version from get_local_node_info.

node latency: latency from rpc ping_peers.

peers: peers count from get_peers.

block_number: the latest block number from rpc get_block_by_number.

pending_transactions: pending txes from get_raw_tx_pool.

total difficulty: difficulty from rpc get_block_chain_info.

uncles: the uncles from rpc get_block_by_number.

last_block_time: the current timestamp sub the block timestamp from rpc get_block_by_number.