Skip to main content

Nockchain

Install Dependencies

sudo apt install --assume-yes git clang curl libssl-dev llvm libudev-dev make protobuf-compiler
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env

Open port

sudo ufw allow ssh; sudo ufw allow 3005; sudo ufw allow 3006; sudo ufw enable

Clone

git clone https://github.com/zorp-corp/nockchain
cd nockchain
cp .env_example .env

Install Hoonc

make install-hoonc

Build

make build

Install Nockchain Wallet

make install-nockchain-wallet

Install Nockchain

make install-nockchain

Setup Keys

nockchain-wallet keygen
BACKUP

Copy every key from output, PubKey Privket Seed Pharse

  • Backup as keys.export file
nockchain-wallet export-keys 
  • edit MINING_PUBKEY in .env file
nano .env

Create Service

note

If you want to run multiple service skip this and go to Run Multi

  • Edit PUB_KEY with your own Public Key
sudo tee /etc/systemd/system/nock.service > /dev/null << EOF
[Unit]
Description=Nockchain Mining
After=network-online.target
StartLimitIntervalSec=0
[Service]
User=$USER
Restart=always
RestartSec=3
Environment=RUST_LOG=info,nockchain=trace,debug,nockchain_libp2p_io=info,libp2p=info,libp2p_quic=info
Environment=MINIMAL_LOG_FORMAT=true
ExecStart=$(which nockchain) \
--mine \
--mining-pubkey="PUB_KEY"
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable nock
sudo systemctl restart nock
  • Check logs
sudo journalctl -u nock -f --no-hostname -o cat

RUN Multi

wget -O nock.sh https://learn.megumii.xyz/nock.sh; chmod +x nock.sh; ./nock.sh 

Troubleshoot

  • For error like this

sudo sysctl -w vm.overcommit_memory=1