We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
my code is it I want parse the text inside messagge version in response from another node:
How can I parse the binary result inside ver_ret and return a structured msg_version object?
ver_ret
msg_version
#!/usr/bin/env python3 import os, sys, socket import socket, time, bitcoin from bitcoin.messages import msg_version from bitcoin.net import CAddress serverhost = sys.argv[1] server_ip = socket.gethostbyname_ex(serverhost)[2][0] #remote node ip clienthost = os.uname()[1] client_ip = socket.gethostbyname_ex(clienthost)[2][1] #myip PORT = 8333 bitcoin.SelectParams('mainnet') def version_pkt(client_ip, server_ip): msg = msg_version() msg.nVersion = 70002 msg.addrTo.ip = server_ip msg.addrTo.port = PORT msg.addrFrom.ip = client_ip msg.addrFrom.port = PORT return msg s = socket.socket() s.connect( (server_ip, PORT) ) s.send( version_pkt(client_ip, server_ip).to_bytes() ) ver_ret = s.recv(1924) print(ver_ret) #???? s.close()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
my code is it I want parse the text inside messagge version in response from another node:
How can I parse the binary result inside
ver_ret
and return a structuredmsg_version
object?The text was updated successfully, but these errors were encountered: