Post by Admin on Oct 31, 2023 9:59:07 GMT
Tutorial - Install a block explorer on Ubuntu Server 22.04
Install a block explorer on Ubuntu Server 22.04 with the following tutorial.
Update your Ubuntu server with the following command:
sudo apt-get update && sudo apt-get upgrade -y
Install the dependencies with the following command:
sudo apt-get install gnupg2 nodejs npm git nano cmake screen unzip -y
Import the MongoDB GPG key:
wget -nc www.mongodb.org/static/pgp/server-6.0.asc
cat server-6.0.asc | gpg --dearmor | sudo tee /etc/apt/keyrings/mongodb.gpg >/dev/null
Install the MongoDB repository with the following command:
sudo sh -c 'echo "deb [ arch=amd64,arm64 signed-by=/etc/apt/keyrings/mongodb.gpg] repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" >> /etc/apt/sources.list.d/mongo.list'
Update your Ubuntu server with the following command:
sudo apt-get update -y
Install MongoDB with the following command:
sudo apt install mongodb-org -y
Download the Linux daemon for your wallet with the following command:
wget "https://dl.walletbuilders.com/download?customer=27b6b4eca5049758c63bf10695972beb83f6e55cc0285f2ebb&filename=truefreedomcoin-daemon-linux.tar.gz" -O truefreedomcoin-daemon-linux.tar.gz
Extract the tar file with the following command:
tar -xzvf truefreedomcoin-daemon-linux.tar.gz
Download the Linux tools for your wallet with the following command:
wget "https://dl.walletbuilders.com/download?customer=27b6b4eca5049758c63bf10695972beb83f6e55cc0285f2ebb&filename=truefreedomcoin-qt-linux.tar.gz" -O truefreedomcoin-qt-linux.tar.gz
Extract the tar file with the following command:
tar -xzvf truefreedomcoin-qt-linux.tar.gz
Type the following command to install the daemon and tools for your wallet:
sudo mv truefreedomcoind truefreedomcoin-cli truefreedomcoin-tx /usr/bin/
Type the following command to open your home directory:
cd $HOME
Create the data directory for your coin with the following command:
mkdir $HOME/.truefreedomcoin
Open nano.
nano $HOME/.truefreedomcoin/truefreedomcoin.conf -t
Paste the following text into nano.
rpcuser=rpc_truefreedomcoin
rpcpassword=dR2oBQ3K1zYMZQtJFZeAerhWxaJ5Lqeq9J2
rpcbind=127.0.0.1
rpcallowip=127.0.0.1
listen=1
server=1
txindex=1
daemon=1
addnode=node2.walletbuilders.com
Save the file with the keyboard shortcut ctrl + x.
Type the following command to start your daemon:
truefreedomcoind
Type the following command to start MongoDB:
sudo systemctl start mongod
Type the following command to open MongoDB:
mongosh
Type the following command to create a MongoDB database named “explorerdb”:
use explorerdb
Type the following command to create a MongoDB user named “iquidus”:
db.createUser( { user: "iquidus", pwd: "414uq3EhKDNX76f7DZIMszvHrDMytCnzFevRgtAv", roles: [ "readWrite" ] } )
Type the following command to close MongoDB:
exit
Type the following command to clone iquidus-explorer:
git clone github.com/walletbuilders/explorer.git explorer
Type the following command to install iquidus-explorer:
cd explorer && npm install --production
Type the following command to create the file settings.json:
cp ./settings.json.template ./settings.json
Open nano.
nano settings.json -t
*****************
Configure Iquidis - IF YOU NEED HELP PLEASE CONTACT ME ON DISCORD OR TELEGRAM
*****************
nano settings.json
"title": "EXPLORER TITLE",
"address": "explorer link",
"coin": "NAME OF COIN",
"symbol": "coin ticker",
// wallet settings
"wallet": {
"host": "localhost",
"port": "your coin rpc port,
"user": "paisacoin4u",
"pass": "mylove4u"
// menu settings
"display": {
"markets": true, - Only supported if your coin is listed in bittrex or cryptopia
// index page (valid options for difficulty are POW, POS or Hybrid)
"index": {
"difficulty": "POW", (change it to the option suitable for your coin)
// ensure links on API page are valid
"api": {
"blockindex": 1, - basically any valid block number of your coin's blockchain
"blockhash": "xxxxxxxxxxxxxxxxx", - from your local wallet get block hash of any any valid block of your coin's blockchain,
"txhash": "xxxxxxxxxxxxxxxxx", - from your local wallet get txid of any any valid block of your coin's block chain,
"address": "xxxxxxxxxxxxxxxxxxxxxx" any valid address on your coin's network
},
// market settings
"coin": "xxx", add your coin's ticker
//genesis
"genesis_tx": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", update with your coin's genesis block details, "getblock 0 or showblock 0"
"genesis_block": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
Save the file with the keyboard shortcut ctrl + x.
Type the following command to open a screen session:
screen
Type the following commands to start your block explorer:
cd $HOME/explorer
npm start
sudo node scripts/sync.js index update
This action will start the process of extract data from the wallet and save it on the mongodb.
Press the keyboard shortcut ctrl + a + d to disconnect from your screen session.
Type the following command to open crontab:
crontab -e
Press the Page Down key on your keyboard PgDown.
Paste the following text into crontab.
@reboot truefreedomcoind
*/1 * * * * cd $HOME/explorer && /usr/bin/nodejs scripts/sync.js index update > /dev/null 2>&1
*/5 * * * * cd $HOME/explorer && /usr/bin/nodejs scripts/peers.js > /dev/null 2>&1
Save the crontab with the keyboard shortcut ctrl + x
Confirm that you want to save the crontab with the keyboard shortcut y + enter
The block explorer is accessible on