3 min read

Announcing Statoshi: Realtime Bitcoin Node Statistics

Bringing DevOps dashboards to Bitcoin node operators.
Announcing Statoshi: Realtime Bitcoin Node Statistics

I’ve been on a quest for the past several months since I first asked the question: how many Bitcoin nodes is enough? In order to better understand what is actually occurring on the Bitcoin network, I came to the conclusion that we need more insight into the internal operations of the Bitcoin nodes. As a result, it is my pleasure to announce the Statoshi project, an open source fork of Bitcoin Core that logs metrics to StatsD. If you run a Bitcoin full node, you may be interested in switching it out with the Statoshi fork so that you can monitor how it is interacting with its peers.

Here are some of the metrics that you’ll see logged:

/stats/message/received/<messageType> /stats/message/sent/<messageType>

“addr” messages sent and received per second
“inv” messages sent and received per second

/stats/message/received/inv_<invType>

block announcement “inv” messages received per second

/stats/message/sent/reject_<messageType>_<rejectReason>

Rejected transactions by reason per second. We can see that duplicate transaction attempts are the most common rejections.

Timers are the milliseconds of wall time that it takes to execute a given function. Graphite will give you quite a few different breakdowns of timer metrics.

/stats/timers/<FunctionName>_<TimeUnit> — Time Units are “ms” (milliseconds) and “us” (microseconds)

Milliseconds to execute the “CheckInputs” function, separated into lower, median, and upper bounds.

/stats/peers/connect
/stats/peers/disconnect

Peer connections and disconnections per second.

/stats/gauges/peers/totalConnections

Total peer connections. You can see when the node was restarted. Note: I modified my node to support more connections than the default 125.

/stats/bandwidth/bytesReceived
/stats/bandwidth/bytesSent

Bytes received per second and bytes sent per second. We can see the downstream bandwidth usage is fairly constant while upstream is spiky.

/stats/gauges/bandwidth/totalBytesReceived
/stats/gauges/bandwidth/totalBytesSent

Total bytes sent and bytes received since node was started. You can see the loss of Internet connection between 15:00 and 16:00

If you want to install and run a Statoshi node yourself, you can find the instructions here!