2

I configured my full bitcoin node behind tor (nowadays there aren't much bitcoin nodes behind tor network, this website: https://bitnodes.21.co/nodes/?q=Tor%20network tell us that there are just 323 nodes), for the moment I hadn't any problem configuring it behind tor. But the problem comes when I want to connect through a rpc client to my bitcoin node. I am using this project as code base: https://github.com/aceat64/EasyBitcoin-PHP and I modify the function __call in the following way:

$options = array(
            CURLOPT_HTTPAUTH       => CURLAUTH_BASIC,
            CURLOPT_USERPWD        => $this->username . ':' . $this->password,
            CURLOPT_PROXY          => '127.0.0.1:9050',
            CURLOPT_PROXYTYPE      => 7,
            CURLOPT_RETURNTRANSFER => TRUE,
            CURLOPT_FOLLOWLOCATION => TRUE,
            CURLOPT_MAXREDIRS      => 10,
            CURLOPT_HTTPHEADER     => array('Content-type: application/json'),
            CURLOPT_POST           => TRUE,
            CURLOPT_POSTFIELDS     => $request
        );

I am very stuck with this issue, due to that I am getting all time Can't complete SOCKS5 connection to 0.0.0.0:0., I have the tor service running and I didn't find any tutorial about how to connect and authenticate to a bitcoin node using php and curl.

Best regards and thanks in advance

1 Answer 1

2

The RPC interface is not exposed over Tor. The only thing that goes over Tor is the P2P connection. To access the RPC server, you need to connect directly to the node's IP address, not connect to it over Tor. Note that the RPC interface and the P2P interface are two different things; the RPC interface is private facing while the P2P interface is public facing.

1
  • Thanks for your reply! I was really stuck and I didn't know that the RPC can't be exposed over TOR! Commented Sep 1, 2017 at 19:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.