This guide explains how to initialize the PostgreSQL database for the Bitmark Explorer and Indexer.
Open the bootstrap file and change the default password:
nano bitmark-bootstrap.psql
Replace:
CREATE ROLE bitmark LOGIN PASSWORD 'CHANGE_ME_STRONG_PASSWORD'
With a strong password:
CREATE ROLE bitmark LOGIN PASSWORD 'StrongPassword123!'
sudo -u postgres psql -f bitmark-bootstrap.psql
If successful, you will see confirmation output.
sudo -u postgres psql
Then inside PostgreSQL:
\l
\c bitmark
\dt bitmark.*
You should see:
psql 'postgres://bitmark:StrongPassword123!@127.0.0.1:5432/bitmark?sslmode=disable'
nano /home/coins/indexer.env.sh
Add:
export PG_DSN="postgres://bitmark:StrongPassword123!@127.0.0.1:5432/bitmark?sslmode=disable"
Reload:
source ~/indexer.env.sh
echo $PG_DSN
bitmark-indexer
It should begin ingesting blocks.
bitmark-explorer-hp-generator
You should see:
Generating initial homepage...
Waiting for new block...
SELECT COUNT(*) FROM bitmark.blocks;
SELECT height, hash FROM bitmark.blocks ORDER BY height DESC LIMIT 5;
sudo -u postgres psql
DROP DATABASE bitmark;
DROP ROLE bitmark;
Then re-run the bootstrap script.
Bitmark Explorer Infrastructure Documentation