DeanSparrow / PIVX-BlockExplorer

GNU Affero General Public License v3.0
0 stars 10 forks source link

PIVX Block Explorer

Customized version of TREZOR block indexer: https://github.com/trezor/blockbook

Tested on Ubuntu 18, these instructions are for a manual or ad-hoc build.

INSTALL THESE PACKAGES

sudo apt-get update
sudo apt-get install -y build-essential software-properties-common lz4 zstd libsnappy-dev libbz2-dev libzmq3-dev golang librocksdb-dev liblz4-dev libjemalloc-dev libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev libzstd-dev

FOR CHARTS TO WORK YOU WILL NEED TO INSTALL

sudo apt-get install -y python3-pip
pip install bitcoinrpc python-bitcoinrpc

CREATE THE DIRECTORIES

mkdir go

CREATE THE GO PATH

GOPATH=/home/<USER>/go   #CHANGE <USER> to your user name
cd go && mkdir src && cd src
git clone https://github.com/PIVX-Project/PIVX-BlockExplorer blockbook
cd blockbook

Edit build/blockchaincfg.json or build/tnblockchaincfg.json adding wallet info

go mod init
go mod tidy
go build

YOU WILL GET AN ERROR MESSAGE...THATS OK

RUN THESE SCRIPTS

./build.sh

SETUP NGINX and SSL certs

UNCOMMENT line for MAINNET or TESTNET

./launch.sh

Edit the following 2 python scripts with your RPC credentials

contrib/scripts/charts/updateCharts_blocks.py
contrib/scripts/charts/updateCharts_github.py

make sure you update config in updateCharts_blocks.py matching your pivxd credentials

run these every hour in a cron (crontab -e)

@hourly python3 /<full/path/to>/updateCharts_blocks.py
@hourly python3 /<full/path/to>/updateCharts_github.py

Out of memory when doing initial synchronization

How to reduce memory footprint of the initial sync: