1

Its mentioned that -rpcconnect can be used to send commands to a remote Bitcoin Core node: https://github.com/bitcoin/bitcoin/blob/master/src/bitcoin-cli.cpp#L70

I am testing this option by using the format mentioned here: https://github.com/BlockchainCommons/Learning-Bitcoin-from-the-Command-Line/blob/master/14_1_Verifying_Your_Tor_Setup.md

torify bitcoin-cli -rpcconnect=vazr3k6bgnfafmdpcmbegoe5ju5kqyz4tk7hhntgaqscam2qupdtk2yd.onion -rpcport=1309 -rpcpassword=password3 getblockchaininfo

If I use the onion address for my node returned in getnetworkinfo, I get the below error:

error: Could not connect to the server vazr3k6bgnfafmdpcmbegoe5ju5kqyz4tk7hhntgaqscam2qupdtk2yd.onion:1309 (error code 1 - "EOF reached")

and If I use the onion address saved in /var/lib/tor/other_hidden_service/hostname, I get this error:

error: Authorization failed: Incorrect rpcuser or rpcpassword

I am assuming connection works fine in second error but issues with rpc credentials. Below are contents of bitcoin.conf:

testnet=1
prune=1000

server=1

listen=1
proxy=127.0.0.1:9050
torcontrol=127.0.0.1:9051
debug=tor

test.rpcport=18332

test.rpcuser=user3
test.rpcpassword=password3
4
  • The onion address exposed through getnetworkinfo is irrelevant. Bitcoin Core is only automatically setting up an onion service for P2P communication, not RPC. Jun 9, 2021 at 2:55
  • Thanks. I was assuming it can be used for both.
    – user103136
    Jun 9, 2021 at 2:57
  • Your command doesn't contain -rpcuser.
    – Ava Chow
    Jun 9, 2021 at 4:21
  • @AndrewChow That resolved the issue :)
    – user103136
    Jun 9, 2021 at 13:15

1 Answer 1

2

-rpcuser was missing in the command. Also, the onion address exposed through getnetworkinfo is irrelevant. Bitcoin Core is only automatically setting up an onion service for P2P communication, not RPC.

Below command works fine:

torify bitcoin-cli -rpcconnect=vazr3k6bgnfafmdpcmbegoe5ju5kqyz4tk7hhntgaqscam2qupdtk2yd.onion -rpcport=1309 -rpcuser=user3 -rpcpassword=password3 getblockchaininfo

Your Answer

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