Open bolatovumar opened 4 years ago
@kevin11h yeah, it's the same issue as #151. Blockstream block explorer is good and worked for me for these exercises.
is the consensus here to use blockstream.info/testnet/api/ like so?
#node = SimpleNode('testnet.programmingbitcoin.com', testnet=True, logging=False)
node = SimpleNode('https://blockstream.info/testnet/api/', testnet=True, logging=False)
is the consensus here to use blockstream.info/testnet/api/ like so?
#node = SimpleNode('testnet.programmingbitcoin.com', testnet=True, logging=False) node = SimpleNode('https://blockstream.info/testnet/api/', testnet=True, logging=False)
Yeah, that's what I did back when I was going through the book.
when I change to blockstream I get a gaierror. Do I need a more specific cmd?
---------------------------------------------------------------------------
gaierror Traceback (most recent call last)
<ipython-input-16-faf9611714a8> in <module>
43
44
---> 45 node = SimpleNode('https://blockstream.info/testnet/api', testnet=True, logging=False)
46
47 # bf = Bloomfilter(size=30, function_count=5, tweak=90405)
~/Documents/programmingbitcoin/programmingbitcoin/code-ch12/network.py in __init__(self, host, port, testnet, logging)
361 # connect to socket
362 self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
--> 363 self.socket.connect((host, port))
364 # create a stream that we can use with the rest of the library
365 self.stream = self.socket.makefile('rb', None)
gaierror: [Errno 8] nodename nor servname provided, or not known
It's been a while since I've gone through the book and I don't really know what gaierror
means. I found this: https://stackoverflow.com/questions/15246088/what-does-this-socket-gaierror-mean
I would also search for the nodename nor servname provided, or not known
error message to see what can be found.
You can find currently running full nodes here: https://bitnodes.io/nodes/
Pick any with ipv4, and it should work.
http://mainnet.programmingbitcoin.com is a 404 http://testnet.programmingbitcoin.com is a 503
As a result a bunch of code examples can't be followed.
For the time being I'm using Blockstream's block explorer API like so:
And a slightly modified
fetch
method (notice the/
beforehex
as opposed to.hex
as it was initially: