Skip to content

Instantly share code, notes, and snippets.

View rustaceanrob's full-sized avatar
💥

Robert Netzke rustaceanrob

💥
View GitHub Profile
use std::{io::BufReader, net::{IpAddr, Ipv4Addr, SocketAddr, ToSocketAddrs}, time::{SystemTime, UNIX_EPOCH}};
use bip324::{Handshake, Role};
use bitcoin::{consensus::{deserialize, serialize, Encodable}, p2p::{message::{NetworkMessage, RawNetworkMessage}, message_network::VersionMessage, Address, ServiceFlags}, Network};
use bytes::BytesMut;
use tokio::{io::{AsyncReadExt, AsyncWriteExt}, net::TcpStream};
pub const PROTOCOL_VERSION: u32 = 70015;
pub fn new_version_message() -> Vec<u8> {