Bitcoin Forum
May 06, 2024, 12:07:52 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoind - help please!  (Read 225 times)
David9996 (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 2


View Profile
July 30, 2019, 09:54:32 AM
Merited by ABCbits (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.
"You Asked For Change, We Gave You Coins" -- casascius
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714954072
Hero Member
*
Offline Offline

Posts: 1714954072

View Profile Personal Message (Offline)

Ignore
1714954072
Reply with quote  #2

1714954072
Report to moderator
1714954072
Hero Member
*
Offline Offline

Posts: 1714954072

View Profile Personal Message (Offline)

Ignore
1714954072
Reply with quote  #2

1714954072
Report to moderator
1714954072
Hero Member
*
Offline Offline

Posts: 1714954072

View Profile Personal Message (Offline)

Ignore
1714954072
Reply with quote  #2

1714954072
Report to moderator
mocacinno
Legendary
*
Offline Offline

Activity: 3388
Merit: 4919


https://merel.mobi => buy facemasks with BTC/LTC


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

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
David9996 (OP)
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: 3388
Merit: 4919


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
July 30, 2019, 10:05:15 AM
Merited by bones261 (2), ABCbits (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

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
David9996 (OP)
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 (OP)
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: 1624
Merit: 2481



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 (OP)
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: 1624
Merit: 2481



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

Activity: 2315
Merit: 2312


View Profile
July 30, 2019, 11:54:18 AM
Merited by bones261 (2), mocacinno (1), ABCbits (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
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



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: 1778
Merit: 764


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.


   ██████████        ████████████
     ██████████        ██████████
       ██████████        ████████
         ██████████        ██████
           ██████████        ████
             ██████████        ██
               ██████████
                 ██████████
                   ████████
                     ██████
                       ████
                        ██
|
     ▄▀▀▀▀▀▀▀▀▀█                 ▄▀▀▀▀▀▀▀▀▀█
 ▄▀                ▄▀█             ▄▀                ▄▀█
 ██████████    █             ██████████    █
 █                █                   █                █    █
 █                █     ▀▀▀▀▀▀▀█                █    █
 █                █  ▄▀             █                █  ▄▀
 ██████████▀                 ██████████▀
          █                                    █
          █                                    █
     ▄▀ █  ▀▀▀▀█                   ▄▀ █ ▀▀▀▀▀▀█
 ▄▀             ▄▀█               ▄▀               ▄▀ █
 █████████   █               ██████████    █
 █              █   █               █                █    █
 █              █   █               █                █    █
 █              █  ▄▀▀▀▀▀▀▀  █                █  ▄▀
 █████████▀                  ██████████▀

Blockchain
Database
                             ▄▄▄
                         ▄▄▀  ▀▄▄
        ▄           ▄▄▀  ▄▀▄  ▀▄▄
      █▄█   █████████████████    █
        █     █                              █ ▄▀ ▌
        █     █        ▄    █   ▄         █▀ ▄▌
       ██    █      ▀▄   █    ▄▀       █▀█
       ▌ ▌   █            █                █  █
       ▌ ▌   █                              █  █
       ██    ███████████████████
                     ▀▀▄  ▀▄▀  ▄▀▀
                         ▀▀▄  ▄▀▀
                             ▀▀▀
Dev friendly
SDK Platform
                             ▄▄▄▄
                         ▄▄█    █▄▄
                     ▄▄█            █▄▄
                 ▄▄█       ▄▄▄       █▄▄
                 █       ▄▀      ▀▄       █
               █▀     █      █      █     ▀█
               ▀▀█  █   ▄█▀█▄   █  █▀▀
               █▀▀   █  ▀███▀  █   ▀▀█
               ▀▀█     █    █    █     █▀▀
                   ▀▀█   █  █  █   █▀▀
                       ▀████████▀
                           █▄▄▄▄█
                 █        █▄▄▄▄█      █
             ▄▀ █▄                   ▄█  ▀▄
            █   █▀▄         ▀      ▄▀█    █
           █   █  █  ▌      ▀   ▐  █  █    █
           █   █▄▀▄▌      ▀   ▐▄▀▄█    █
           █       █          ▀        █       █
        █▀▀▀▀▀▀█                █▀▀▀▀▀▀█
        ▀▀▀▀▀▀▀▀                ▀▀▀▀▀▀▀▀
User-friendly
Token Creation
|
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



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:  

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