May 23, 2025

**nockchain**

ubuntu 22.04
my test - 1cpu/18ram

CLI Installation Steps

Step 1: Install Dependecies

  • Update Packages
sudo apt-get update && sudo apt-get upgrade -y
  • Install Packages:
sudo apt install curl iptables build-essential git wget lz4 jq make gcc nano automake autoconf tmux htop nvme-cli libgbm1 pkg-config libssl-dev libleveldb-dev tar clang bsdmainutils ncdu unzip libleveldb-dev libclang-dev llvm-dev -y
  • Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env

Step 2: Delete Old Repo and Wipe All Data

# kill miner screen
screen -XS miner quit

# remove nockchain
rm -rf nockchain
rm -rf .nockapp

Step 3: NockChain Repo

git clone https://github.com/zorp-corp/nockchain

cd nockchain

Step 4: Build

  • Copy .env file from the example one:
cp .env_example .env
  • Build: (takes time depending on your hardware.)
make install-hoonc

export PATH="$HOME/.cargo/bin:$PATH"
make build
make install-nockchain-wallet

export PATH="$HOME/.cargo/bin:$PATH"
make install-nockchain

export PATH="$HOME/.cargo/bin:$PATH"

Step 5: Setup Wallet

Make sure you are in nockchain directory.

  • Set PATH:
export PATH="$HOME/.cargo/bin:$PATH"
  • Create wallet:
nockchain-wallet keygen
  • Save memo, private key & public key of your wallet.
  • Replace the value of MINING_PUBKEY= in .env with your own Public Key:
nano .env

To save: Press Ctrl + X, Y & Enter.

Step 6: Backup/Import Wallet Keys (optional)

Backup wallet keys:

nockchain-wallet export-keys
  • This will save your keys to a file called keys.export in the current directory.

Import wallet keys:

nockchain-wallet import-keys --input keys.export
  • Make sure keys.export is in your nockchain directory.
  • Note: For Local systems who are using a home router network which is mostly behind NAT, they need to forward ports. Ask chatgpt until I get the chance to write a guide for it.

Step 7: Run Miner

Start miner

RUST_LOG=info nockchain --mining-pubkey $MINING_PUBKEY \
--mine \
--peer /ip4/95.216.102.60/udp/3006/quic-v1 \
--peer /ip4/65.109.156.108/udp/3006/quic-v1 \
--peer /ip4/65.21.67.175/udp/3006/quic-v1 \
--peer /ip4/65.109.156.172/udp/3006/quic-v1 \
--peer /ip4/34.174.22.166/udp/3006/quic-v1 \
--peer /ip4/34.95.155.151/udp/30000/quic-v1 \
--peer /ip4/34.18.98.38/udp/30000/quic-v1 \
--npc-socket .socket/nockchain.sock \
--bind /ip4/0.0.0.0/udp/3006/quic-v1 \
--max-established-incoming 1000 \
--max-established-outgoing 1000 \
--max-established 2000 \
--max-established-per-peer 10
  • Replace your_pub_key.
  • If you run miltiple instance, then in a separate terminal use the same command but change the port 3006 with 300n--bind /ip4/0.0.0.0/udp/3006/quic-v1
  • And change name --npc-socket .socket/nockchain(n).sock

Restart Miner:

  • If you ever stopped your Miner, to restart it again, delete old data files first:
rm -rf ./.data.nockchain .socket/nockchain_npc.sock

To check your wallet balance:

nockchain-wallet --nockchain-socket $HOME/nockchain/.socket/nockchain.sock list-notes-by-pubkey -p <your-pubkey>

Example:

If you see such logs, then everything if is fine

Logs miners:

Logs height: