Jump to content

How to Basic Block Explorer


buzzkillb
 Share

Recommended Posts

How to setup a basic block explorer on Denarius.  Using ciquidus because it shows an extra masternode thingy.

image.thumb.png.47564312f7f8b002e8d1d86ed2310478.png

Mostly RIP'd from Biblepay explorer setup
https://www.reddit.com/r/BiblePay/comments/7elm7r/iquidus_block_explorer_guide/

#explorer we are using
https://github.com/iquidus/explorer

#edit denarius.conf

nano denarius.conf
rpcuser=XXXX
rpcpassword=XXXX
daemon=1
listen=1
server=1
daemon=1
txindex=1

#install mongodb 4.2 ubuntu 16.04, reference for 18.04
reference: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/

wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
sudo apt-get update
sudo apt-get install -y mongodb-org
sudo service mongod start

cd /var/log/mongodb
tail mongod.log
# [initandlisten] waiting for connections on port <port>
# Port 27017 by default


#setup mongodb

mongo
use explorerdb
db.createUser( { user: "iquidus", pwd: "3xp!0reR", roles: [ "readWrite" ] } )
exit

#install nodejs

sudo apt-get update
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs


#install ciquidus block explorer

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

# gyp build errors
# https://github.com/nodejs/node-gyp/issues/809

sudo apt-get install libkrb5-dev
cd explorer && npm install --production

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


#start explorer

cd ~/explorer
npm start

#start syncing explorer to blockchain
#open 2nd putty

cd ~/explorer
node scripts/sync.js index update

#Binding a Node.js App to Port 80 with Nginx
https://eladnava.com/binding-nodejs-port-80-using-nginx/

  • Like 1
Link to comment
Share on other sites

READ POST BELOW FOR LATEST Iquidus 1.7.3 settings.json

keeping the original ciquidus settings.json here for archive reasons.

#exchange id's

cryptopia id 5265
coinexchange id 371

#sample settings.json

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

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

  "address": "https://denarius.pro",

  // coin name
  "coin": "Denarius",

  // coin symbol
  "symbol": "D",

  // logo
  "logo": "/images/denarius.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": "Slate",

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

  // database settings (MongoDB)
  "dbsettings": {
    "user": "CHANGEMECHANGEMECHANGEME",
    "password": "CHANGEMECHANGEMECHANGEME",
    "database": "explorerdb",
    "address": "localhost",
    "port": 27017
  },

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

  // wallet settings
  "wallet": {
    "host": "localhost",
    "port": 32369,
    "user": "denariusrpc",
    "pass": "CHANGEMECHANGEMECHANGEME"
  },

  // confirmations
  "confirmations": 10,

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

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

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

  // ensure links on API page are valid
  "api": {
    "blockindex": 1337,
    "blockhash": "000000000661c86bf89e652eb142093bd9123006f3085595dee183bfe1c24570",
    "txhash": "000000000661c86bf89e652eb142093bd9123006f3085595dee183bfe1c24570",
    "address": "DABQj7yoQuvfxVVWMf2mqWhoHLDMUqUJsc"
  },

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

  // 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, bitcointalk, github, slack, website
  "twitter": "denariuscoin",
  "facebook": "yourfacebookpage",
  "googleplus": "yourgooglepluspage",
  "bitcointalk": "yourbitcointalktopicvalue",
  "github": "yourgithubusername/yourgithubrepo",
  "slack": "yourfullslackinviteurl",
  "website": "yourfullwebsiteurl",

  //genesis
  "genesis_tx": "c6d8e8f56c25cac33567e571a3497bfc97f715140fcfe16d971333b38e4ee0f2",
  "genesis_block": "00000d5dbbda01621cfc16bbc1f9bf3264d641a5dbf0de89fd0182c2c4828fcd ",

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

  //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": "GETINFO",

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

  // 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 : "CGTta3M4t3yXu8uRgkKvaWd2d8DQvDPnpL": {"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": {
  //  "CLkWg5YSLod772uLzsFRxHgHiWVGAJSezm": {"label": "Donation Address", "type":"primary", "url":"http://example.com"},
  "DNRXXXXXXXXXXXXXXXXXXXXXXXXXZeeDTw": {"label": "Burn Addy"}
  }
}

 

Link to comment
Share on other sites

  • 11 months later...

For latest 1.7.3 release

recompile daemon putting a // in front of this line

https://github.com/carsenk/denarius/blob/master/src/rpcrawtransaction.cpp#L115

Error reading "last" property during reindex reference: https://github.com/iquidus/explorer/issues/335

Change to amount of CPU's and test sync

  "block_parallel_tasks": 4,

sample 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": "Denarius",

  // coin symbol
  "symbol": "D",

  // 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": "Cyborg",

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

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

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

  // wallet settings
  "use_rpc": true,

  "wallet": {
    "host": "localhost",
    "port": 32369,
    "username": "denarius",
    "password": "password"
  },

  // confirmations
  "confirmations": 10,

  // 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
  },

  // index page (valid options for difficulty are POW, POS or Hybrid)
  "index": {
    "show_hashrate": true,
    // Show Market Cap in header
    "show_market_cap": false,
    // Show Market Cap in place of price box
    "show_market_cap_over_price": false,
    "difficulty": "Hybrid",
    "last_txs": 100,
    "txs_per_page": 10
  },

  // ensure links on API page are valid
  "api": {
    "blockindex": 1337,
    "blockhash": "000000000661c86bf89e652eb142093bd9123006f3085595dee183bfe1c24570",
    "txhash": "000000000661c86bf89e652eb142093bd9123006f3085595dee183bfe1c24570",
    "address": "DABQj7yoQuvfxVVWMf2mqWhoHLDMUqUJsc"
  },

  // 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": "D",
    "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": "iquidus",
  "facebook": "yourfacebookpage",
  "googleplus": "yourgooglepluspage",
  "youtube": "youryoutubechannel",

  //genesis
  "genesis_tx": "c6d8e8f56c25cac33567e571a3497bfc97f715140fcfe16d971333b38e4ee0f2",
  "genesis_block": "00000d5dbbda01621cfc16bbc1f9bf3264d641a5dbf0de89fd0182c2c4828fcd",

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

  //disable saving blocks & TXs via API during indexing.
  "lock_during_index": false,

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

  //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": "GETINFO",

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

  // 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": {
  "DDD6SzCwXSEcTPHmNwEQX6xbUs2Rf3svNX": {"label": "Cryptopia", "type":"primary", "url":"http://disney.com"},
  //  "JSWVXHWeYNknPdG9uDrcBoZHztKMFCsndw": {"label": "Cryptsy"}
  }
}

 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

I give up trying to run some fancy cronjob to indexing. Setup screen

screen -S index

in screen make a new file called index.sh in your explorer directory and throw this in

#!/bin/bash
while true; do
rm tmp/index.pid
node scripts/sync.js index update
sleep 15
done

then make it executable

chmod +x index.sh

run this forever

./index.sh

then to leave this screen session but keep it running

ctrl a+d

to come back in list your screens

screen -ls

then reattach the screen

screen -r somenumber.name

e-z, and could throw in the peer and market updating in above, but cronjob seems okay for those.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...