DocsNode Setup & Mining Guide
Mine FRAI tokens with Proof of Fractal Work

Run a Node & Start Mining

Join the FractalAI network as a miner. Generate Julia set fractals, earn FRAI rewards, and help secure a post-quantum blockchain.

Testnet Live

Seed Node
159.223.197.61
RPC Port
9545
P2P Port
30303
Chain ID
3 (Testnet)

How Proof of Fractal Work Mining Works

🌀
1

Generate

Node creates a Julia set fractal challenge

📐
2

Analyze

Compute fractal dimensions & metrics

🏆
3

Score

Closer to golden ratio (φ=1.618) = higher score

4

Validate

Network verifies the fractal proof

💰
5

Reward

Miner receives FRAC block reward

Hardware Requirements

CPU

Minimum:2 cores
Recommended:4+ cores

Any modern x86_64 processor. Fractal mining is CPU-based, more cores = faster blocks.

RAM

Minimum:2 GB
Recommended:4 GB+

Memory for block processing, state storage, and P2P networking.

Storage

Minimum:20 GB SSD
Recommended:50 GB SSD

RocksDB storage for blocks, state, and transaction history.

Network

Minimum:Port 30303 TCP open
Recommended:Public IP + 100 Mbps

P2P port (30303/TCP) must be accessible. Stable connection with low latency preferred.

Software Requirement

OS: Ubuntu 22.04+ / Debian 12+ (recommended) — also works on macOS and Windows (WSL2)
Rust: Version 1.85.0 specifically (newer versions have a wasmer compatibility issue)
Build tools: gcc, pkg-config, libssl-dev, clang

Step-by-Step Installation

1
Install System Dependencies

Ubuntu / Debian
sudo apt update && sudo apt install -y \
  build-essential pkg-config libssl-dev git clang

2
Install Rust 1.85.0

Install Rust toolchain
# Install rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source ~/.cargo/env

# Install and set Rust 1.85.0 (REQUIRED - newer versions break wasmer)
rustup install 1.85.0
rustup default 1.85.0

# Verify
rustc --version
# Should output: rustc 1.85.0

Important: Rust versions above 1.85 removed __rust_probestack which the WASM VM (wasmer 4.2) still references. Using Rust 1.86+ will cause a linker error. Always use rustup default 1.85.0.

3
Clone and Build

Build FractalAI node (~5 minutes)
# Clone the repository
git clone https://github.com/johnInarti/FRACTAL-AI.git
cd FRACTAL-AI/blockchain

# Build in release mode
cargo build --release

# Verify the binary
./target/release/fractal-node --help

4
Create Your Miner Wallet

You need a wallet address to receive mining rewards. Create one from the FractalAI web app:

Option A: Web Wallet

  1. 1. Go to fractalai.net.co/wallet
  2. 2. Click "Create New Wallet"
  3. 3. Set a password and save your keyfile
  4. 4. Copy your address (starts with 0x)

Option B: Quick CLI

# Generate a random address python3 -c " import secrets addr = '0x' + secrets.token_hex(20) print(f'Address: {addr}') print('Save this! Use as --coinbase') "

5
Initialize and Start Mining

Initialize testnet and start mining
# Create data directory
sudo mkdir -p /var/lib/fractal/data-testnet
sudo chown $USER:$USER /var/lib/fractal/data-testnet

# Initialize the testnet chain (creates genesis block)
./target/release/fractal-node testnet init

# Get the seed node's current Peer ID (run this first!)
curl -s http://159.223.197.61:9545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"fractal_getNodeInfo","params":[],"id":1}' \
  | python3 -c "import sys,json; print(json.load(sys.stdin)['result'])"

# Set environment variables
export FRACTAL_BOOTSTRAP_NODES="/ip4/159.223.197.61/tcp/30303/p2p/PASTE_PEER_ID_HERE"
export FRACTAL_DATA_DIR="/var/lib/fractal/data-testnet"

# Start mining! (replace YOUR_ADDRESS with your wallet address)
./target/release/fractal-node \
  --rpc-port 9545 \
  testnet start \
  --mining \
  --coinbase YOUR_ADDRESS
You should see:
INFO  Mining started with N threads
INFO  Mined block #1 score=XXXXX difficulty=XX time=XXms

6
Run as a System Service (Production)

Create systemd service
# Create the service file
sudo tee /etc/systemd/system/fractal-miner.service > /dev/null << 'SERVICEFILE'
[Unit]
Description=FractalAI Miner Node
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=YOUR_USERNAME
WorkingDirectory=/home/YOUR_USERNAME/fractal-ai/blockchain
Environment="FRACTAL_BOOTSTRAP_NODES=/ip4/159.223.197.61/tcp/30303/p2p/PASTE_PEER_ID"
Environment="FRACTAL_DATA_DIR=/var/lib/fractal/data-testnet"
ExecStart=/home/YOUR_USERNAME/fractal-ai/blockchain/target/release/fractal-node --rpc-port 9545 testnet start --mining --coinbase YOUR_ADDRESS
Restart=always
RestartSec=5
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target
SERVICEFILE

# Replace YOUR_USERNAME, PASTE_PEER_ID, and YOUR_ADDRESS above, then:
sudo systemctl daemon-reload
sudo systemctl enable fractal-miner
sudo systemctl start fractal-miner

# Check that it's running
sudo systemctl status fractal-miner
sudo journalctl -u fractal-miner -f --no-pager

Verify Your Node

Check your node is mining and connected
# Check node health
curl -s http://localhost:9545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"fractal_health","params":[],"id":1}' | python3 -m json.tool

# Expected output:
# {
#   "block_height": 12345,    <-- Should increase
#   "mining": true,            <-- Must be true
#   "peer_count": 1,           <-- Connected to seed node
#   "status": "ok"
# }

# Check your balance (mining rewards)
curl -s http://localhost:9545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_getBalance","params":["YOUR_ADDRESS","latest"],"id":1}'

# Get testnet FRAC from faucet
curl -s http://159.223.197.61:9545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"fractal_faucet","params":["YOUR_ADDRESS",100],"id":1}'

Mining Rewards

Under Modelo 3, miners earn FRAI tokens (100 per block) as the sole mining reward. FRAC has zero new emission and is purely deflationary. Block scores are calculated using fractal quality metrics — the closer your fractal's Hausdorff dimension is to the golden ratio (φ = 1.618033...), the higher your score.

Score = Hausdorff(35%) + Correlation(20%) + Similarity(30%) + Spectrum(15%) Golden Ratio Bonus: up to 1.5x if Hausdorff is within 5% of φ (1.618) Max Score: 1,000,000 Min Score for Valid Block: 1,000 (testnet) / varies (mainnet)
φ = 1.618
Target Dimension
64×64
Testnet Grid Size
~3s
Target Block Time
2 AI
Models Trained/Block

Troubleshooting

Build fails with "__rust_probestack" error

You are using Rust > 1.85. Run: rustup default 1.85.0 and rebuild.

Node starts but block_height stays at 0

Delete the data directory and re-initialize: rm -rf /var/lib/fractal/data-testnet && ./target/release/fractal-node testnet init

peer_count is 0

Check that: (1) Port 30303 TCP is open in your firewall, (2) The Peer ID in FRACTAL_BOOTSTRAP_NODES is current (it changes on seed node restart), (3) Run the curl command from Step 5 to get the latest Peer ID.

"No head block - call init() first"

The database is corrupted or from an old version. Delete the data directory and run testnet init again.

Mining is very slow / high CPU

Testnet mining should be fast (2-10ms per block). If blocks take longer, ensure you pulled the latest code with the optimized solve() function.

Ecosystem Applications

These applications are already integrated with FractalAI. Users create wallets directly in each app.

F

FincAI

Personal finance AI assistant

FINC (1,000 FINC = 1 FRAC)
  • AI financial advisor
  • Budget tracking
  • Receipt scanning
  • Investment goals
K

KpitApp

Venture OS management platform

KPICoin (Governance)
  • DAO governance
  • Treasury management
  • 8 smart contracts
  • 7 AI agents
E

EngagedNet

Social network with AI agents

SPARK (1,000 SPARK = 1 FRAC)
  • AI agent NFTs
  • Audio rooms
  • Tournaments
  • Post-quantum wallet

Quick Reference - Useful RPC Commands

JSON-RPC commands for monitoring your node
# Node health check
curl -s http://localhost:9545 -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"fractal_health","params":[],"id":1}'

# Get block height
curl -s http://localhost:9545 -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

# Get your balance
curl -s http://localhost:9545 -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_getBalance","params":["YOUR_ADDR","latest"],"id":1}'

# Get node info (peer count, chain ID, mining status)
curl -s http://localhost:9545 -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"fractal_getNodeInfo","params":[],"id":1}'

# Get current mining challenge details
curl -s http://localhost:9545 -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"fractal_getChallenge","params":[],"id":1}'

# Get network statistics
curl -s http://localhost:9545 -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"fractal_getNetworkStats","params":[],"id":1}'

# Request testnet FRAC from faucet
curl -s http://159.223.197.61:9545 -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"fractal_faucet","params":["YOUR_ADDR",100],"id":1}'