Bitcoin Forum
May 28, 2024, 02:46:43 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Establishing testnet connection between 2 machines  (Read 495 times)
haggis (OP)
Hero Member
*****
Offline Offline

Activity: 984
Merit: 1000


View Profile
May 25, 2014, 12:59:24 PM
 #1

Hello,

I just started playing with the latest litecoin code for personal education. Got the genesis block created and am now trying to establish a testnet connection between my vps and my home machine.

vps IP: x.x.x.x
home IP: y.y.y.y
Testnet port: 19700

From what I read I should do...

on vps: ./foocoind -testnet -connect=y.y.y.y
on home: ./foocoind -testnet -connect=x.x.x.x

I already forwarded the ports on my router to the home machine, so this should be no problem. However, I never geht both machines connected. Here are the conf files I tried (~/.foocoin/foocoin.conf):

Code:
rpcuser=test
rpcpassword=test1

Result (debug.log):
on vps:
2014-05-25 12:47:45 trying connection y.y.y.y lastseen=0.0hrs
2014-05-25 12:47:45 connect() failed after select(): Connection refused

on home:
2014-05-25 12:48:21 trying connection x.x.x.x lastseen=0.0hrs
2014-05-25 12:48:26 connection timeout

Other config:
Code:
rpcuser=test
rpcpassword=test1
testnet=1

Result: same as above

Other config:
Code:
rpcuser=test
rpcpassword=test1
testnet=1
testnet_config=1

Result: same as above

This is the output of "netstat -anet | grep 19700":

vps:
Code:
tcp        0      0 127.0.0.1:19700         0.0.0.0:*               LISTEN      1000       44434377
tcp        0      1 x.x.x.x:38424     y.y.y.y:19700     SYN_SENT    1000       44434729
tcp6       0      0 ::1:19700               :::*                    LISTEN      1000       44434375

home (192.168.1.107 is my local ip which is the port forwarded to):
Code:
tcp        0      0 127.0.0.1:19700         0.0.0.0:*               LISTEN      1000       4104309
tcp        0      1 192.168.1.107:34093     x.x.x.x:19700     SYN_SENT    1000       4105400
tcp6       0      0 ::1:19700               :::*                    LISTEN      1000       4104308

If I put "listen=1" to any of the machines config file I always get:
Code:
Error: An error occurred while setting up the RPC port 19700 for listening on IPv4: bind: Address already in use


Any ideas what else I can try?

Regards, haggis
haggis (OP)
Hero Member
*****
Offline Offline

Activity: 984
Merit: 1000


View Profile
May 25, 2014, 02:06:27 PM
 #2

If I add "rpcallowip=*" on each side then the vps connects to my home machine, but the home machine still gets:
Code:
2014-05-25 14:04:16 trying connection x.x.x.x lastseen=0.0hrs
2014-05-25 14:04:21 connection timeout

netstat -anet | grep 19700
vps:
Code:
tcp        0      0 x.x.x.x:39425     y.y.y.y:19700     TIME_WAIT   0          0
tcp        0      0 x.x.x.x:39434     y.y.y.y:19700     CONNECTED   1000       44447848
tcp6       0      0 :::19700                :::*                    LISTEN      1000       44447623

home:
Code:
tcp6       0      0 :::19700                :::*                    LISTEN      1000       4155783
tcp6       0      0 192.168.1.107:19700     x.x.x.x:39434     CONNECTED   1000       4157135
haggis (OP)
Hero Member
*****
Offline Offline

Activity: 984
Merit: 1000


View Profile
May 25, 2014, 04:08:23 PM
 #3

I needed to do the following on the vps:
Code:
iptables -A INPUT -p tcp --dport 19700 -j ACCEPT


haggis (OP)
Hero Member
*****
Offline Offline

Activity: 984
Merit: 1000


View Profile
May 25, 2014, 04:29:31 PM
 #4

Both machines went async. While the vps found 19 blocks, my home machine was at 0 blocks (./foocoind getinfo)

Is it normal, that you need to set "rpcallowip=*" to establish a connection between two machines? I thought this option is only to set who is allowed to send commands?
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!