kasnodes
Crawling the networkCrawl24.8%

kaspad on Linux

Intermediate7 stepsAbout 20 minutes, plus the sync
1. Download kaspad0 of 7 done
  1. Download kaspad
  2. Install it
  3. Run it once
  4. Run it as a service
  5. Day-to-day commands
  6. Make it public
  7. Troubleshooting

Before you start

1

Download kaspad

Get the official build from the Rusty Kaspa releases page.

On the releases page, copy the link to the newest linux-amd64.zip, then on the machine (install unzip first if it is missing):

cd /tmp
curl -L -o rusty-kaspa.zip PASTE_THE_LINK_HERE
unzip rusty-kaspa.zip -d rusty-kaspa
find rusty-kaspa -name kaspad -type f

The last command prints where kaspad is inside the archive. You can also download it in a browser and copy it to the server with scp. There is no ARM build; on a Raspberry Pi or other ARM board, use Docker.

2

Install it

Put kaspad in /usr/local/bin, so it runs from anywhere, and make its data folder.

Replace the path with the one find printed:

sudo install -m 755 /tmp/rusty-kaspa/PATH/TO/kaspad /usr/local/bin/kaspad
mkdir -p ~/.kaspad/logs
which kaspad
kaspad --version
It is installed when
  • which kaspad prints /usr/local/bin/kaspad
  • kaspad --version prints a version
3

Run it once

Start it by hand first. Problems are much easier to see here than once it runs in the background.

kaspad --utxoindex --appdir=~/.kaspad
--utxoindex
Keeps an index for balance lookups (recommended)
--appdir
Keeps the chain in ~/.kaspad
It is working when the log shows
  • kaspad starting, with its version
  • Peers connecting, 8 or more of them
  • Headers, then blocks, downloading

Ctrl+C stops it. Next time it carries on syncing where it stopped.

4

Run it as a service

systemd starts kaspad at boot, restarts it if it stops, and keeps its log.

Save this, replacing YOUR_USERNAME everywhere with yours (whoami prints it):

/etc/systemd/system/kaspad.service
[Unit]
Description=Kaspa node (kaspad)
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=YOUR_USERNAME
Group=YOUR_USERNAME
ExecStart=/usr/local/bin/kaspad --utxoindex --appdir=/home/YOUR_USERNAME/.kaspad --rpclisten=127.0.0.1:16110
Restart=on-failure
RestartSec=10
LimitNOFILE=65536
StandardOutput=journal
StandardError=journal
SyslogIdentifier=kaspad

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable kaspad
sudo systemctl start kaspad
sudo systemctl status kaspad
It is running when
  • systemctl status kaspad says active (running)
  • journalctl -u kaspad shows peers and sync progress
5

Day-to-day commands

Everything you'll need once it is running.

Follow the log
sudo journalctl -u kaspad -f
Errors only
sudo journalctl -u kaspad -p err -n 50
Is it synced?
sudo journalctl -u kaspad -n 200 | grep -i "sync\|height"
Stop, start, restart
sudo systemctl stop kaspad
sudo systemctl start kaspad
sudo systemctl restart kaspad
Disk used, and free
du -sh ~/.kaspad
df -h ~
Memory and processor
top -p $(pgrep kaspad)
6

Make it public

Optional, and the most useful thing you can do: a public node helps new nodes join and sync. On a hosted server, opening the firewall is usually enough.

Open the port in the firewall. UFW (Ubuntu, Debian):

sudo ufw allow 16111/tcp
sudo ufw status

firewalld (Fedora, RHEL, CentOS):

sudo firewall-cmd --permanent --add-port=16111/tcp
sudo firewall-cmd --reload
sudo firewall-cmd --list-ports

Check kaspad is listening on all addresses, 0.0.0.0:16111 or [::]:16111:

sudo ss -tulpn | grep 16111

At home, kaspad asks your router to open the port by itself (UPnP), which many routers allow. If it doesn't become public, forward the port by hand:

  1. Find this machine's local address: hostname -I.
  2. Open your router's admin page, usually at 192.168.1.1 or 192.168.0.1.
  3. Forward external TCP port 16111 to that address, port 16111.

Router menus differ. portforward.com has steps for most models.

It is public when
  • The log shows inbound peers
  • It appears on KasNodes after the next crawl
7

Troubleshooting

The usual problems and what fixes them.

The service fails or stops straight away

Read sudo journalctl -u kaspad -n 100 --no-pager. Usually User and Group don't match whoami, /usr/local/bin/kaspad is missing or not executable, the data folder belongs to another user, or another kaspad is already running (ps aux | grep kaspad).

It runs out of memory, or the log shows Killed

kaspad needs 16 GB of memory, and more while it syncs. Close other programs, or move it to a larger machine.

Permission denied on the data folder

Give it back to your user: sudo chown -R $USER:$USER ~/.kaspad.

It shows 0 peers

It can't reach the network. Check the connection and that nothing blocks outbound traffic, check the log for errors, and restart it.

The disk is filling up

Check what kaspad uses, free some space, or move the data folder to a larger disk by changing --appdir. Keep 640 GB free for it; 1 TB is better.

It isn't public after opening the port

Check the firewall rule and the router rule are both TCP 16111 and point at the right machine. Some hosts and home providers put you behind their own NAT, which blocks inbound connections.

Running? Put your name on it.

Once the node shows up in a crawl you can claim it, pick a public name and follow its rank.