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:

Roles per machine (you can stack them if you like – just watch ports):

MachineRole(s)
1PKT node
2Master, Paymaker & Block Handler
3‑4Ann Handlers
5‑6Block 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:

General Information

Repository Information

RepositoryTools
packetcrypt_rsAnnHandler, BlkMiner, AnnMiner
PacketCryptMaster, Paymaker, BlkHandler
pktdpktd

Assumed Network Ranges

Public: 198.51.100.0/24  Private: 10.0.16.0/24

MachinePublic IPPrivate IP
1198.51.100.110.0.16.1
2198.51.100.210.0.16.2
3198.51.100.310.0.16.3
4198.51.100.410.0.16.4
510.0.16.5
610.0.16.6

Assumed Port Ranges

ServiceMachinePort / Range
MasterMachine 28080
PaymakerMachine 28081
Block HandlersMachine 28100‑8200
Ann HandlersMachines 3 & 480

Installation

Machine 1 – PKTD node

Requires ≥ 150 GB NVMe (250 GB recommended).

  1. Install Go
    sudo add-apt-repository ppa:longsleep/golang-backports
    sudo apt update
    sudo apt install golang-go
  2. Install Git
    sudo apt install git
  3. 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

  1. Install prerequisites (npm, node, etc.) – see snippet below.
  2. 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

  1. Install git, gcc, curl and Rust:
    sudo apt install gcc git curl
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  2. 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