updated May 08, 2019,15:30 am

applies to ALL
branch v0.12+

Use the following tutorial to setup a block explorer.

Make sure that you have the following requirement.

– A server or VPS with Ubuntu Server 18.04 installed

Update your Ubuntu machine.

sudo apt-get update
sudo apt-get upgrade

Install the required dependencies.

sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils python3 libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libboost-all-dev libboost-program-options-dev
sudo apt-get install libminiupnpc-dev libzmq3-dev libprotobuf-dev protobuf-compiler unzip software-properties-common mongodb nodejs npm git nano screen

Install Berkeley DB.

sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev

Go to your home directory.

cd $HOME

Note: replace “examplecoin” with the name of your coin.
Note: replace “6gs39011kick8xmqutpkrvi92xx5kwev4ykanlv1ls0ouuae5x” with the coinID of your coin.

Download the daemon and tools from MyCoin. (Available for a paid coin)

wget "https://dl.**.com/download?customer=6gs39011kick8xmqutpkrvi92xx5kwev4ykanlv1ls0ouuae5x&filename=examplecoin-daemon-linux.tar.gz" -O examplecoin-daemon-linux.tar.gz
wget "https://dl.**.com/download?customer=6gs39011kick8xmqutpkrvi92xx5kwev4ykanlv1ls0ouuae5x&filename=examplecoin-qt-linux.tar.gz" -O examplecoin-qt-linux.tar.gz

Extract the tar files.

tar -xzvf examplecoin-daemon-linux.tar.gz
tar -xzvf examplecoin-qt-linux.tar.gz

Install the daemon and tools.

sudo mv examplecoind examplecoin-cli examplecoin-tx /usr/bin/

Create the config file.

mkdir $HOME/.examplecoin
nano $HOME/.examplecoin/examplecoin.conf

Paste the following lines in examplecoin.conf.

rpcuser=rpc_examplecoin
rpcpassword=CNsahKWiZpMzFxdvb9R7vKuAvYWRXqr24EfCkdjz
rpcallowip=127.0.0.1
listen=1
server=1
txindex=1
daemon=1

Start your daemon with the following command.

examplecoind

Open mongodb.

mongo

Create the database “explorerdb”.

use explorerdb

Note: replace the value “414uq3EhKDNX76f7DZIMszvHrDMytCnzFevRgtAv” with a unique password.

Create the database user.

db.createUser( { user: "iquidus", pwd: "414uq3EhKDNX76f7DZIMszvHrDMytCnzFevRgtAv", roles: [ "readWrite" ] } )

Close mongodb.

exit

Go to your home directory.

cd $HOME

Download iquidus explorer.

git clone https://github.com/iquidus/explorer explorer

Install iquidus explorer.

cd explorer && npm install --production

Create the settings file.

cp ./settings.json.template ./settings.json

Open the settings file.

nano settings.json

Change the marked values.

title – Change the value “IQUIDUS” with the name of your coin.

address – Change the value “127.0.0.1” with the IP address of your server.

coin – Change the value “Darkcoin” with the name of your coin.

symbol – Change the value “DRK” with the abbreviation of your coin.

password – Change the value “3xp!0reR” with the mongodb password.

user – Change the value “darkcoinrpc” with the RPC username of your coin.

pass – Change the value “123gfjk3R3pCCVjHtbRde2s5kzdf233sa” with the RPC password of your coin.

api – Change the value “true” to “false”.

markets – Change the value “true” to “false”.

twitter – Change the value “true” to “false”.

confirmations – Change the value “40” with the transaction confirmations of your coin.

Original settings.json.


/*
  This file must be valid JSON. But comments are allowed

  Please edit settings.json, not settings.json.template
*/
{
  // name your instance!
  "title": "IQUIDUS",

  "address": "127.0.0.1:3001",

  // coin name
  "coin": "Darkcoin",

  // coin symbol
  "symbol": "DRK",

...

  // database settings (MongoDB)
  "dbsettings": {
    "user": "iquidus",
    "password": "3xp!0reR",
    "database": "explorerdb",
    "address": "localhost",
    "port": 27017
  },

  //update script settings
  "update_timeout": 10,
  "check_timeout": 250,

  // wallet settings
  "wallet": {
    "host": "localhost",
    "port": 9332,
    "user": "darkcoinrpc",
    "pass": "123gfjk3R3pCCVjHtbRde2s5kzdf233sa"
  },

  // confirmations
  "confirmations": 40,

  // language settings
  "locale": "locale/en.json",

  // menu settings
  "display": {
    "api": true,
    "markets": true,
    "richlist": true,
    "twitter": true,
    "facebook": false,
    "googleplus": false,
    "youtube": false,
    "search": true,
    "movement": true,
    "network": true
  },

Example settings.json.


/*
  This file must be valid JSON. But comments are allowed

  Please edit settings.json, not settings.json.template
*/
{
// name your instance!
  "title": "Florijncoin",

  "address": "198.51.100.1:3001",

// coin name
  "coin": "Florijncoin",

// coin symbol
  "symbol": "FLRN",

// logo
  "logo": "/images/logo.png",

// favicon
  "favicon": "public/favicon.ico",

// Uses bootswatch themes (http://bootswatch.com/)
// Valid options:
//     Cerulean, Cosmo, Cyborg, Darkly, Flatly, Journal, Lumen, Paper,
//     Readable, Sandstone, Simplex, Slate, Spacelab, Superhero, United, Yeti
// theme (see /public/themes for available themes)
  "theme": "Spacelab",

// port to listen for requests on.
  "port" : 3001,

// database settings (MongoDB)
  "dbsettings": {
    "user": "iquidus",
    "password": "3xp!0reR",
    "database": "explorerdb",
    "address": "localhost",
    "port": 27017
  },

//update script settings
  "update_timeout": 10,
  "check_timeout": 250,

// wallet settings
  "wallet": {
    "host": "localhost",
    "port":  8349,
    "user": "rpc_florijncoin",
    "pass": "3xp!0reR"
  },

// confirmations
  "confirmations": 6,

// language settings
  "locale": "locale/en.json",

// menu settings
  "display": {
    "api": false,
    "markets": false,
    "richlist": true,
    "twitter": true,
    "facebook": true,
    "googleplus": false,
    "youtube": false,
    "search": true,
    "movement": true,
    "network": true
  },

// index page (valid options for difficulty are POW, POS or Hybrid)
  "index": {
    "show_hashrate": true,
    "difficulty": "POW",
    "last_txs": 100
  },

// ensure links on API page are valid
  "api": {
    "blockindex": 1337,
    "blockhash": "1733320247b15ca2262be646397d1ffd6be953fa638ebb8f5dcbb4c2b91b34f1",
    "txhash": "f270cd3813254c9922a2e222a56ba745842d9112223a1394062e460b33d27b7e",
    "address": "RBiXWscC63Jdn1GfDtRj8hgv4Q6Zppvpwb"
  },

// market settings
//supported markets: bittrex, poloniex, yobit, empoex, bleutrade, cryptopia, ccex
//default market is loaded by default and determines last price in header
  "markets": {
    "coin": "JBS",
    "exchange": "BTC",
    "enabled": ["bittrex"],
    "cryptopia_id": "1658",
    "ccex_key" : "Get-Your-Own-Key",
    "default": "bittrex"
  },

// richlist/top100 settings
  "richlist": {
    "distribution": true,
    "received": true,
    "balance": true
  },
// movement page settings
// min amount: show transactions greater than this value
// low flag: greater than this value flagged yellow
// high flag: greater than this value flagged red
  "movement": {
    "min_amount": 100,
    "low_flag": 1000,
    "high_flag": 5000
  },

// twitter, facebook, googleplus, youtube
  "twitter": "FlorijnCoin",
  "facebook": "Florijncoin",
  "googleplus": "yourgooglepluspage",
  "youtube": "Florijncoin",

//genesis
  "genesis_tx": "74b8d9e2e89767702c6edb90e2b87ad765bff9e7335291804ca627ce032aa593",
  "genesis_block": "b2926a56ca64e0cd2430347e383f63ad7092f406088b9b86d6d68c2a34baef51",

//heavy (enable/disable additional heavy features)
  "heavy": true,

//amount of txs to index per address (stores latest n txs)
  "txcount": 100,

//show total sent & received on address page (set false if PoS)
  "show_sent_received": true,

// how to calculate current coin supply
// COINBASE : total sent from coinbase (PoW)
// GETINFO : retreive from getinfo api call (PoS)
// HEAVY: retreive from heavys getsupply api call
// BALANCES : total of all address balances
// TXOUTSET : retreive from gettxoutsetinfo api call
  "supply": "HEAVY",

// how to acquire network hashrate
// getnetworkhashps: uses getnetworkhashps api call, returns in GH/s
// netmhashps: uses getmininginfo.netmhashpsm returns in MH/s
  "nethash": "getnetworkhashps",

// nethash unitd: sets nethash API return units
// valid options: "P" (PH/s), "T" (TH/s), "G" (GH/s), "M" (MH/s), "K" (KH/s)
  "nethash_units": "G",

// Address labels
// example : "JhbrvAmM7kNpwA6wD5KoAsbtikLWWMNPcM": {"label": "This is a burn address", "type":"danger", "url":"http://example.com"}
// label (required) = test to display
// type (optional) = class of label, valid types: default, primary, warning, danger, success
// url (optional) = url to link to for more information
  "labels": {
//  "JSoEdU717hvz8KQVq2HfcqV9A79Wihzusu": {"label": "Developers address", "type":"primary", "url":"http://example.com"},
//  "JSWVXHWeYNknPdG9uDrcBoZHztKMFCsndw": {"label": "Cryptsy"}
}

Save the settings file.

———-optional———-

Replace the default logo with your own logo.

Note: The file must be a PNG file with a width and height of 128 px.

Overwrite the file “logo.png” inside the path “explorer/public/images/”.

Replace the default favicon with your own favicon.

Note 1: The file must be an ICO file with a width and height of 16 px.
Note 2: You can convert your PNG file to an ICO file on Online ICO converter.

Overwrite the file “favicon.ico” inside the path “explorer/public/”.

———-optional———-

Get the path to your block explorer.

cd $HOME/explorer
pwd

Example output

/root/explorer

Open crontab

crontab -e

Change the path “/root/explorer” with the path to your block explorer.

Paste the following lines to the bottom of the crontab.

*/1 * * * * cd /root/explorer && /usr/bin/nodejs scripts/sync.js index update > /dev/null 2>&1
*/5 * * * * cd /root/explorer && /usr/bin/nodejs scripts/peers.js > /dev/null 2>&1

Save the crontab.

A screen session will remain open when the SSH connection is disconnected.
You can disconnect from a screen session using the keyboard combination ctrl + a + d.

Start a screen session.

screen

Start your block explorer.

cd $HOME/explorer
npm start

You can access the block explorer on the IP of your server on port 3001.

E.G. http://198.51.100.1:3001