https://github.com/blockscapenetwork/peerdx
Peer Diagnostics Tool for Tendermint blockchains
https://github.com/blockscapenetwork/peerdx
Last synced: about 2 months ago
JSON representation
Peer Diagnostics Tool for Tendermint blockchains
- Host: GitHub
- URL: https://github.com/blockscapenetwork/peerdx
- Owner: BlockscapeNetwork
- License: apache-2.0
- Created: 2020-04-22T11:10:41.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-28T08:36:22.000Z (about 5 years ago)
- Last Synced: 2024-06-20T11:14:18.196Z (11 months ago)
- Language: Go
- Size: 25.4 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Peerdx, a Peer Diagnostics Tool
This tool allows you to run diagnostics for peers of Tendermint nodes by means of analyzing your nodes' address books or directly connecting to the nodes themselves via RPC. In contrast to just retrieving the information via the /net_info endpoint, this program aims to present the data in a more readable way as well as make it possible to compare multiple nodes with each other in terms of peer diversity.
## Requirements
Go 1.13+
## Install
Clone this repo and run `go install` within its root directory.
## How to Run Diagnostics on Address Books
In order to compare address books, put them into one directory and type:
```
$ peerdx addrbook --dir
```The output should look something like this:
```
2020/04/08 18:25:29 Looking for address book json files at /path/to/addrBooks
2020/04/08 18:25:29 Analyzing address books
2020/04/08 18:25:29 A total of 29 different addresses:
2020/04/08 18:25:29 c3469b7fcf414f26bc1e86a9abe019053587422d: addrbook1.json, addrbook2.json
2020/04/08 18:25:29 304ddd76ea750c7d2d72ac40a2525c37b10ad124: addrbook1.json
...
```If you already know some of the nodes and want to give them a name, you can do so by providing a config file:
```
$ peerdx addrbook --dir --config cfg.json
```
The config file should look like this:
```
{
"known_ids": [
{
"name": "Awesome Node",
"id": "c3469b7fcf414f26bc1e86a9abe019053587422d"
}
]
}
```
And the output would look like this:
```
2020/04/08 18:25:29 Looking for address book json files at /path/to/addrBooks
2020/04/08 18:25:29 Analyzing address books
2020/04/08 18:25:29 A total of 29 different addresses:
2020/04/08 18:25:29 Awesome Node : addrbook1.json, addrbook2.json
2020/04/08 18:25:29 304ddd76ea750c7d2d72ac40a2525c37b10ad124: addrbook1.json
...
```## How to Run Diagnostics via RPC
### Comparing peers of nodes
If you want to compare peers of nodes without collecting all of their address books, you can check via RPC. You have to make the rpc endpoint accessible on the nodes you want to compare.
Then all you have to do is run:```
$ peerdx rpc compare <...>
```You can pass in a config file with already known addresses as shown in the address book description.
The output will look exactly the same as when comparing address books.### Show Peer Info of a Single Node
Additionally, you can take a more detailed look at the node's peers. Just type:
```
$ peerdx rpc list
```The result will look something like this:
```
OUT sebytza05 [d32432f9...] : IP 164.64.104.66
send active; receive active
tendermint version 0.33.3OUT prim-sentry [8aea2394...] : IP 157.85.239.128
send active; receive active
tendermint version 0.33.3OUT Nodeasy [3f931256...] : IP 172.243.73.214
send active; receive active
tendermint version 0.33.3OUT gunray [49d7656d...] : IP 65.222.131.87
send active; receive active
tendermint version 0.33.3
```