Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: mav on September 29, 2012, 02:19:10 AM



Title: bitcoind testnet rpc is no longer working
Post by: mav on September 29, 2012, 02:19:10 AM
I'm trying to make a connection to bitcoind testnet but it fails with 'curl: (7) couldn't connect to host'

It used to work, but now it does not. I can connect to non-testnet without issues.

I noticed that I have a new folder in my .bitcoin directory called 'testnet3' - I put my old certificate and key files in that new directory for ssl (although both ssl and non-ssl rpc is broken for me on testnet). The certificate and key file is in .bitcoin and .bitcoin/testnet and .bitcoin/testnet3 so I am sure the file is not the problem.

When I try to connect with or without ssl to testnet via curl I get the response in the first line of this post.

Here is my command to testnet which does not work: (change port to 8332 and the commands work for me with non-testnet)

non-ssl
curl --user bob --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.7:18332/

ssl
curl --user bob --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }' -H 'content-type: text/plain;' https://127.0.0.7:18332/ -k

Any ideas why this is no longer working? Can anyone else confirm rpc is not working for testnet? Am I missing something obvious here and just need a sanity check?

Bitcoin version from getinfo is 70003


Title: Re: bitcoind testnet rpc is no longer working
Post by: Diapolo on September 29, 2012, 11:08:17 AM
Can it be that the current official release has 8332 as RPC port, even on testnet, did you try that?
The commit to change the default RPC port to 18332 was just recently merged to Github master.

Dia


Title: Re: bitcoind testnet rpc is no longer working
Post by: mav on September 30, 2012, 02:08:11 AM
Can it be that the current official release has 8332 as RPC port, even on testnet, did you try that?
The commit to change the default RPC port to 18332 was just recently merged to Github master.

Dia


https://github.com/bitcoin/bitcoin/pull/1862 (https://github.com/bitcoin/bitcoin/pull/1862)

Yes the rpc port is still on port 8332, lsof confirmed this.

The other problem was using 127.0.0.1:8332 which didn't work, but localhost:8332 did work

Thanks for the clarification Diapolo.


Title: Re: bitcoind testnet rpc is no longer working
Post by: jlp on January 30, 2014, 07:43:42 PM
The other problem was using 127.0.0.1:8332 which didn't work, but localhost:8332 did work

I'm having a similar problem.  I'm running Bitcoin-QT on my Mac.  The following command in terminal works when I'm running Bitcoin-QT in mainnet:

curl --user bituser --data-binary '{"id":"t0", "method": "getinfo", "params": [] }' http://127.0.0.1:8332/

But I get 'curl: (7) couldn't connect to host' when I'm running Bitcoin-QT in testnet mode.  I've tried the following but it still does not work in testnet mode:

curl --user bituser --data-binary '{"id":"t0", "method": "getinfo", "params": [] }' http://localhost:8332/

My Library\Application Support\Bitcoin\bitcoin.conf file has the following:

rpcuser=bituser
rpcpassword=password
server=1
testnet = 1

I've put a copy of this bitcoin.conf file into the Library\Application Support\Bitcoin\testnet3 folder, but this does not fix the problem.

Does anyone have any suggestions?

Update:  I just got it to work by adding the following to bitcoin.conf.  I don't know why this is needed for testnet but not mainnet.

rpcport=8332


Title: Re: bitcoind testnet rpc is no longer working
Post by: moocoin on January 31, 2014, 06:18:23 AM
Because the default port for testnet is 18332  :)