Hello!
I'm in chapter 10 of the book. Now I'm trying to connect my node to the node with URL mainnet.programmingbitcoin.com.
I managed to handshake the node (I sent a version message and I got back a verack message). Until then, everything is going well. But when I send a getheaders message, I don't receive anything back. What am I doing wrong? Or there is something bad with the node?
This is part of my getHeaders class (implementation in ruby):
def initialize(version: 70015, num_hashes: 1, start_block: nil, end_block: nil)
@version = version
@num_hashes = num_hashes
raise 'a start block is required' if start_block.nil?
@start_block = start_block
@end_block = end_block.nil? ? "\x00" * 32 : end_block
end
def serialize
result = int_to_little_endian(@version, 4)
result << encode_varint(@num_hashes)
result << @start_block.reverse
result << @end_block.reverse
result
end
Hello! I'm in chapter 10 of the book. Now I'm trying to connect my node to the node with URL
mainnet.programmingbitcoin.com
.I managed to handshake the node (I sent a
version
message and I got back averack
message). Until then, everything is going well. But when I send agetheaders
message, I don't receive anything back. What am I doing wrong? Or there is something bad with the node?This is part of my
getHeaders
class (implementation in ruby):