btcsuite / btcd

An alternative full node bitcoin implementation written in Go (golang)
https://github.com/btcsuite/btcd/blob/master/README.md
ISC License
6.11k stars 2.32k forks source link

--rpcserver arg does not work as expected #1939

Closed jagottsicher closed 1 year ago

jagottsicher commented 1 year ago

I have a btcd running on my local network. mit btcctl and the right credentials I can reach it on localhost, but if I try from another machine to reach it e.g. with /absolute-path-to-my/btcd/cmd/btcctl/btcctl --rpcserver=192.168.1.x --rpcuser=rpcusername --rpcpass=supersecretpassword getpeerinfo it fails.

btcctl barks Post "http://192.168.1.239:8334": dial tcp 192.168.1.239:8334: connect: connection refused at me. `

Due to the fact locally executed it works I guess that the node does not need to be synced. Also Netstat shows that all ports (also 8334) are open and btcd listening

tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:8334          0.0.0.0:*               LISTEN      209853/btcd         
tcp        0      0 0.0.0.0:8555            0.0.0.0:*               LISTEN      209853/btcd         
tcp6       0      0 :::22                   :::*                    LISTEN      -                   
tcp6       0      0 ::1:8334                :::*                    LISTEN      209853/btcd         
tcp6       0      0 :::8555                 :::*                    LISTEN      209853/btcd         
tcp6       0      0 :::6061                 :::*                    LISTEN      209853/btcd

Also installing the rpc.cert leads to the same problem. Local on the btcd machine FW is off.

Do I miss something here? I cannot rpc to an external machine?

guggero commented 1 year ago

127.0.0.1:8334 means it's listening on the local interface only. Try with --rpclisten=0.0.0.0:8334 on the server.

jagottsicher commented 1 year ago

Thanks. Seems I need more coffee (or less?).