0
I'm running a testnet bitcoind node and I have been doing RPC calls on the default port 18332.
I have added this line to ~/.bitcoin/bitcoin.conf:
rpcport=19832
And restarted the bitcoind service. I even restarted the whole machine.
But for some reason it is still accepting RPC calls on port 18332, and trying the same on port 19832 gives "connection refused".
It is definitely using the settings in bitcoin.conf, for example if I change rpcuser or rpcpassword (and restart again) I have to use the new user+password in RPC calls, the old ones don't work anymore.
But somehow the port does change.
Am I doing something wrong? Is the setting called something else than rpcport=xxx ?
I know I can probably also define the port manually on the cmd line (using bitcoind -rpcport=xxx or something) when starting bitcoind, but I want to have everything configured in bitcoin.conf (where it belongs) and have it all started automatically.
P.S. I am connecting on localhost, i.e. on the machine itself. I am also running the ufw firewall, and it is configured to accept connections on both 19832 as well as 18832 (so it's definitely not the firewall that's blocking things here).
(edit) FYI here's the complete bitcoin.conf file:
testnet=1
server=1
daemon=1
txindex=1
rpcuser=XXXXXXXXXXXXXXXXXXXXXXX
rpcpassword=XXXXXXXXXXXXXXXXXXX
rpcallowip=127.0.0.1
rpcport=19832
onlynet=ipv4
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333
And here is how I perform RPC commands:
curl http://XXXXXXXXX:XXXXXXXXX@localhost:18332 -H 'content-type:text/plain;' --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getwalletinfo","params":[]}'
This works OK although note it connects to 18332. If I change localhost:18332 into localhost:19832 it doesn't work anymore (Connection refused).
In case my version is relevant, the result of getwalletinfo contains "walletversion": 169900.
Could you add the full
bitcoin.conffile? – Зелёный – 2019-02-08T12:14:28.910@Зелёный added – RocketNuts – 2019-02-08T12:17:51.640
Also add the full command line you're using to start it – Alistair Mann – 2019-02-08T12:20:36.383
@RocketNuts add this command
rpcbind=127.0.0.1:19832– Зелёный – 2019-02-08T12:26:23.910@Зелёный Thanks but unfortunately it doesn't seem to help. After adding that line and restarting the service, it still accepts RPC commands on 18332 and not on 19832. I also tried removing
rpcallowip=127.0.0.1(so instead of two separaterpcallowip=andrpcport=lines there was now just onerpcbind=127.0.0.1:19832line) but again, still the same. – RocketNuts – 2019-02-08T12:32:13.750Provide full command, how you're running and testing the RPC, all things please. – Зелёный – 2019-02-08T12:35:00.500
@Зелёный added above – RocketNuts – 2019-02-08T12:41:52.593
How you're running the
– Зелёный – 2019-02-08T12:45:17.130bitcoinditself? Could you also try to run just this conf file ? https://pastebin.com/mKWmKs00, also try with127.0.0.1instead oflocalhostin thecurlcommand.@Зелёный I start bitcoind with
sudo systemctl start bitcoindorsudo systemctl restart bitcoind. Tried your bitcoin.conf file (and changed the username and password to something new, so I'm sure this .conf file is used) and restarted the service, but unfortunately same result: it allows connection on 18332 (using new user&pasw) but not on 19832. Also tried127.0.0.1instead oflocalhostwithcurlbut again no difference. Strange huh? – RocketNuts – 2019-02-08T13:04:16.710I cant reproduce your problem, because on the same configuration is working for me. Maybe something wrong with your systemctl service, run command and show the result
systemctl cat bitcoind.service. – Зелёный – 2019-02-08T13:08:26.887@Зелёный Result of
– RocketNuts – 2019-02-08T13:14:51.460systemctl cat bitcoind.service: https://pastebin.com/raw/JQS0yuJH Thanks a lot for your attempts to help. Just to be sure, you are also testing with testnet? (not mainnet?)Yes, I tested it with testnet and mainnet. To be honest IDK, why it's not working for you. Here is my service https://pastebin.com/raw/r4hrPkvt also my bitcoin config exactly like this https://pastebin.com/raw/mKWmKs00.
– Зелёный – 2019-02-08T13:28:59.757@Зелёный Hmm very weird. And your walletversion from
getwalletinfois also 169900 ? – RocketNuts – 2019-02-08T13:34:38.553Yes, it is. Try my service and bitcoin configuration. – Зелёный – 2019-02-08T13:41:20.560
@Зелёный Have done that, but unfortunately no difference. Very weird :( Well, thanks for all the help attempts. Much appreciated. I will just keep using the regular port for now, and maybe reinstall my entire machine at some later time. – RocketNuts – 2019-02-08T13:57:31.747
Could you: print the result of running "sudo lsof -i | grep bitcoind | grep LISTEN" (you'll need to be give the root password) And can you also give us the result of running manually: "sudo systemctl start bitcoind; " then "/path/to/bitcoind -conf=/home/[your homedir]/.bitcoin/bitcoin.conf". Does it honour the correct port when run manually? – Alistair Mann – 2019-02-08T14:41:31.287
Oops - that should be "sudo systemctl stop bitcoind" – Alistair Mann – 2019-02-08T16:40:59.950
@AlistairMann Here's the result: https://pastebin.com/raw/MVcuVnWd When stopping the service (and checking with
– RocketNuts – 2019-02-08T20:26:00.183sudo systemctl status bitcoindto be 100% sure it stopped) and then starting manually, thelsofoutput is the same (well, other processIDs, but the three listen ports are the same.I've deleted my last request because I've managed to replicate your problem on my own machine. Will report back shortly. – Alistair Mann – 2019-02-08T20:41:42.850