Bitcoin Forum
April 26, 2024, 12:59:59 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: JSONRPC - not working with Bitcoin - others are 100% working  (Read 2383 times)
AgoraLive (OP)
Full Member
***
Offline Offline

Activity: 221
Merit: 100



View Profile
February 22, 2015, 12:29:22 PM
 #1

I have a script which is working when I access the bitcoin-qt.exe from localhost. I have allowrpc= set to the external server but for some reason it is not working?

The same script is running with a few ALTCoins without any issues, so it is not an IP, script error (as far as I know)?

Any ideas? Oh the script is php, is that's and issue...
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714136399
Hero Member
*
Offline Offline

Posts: 1714136399

View Profile Personal Message (Offline)

Ignore
1714136399
Reply with quote  #2

1714136399
Report to moderator
1714136399
Hero Member
*
Offline Offline

Posts: 1714136399

View Profile Personal Message (Offline)

Ignore
1714136399
Reply with quote  #2

1714136399
Report to moderator
Pieter Wuille
Legendary
*
Offline Offline

Activity: 1072
Merit: 1174


View Profile WWW
February 22, 2015, 05:20:50 PM
 #2

Hard to say without seeing the script...

I do Bitcoin stuff.
AgoraLive (OP)
Full Member
***
Offline Offline

Activity: 221
Merit: 100



View Profile
February 23, 2015, 06:13:01 PM
 #3

Well

 require_once 'jsonRPCClient.php';
 
  $bitcoin = new jsonRPCClient('http://user:password@127.0.0.1:8332/');
 
  echo "<pre>\n";
  print_r($bitcoin->getinfo());
  echo "</pre>";


Now this runs perfect localhost, but dosen't work when I run from external server. YES I have rpcallowip=xxx.xxx.xxx.xxx set correct because other coins are working from external source.
Bitware
Hero Member
*****
Offline Offline

Activity: 926
Merit: 1001


weaving spiders come not here


View Profile
February 24, 2015, 04:52:21 AM
 #4

Look at router and firewall settings.
gmaxwell
Staff
Legendary
*
Offline Offline

Activity: 4158
Merit: 8382



View Profile WWW
February 24, 2015, 05:59:33 AM
 #5

YES I have rpcallowip=xxx.xxx.xxx.xxx set correct because other coins are working from external source.
You probably don't. Read your debug.log.
AgoraLive (OP)
Full Member
***
Offline Offline

Activity: 221
Merit: 100



View Profile
February 24, 2015, 07:19:14 PM
 #6

Look at router and firewall settings.
Why should this be an issue with bitcoin, when litecoin and doge is running perfect with same script? Other ports naturally, but script is identical
AgoraLive (OP)
Full Member
***
Offline Offline

Activity: 221
Merit: 100



View Profile
February 24, 2015, 07:20:35 PM
 #7

YES I have rpcallowip=xxx.xxx.xxx.xxx set correct because other coins are working from external source.
You probably don't. Read your debug.log.


What should I be looking for?
cassini
Member
**
Offline Offline

Activity: 112
Merit: 10



View Profile
February 25, 2015, 12:02:11 AM
 #8

You probably don't. Read your debug.log.


What should I be looking for?
Any line that contains "RPC". Unfortunately not all types of RPC errors show up in debug.log, though.

First of all try curl locally on the same machine you run bitcoin-qt to get more detailed error messages (some Linux distros and Mac OS contain curl already, otherwise download from http://curl.haxx.se/).
Code:
curl --data-binary '{"jsonrpc": "1.0", "id":"mycurltest", "method": "getinfo", "params": [] }' -u <yourRPCusername>:<yourRPCpassword> 127.0.0.1:8332

BTW, what does your bitcoin.conf look like?
AgoraLive (OP)
Full Member
***
Offline Offline

Activity: 221
Merit: 100



View Profile
February 25, 2015, 07:25:18 PM
 #9

rpcuser=username
rpcpassword=password
rpcallowip=::/0
rpcport=8332
server=1


rpcallowip=::/0 - ONLY TO OPEN ALL FOR TESTING....


Even with specific IP it dosen't work (Again other coins does NOT have issues)
cr1776
Legendary
*
Offline Offline

Activity: 4018
Merit: 1299


View Profile
February 25, 2015, 08:08:07 PM
 #10

Are you sure this format is correct?  It does not look good to me:
Quote
rpcallowip=::/0

You could try something like:
rpcallowip=*

or (for better security), something like if you are testing it from your LAN:
192.168.0.0/24
(depending on the addresses).

Or you could just whitelist your IP.

What did curl show - as cassini suggested above?


rpcuser=username
rpcpassword=password
rpcallowip=::/0
rpcport=8332
server=1


rpcallowip=::/0 - ONLY TO OPEN ALL FOR TESTING....


Even with specific IP it dosen't work (Again other coins does NOT have issues)
AgoraLive (OP)
Full Member
***
Offline Offline

Activity: 221
Merit: 100



View Profile
February 25, 2015, 08:18:50 PM
 #11

Are you sure this format is correct?  It does not look good to me:
Quote
rpcallowip=::/0

You could try something like:
rpcallowip=*

or (for better security), something like if you are testing it from your LAN:
192.168.0.0/24
(depending on the addresses).

Or you could just whitelist your IP.

What did curl show - as cassini suggested above?


rpcuser=username
rpcpassword=password
rpcallowip=::/0
rpcport=8332
server=1


rpcallowip=::/0 - ONLY TO OPEN ALL FOR TESTING....


Even with specific IP it dosen't work (Again other coins does NOT have issues)

according to the bitcoin changelog (v 0.10.0) then ip:* is no longer supported and should be ::/0

Accessing from localhost is not a problem

I have not tried CURL yet
AgoraLive (OP)
Full Member
***
Offline Offline

Activity: 221
Merit: 100



View Profile
February 25, 2015, 08:28:26 PM
 #12

Might not understand curl but:

curl: (6) Could not resolve host: 1.0,
curl: (6) Could not resolve host: id
curl: (6) Could not resolve host: method
curl: (6) Could not resolve host: getinfo,
curl: (6) Could not resolve host: params
curl: (3) [globbing] bad range specification in column 2
curl: (3) [globbing] unmatched close brace/bracket in column 1
{"result":null,"error":{"code":-32700,"message":"Parse error"},"id":null}
AgoraLive (OP)
Full Member
***
Offline Offline

Activity: 221
Merit: 100



View Profile
February 25, 2015, 08:44:47 PM
 #13

OH GOD SO STUPID!!!!!!!!!!

I forgot to open the port  Angry

BITWARE <---- THANK YOU
cr1776
Legendary
*
Offline Offline

Activity: 4018
Merit: 1299


View Profile
February 25, 2015, 09:16:47 PM
 #14

OH GOD SO STUPID!!!!!!!!!!

I forgot to open the port  Angry

BITWARE <---- THANK YOU

Glad you got it!

(Didn't know if you were running 0.9.x or 0.10.0)
Bitware
Hero Member
*****
Offline Offline

Activity: 926
Merit: 1001


weaving spiders come not here


View Profile
February 26, 2015, 02:09:03 PM
 #15

OH GOD SO STUPID!!!!!!!!!!

I forgot to open the port  Angry

BITWARE <---- THANK YOU

You are most welcome.
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!