0xB10C / peer-observer

Tool to monitor for P2P anomalies and attacks using Bitcoin Core honeynodes
https://public.peer.observer
MIT License
12 stars 2 forks source link

Use clap for command line arguments #30

Closed 0xB10C closed 3 months ago

0xB10C commented 3 months ago

Fixes #28.

The clap-based command line arguments not provide a --help, --version, and usage hints. It's also explicit what's needed and what's used as default.

For example, the extractor help now shows:

$ extractor --help
The peer-observer extractor Hooks into a Bitcoin Core binary with tracepoints and extracts events from it into a nanomsg PUB-SUB queue

Usage: extractor [OPTIONS] --bitcoind-path <BITCOIND_PATH>

Options:
  -a, --address <ADDRESS>              TCP socket the nanomsg publisher binds on [default: tcp://127.0.0.1:8883]
  -b, --bitcoind-path <BITCOIND_PATH>  Path to the Bitcoin Core (bitcoind) binary that should be hooked into
      --no-p2pmsg-tracepoints          Controls if the p2p message tracepoints should be hooked into
      --no-connection-tracepoints      Controls if the connection tracepoints should be hooked into
      --no-mempool-tracepoints         Controls if the mempool tracepoints should be hooked into
      --no-validation-tracepoints      Controls if the validation tracepoints should be hooked into
      --addrman-tracepoints            Controls if the addrman tracepoints should be hooked into. These may not have been PRed to Bitcoin Core yet
  -h, --help                           Print help
  -V, --version                        Print version
i-am-yuvi commented 3 months ago

Tested ACK This will help new devs get started with peer-observer.

0xB10C commented 3 months ago

rebased on #29

0xB10C commented 3 months ago

rebased on #34