You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42-12Lines changed: 42 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,14 +26,20 @@ A minimalist TUI block explorer for Ethereum blockchains
26
26
Usage: blocktop [OPTIONS]
27
27
28
28
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
35
40
```
36
41
42
+
37
43
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.
38
44
39
45
### TUI Mode ###
@@ -59,12 +65,11 @@ To invoke solely the indexer without the TUI frontend, specify the `--headless`
2025-05-28T10:14:14.234Z INFO blocktop::db > Wrote block 0xe828b36306c36ed8d5175540e9444861507e27b8570760d1409787fb9ad233c7 to the database
68
73
```
69
74
70
75
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
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.
0 commit comments