TUTORIAL - HOW TO SETUP & RUN PUBLIC-POOL

For PRIVATE or PUBLIC use.

This guide focuses on Debian / Ubuntu, but you can install on any Linux Distro.

Check here for more information: https://github.com/benjamin-wilson/public-pool


BUILDING:

Dependencies:

sudo apt install git -y
sudo curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - && sudo apt install nodejs -y
sudo npm install npm@latest -g
sudo npm install pm2@latest -g

Clone official repo:

git clone https://github.com/benjamin-wilson/public-pool.git

Build:

cd public-pool
npm install

Edit .env

nano .env

Remove everything & add:

# bitcoin node
BITCOIN_RPC_URL=http://yourbitcoinnodeip

BITCOIN_RPC_USER=your_rpc_admin_username
BITCOIN_RPC_PASSWORD=your_rpc_node_password
BITCOIN_RPC_PORT=8332
BITCOIN_RPC_TIMEOUT=10000

# Enable in bitcoin.conf with
# zmqpubrawblock=tcp://*:3000
# BITCOIN_ZMQ_HOST="tcp://192.168.1.100:3000"

API_PORT=your_desired_pool_api_port(4321)
STRATUM_PORT=your_desired_pool_port(3333)

#optional telegram bot
#TELEGRAM_BOT_TOKEN=

#optional discord bot
#DISCORD_BOT_CLIENTID=
#DISCORD_BOT_GUILD_ID=
#DISCORD_BOT_CHANNEL_ID=

#optional
DEV_FEE_ADDRESS=your_bitcoin_address_for_pool_fees
# mainnet | testnet
NETWORK=mainnet

API_SECURE=false

ENABLE_SOLO=true

#optional (pool will act as a proxy)
ENABLE_PROXY=false
PROXY_PORT=3333

BRAIINS_ACCESS_TOKEN=

Production build:

npm run build

RUNNING:

Start the pool:

npm run start

or start as cluster in background with PM2:

pm2 start dist/main.js -i 2

Where 2 is the number of instances

Point your miner now to yourpoolipaddress:3333


Congratulations, your public-pool is now ready to use.