Skip to main content

Update

STOP

systemctl stop nock
cargo clean

Pull

cd $HOME/nockchain 
git reset --hard HEAD
git pull
cp .env_example .env
  • edit MINING_PUBKEY in .env file
nano .env

Remove Data

rm -rf /.data.nockchain /.socket/nockchain_npc.sock

Build

make build

Install Hoonc

make install-hoonc

Install Nockchain Wallet

make install-nockchain-wallet

Install Nockchain

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

Update 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) \
--mining-pubkey="PUB_KEY" \
--mine \
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable nock
sudo systemctl restart nock

Cek log

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