Knotsday

Troubleshooting & Advanced

Field Repairs

AI-Assisted Troubleshooting

The fastest way to diagnose and fix issues is to use Claude Code — an AI agent that can read your system state, run diagnostics, and apply fixes directly. It can use the Knotsday skill file to understand your setup.

1

Install Claude Code

# Install via npm (requires Node.js 18+)
npm install -g @anthropic-ai/claude-code

# Or if you don't have Node.js:
sudo apt-get install -y nodejs npm
npm install -g @anthropic-ai/claude-code

You will need an Anthropic API key. Get one at console.anthropic.com, then set it:

export ANTHROPIC_API_KEY="your-api-key-here"
2

Download the Knotsday skill file

# Download the skill file to your project
mkdir -p ~/.claude
wget -O ~/.claude/SKILL.md https://knotsday.com/SKILL.md

This file teaches Claude Code how Bitcoin Knots, ckpool, and Bitaxe work together. It knows the correct configuration, common errors, and how to fix them.

3

Run Claude Code

# Start Claude Code in your home directory
cd ~
claude

Then tell it what is wrong. Examples:

# Example prompts:
"My Bitcoin Knots node won't start, check the debug log"
"My Bitaxe can't connect to ckpool"
"Set up my node from scratch following the Knotsday guide"
"Check if my drive is ext4 and migrate if needed"
"My node shows 'Failed to read block' errors"
"Configure my Bitaxe at 192.168.1.50 to point to my node"

Claude Code can read log files, check system state, run diagnostic commands, edit configuration, and restart services. It will ask for confirmation before making changes.

Diagnostic Commands

Run these commands to gather information about your setup. Copy the output and share it with Claude Code or use it to identify issues.

Full system diagnostic

#!/bin/bash
# Knotsday diagnostic script - run and share the output

echo "=== Bitcoin Knots ==="
bitcoind --version 2>/dev/null | head -1 || echo "NOT INSTALLED"

echo ""
echo "=== Node Status ==="
bitcoin-cli getblockchaininfo 2>&1 | head -10 || echo "NODE NOT RUNNING"

echo ""
echo "=== Peer Connections ==="
bitcoin-cli getconnectioncount 2>&1 || echo "CANNOT CONNECT"

echo ""
echo "=== Drive Filesystem ==="
df -Th /media/$USER/bitcoin 2>/dev/null || \
  df -Th $(grep datadir ~/.bitcoin/bitcoin.conf 2>/dev/null | cut -d= -f2) 2>/dev/null || \
  echo "DATADIR NOT FOUND"

echo ""
echo "=== ckpool ==="
systemctl --user status ckpool 2>&1 | head -5 || echo "NOT A SERVICE"
pgrep -a ckpool || echo "NOT RUNNING"

echo ""
echo "=== Recent Errors ==="
DATADIR=$(grep datadir ~/.bitcoin/bitcoin.conf 2>/dev/null | cut -d= -f2)
if [ -f "$DATADIR/debug.log" ]; then
  grep -i "error\|fatal\|failed" "$DATADIR/debug.log" | tail -10
else
  echo "NO DEBUG LOG FOUND"
fi

echo ""
echo "=== Disk Space ==="
df -h / /media/$USER/bitcoin 2>/dev/null

echo ""
echo "=== Network Interfaces ==="
ip addr show | grep "inet " | grep -v 127.0.0.1

Save and run the diagnostic

wget -O /tmp/knotsday-diag.sh https://knotsday.com/scripts/diagnose.sh
chmod +x /tmp/knotsday-diag.sh
/tmp/knotsday-diag.sh

Common Issues

Node won't start

Check the debug log

# Find your datadir
grep datadir ~/.bitcoin/bitcoin.conf

# Read the last 50 lines of the debug log
tail -50 /path/to/datadir/debug.log

Common causes:

"Failed to read block" errors

Diagnose block file corruption

# Count zero-byte block files
DATADIR=$(grep datadir ~/.bitcoin/bitcoin.conf | cut -d= -f2)
echo "Zero-byte block files:"
find "$DATADIR/blocks/" -name "blk*.dat" -size 0 | wc -l

echo "Total block files:"
find "$DATADIR/blocks/" -name "blk*.dat" | wc -l

echo "Filesystem type:"
df -Th "$DATADIR" | tail -1 | awk '{print $2}'

If you see zero-byte files and the filesystem is exFAT or NTFS, you need to migrate to ext4. See the migration script.

If the filesystem is already ext4, a simple reindex will re-download the missing blocks:

bitcoin-qt -reindex &

Do not use exFAT for blockchain storage. exFAT has no journaling. A crash or power loss during writes can silently zero out block files with no way to recover. Always use ext4.

Sync is extremely slow

Diagnose sync performance

# Check current sync progress
bitcoin-cli getblockchaininfo | grep -E "blocks|headers|verificationprogress"

# Check disk I/O (high iowait = disk bottleneck)
iostat -x 1 5

# Check if dbcache is set high enough
grep dbcache ~/.bitcoin/bitcoin.conf

# Check available RAM
free -h

# Check disk type (SSD vs HDD)
lsblk -d -o NAME,ROTA,SIZE,MODEL
# ROTA=0 means SSD (good), ROTA=1 means HDD (slow)

Fixes:

ckpool won't connect to node

Debug ckpool connection

# Check if ckpool is running
systemctl --user status ckpool

# Check ckpool logs
tail -20 ~/.local/var/log/ckpool/ckpool.log

# Test RPC credentials manually
RPC_USER=$(grep rpcuser ~/.bitcoin/bitcoin.conf | cut -d= -f2)
RPC_PASS=$(grep rpcpassword ~/.bitcoin/bitcoin.conf | cut -d= -f2)
bitcoin-cli -rpcuser=$RPC_USER -rpcpassword=$RPC_PASS getblockcount

# Verify ckpool config matches bitcoin.conf
echo "=== ckpool config ==="
cat ~/.local/etc/ckpool.conf | grep -E "auth|pass"
echo "=== bitcoin.conf ==="
grep -E "rpcuser|rpcpassword" ~/.bitcoin/bitcoin.conf

Common causes:

Bitaxe can't connect

Debug Bitaxe connectivity

# Step 1: Find the Bitaxe on your network
# If it's in AP mode, connect to its WiFi (Bitaxe_XXXX)
# and access it at 192.168.4.1

# Step 2: Check Bitaxe status via API
curl -s http://BITAXE_IP/api/system/info | python3 -c "
import sys, json
d = json.load(sys.stdin)
print(f'WiFi: {d[\"ssid\"]} ({d[\"wifiStatus\"]})')
print(f'Stratum: {d[\"stratumURL\"]}:{d[\"stratumPort\"]}')
print(f'Fallback: {d[\"isUsingFallbackStratum\"]}')
print(f'Hashrate: {d[\"hashRate\"]:.0f} GH/s')
print(f'Shares: {d[\"sharesAccepted\"]} ok, {d[\"sharesRejected\"]} bad')
"

# Step 3: Verify ckpool is reachable from the Bitaxe's network
YOUR_IP=$(ip addr show | grep "inet " | grep -v 127.0.0.1 | head -1 | awk '{print $2}' | cut -d/ -f1)
echo "Your IP: $YOUR_IP"
nc -zv $YOUR_IP 3333

# Step 4: Check if ckpool sees the Bitaxe
grep "Authorised" ~/.local/var/log/ckpool/ckpool.log | tail -5

Common causes:

Phone hotspot using too much data

Prevent node sync over mobile data

# Check which interface has the default route
ip route show | grep default

# If your phone hotspot interface has a default route, remove it
# Find the gateway and interface name first:
ip route show | grep default

# Remove the hotspot default route (keep the main WiFi route)
sudo ip route del default via HOTSPOT_GATEWAY dev HOTSPOT_INTERFACE

# Verify only your main WiFi has internet routing
ip route show | grep default
# Should show only one line with your main WiFi interface

This change is temporary and resets on reboot or reconnect. The hotspot will still carry local traffic (Bitaxe to ckpool) but no internet traffic (blockchain sync).

Drive shows as exFAT

Check and migrate filesystem

# Check filesystem type
DATADIR=$(grep datadir ~/.bitcoin/bitcoin.conf | cut -d= -f2)
df -Th "$DATADIR" | tail -1

# If it shows fuseblk, exfat, or ntfs, you need to migrate
# Download and run the migration script:
wget https://knotsday.com/scripts/migrate-to-ext4.sh
chmod +x migrate-to-ext4.sh

# Stop the node first!
bitcoin-cli stop
sleep 10

# Run the migration
./migrate-to-ext4.sh

Migration requires enough free space on another drive to temporarily store your blockchain data (~800 GB). See the setup guide for details.

Advanced: Updating Bitcoin Knots

# Check current version
bitcoind --version | head -1

# Check latest version
curl -s https://bitcoinknots.org | grep -oP 'bitcoin-\K[0-9.]+knots[0-9]+' | head -1

# Stop the node
bitcoin-cli stop
sleep 10

# Download and install (replace version as needed)
KNOTS_VERSION="29.3.knots20260508"
cd /tmp
wget "https://bitcoinknots.org/files/29.x/${KNOTS_VERSION}/bitcoin-${KNOTS_VERSION}-x86_64-linux-gnu.tar.gz"
tar xzf "bitcoin-${KNOTS_VERSION}-x86_64-linux-gnu.tar.gz"
cp "bitcoin-${KNOTS_VERSION}/bin/"* ~/.local/bin/

# Restart
bitcoind
bitcoind --version | head -1

Advanced: Rebuilding ckpool

# If ckpool won't build, ensure all dependencies are installed
sudo apt-get install -y build-essential autoconf automake \
  libtool pkg-config libssl-dev

# Clean build
cd /tmp
rm -rf ckpool
git clone https://bitbucket.org/ckolivas/ckpool.git
cd ckpool
./autogen.sh
./configure
make -j$(nproc)

# Install
cp src/ckpool src/notifier ~/.local/bin/

# Restart service
systemctl --user restart ckpool
systemctl --user status ckpool

Nuclear Option: Full Reset

Only use this if nothing else works. This deletes all blockchain data and re-syncs from scratch. It will take hours.

# Stop everything
bitcoin-cli stop 2>/dev/null
systemctl --user stop ckpool 2>/dev/null
sleep 10

# Back up your wallet and config
cp ~/.bitcoin/bitcoin.conf ~/bitcoin.conf.backup

# Wipe and re-sync (keeps your config)
DATADIR=$(grep datadir ~/.bitcoin/bitcoin.conf | cut -d= -f2)
rm -rf "$DATADIR/blocks" "$DATADIR/chainstate" "$DATADIR/indexes"

# Start fresh
bitcoin-qt &

Getting Help

If the diagnostic commands and Claude Code don't resolve your issue, gather the output of the diagnostic script and share it (after removing any private keys or passwords) in: