Bitcoin Forum
November 14, 2019, 01:57:48 PM *
News: Help collect the most notable posts made over the last 10 years.
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoind - help please!  (Read 149 times)
David9996
Newbie
*
Offline Offline

Activity: 6
Merit: 2


View Profile
July 30, 2019, 09:54:32 AM
Merited by ETFbitcoin (1), o_e_l_e_o (1)
 #1

Hi Guys,

Hope you can help me.

I've got two virtual machines setup.

VM#1 is setup as a bitcoin node

VM#2 is the server trying to reach BTC node


VM#1 Bitcoin.conf:
Code:
  server=1
   rpcuser=testuser
   rpcpassword=testpassword
   rpcport=19915
   rpcallowip=192.168.1.13

VM#1 - Shows its listening on port
 https://i.imgur.com/59P100s.png


I did a test through curl to see if I could generate a wallet, This worked (running on the #1 vm itself):
Code:
curl --user testuser:testpassword --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getnewaddress","params":[]}' -H 'content-type:text/plain;' http://127.0.0.1:19915


When I use the VMs IP address from VM #2 or even on the vm itself, it shows as connection refused:
Code:
curl --user testuser:testpassword --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getnewaddress","params":[]}' -H 'content-type:text/plain;' http://192.168.1.11:19915

So it works using the loopback/local address 127.0.0.1 but not the machine ip on the network for some reason or there's a setting I haven't did correctly.

Can anyone please shed any light on what could be causing this? it's driving me crazy.


Additional Info:
  - Firewall disabled
  - Running on Oracle VM VirtualBox
  - Network Adapter
           - Bridged Adapter on WIFI card
           - Promiscuous Mode: Allow All
           - Cable Connected: Ticked.



Hope this enough info to help.
1573739868
Hero Member
*
Offline Offline

Posts: 1573739868

View Profile Personal Message (Offline)

Ignore
1573739868
Reply with quote  #2

1573739868
Report to moderator
The Bitcoin Forum is turning 10 years old! Join the community in sharing and exploring the notable posts made over the years.
mocacinno
Legendary
*
Offline Offline

Activity: 1764
Merit: 1821


https://unblur.ninja =>lightning network testsite


View Profile WWW
July 30, 2019, 10:03:13 AM
 #2

it's listening on the loopback address only...
127.0.0.1:19915 instead of 0.0.0.0:19915

David9996
Newbie
*
Offline Offline

Activity: 6
Merit: 2


View Profile
July 30, 2019, 10:03:45 AM
 #3

it's listening on the loopback address only...

Thanks for your reply, I thought this - how can I change this?
mocacinno
Legendary
*
Offline Offline

Activity: 1764
Merit: 1821


https://unblur.ninja =>lightning network testsite


View Profile WWW
July 30, 2019, 10:05:15 AM
Merited by bones261 (2), ETFbitcoin (1), o_e_l_e_o (1)
 #4

Thanks for your reply, I thought this - how can I change this?
rpcbind=192.168.1.11 in your bitcoin.conf

At least, that should work... I'm not sitting behind my own desk at the moment, so i can't actually look trough the documentation right now Smiley

David9996
Newbie
*
Offline Offline

Activity: 6
Merit: 2


View Profile
July 30, 2019, 10:58:21 AM
 #5

Thanks for your reply, I thought this - how can I change this?
rpcbind=192.168.1.11 in your bitcoin.conf

At least, that should work... I'm not sitting behind my own desk at the moment, so i can't actually look trough the documentation right now Smiley

IT WORKS!! You sir a life saver, I'm forever grateful.

Strange how I never came across rpcbind before!
David9996
Newbie
*
Offline Offline

Activity: 6
Merit: 2


View Profile
July 30, 2019, 11:31:30 AM
 #6

Thanks for your reply, I thought this - how can I change this?
rpcbind=192.168.1.11 in your bitcoin.conf

At least, that should work... I'm not sitting behind my own desk at the moment, so i can't actually look trough the documentation right now Smiley


One last question, Now when I type into the VM with bitcoind 'bitcoin-cli getinfo' i get the following error:
Code:
root@BitcoinD-VirtualBox:~# bitcoin-cli getinfo
error: Could not connect to the server 127.0.0.1:19915

Make sure the bitcoind server is running and that you are connecting to the correct RPC port.


Is there a way I can rpcbind to both local and external? or tell bitcoin-cli to use the network ip?
bob123
Legendary
*
Offline Offline

Activity: 1078
Merit: 1571



View Profile WWW
July 30, 2019, 11:37:24 AM
 #7

Is there a way I can rpcbind to both local and external? or tell bitcoin-cli to use the network ip?

Just don't use the rpcbind statement at all.

With IPs in rpcallow and no rpcbind, your server will listen on all interfaces (including loopback).
This should allow you to connect to it from outside of your network (i.e. in this case from the other VM) and from localhost.

David9996
Newbie
*
Offline Offline

Activity: 6
Merit: 2


View Profile
July 30, 2019, 11:41:56 AM
 #8

Is there a way I can rpcbind to both local and external? or tell bitcoin-cli to use the network ip?

Just don't use the rpcbind statement at all.

With IPs in rpcallow and no rpcbind, your server will listen on all interfaces (including loopback).
This should allow you to connect to it from outside of your network (i.e. in this case from the other VM) and from localhost.

I had that previously but it wouldn't work with just rpcallowip

can you look at my bitcoin.conf above and tell me if you can see the issue?
bob123
Legendary
*
Offline Offline

Activity: 1078
Merit: 1571



View Profile WWW
July 30, 2019, 11:48:39 AM
 #9

Can you try it without rpcbind and with the following:

Code:
rpcallowip=192.168.1.0/24


This should work. If not, you might find an anomaly in the logs.
Feel free to post them here if you need help inspecting them (using a service like pastebin for example).

A-Bolt
Legendary
*
Online Online

Activity: 1384
Merit: 1283

CryptoTalk.Org - Get Paid for every Post!


View Profile
July 30, 2019, 11:54:18 AM
Merited by bones261 (2), ETFbitcoin (1), mocacinno (1), o_e_l_e_o (1)
 #10

Is there a way I can rpcbind to both local and external?

Code:
rpcbind=127.0.0.1
rpcbind=192.168.1.11

You also can bind bitcoind to all IPv4 interfaces:
Code:
rpcbind=0.0.0.0

 
                                . ██████████.
                              .████████████████.
                           .██████████████████████.
                        -█████████████████████████████
                     .██████████████████████████████████.
                  -█████████████████████████████████████████
               -███████████████████████████████████████████████
           .-█████████████████████████████████████████████████████.
        .████████████████████████████████████████████████████████████
       .██████████████████████████████████████████████████████████████.
       .██████████████████████████████████████████████████████████████.
       ..████████████████████████████████████████████████████████████..
       .   .██████████████████████████████████████████████████████.
       .      .████████████████████████████████████████████████.

       .       .██████████████████████████████████████████████
       .    ██████████████████████████████████████████████████████
       .█████████████████████████████████████████████████████████████.
        .███████████████████████████████████████████████████████████
           .█████████████████████████████████████████████████████
              .████████████████████████████████████████████████
                   ████████████████████████████████████████
                      ██████████████████████████████████
                          ██████████████████████████
                             ████████████████████
                               ████████████████
                                   █████████
.CryptoTalk.org.|.MAKE POSTS AND EARN BTC!.🏆
bob123
Legendary
*
Offline Offline

Activity: 1078
Merit: 1571



View Profile WWW
July 30, 2019, 12:04:07 PM
 #11

Alright, never mind.

My proposed solution does not work since 0.18.0:

The rpcallowip option can no longer be used to automatically listen on all network interfaces. Instead, the rpcbind parameter must be used to specify the IP addresses to listen on.


The solution from A-Bolt

Code:
rpcbind=127.0.0.1
rpcbind=192.168.1.11

together with:

Code:
rpcallowip=127.0.0.1
rpcallowip=192.168.1.13   # or 192.168.1.0/24 if you want to be able to access it from the whole local network

should work for your setup.

legendster
Hero Member
*****
Offline Offline

Activity: 1330
Merit: 716


www.V.systems


View Profile
July 30, 2019, 06:48:11 PM
 #12

I had a similar issue when I was hosting shitcoin masternodes.

So I added in one extra line in the wallet conf file

Code:
listen=1

And I also did this in the server main screen:

Code:
ufw allow ssh/tcp
ufw allow 11333/tcp

11333 was the port.

I had sudo access.

Without these codes my daemons would not run and would return a connection refused or connection timed out error.

smartmixer.io▀  ▀  ▀  ▀  ▀
▄  ▄  ▄  ▄  ▄

▀  ▀  ▀  ▀  ▀
▄  ▄  ▄  ▄  ▄

▀  ▀  ▀  ▀  ▀
▄  ▄  ▄  ▄  ▄

▀  ▀  ▀  ▀  ▀
▄  ▄  ▄  ▄  ▄

▀  ▀  ▀  ▀  ▀
.Make your Cryptos untraceable!.
(( ███████ ((    TELEGRAM    )) ███████ ))
▄▄███████▄▄
▄███████▀███████▄
▄███▀▀▀ ▄▄▄ ▀▀▀███▄
▄███ ▄▀▀▀   ▀▀▀▄ ███▄
████ █  ▄   ▄█ █ ████
████▌▐▌ ▀█▄█▀ ▐▌▐████
▀████ ▀▄  ▀  ▄▀ ████▀
▀████▄ ▀▄▄▄▀ ▄████▀
▀█████▄▄ ▄▄█████▀
▀▀███████▀▀
.
NO LOGS
▄▄███████▄▄
▄██████▀▀▀██████▄
▄█████▀ ▄▄▄ ▀█████▄
▄██████ ▀   █ ██████▄
███████   █▀  ███████
████████▄ ▄ ▄████████
▀████▀         ▀████▀
▀███   ▄   ▄   ███▀
▀███████████████▀
▀▀███████▀▀
.
NO SIGN-UP
▄▄███████▄▄
▄███████████████▄
▄███████▀   ▀█████▄
▄████▀  ▀      █████▄
████     ▄▀▄  ▀ ▀████
███    ▄▀▄ ▄▀▄    ███
▀███▄▄  ▀█ █▀   ▄███▀
▀████████ ████████▀
▀███████████████▀
▀▀███████▀▀
.

70% COMSN
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
MIX NOW!
.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀  ▀  ▀  ▀  ▀
▄  ▄  ▄  ▄  ▄

▀  ▀  ▀  ▀  ▀
▄  ▄  ▄  ▄  ▄

▀  ▀  ▀  ▀  ▀
▄  ▄  ▄  ▄  ▄

▀  ▀  ▀  ▀  ▀
▄  ▄  ▄  ▄  ▄

▀  ▀  ▀  ▀  ▀
bob123
Legendary
*
Offline Offline

Activity: 1078
Merit: 1571



View Profile WWW
July 31, 2019, 07:05:55 AM
Merited by o_e_l_e_o (1)
 #13

I had a similar issue when I was hosting shitcoin masternodes.

So I added in one extra line in the wallet conf file

Code:
listen=1


You don't need to explicitly set listen=1, since it is enabled by default (if you are not using connect).



Code:
ufw allow ssh/tcp
ufw allow 11333/tcp

11333 was the port.

I had sudo access.

Without these codes my daemons would not run and would return a connection refused or connection timed out error.

Since OP set up two virtual machines, i doubt he has installed a firewall and restricted the access.
Especially since he was able to access the interface from his 2nd (client-) machine, but no longer from the server itself via loopback.



I still belief the following addition should work:
Code:
rpcbind=127.0.0.1
rpcbind=192.168.1.11

rpcallowip=127.0.0.1
rpcallowip=192.168.1.13   # or 192.168.1.0/24 if you want to be able to access it from the whole local network

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!