Author

Topic: Bitcoin node and Insight API (Read 2354 times)

sr. member
Activity: 362
Merit: 262
March 05, 2015, 03:36:37 AM
#13
Do you have bitcoind running the same machine or different?

If on the same machine
You need to use 127.0.0.1 as the bitcoind ip. 127.0.0.1 is the loopback ip.  It's a "point to myself" ip.
Also check rpcallowip=127.0.0.1 is present in your bitcoin.conf.
Also the default rpc port is 8332. 3000 is wrong. RPC port is the port bitcoind uses for rpc commands.
You can also check the port in your bitcoin.conf.

Also I'm not sure if insight is compatible with block files that are out of order (bitcoind v0.10).  You may need to change the block data dir to an invalid path in this case it may not be able to sync via block data.  Only by rpc (slower initially but fine once you've caught up).  I prefer rpc sync in any case as it seems less buggy.

If bitcoind is on a different machine
You need to provide the relevant ip (edit: and also the correct rpc port). Also then on the machine running bitcoind you need include rpcallowip= in the bitcoin.conf for the ip of the machine running insight.  

block data dir is not really relevant here as sync will be rpc only as the block data dir will not be accessible (unless you jump through a few more hoops).
newbie
Activity: 6
Merit: 0
March 05, 2015, 01:19:42 AM
#12
I didn't run grunt.js on insight, should I ?
I managed to make them shown by adding help '--help'

root@vultr:/var/vhosts/btc/insight-api# node insight.js --help

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

                                                v0.2.12


  Usage: insight [options]

  Options:

    -h, --help     output usage information
    -V, --version  output the version number

info:
# Configuration:
        INSIGHT_NETWORK (Network): livenet
        INSIGHT_DB (Database Path):  /root/.insight/
        INSIGHT_SAFE_CONFIRMATIONS (Safe Confirmations):  6
        INSIGHT_IGNORE_CACHE (Ignore Cache):  no
 # Bicoind Connection configuration:
        RPC Username: bitcoinrpc                BITCOIND_USER
        RPC Password: Yes(hidden)       BITCOIND_PASS
        RPC Protocol: http              BITCOIND_PROTO
        RPC Host: 108.61.212.227                BITCOIND_HOST
        RPC Port: 3000                  BITCOIND_PORT
        P2P Port: 8333                  BITCOIND_P2P_PORT
        BITCOIND_DATADIR: /root/.bitcoin/


Change setting by assigning the enviroment variables above. Example:
 $ INSIGHT_NETWORK="testnet" BITCOIND_HOST="123.123.123.123" ./insight.js


root@vultr:/var/vhosts/btc/insight-api#
legendary
Activity: 1862
Merit: 1469
March 05, 2015, 01:16:44 AM
#11
That's strange. I've never really run insight for BTC but I have for alt coins and the variables always appear there at startup.

You should consider setting them on insight-api/config/config.js just in case.

Are you running grunt on /insight?


Edit: you need to check this:
Connection.parseMessage(): Command not implemented

It seems something is not (well) installed.
newbie
Activity: 6
Merit: 0
March 05, 2015, 01:13:21 AM
#10
the previous lines only displays "INSIGHT" logo it didnt display any of the env variables.
I actually set the rpcuser and rpcpass in env.

looked liek this:

root@vultr:/var/vhosts/btc/insight-api# node insight.js

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

                                                v0.2.12

info: insight server listening on port 3000 in production mode
POST / 404 4ms - 44b
error: Not found
{ '0': 'connecting to 108.61.212.227:8333' }
{ '0': 'connected to 108.61.212.227:8333' }
{ '0': 'Connection.parseMessage(): Command not implemented',
  '1': { cmd: 'notfound' } }
GET /api/peer 304 2ms
{ '0': 'Connection.parseMessage(): Command not implemented',
  '1': { cmd: 'notfound' } }
GET /api/sync 304 1ms
POST / 404 1ms - 44b
GET /api/status?q=getInfo 503 3ms
legendary
Activity: 1862
Merit: 1469
March 05, 2015, 01:10:39 AM
#9
Yep, the return value was like this:

Browser:
http://127.0.0.1:3000/api/sync
{"status":"error","syncPercentage":"NaN","height":0,"error":"Not found"}

http://127.0.0.1:3000/api/peer
{"connected":true,"host":"127.0.0.1","port":"8333"}

Command line:
info: insight server listening on port 3000 in production mode
POST / 404 4ms - 44b
error: Not found
{ '0': 'connecting to 108.61.212.227:8333' }
{ '0': 'connected to 108.61.212.227:8333' }
GET /api/sync 200 2ms - 72b
POST / 404 1ms - 44b
GET /api/status?q=getInfo 503 2ms
GET /api/peer 200 1ms - 56b

What about the previous lines? It should list the env. variables like username and password.

Are you sure that's OK?
legendary
Activity: 1862
Merit: 1469
March 05, 2015, 01:08:34 AM
#8
Yep, the return value was like this:

http://127.0.0.1:3000/api/sync
{"status":"error","syncPercentage":"NaN","height":0,"error":"Not found"}

http://127.0.0.1:3000/api/peer
{"connected":true,"host":"127.0.0.1","port":"8333"}

Not that. The log resulting from running it from the command line.
What appears after typing the command to start it up.

The exact command you're using would help too if you can share it.
newbie
Activity: 6
Merit: 0
March 05, 2015, 01:06:26 AM
#7
Yep, the return value was like this:

Browser:
http://127.0.0.1:3000/api/sync
{"status":"error","syncPercentage":"NaN","height":0,"error":"Not found"}

http://127.0.0.1:3000/api/peer
{"connected":true,"host":"127.0.0.1","port":"8333"}

Command line:
info: insight server listening on port 3000 in production mode
POST / 404 4ms - 44b
error: Not found
{ '0': 'connecting to 108.61.212.227:8333' }
{ '0': 'connected to 108.61.212.227:8333' }
GET /api/sync 200 2ms - 72b
POST / 404 1ms - 44b
GET /api/status?q=getInfo 503 2ms
GET /api/peer 200 1ms - 56b
legendary
Activity: 1862
Merit: 1469
March 05, 2015, 12:48:15 AM
#6
I tried running just  /api/status?q=getinfo always got 503 error.

bitcoind is listening on port 8333 on localhost. but for some reason it cannot be accessed

could anybody help me please ?

Cheers


Post the result of running insight-api from the command line, especially the first 20 lines.

It's hard to help blindly.
newbie
Activity: 6
Merit: 0
March 05, 2015, 12:45:20 AM
#5
I tried running just  /api/status?q=getinfo always got 503 error.

bitcoind is listening on port 8333 on localhost. but for some reason it cannot be accessed

could anybody help me please ?

Cheers

sr. member
Activity: 362
Merit: 262
March 04, 2015, 04:01:36 AM
#4
Run insight from the command line and check the errors that pop-up.  Also I think this is off-topic here.
newbie
Activity: 6
Merit: 0
March 04, 2015, 12:39:26 AM
#3
for insight-api/config/config.js, I didnt change anything inside, since when I looked at it, it tried to access env variables, which then I set them (environement variables) up.

the error was that the /api/sync was failed, it returns {"status":"error","syncPercentage":"NaN","height":0,"error":"Not found"}

I will put the screenshot for the front-end.

to be honest I'm not too sure where I can get the insight-api logs.

http://108.61.212.227/images/insight01.png

http://108.61.212.227/images/insight2.png

legendary
Activity: 1862
Merit: 1469
March 04, 2015, 12:15:37 AM
#2
Hi guys,

I'm very new with bitcoins, so please be gentle with my stupidity :p

basically I'm trying to setup a bitcoin node and insight.
the node address is: 108.61.212.227.
https://getaddr.bitnodes.io/nodes/108.61.212.227-8333/

however, I have problems when I'm setting up insight, it doesn't recognize the bitcoind on the server it is installed on. I have installed leveldb, and setup the environment for the api, but it still refuses to sync with bitcoind.

can anybody help me out with insight setup, please ?

Cheers and thanks

Just to confirm, did you already change the basic settings like username and password on insight-api/config/config.js?

You will need to provide more information to get help.
Is there any error shown? what does the log say?

newbie
Activity: 6
Merit: 0
March 04, 2015, 12:03:14 AM
#1
Hi guys,

I'm very new with bitcoins, so please be gentle with my stupidity :p

basically I'm trying to setup a bitcoin node and insight.
the node address is: 108.61.212.227.
https://getaddr.bitnodes.io/nodes/108.61.212.227-8333/

however, I have problems when I'm setting up insight, it doesn't recognize the bitcoind on the server it is installed on. I have installed leveldb, and setup the environment for the api, but it still refuses to sync with bitcoind.

can anybody help me out with insight setup, please ?

Cheers and thanks
Jump to: