Bitcoin Forum
May 12, 2024, 09:39:13 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: BitcoinD RPC Server  (Read 1812 times)
XavierNauze (OP)
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile WWW
April 29, 2017, 05:03:58 AM
Last edit: April 29, 2017, 05:19:27 AM by XavierNauze
 #1

Hi there,

I have a small problem with my server bitcoind, when i taping example : bitcoin-cli getbalance i have that error :

error: couldn't connect to server: unknown (code -1)
(make sure server is running and you are connecting to the correct RPC port)

But the port its open, how i can resolve that ?

System : Ubuntu Server

Bitcoin.conf :
prune=550
rpcport=8332
maxconnections=125
maxuploadtarget=0
rpcuser=USERHIDDEN
rpcpassword=PASSWORDHIDDEN
daemon=1
keypool=100

#Edit : Bad English
Thank

1715549953
Hero Member
*
Offline Offline

Posts: 1715549953

View Profile Personal Message (Offline)

Ignore
1715549953
Reply with quote  #2

1715549953
Report to moderator
1715549953
Hero Member
*
Offline Offline

Posts: 1715549953

View Profile Personal Message (Offline)

Ignore
1715549953
Reply with quote  #2

1715549953
Report to moderator
1715549953
Hero Member
*
Offline Offline

Posts: 1715549953

View Profile Personal Message (Offline)

Ignore
1715549953
Reply with quote  #2

1715549953
Report to moderator
"If you don't want people to know you're a scumbag then don't be a scumbag." -- margaritahuyan
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
cloverme
Legendary
*
Offline Offline

Activity: 1512
Merit: 1057


SpacePirate.io


View Profile WWW
April 29, 2017, 11:00:26 AM
 #2

Hi there,

I have a small problem with my server bitcoind, when i taping example : bitcoin-cli getbalance i have that error :

error: couldn't connect to server: unknown (code -1)
(make sure server is running and you are connecting to the correct RPC port)

But the port its open, how i can resolve that ?

System : Ubuntu Server

Bitcoin.conf :
prune=550
rpcport=8332
maxconnections=125
maxuploadtarget=0
rpcuser=USERHIDDEN
rpcpassword=PASSWORDHIDDEN
daemon=1
keypool=100

#Edit : Bad English
Thank



A couple of things...

Use your RPC connect username and password in the command.
Code:
bitcoin-cli -rpcuser=userhidden -rpcpassword=passwordhidden -rpcport=8332

Check your firewall rules:
Code:
sudo iptables -L

or
Code:
sudo ufw status

For debugging, you can try turning off your firewall
Code:
sudo ufw disable
, dont forget to turn it back on.

If it was blocked locally, you can add a rule:
Code:
sudo ufw allow from (source ip) to (RPC IP) port 8332 proto tcp
example: sudo ufw allow from 192.168.1.1 to 192.168.1.1 port 8332 proto tcp

Good luck
BitcoinPot
Newbie
*
Offline Offline

Activity: 29
Merit: 2


View Profile
April 29, 2017, 10:14:25 PM
 #3

Check this thread too:
https://bitcointalk.org/index.php?topic=1871447.0

I got similar problems this where caused by closed ports...
Casy
Member
**
Offline Offline

Activity: 149
Merit: 22

🔴🔵 FoxMixer.com 🔵🔴


View Profile WWW
April 30, 2017, 10:35:11 AM
 #4


Bitcoin.conf :
prune=550
rpcport=8332
maxconnections=125
maxuploadtarget=0
rpcuser=USERHIDDEN
rpcpassword=PASSWORDHIDDEN
daemon=1
keypool=100


I don't know about the current defaults, but a
Code:
server=1
may also help

initstring
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
January 27, 2018, 03:39:37 AM
 #5

Quote
I don't know about the current defaults, but a
Code:
server=1
may also help

Thanks! For anyone else reading, I noticed that bitcoin-cli worked properly when bitcoind was invoked via the command line, but not when running the GUI.

Adding "server=1" to bitcoin.conf fixed this issue.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6635


Just writing some code


View Profile WWW
January 29, 2018, 12:49:59 AM
 #6

Thanks! For anyone else reading, I noticed that bitcoin-cli worked properly when bitcoind was invoked via the command line, but not when running the GUI.

Adding "server=1" to bitcoin.conf fixed this issue.
bitcoind will default to server=1. bitcoin-qt will not. So if you want to use the RPC server while running bitcoin-qt, you need to set server=1

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!