Bitcoin Forum
June 18, 2018, 10:33:13 AM *
News: Latest stable version of Bitcoin Core: 0.16.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Unstable Bitcoin Connection  (Read 112 times)
haoqian
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.
1529317993
Hero Member
*
Offline Offline

Posts: 1529317993

View Profile Personal Message (Offline)

Ignore
1529317993
Reply with quote  #2

1529317993
Report to moderator
1529317993
Hero Member
*
Offline Offline

Posts: 1529317993

View Profile Personal Message (Offline)

Ignore
1529317993
Reply with quote  #2

1529317993
Report to moderator
1529317993
Hero Member
*
Offline Offline

Posts: 1529317993

View Profile Personal Message (Offline)

Ignore
1529317993
Reply with quote  #2

1529317993
Report to moderator
Automated Bitcoin Fork Extraction Tool WE DO TOUGH WALLETS: BCH | BTG | BCD | SBTC | UBTC | B2X | BCX | BTF Electrum 2FA, Trezor, Ledger, SegWit, Bech32
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1529317993
Hero Member
*
Offline Offline

Posts: 1529317993

View Profile Personal Message (Offline)

Ignore
1529317993
Reply with quote  #2

1529317993
Report to moderator
1529317993
Hero Member
*
Offline Offline

Posts: 1529317993

View Profile Personal Message (Offline)

Ignore
1529317993
Reply with quote  #2

1529317993
Report to moderator
Sellingaccs
Member
**
Offline Offline

Activity: 126
Merit: 49

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: 1036
Merit: 1071


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

Activity: 13
Merit: 1


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!

Bitrated user: dlystyr.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 1428
Merit: 1350


3F1Y9yquzvY6RWvKbw2n2zeo9V5mvBhADU


View Profile WWW
May 08, 2018, 09:13:00 PM
Merited by Jet Cash (1), bob123 (1), posi (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
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:  

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!