The handshake process is initiated by connecting to a target node, sending a version message, and expecting a version message in return. Upon successful version exchange, a verack message is sent to the node, and a verack message is expected in return to complete the handshake. wiki link here
- Clone this repository:
git clone https://github.com/BowTiedDeployer/bitcoin-node-handshake.git
cd bitcoin-node-handshake
- Build the project:
cargo build --release
- Run the CLI with desired commands, for example (optional argument
-t
for testnet):
- To list available DNS seeds:
cargo run -- -dns [-t]
- To fetch IPs from specified DNS seeds (optional argument
-t
for testnet):
cargo run -- -ips [-t] <number> <DNS> <DNS> ... <DNS>
- To perform a handshake with specified IPs and the optional arguments:
-t
for testnet-f
to log the output inoutput.log
instead of the terminal
cargo run -- -handshake [-t] [-f] <IP> <IP> ... <IP>
After running the handshake command, check the console (or file) output to verify that the version and verack messages were successfully exchanged with the target node(s).