Skip to content

Instantly share code, notes, and snippets.

@OstlerDev
Last active August 2, 2018 23:05
Show Gist options
  • Save OstlerDev/aa9d2f5a32c7f98ee45a8f8a90ae5cf2 to your computer and use it in GitHub Desktop.
Save OstlerDev/aa9d2f5a32c7f98ee45a8f8a90ae5cf2 to your computer and use it in GitHub Desktop.
How to Setup Bitcore, Litecore and Flocore

How to install Insight for Bitcoin, Litecoin and Flo

As a pre-requisite to any of the guides, make sure you have Node v8.11.3 or later installed and accessable.

Bitcoin

  1. Make sure you have Node v8.11.3 or later installed and accessable.

  2. Create a directory to store everything in

mkdir bitcore
  1. Go into the created directory
cd bitcore
  1. Install bitcore by running the following command
npm install bitcore@5.0.0-beta.44
  1. Create a bitcore node by running the following command.
./node_modules/bitcore/bin/bitcore create livenet
  1. Go into the livenet directory that was just created.
cd livenet
  1. Install bitcore-node manually by running the following command
npm install --save bitcore-node@5.0.0-beta.44
  1. Edit the config file bitcore-node.json to reflect your desired network, port, data save location, and route-prefix (if any). Make sure that you add insight-api and insight-ui to the services array, or it will not attempt to load them.

Sample Config

{
  "version": "5.0.0-beta.44",
  "network": "testnet",
  "port": 3005,
  "services": [
    "address",
    "block",
    "db",
    "fee",
    "header",
    "mempool",
    "p2p",
    "timestamp",
    "transaction",
    "insight-api",
    "insight-ui",
    "web"
  ],
  "datadir": "/home/bitc/bitcore/testnet/data",
  "servicesConfig": {
    "insight-api": {
      "routePrefix": "api",
      "cwdRequirePath": "node_modules/insight-api"
    },
    "insight-ui": {
      "routePrefix": "",
      "apiPrefix": "api",
      "cwdRequirePath": "node_modules/insight-ui"
    }
  }
}
  1. Install both insight-ui and insight-api by running the following command
npm install --save insight-ui@5.0.0-beta.44 insight-api@5.0.0-beta.44
  1. Startup the node and start it syncing
./node_modules/bitcore-node/bin/bitcore-node start
  1. The blocks should start downloading. After it seems like all the blocks have been successfully downloaded, restart the server.
  2. Test to make sure that the UI works and that blocks are still being downloaded. Also test to make sure mempool transactions are being streamed in. If they are not, restart the server.

To restart the server try the following:

  1. Press ctrl+c
  2. If that does not stop it after a few seconds, press ctrl+\ to attempt a second gentle quit.

Litecoin

  1. Make sure you have Node v8.11.3 or later installed and accessable.

  2. Create a directory to store everything in

mkdir litecore-node
  1. Go into the created directory
cd litecore-node
  1. Install litecore-node by running the following command
npm install https://github.com/litecoin-project/litecore-node#v5.0
  1. Create a litecore node by running the following command. Please note that this command will likely fail. This is normal.
./node_modules/litecore-node/bin/litecore-node create livenet
  1. Go into the livenet directory that was just created.
cd livenet
  1. Install litecore-node (again) and litecore-lib manually by running the following command. This places them inside of the livenet/node_modules folder for use.
npm install --save npm install --save https://github.com/litecoin-project/litecore-node#v5.0 https://github.com/litecoin-project/litecore-lib#v5.0
  1. Edit the config file litecore-node.json to reflect your desired network, port, data save location, and route-prefix (if any). Make sure that you add insight-lite-api and insight-lite-ui to the services array, or it will not attempt to default load them.

Sample Config

{
  "version": "5.0.0-beta.41",
  "network": "testnet",
  "port": 3003,
  "services": [
    "address",
    "block",
    "db",
    "fee",
    "header",
    "mempool",
    "p2p",
    "timestamp",
    "transaction",
    "insight-lite-api",
    "insight-lite-ui",
    "web"
  ],
  "datadir": "/home/litec/litecore-node/testnet/data",
  "servicesConfig": {
    "insight-lite-api": {
      "routePrefix": "api",
      "cwdRequirePath": "node_modules/insight-lite-api"
    },
    "insight-lite-ui": {
      "routePrefix": "",
      "apiPrefix": "api",
      "cwdRequirePath": "node_modules/insight-lite-ui"
    }
  }
}
  1. Install both insight-lite-ui and insight-lite-api by running the following command
npm install --save https://github.com/litecoin-project/insight-lite-ui#v5.0 https://github.com/litecoin-project/insight-lite-api#v5.0
  1. Startup the node and start it syncing
./node_modules/litecore-node/bin/litecore-node start
  1. The blocks should start downloading. After it seems like all the blocks have been successfully downloaded, restart the server.
  2. Test to make sure that the UI works and that blocks are still being downloaded. Also test to make sure mempool transactions are being streamed in. If they are not, restart the server.

To restart the server try the following:

  1. Press ctrl+c
  2. If that does not stop it after a few seconds, press ctrl+\ to attempt a second gentle quit.

Having issues where you can't seem to get insight-lite-api and insight-lite-ui working? Try running the following install command inside of the testnet node folder.

npm install --save https://github.com/litecoin-project/litecore-node#v5.0 https://github.com/litecoin-project/litecore-lib#v5.0 https://github.com/litecoin-project/insight-lite-ui#v5.0 https://github.com/litecoin-project/insight-lite-api#v5.0

Flo

  1. Make sure you have Node v8.11.3 or later installed and accessable.

  2. Create a directory to store everything in

mkdir flocore
  1. Go into the created directory
cd flocore
  1. Install flocore by running the following command
npm install flocore
  1. Create a flocore node by running the following command.
./node_modules/flocore/bin/flocore create livenet
  1. Go into the livenet directory that was just created.
cd livenet
  1. Edit the config file flocore-node.json to reflect your desired network, port, data save location, and route-prefix (if any). Make sure that you add flosight-api and flosight-ui to the services array, or it will not attempt to default load them.

Sample Config

{
  "version": "5.0.0-beta.44",
  "network": "livenet",
  "port": 3001,
  "services": [
    "address",
    "block",
    "db", 
    "fee",   
    "header", 
    "mempool",
    "p2p",
    "timestamp",
    "transaction",
    "flosight-api",
    "flosight-ui",
    "web"
  ],
  "datadir": "/home/floc/flocore/livenet/data",
  "servicesConfig": {
    "flosight-api": {
      "routePrefix": "api",
      "cwdRequirePath": "node_modules/flosight-api"
    },
    "flosight-ui": {
      "routePrefix": "",
      "apiPrefix": "api",
      "cwdRequirePath": "node_modules/flosight-ui"
    }
  }
}
  1. Install both flosight-ui and flosight-api by running the following command
npm install --save flosight-ui flosight-api
  1. Startup the node and start it syncing
./node_modules/flocore-node/bin/flocore-node start
  1. The blocks should start downloading. After it seems like all the blocks have been successfully downloaded, restart the server.
  2. Test to make sure that the UI works and that blocks are still being downloaded. Also test to make sure mempool transactions are being streamed in. If they are not, restart the server.

To restart the server try the following:

  1. Press ctrl+c
  2. If that does not stop it after a few seconds, press ctrl+\ to attempt a second gentle quit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment