Skip to content

sydhds/bitcoin_handshake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bitcoin handshake

A toy project that can connect to a Bitcoin node, send a ping and check for the received pong message.

No bitcoin crate have been used, the main dependencies are:

  • tokio - async tcp networking
  • nom - binary parsing (encode & decode Bitcoin message)
  • bitflags - C bit flags handling

Architecture

  • bitcoin_node: bin
    • can connect to a Bitcoin node + ping/pong exchange
  • bth_network: lib
    • Implement tokio_codec to send/receive message
    • use bth_message
  • bth_message: lib
    • Bitcoin message (and other Bitcoin object) serialization & deserialization

Protocol

Handshake description:

Run

  • RUST_LOG=debug cargo run -- --ip 127.0.0.1 --port 8333
  • RUST_LOG=debug cargo run -- --ip 188.215.62.122 -p 8333

Find bitcoin node ip address:

Unit tests

  • cargo test

About

Bitcoin protocol implementation in Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages