Bitcoin Forum
May 26, 2024, 05:53:11 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: bitcoind testnet rpc is no longer working  (Read 1589 times)
mav (OP)
Full Member
***
Offline Offline

Activity: 169
Merit: 107


View Profile
September 29, 2012, 02:19:10 AM
 #1

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
Diapolo
Hero Member
*****
Offline Offline

Activity: 769
Merit: 500



View Profile WWW
September 29, 2012, 11:08:17 AM
 #2

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

Liked my former work for Bitcoin Core? Drop me a donation via:
1PwnvixzVAKnAqp8LCV8iuv7ohzX2pbn5x
bitcoin:1PwnvixzVAKnAqp8LCV8iuv7ohzX2pbn5x?label=Diapolo
mav (OP)
Full Member
***
Offline Offline

Activity: 169
Merit: 107


View Profile
September 30, 2012, 02:08:11 AM
 #3

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

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.
jlp
Sr. Member
****
Offline Offline

Activity: 266
Merit: 264


View Profile
January 30, 2014, 07:43:42 PM
Last edit: January 30, 2014, 08:18:30 PM by jlp
 #4

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
moocoin
Member
**
Offline Offline

Activity: 112
Merit: 10

Do you moo?


View Profile WWW
January 31, 2014, 06:18:23 AM
 #5

Because the default port for testnet is 18332  Smiley


Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!