Bitcoin Forum
June 27, 2024, 09:29:42 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Unstable Bitcoin Connection  (Read 195 times)
haoqian (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 0


View Profile
May 07, 2018, 02:21:51 PM
 #1

I fork bitcoin core 16.0 and create my own alt coin. I run two bitcoind:

Code:
sudo ~/bitcoin/src/bitcoind -addnode=127.0.0.1:9332 -port=8963 -rpcport=8962 -debug=rpc -dns=0 -dnsseed=0

sudo ~/bitcoin/src/bitcoind -datadir=$HOME/.bitcoin2 -addnode=127.0.0.1:8962 -port=9333 -rpcport=9332 -debug=rpc -dns=0 -dnsseed=0

However, the connection between them seems very unstable. When I use bitcoin-cli -getinfo, sometimes the connection=0

I run locally, So I think the connection should be pretty stable? What's wrong?

Thank you very much.
Sellingaccs
Member
**
Offline Offline

Activity: 126
Merit: 50

Ask me for Pools, Nodes and Explorers.


View Profile
May 07, 2018, 02:37:10 PM
 #2

I think that locally running two nodes might be causing some problems, however do not take my word for it.
I'd suggest you to try running other of the nodes on a external server, like on a Vultr VPS for example.

Also i noticed that you have the following line:

Code:
sudo ~/bitcoin/src/bitcoind -datadir=$HOME/.bitcoin2 -addnode=127.0.0.1:8962 -port=9333 -rpcport=9332 -debug=rpc -dns=0 -dnsseed=0

Try changing the 8962 to 8963 on the addnode line. You entered the wrong P2P port, unless you are trying to send RPC commands to the another client. Don't know what else could be the problem.

jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
May 07, 2018, 03:21:09 PM
 #3

Could both computers be trying to take the 127.0.0.1 IP internally also?

Do you have another IP they have assigned like 10.10.x.x or 192.168.x.x that you could use to link them (just thinking a bit outside the box).

Sellingaccs covered everything else quite well.
dlystyr
Jr. Member
*
Offline Offline

Activity: 77
Merit: 7


View Profile WWW
May 08, 2018, 06:26:58 PM
 #4

What exactly are you trying to achieve?

There is no need to run 2 nodes on the same machine with the same coin. it will just waste double the space and incoming nodes will expect to connect on a certain port anyway and if you are running non standard ports it wont get a connection.

If you want to test your modified version of bitcoin I would suggest using an outside server using the standard ports on both sides. This is the only true test you can attempt. Try what Sellingaccs has suggested.

Hope it all works!

Crack Puzzle #66 Pool - http://www.ttdsales.com/66bit/index.php
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3430
Merit: 6720


Just writing some code


View Profile WWW
May 08, 2018, 09:13:00 PM
Merited by Jet Cash (1), posi (1), bob123 (1)
 #5

addnode does not guarantee that a connection to the specified node will be attempted. If you want to guarantee that a connection will be attempted, then you need to use the -connect option.

haoqian (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 0


View Profile
May 12, 2018, 06:42:30 AM
 #6

addnode does not guarantee that a connection to the specified node will be attempted. If you want to guarantee that a connection will be attempted, then you need to use the -connect option.

Solved! Thanks!
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!