Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: mmitech on August 11, 2015, 05:26:04 PM



Title: Insight: Can't connect to coind to get live updates from the p2p network.
Post by: mmitech on August 11, 2015, 05:26:04 PM
I am struggling with this for a couple of hours now:
Quote
Can't connect to coind to get live updates from the p2p network. (Tried connecting to bitcoind at 127.0.0.1:5837 and failed.)

in the log I see
Code:
{ '0': 'connecting to 127.0.0.1:5837' } after a while { '0': 'disconnected from peer 127.0.0.1:5837' }.

I can telnet 127.0.0.1 5837 and 0.0.0.0 5837
Code:
telnet 127.0.0.1 5837
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.

I double checked the magic again, and it is d9e6e7e5 exactly like in the source code https://github.com/Leocoin-project/LEOcoin/blob/master/src/main.cpp#L3023
The Protocol version is 70000 same as in the code
Code:
"version" : "v1.3.0.0-L32a928e-leo-enhanced",
"protocolversion" : 70000,
"walletversion" : 60000,
"balance" : 0.00000000,
"newmint" : 0.00000000,
"stake" : 0.00000000,
"blocks" : 605091,
"moneysupply" : 65289528.44299800,
"connections" : 9,
"proxy" : "",
"ip" : "217.26.192.84",
"difficulty" : 0.18828001,
"testnet" : false,
"keypoololdest" : 1439130316,
"keypoolsize" : 102,
"paytxfee" : 0.00001000,
"errors" : "."

but I can't get it to work !!! any suggestion ? did I miss anything ?


Title: Re: Insight: Can't connect to coind to get live updates from the p2p network.
Post by: achow101 on August 11, 2015, 05:32:35 PM
Did you set the rpc user and password correctly both in the config file and in the environment variables when starting Insight?


Title: Re: Insight: Can't connect to coind to get live updates from the p2p network.
Post by: mmitech on August 11, 2015, 05:43:41 PM
Did you set the rpc user and password correctly both in the config file and in the environment variables when starting Insight?
I did set it in the config file at
Code:
insight/node_modules/insight-bitcore-api/config/config.js
  is there any other config file that need to be changed beside that ?


Title: Re: Insight: Can't connect to coind to get live updates from the p2p network.
Post by: achow101 on August 11, 2015, 05:47:42 PM
Did you set the rpc user and password correctly both in the config file and in the environment variables when starting Insight?
I did set it in the config file at
Code:
insight/node_modules/insight-bitcore-api/config/config.js
  is there any other config file that need to be changed beside that ?
Make sure it the user and password are the same as the ones that you put into the coind config file.

Also, what command are you using to start insight?


Title: Re: Insight: Can't connect to coind to get live updates from the p2p network.
Post by: mmitech on August 11, 2015, 05:53:15 PM
Did you set the rpc user and password correctly both in the config file and in the environment variables when starting Insight?
I did set it in the config file at
Code:
insight/node_modules/insight-bitcore-api/config/config.js
 is there any other config file that need to be changed beside that ?
Make sure it the user and password are the same as the ones that you put into the coind config file.

Also, what command are you using to start insight?

They are the same,  I am starting it with npm start .

Edit: I get the net stats and block height, the problem is that insight doesn't submit latest blocks in the network


Title: Re: Insight: Can't connect to coind to get live updates from the p2p network.
Post by: achow101 on August 11, 2015, 06:00:12 PM
They are the same,  I am starting it with npm start .

Edit: I get the net stats and block height, the problem is that insight doesn't submit latest blocks in the network
Do you start it with
Code:
INSIGHT_NETWORK=livenet
in the command because if you don't then it will default to testnet and it won't work properly.


Title: Re: Insight: Can't connect to coind to get live updates from the p2p network.
Post by: mmitech on August 11, 2015, 06:03:05 PM
They are the same,  I am starting it with npm start .

Edit: I get the net stats and block height, the problem is that insight doesn't submit latest blocks in the network
Do you start it with
Code:
INSIGHT_NETWORK=livenet
in the command because if you don't then it will default to testnet and it won't work properly.

yes it is on the live net, in fact I have the same config for both livenet and testnet.

as you can see www.mmitech.info it is showing the main net


Title: Re: Insight: Can't connect to coind to get live updates from the p2p network.
Post by: achow101 on August 11, 2015, 06:27:01 PM
Have you tried restarting insight or clearing its databases to resynce? That might help, otherwise, I don't know if what the problem is. Also, if you search for the latest block, it will still show the data even with the error.


Title: Re: Insight: Can't connect to coind to get live updates from the p2p network.
Post by: mmitech on August 11, 2015, 06:28:21 PM
Have you tried restarting insight or clearing its databases to resynce? That might help, otherwise, I don't know if what the problem is. Also, if you search for the latest block, it will still show the data even with the error.
I see, it got messed up again...


Title: Re: Insight: Can't connect to coind to get live updates from the p2p network.
Post by: mmitech on August 11, 2015, 06:56:23 PM
Have you tried restarting insight or clearing its databases to resynce? That might help, otherwise, I don't know if what the problem is. Also, if you search for the latest block, it will still show the data even with the error.

OK, I tried re-syncing, but I see the same problem !!! all suggestions are welcome, maybe I am missing something really small here...


Title: Re: Insight: Can't connect to coind to get live updates from the p2p network.
Post by: achow101 on August 11, 2015, 08:22:40 PM
Have you tried restarting insight or clearing its databases to resynce? That might help, otherwise, I don't know if what the problem is. Also, if you search for the latest block, it will still show the data even with the error.

OK, I tried re-syncing, but I see the same problem !!! all suggestions are welcome, maybe I am missing something really small here...
Could you post the log here? I don't remember where it is but it shouldn't be that hard to find.


Title: Re: Insight: Can't connect to coind to get live updates from the p2p network.
Post by: mmitech on August 11, 2015, 08:40:57 PM
Have you tried restarting insight or clearing its databases to resynce? That might help, otherwise, I don't know if what the problem is. Also, if you search for the latest block, it will still show the data even with the error.

OK, I tried re-syncing, but I see the same problem !!! all suggestions are welcome, maybe I am missing something really small here...
Could you post the log here? I don't remember where it is but it shouldn't be that hard to find.

Code:
> insight-bitcore@0.2.7 start /root/insight
> INSIGHT_PUBLIC_PATH=public node node_modules/.bin/insight-bitcore-api


    ____           _       __    __     ___          _
   /  _/___  _____(_)___ _/ /_  / /_   /   |  ____  (_)
   / // __ \/ ___/ / __ `/ __ \/ __/  / /| | / __ \/ /
 _/ // / / (__  ) / /_/ / / / / /_   / ___ |/ /_/ / /
/___/_/ /_/____/_/\__, /_/ /_/\__/  /_/  |_/ .___/_/
                 /____/                   /_/

                                                v0.2.18

info: insight server listening on port 3000 in development mode
info: Bitcoin Core version  v1.3.0.0-L32a928e-leo-enhanced
info: Using RPC sync
info: Resuming sync from block: 000004ad126411624468754033d92580bb636ce441a752032408dafa71747487 #969
info: Could not find block files at: /root/.LEOcoin/testnet3/blocks/blk*.dat. Disabling file sync.
info: Got 969 blocks in current DB, out of 605210 block at bitcoind
info: syncing from RPC (slow)
info: Starting from:  000004ad126411624468754033d92580bb636ce441a752032408dafa71747487
info: status: [0.16%]
info: NEW TIP: 000004ad126411624468754033d92580bb636ce441a752032408dafa71747487 NEED REORG (old tip: 000004ad126411624468754033d92580bb636ce441a752032408dafa7174$
info: Reorg Case 1) OldNext: 000004ad126411624468754033d92580bb636ce441a752032408dafa71747487 NewHeight: 969
info:   Unconfirming 2 Txs
info: status: [0.2%]
info: status: [0.3%]
{ '0': 'connecting to 127.0.0.1:5837' }
info: status: [0.399%]
info: status: [0.499%]
info: status: [0.599%]
info: status: [0.699%]
info: status: [0.799%]
info: status: [0.898%]
info: status: [0.998%]
info: status: [1.098%]
info: status: [1.198%]
info: status: [1.298%]
info: status: [1.397%]
info: status: [1.497%]
info: status: [1.597%]
info: status: [1.697%]
info: status: [1.797%]
info: status: [1.896%]
info: status: [1.996%]
info: status: [2.096%]
info: status: [2.196%]
info: status: [2.296%]
info: status: [2.395%]
info: status: [2.495%]
info: status: [2.595%]
{ '0': 'disconnected from peer 127.0.0.1:5837' }
info: status: [2.695%]
info: status: [2.795%]
info: status: [2.894%]
info: status: [2.994%]
info: status: [3.094%]
info: status: [3.194%]

I removed HTTP calls


Title: Re: Insight: Can't connect to coind to get live updates from the p2p network.
Post by: mmitech on August 12, 2015, 11:23:31 AM
I found the trick, it was my mistake, I made a mistake with the magic, I mixed the mainnet one with the testnet one.... make sure you have the right magic or your daemon will reject connections