Setting up a PacketCrypt Pool
Deploy a fully‑functional PacketCrypt mining pool on Ubuntu 18.04/20.04 LTS – machine roles, services, installation, configuration and running instructions.
Setting up a pool is a highly technical and difficult process, This article was generated from previous sources, It may or may not be functional and or accurate.
Expectations & Machine Roles
Before you begin you should have:
- General Linux knowledge
- Git basics
- Networking fundamentals
- Blockchain concepts
- At least 6 Ubuntu machines (18.04 or 20.04 LTS)
Roles per machine (you can stack them if you like – just watch ports):
| Machine | Role(s) |
|---|---|
| 1 | PKT node |
| 2 | Master, Paymaker & Block Handler |
| 3‑4 | Ann Handlers |
| 5‑6 | Block Miners |
As of June 2022 the network difficulty is high – a dozen or more miners with 768 GB RAM is recommended for serious production.
Block Mining & Running a Pool
Pool operator must provide the following services:
- pktd node – One (or more) pktd instance(s) are needed for the Master.
- Master – Coordinates work and distributes configuration.
- Ann Handler(s) – Accept announcements from miners and hand them to block miners.
- Block Miner(s) – Download announcements and mine blocks.
- Block Handler(s) – Validate and submit block shares.
- Paymaker – Keeps track of shares and sends payouts via the Master.
General Information
Repository Information
| Repository | Tools |
|---|---|
| packetcrypt_rs | AnnHandler, BlkMiner, AnnMiner |
| PacketCrypt | Master, Paymaker, BlkHandler |
| pktd | pktd |
Assumed Network Ranges
Public: 198.51.100.0/24 Private: 10.0.16.0/24
| Machine | Public IP | Private IP |
|---|---|---|
| 1 | 198.51.100.1 | 10.0.16.1 |
| 2 | 198.51.100.2 | 10.0.16.2 |
| 3 | 198.51.100.3 | 10.0.16.3 |
| 4 | 198.51.100.4 | 10.0.16.4 |
| 5 | – | 10.0.16.5 |
| 6 | – | 10.0.16.6 |
Assumed Port Ranges
| Service | Machine | Port / Range |
|---|---|---|
| Master | Machine 2 | 8080 |
| Paymaker | Machine 2 | 8081 |
| Block Handlers | Machine 2 | 8100‑8200 |
| Ann Handlers | Machines 3 & 4 | 80 |
Installation
Machine 1 – PKTD node
Requires ≥ 150 GB NVMe (250 GB recommended).
- Install Go
sudo add-apt-repository ppa:longsleep/golang-backports sudo apt update sudo apt install golang-go
- Install Git
sudo apt install git
- Clone & build pktd (develop branch)
git clone --branch develop https://github.com/pkt-cash/pktd cd pktd ./do
Output should include “Everything looks good – use ./bin/pktd to launch”.
Machine 2 – Master, Paymaker & Block Handler
- Install prerequisites (npm, node, etc.) – see snippet below.
- Clone PacketCrypt master (master branch) and build:
git clone --branch master https://github.com/cjdelisle/PacketCrypt cd PacketCrypt npm install
Machine 3‑6 – AnnHandler / Block Miner / AnnMiner
- Install git, gcc, curl and Rust:
sudo apt install gcc git curl curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- Clone packetcrypt_rs (develop branch) and build:
git clone --branch develop https://github.com/cjdelisle/packetcrypt_rs cd packetcrypt_rs ~/.cargo/bin/cargo build --release --features jemalloc
Configuration – pool.example.js
config.privateSeed
Keep it `null` unless you know what you’re doing – signing announcements is rarely used and can break multi‑pool mining.
config.privateSeed = null
config.paymakerHttpPasswd
Random and fire‑walled. Used as the password in HTTP basic auth.
config.paymakerHttpPasswd = 'anyone with this password can post results to the paymaker';
config.masterUrl
Used by the Paymaker and Block Handlers to locate the Master.
config.masterUrl = 'http://localhost:8080';
config.rpc
user: 'x', pass: 'x',
config.annHandlers
List each AnnHandler with its own port – no overlap with BlkMiner ports.
[ann_handler.ah0] url: 'http://10.0.16.3:8081' [ann_handler.ah1] url: 'http://10.0.16.4:8081'
config.blkHandlers
[blk_handler.blk0] url: 'http://localhost:8100' port: 8082 host: '::' maxConnections: 50
config.master
port: 8080, host: '::', annMinWork: Util.annWorkToTarget(128), shareWorkDivisor: 4, annVersions: [1], mineOldAnns: 0
config.payMaker
url: 'pool.pktpool.io', port: 8081, host: '::', updateCycle: 120, historyDepth: 60 * 60 * 24 * 30, maxConnections: 200, blockPayoutFraction: 0.5, poolFee: 0.40, poolFeeAddress: "pkt1qyc9dkhca7uc84zn3vlgd0h0fxr3twwn34qgeqe", pplnsAnnConstantX: 0.125, pplnsBlkConstantX: 2, defaultAddress: "pkt1q6hqsqhqdgqfd8t3xwgceulu7k9d9w5t2amath0qxyfjlvl3s3u4sjza2g2", errorAddress: "pkt1q6hqsqhqdgqfd8t3xwgceulu7k9d9w5t2amath0qxyfjlvl3s3u4sjza2g2"
Configuration – pool.example.toml
Edit the example file and then run the command below to create the real config.
~/packetcrypt_rs/pool.example.toml ~/packetcrypt_rs/pool.toml
In the TOML file you’ll set the paymaker password and master URL – they match the values in `pool.js`.
paymaker_http_password = "secret" master_url = "http://pool.pktpool.io"
Running the Pool Manually
Machine 1 – PKTD
Make sure the node has synced to current height before launching mining.
./pktd/bin/pktd --rpcuser=XXX --rpcpass=XXX --miningaddr <your PKT wallet address>
Machine 2 – Master, Paymaker & Block Handlers
node ./pool.js --master node ./pool.js --payMaker node ./pool.js --blk0 # first BlkHandler node ./pool.js --blk1 # second BlkHandler
Machine 3‑4 – Ann Handlers
./target/release/packetcrypt ah --config /path/to/pool.toml ah0 ./target/release/packetcrypt ah --config /path/to/pool.toml ah1
Machine 5‑6 – Block Miners
./target/release/packetcrypt blk--paymentaddr --threads 80 --memorysizemb 665000 --handlerpass NoOneStealsMyAnns --subscribe 10.0.16.3:6666 --bind 0.0.0.0:6667 --mcast 239.0.1.1
NGINX Reverse‑Proxy (External AnnMining)
Install Nginx and create a simple reverse‑proxy for the Master and Paymaker.
sudo apt update sudo apt install nginx unlink /etc/nginx/sites-enabled/default cd /etc/nginx/sites-available sudo vim reverse-proxy.conf # Paste the config below
server {
listen 80;
listen [::]:80;
server_name ;
location / {
proxy_pass http://localhost:8080/;
}
}
server {
listen 80;
listen [::]:80;
server_name paymaker.pktpool.io;
location / {
proxy_pass http://localhost:8081/;
}
}
ln -s /etc/nginx/sites-available/reverse-proxy.conf /etc/nginx/sites-enabled/reverse-proxy.conf rm -f /etc/nginx/sites-enabled/default sudo nginx -t sudo systemctl reload nginx