Bitcore (insight + insight-api)

Guide to set up the Explorer and API. This requires a bitcoind node with the bitcore patches already compiled.

Introduction

In order to display the blockchain data, bitcore is going to be used. The bitcore process will start the bitcoind node and will serve the insight and insight-api.

Installation

Requirements:

Install bitcore:

  • In your terminal set the NodeJs version to v4.

nvm use v4
  • Install bitcore:

npm install -g bitcore --unsafe-perm=true
  • Create your node folder.

    • -d: Your bitcoin data folder. (The configuration file must be also located inside that folder with the name bitcoin.conf)

    • mynode: This will be the folder name, it can be change.

bitcore create -d "/root/.bitcoin/" mynode
  • Add the Explorer and API to the bitcore service.

cd mynode
bitcore install insight-api insight-ui

Configuration file:

Inside your node folder there is a file named: bitcore-node.json

Set the network to testnet, and the location of your compiled bitcoind.

{
  "network": "testnet",
  "port": 3001,
  "services": [
    "bitcoind",
    "insight-api",
    "insight-ui",
    "web"
  ],
  "servicesConfig": {
    "bitcoind": {
      "datadir": "/root/.bitcoin",
      "exec": "/root/your/directory/to/bitcoin-abc/src/bitcoind"
    }
  }
}

Usage

Run bitcore:

Inside your node folder:

nvm use v4
bitcored
Bitcore running.

Check you explorer and API:

The Explorer will be hosted in localhost:3001/insight/

Insight explorer index.

The API will be hosted in localhost:3001/insight-api/

Insight-API result for a block.

References

Last updated