Bitcoin Forum
September 25, 2024, 05:19:37 PM *
News: Latest Bitcoin Core release: 27.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: connect two bitcoin core nodes on different machine, using regtest  (Read 188 times)
victorkimba17 (OP)
Jr. Member
*
Offline Offline

Activity: 113
Merit: 5


View Profile
March 14, 2018, 09:20:06 AM
 #1

I have setup one bitcoin core node on machine A, and one bitcoin core node on machine B. The two machines can ping each other.

On machine A (10.0.0.11):
bitcoind -regtest -port=18332 -rpcport=8331
Bitcoin server starting

On machine B (11.0.0.12):
bitcoind -regtest -port=18332 -rpcport=8331 -connect=10.0.0.11:18332
Bitcoin server starting

Then on machine B, i run the command:
"bitcoin-cli -regtest  -port=18332 -rpcport=8331 getconnectioncount"

It returns 0. Is there any mistakes in my steps ?
victorkimba17 (OP)
Jr. Member
*
Offline Offline

Activity: 113
Merit: 5


View Profile
March 15, 2018, 02:14:45 AM
 #2

I can connect regtest on two nodes on the same machine.

However, i cannot connect regtest on two nodes on different machine.

I use bitcoin v0.15.1 , setup the bitcoind to connect to remote host in bitcoin.conf 
`connect = 11.0.0.110:18332`
as well as command line
 `-connect=11.0.0.110:18332`

The bitcoind is still trying to connect to
`2018-03-15 01:31:32 Binding RPC on address ::1 port 18332 failed.
2018-03-15 01:31:32 Binding RPC on address 127.0.0.1 port 18332 failed.`

Anyone knows why ?
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3500
Merit: 6833


Just writing some code


View Profile WWW
March 15, 2018, 04:33:54 AM
Merited by ABCbits (1)
 #3

The bitcoind is still trying to connect to
`2018-03-15 01:31:32 Binding RPC on address ::1 port 18332 failed.
2018-03-15 01:31:32 Binding RPC on address 127.0.0.1 port 18332 failed.`

Anyone knows why ?
You have two programs that are trying to use the same port. You can't do that. One of your bitcoind instances will need to use a different rpcport (-rpcport) and normal p2p port (-port)

victorkimba17 (OP)
Jr. Member
*
Offline Offline

Activity: 113
Merit: 5


View Profile
March 15, 2018, 05:45:16 AM
 #4


You have two programs that are trying to use the same port. You can't do that. One of your bitcoind instances will need to use a different rpcport (-rpcport) and normal p2p port (-port)

The bitcoin.conf was setup already.  As below:

regtest = 1
server = 1
port=18443
connect = 12.0.0.111:18332
rpcuser=bitcoinrpc
rpcpassword=password

The port is set to 18443. Why is that bitcoind trying to bind to port 18332 ?

"2018-03-15 01:31:32 Binding RPC on address ::1 port 18332 failed.
2018-03-15 01:31:32 Binding RPC on address 127.0.0.1 port 18332 failed."
victorkimba17 (OP)
Jr. Member
*
Offline Offline

Activity: 113
Merit: 5


View Profile
March 15, 2018, 06:08:49 AM
 #5

You have two programs that are trying to use the same port. You can't do that. One of your bitcoind instances will need to use a different rpcport (-rpcport) and normal p2p port (-port)

Thank you. The setup of bitcoin core regtest network  on two nodes on two  different machine, is working now. Have to add rpcport entry. The machine A bitcoin.conf

`regtest=1
server=1
port=18332
rpcport = 18333
rpcuser=bitcoinrpc
rpcpassword=password
rpcallowip=0.0.0.0/0`

and machine B bitcoin.conf
`regtest = 1
server = 1
port=18443
rpcport = 18444
connect = 11.0.0.110:18332
rpcuser=bitcoinrpc
rpcpassword=password`
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!