jimmysong / programmingbitcoin

Repository for the book
Other
1.73k stars 654 forks source link

testnet.programmingbitcoin.com is down #151

Open steelsparrow opened 5 years ago

steelsparrow commented 5 years ago

Like mainnet, the testnet block explorer appears to be down. Would it be possible for you to note the explorer you are running so users can bring up private instances to continue working through the exercises in the book?

chanhosuh commented 5 years ago

I suspect he's just RPC'ing to his own full node. It might be nice for the next edition for Jimmy to show readers how to setup a full node (pretty easy now using Docker) and RPC to it.

MichelKansou commented 5 years ago

@steelsparrow I used blockstream API and it works fine

        if testnet:
            return 'https://blockstream.info/testnet/api/'
        else:
            return 'https://blockstream.info/api/'
MichelKansou commented 5 years ago

@chanhosuh I'm currently in chapter 10 where you need to make a network handshake with testnet.programmingbitcoin.com but I guess the server is still down do you think I need a local full node to test this ?

chanhosuh commented 5 years ago

@MichelKansou you can find someone's node to connect to, but in the end, you'll just be spamming them (especially if you aren't doing the handshake correctly!), so it's better to just run your own node. I think it's probably also more useful as a developer to run your own node anyway.

It's not difficult to run a local node using Docker, exposing ports 8333 / 18333. Then connect a socket to localhost:8333 (or 18333) by initializing SimpleNode appropriately.

You can use this docker setup: https://github.com/chanhosuh/docker-bitcoin

MichelKansou commented 5 years ago

@chanhosuh thank you I already have a full node running so I will use it 😁

MichelKansou commented 4 years ago

@chanhosuh yesterday I was trying to use my remote full node but I'm getting a RuntimeError Connection reset! which mean my stream is empty or my full node can't be reached do I need to provide rpcuser & rpcpassword ?

MichelKansou commented 4 years ago

@chanhosuh I just found out I needed to configure my router to enable 8333 Port Forwarding and also add upnp=1 in my bitcoin.conf 😅 https://bitcoin.org/en/full-node#port-forwarding

marcdk commented 4 years ago

Hi guys, I noticed that the testnet param is missing - adding that solved the problem for me

https://github.com/jimmysong/programmingbitcoin/pull/193

joelklabo commented 3 years ago

202

lucidprojects commented 3 years ago

I've been trying to get a alternative testnet going for the last week. finally got a testnet node running in docker. How do I access it and substitute it in get_urls?

like this http://127.0.0.1:8332 ?

Is not accessible in a browser but don't know if it should be

this is what docker container inspect says my exposed ports are

"ExposedPorts": {
                "18332/tcp": {},
                "18333/tcp": {},
                "18443/tcp": {},
                "18444/tcp": {},
                "8332/tcp": {},
                "8333/tcp": {}
            },

any help appreciated

marcdk commented 3 years ago

Hi @lucidprojects

Port 8333 is used by nodes to communicate according to the P2P protocol and port 8332 is typically configured for JSON-RPC. The node doesn't expose a web interface (via these two, or any other port).

IIRC, at the least the one exercise was to communicate according to the P2P protocol

lucidprojects commented 3 years ago

Thanks @marcdk

I'm clear on the port to use.

I'm more asking how to use it. specifically for the last exercise Chapter12 exercise 6. It connects with

node = SimpleNode('testnet.programmingbitcoin.com', testnet=True, logging=False)

which doesn't work

changing to

node = SimpleNode('https://blockstream.info/testnet/api', testnet=True, logging=False)

gives me the below get address error which is why I'm trying to connect to my own testnet node

---------------------------------------------------------------------------
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/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

I'm also getting this from my docker so I don't think the port is being exposed properly

error: Could not connect to the server 127.0.0.1:8332
Make sure the bitcoind server is running and that you are connecting to the correct RPC port.

appreciate any help

marcdk commented 3 years ago

Just a couple of things from my understanding that can hopefully help:

Hope this helps

GKenu commented 2 years ago

Reference in ne

Would you still have this code? I've been trying everything I found to fix this but couldn't.

The link you shared is not working anymore. Tkws

marcdk commented 2 years ago

Hi @GKenu, I've just had a look, but I don't have the code anymore. Sorry about that!

GKenu commented 2 years ago

Hi Marc! I just managed to do it. I sent an email to Jimmy and he got his server back up running - I managed to finish all exercises.

Thanks either way!

On Tue, May 10, 2022 at 5:46 AM Marc @.***> wrote:

Hi @GKenu https://github.com/GKenu, I've just had a look, but I don't have the code anymore. Sorry about that!

— Reply to this email directly, view it on GitHub https://github.com/jimmysong/programmingbitcoin/issues/151#issuecomment-1122108308, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATTYSDWB5X3TWQEHI3R4S6LVJIO6RANCNFSM4H2S7F6A . You are receiving this because you were mentioned.Message ID: @.***>

seccobit commented 6 months ago

I think the node is still down, I tried to connect from a new node but connection is not stable. Any indication of what can be wrong would be much appreciated.

https://bitcoin.stackexchange.com/questions/122126/intermittent-connection-issues-datastreamread-end-of-data-unspecified-i