Skip to content

Commit 97a834d

Browse files
committed
Update README
1 parent ad06a61 commit 97a834d

File tree

1 file changed

+42
-12
lines changed

1 file changed

+42
-12
lines changed

README.md

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,20 @@ A minimalist TUI block explorer for Ethereum blockchains
2626
Usage: blocktop [OPTIONS]
2727
2828
Options:
29-
-r, --rpc <RPC> [default: wss://eth.merkle.io]
30-
-d, --db <DB>
31-
--headless
32-
--list-block-hashes
33-
-h, --help Print help
34-
-V, --version Print version
29+
-r, --rpc <RPC> [default: wss://eth.merkle.io]
30+
-d, --db <DB>
31+
--headless
32+
--list-block-hashes
33+
--block <BLOCK>
34+
--transaction <TRANSACTION>
35+
-s, --serve
36+
-m, --metrics
37+
-p, --port <PORT>
38+
-h, --help Print help
39+
-V, --version Print version
3540
```
3641

42+
3743
At the moment, `blocktop` only supports Websockets or Unix domain sockets as transports for RPC communication. `blocktop` makes use of the [free Ethereum RPC service provided by Merkle](https://merkle.io/free-eth-rpc) by default.
3844

3945
### TUI Mode ###
@@ -59,12 +65,11 @@ To invoke solely the indexer without the TUI frontend, specify the `--headless`
5965

6066
```
6167
$ RUST_LOG=info blocktop --headless
62-
2025-01-15T05:13:06.017Z INFO blocktop::client > Websockets client initialised (endpoint: wss://eth.merkle.io/, chain: 1)
63-
2025-01-15T05:13:06.806Z INFO blocktop::db > Wrote block 0x2d21b100f838bb2656bcd0599cbdc30048d6d1a694581c6ec781e8f58961c729 to the database
64-
2025-01-15T05:13:08.077Z INFO blocktop::client > Websockets client initialised (endpoint: wss://eth.merkle.io/, chain: 1)
65-
2025-01-15T05:13:19.203Z INFO blocktop::db > Wrote block 0x5850d0c1ba90da1cfe682ad29a727b841038ead07e198477869550cbb387f053 to the database
66-
2025-01-15T05:13:26.187Z INFO blocktop::db > Wrote block 0x52a43747e20465e7407ccba6915a027457220e06399ab992409b3ace66e40301 to the database
67-
2025-01-15T05:13:39.812Z INFO blocktop::db > Wrote block 0xf31df89a9277295916f714d78a3ccf708826951a7a6e0ac40563b18a51d14f76 to the database
68+
2025-05-28T10:14:05.298Z WARN blocktop > Headless mode without specifying an on-disk database. All data will be lost on exit.
69+
2025-05-28T10:14:06.493Z INFO blocktop::client > Websockets client initialised (endpoint: wss://eth.merkle.io/, chain: 1)
70+
2025-05-28T10:14:07.440Z INFO blocktop::db > Wrote block 0xed8f155905becde73d4eae0b03a3bd6ddce554aa0c4fe2495bc61238e6207885 to the database
71+
2025-05-28T10:14:08.840Z INFO blocktop::client > Websockets client initialised (endpoint: wss://eth.merkle.io/, chain: 1)
72+
2025-05-28T10:14:14.234Z INFO blocktop::db > Wrote block 0xe828b36306c36ed8d5175540e9444861507e27b8570760d1409787fb9ad233c7 to the database
6873
```
6974

7075
As the warning-level log line at the start of the output indicates, headless operation also benefits from specifying an on-disk database to save chain state to:
@@ -73,3 +78,28 @@ As the warning-level log line at the start of the output indicates, headless ope
7378
$ RUST_LOG=info blocktop --headless --db foobar.db
7479
```
7580

81+
#### Metrics ####
82+
83+
To expose metrics for scraping via Prometheus, use the `--metrics` flag:
84+
85+
```
86+
$ RUST_LOG=info blocktop --headless --metrics
87+
```
88+
89+
Then, concurrently:
90+
91+
```
92+
$ curl http://localhost:9898/metrics
93+
# HELP blocks_added The number of blocks added to the index
94+
# TYPE blocks_added gauge
95+
blocks_added 0
96+
# HELP failed_rpc_requests The number of requests made to the RPC node that have received an error response
97+
# TYPE failed_rpc_requests gauge
98+
failed_rpc_requests 0
99+
# HELP rpc_requests The number of requests made to the RPC node
100+
# TYPE rpc_requests gauge
101+
rpc_requests 0
102+
```
103+
104+
Technically, metrics can be enable whilst using the TUI; however, one would imagine that it really only makes sense to collect metrics in order to view the state of the index.
105+

0 commit comments

Comments
 (0)