Sign inSign up

supertypo/kaspad

By supertypo

•Updated about 2 years ago

Containerized Kaspad.

Image
4

10K+

supertypo/kaspad repository overview

⁠Containerized Kaspad (x86 and ARM).

** NOTICE: The Golang node is DEPRECATED, please upgrade to the Rust node **

⁠Kaspad on Rust

A new Kaspa daemon has been developed in Rust, it's superior in performance and features, so please use it instead:
https://hub.docker.com/r/supertypo/rusty-kaspad⁠

⁠About

Kaspa is an ancient Aramaic word for “silver” and “money.” Kaspa aims to become the most resilient, robust and fastest PoW BlockDAG in the world.

https://kaspa.org⁠

Kaspad release binaries for linux/amd64 and linux/arm64 are compiled from the corresponding tag from the official repository at:
https://github.com/kaspanet/kaspad⁠ (ISC licensed)

Release candidates (-rcX) are sometimes fetched from other developer repositories.
The kaspad release url is exposed as an environment variable in the container:

sudo docker run --rm supertypo/kaspad:latest env | grep REPO_URL

The commit id from which the release has been built is also exposed as an environment variable in the container:

sudo docker run --rm supertypo/kaspad:latest env | grep KASPA_VERSION

The loadbalancer, HAProxy, is GPLv2 licensed.
http://www.haproxy.org/⁠

Build source for this image is available at:
https://github.com/supertypo/docker-kaspad⁠

⁠Donations welcome

If you appreciate the Docker images and guides I create and maintain, please consider a donation:
kaspa:qrjtsnnpjyvlmkffdqyayrny3qyen9yjkpuw7xvhsz36n69wmrfdyf3nwv67t or (btc) 3GaNNrhkpPpq7V1v1LCYzayvbyWWeBd5vx

⁠Prerequisites

⁠Make sure your system is up to date first (this example is for Ubuntu)
sudo apt update && sudo apt dist-upgrade -y

Reboot now if you're told to after the updates have been installed.

⁠Install and enable Docker daemon
sudo apt install docker.io docker-compose
sudo systemctl enable docker
⁠Make your node public (optional)

The very heart of Kaspa is the public nodes, please consider making your node public.
If your host is running on a private network behind an uPNP-capable router you can easily open the consensus-port using the following command:

sudo docker run --rm --network=host alpine sh -c 'apk add miniupnpc; upnpc -r 16111 tcp' | grep 16111
⁠Continue with either the docker-compose or plain docker setup

⁠Quickstart (docker-compose)

⁠Create docker-compose.yaml

Create a file named 'docker-compose.yaml' in a new directory named 'docker-kaspad' with the following contents:

version: "3"

services:
  kaspad:
    container_name: kaspad
    image: supertypo/kaspad:latest
    restart: unless-stopped
    ports:
      - "16110:16110/tcp"
      - "16111:16111/tcp"
    volumes:
      - kaspad:/app/data/

volumes:
  kaspad:
⁠Start kaspad
sudo docker-compose pull && sudo docker-compose up -d
⁠Tail logs:
sudo docker logs -n 1000 -f kaspad

The node is fully synced when it prints lots of "Accepted block ..." lines.

⁠View kaspad disk usage
sudo docker system df -v
⁠Delete datadir and resync
sudo docker rm -f kaspad
sudo docker volume rm docker-kaspad_kaspad
sudo docker-compose up -d

⁠Quickstart (plain docker):

⁠Create datadir and set correct permissions
sudo mkdir -p /var/kaspad && sudo chown 51591 -R /var/kaspad
⁠Start or update Kaspad container
sudo docker rm -f kaspad
sudo docker run --pull always -d --restart unless-stopped \
  -v /var/kaspad/:/app/data/ -p 16110:16110 -p 16111:16111 \
  --name kaspad supertypo/kaspad:latest
⁠Tail logs:
sudo docker logs -n 1000 -f kaspad

The node is fully synced when it prints lots of "Accepted block ..." lines.

⁠Clear database and resync (if needed)
sudo docker stop kaspad
sudo rm -r /var/kaspad/.kaspad
sudo docker start kaspad

⁠Advanced: Run 2 independent instances, persistent storage and a load balancer using Docker Compose

HAProxy is used as loadbalancer, and the configuration is included in the kaspad_loadbalancer image (see git repo for details).
The HAProxy stats page is mapped to 9000 per default.

docker-compose.yaml:

version: "3"

services:
  kaspad_loadbalancer:
    container_name: kaspad_loadbalancer
    image: supertypo/kaspad_loadbalancer:latest
    restart: unless-stopped
    ports:
      - "9000:9000/tcp"
      - "16110:16110/tcp"
      - "16111:16111/tcp"
    links:
      - kaspad1
      - kaspad2

  kaspad1:
    container_name: kaspad1
    image: supertypo/kaspad:latest
    restart: unless-stopped
    volumes:
      - kaspad1:/app/data/

  kaspad2:
    container_name: kaspad2
    image: supertypo/kaspad:latest
    restart: unless-stopped
    volumes:
      - kaspad2:/app/data/

volumes:
  kaspad1:
  kaspad2:

Run/upgrade with: sudo docker-compose pull && sudo docker-compose up -d

⁠View kaspad disk usage
sudo docker system df -v
⁠Resync example (resync node nr. 1 - without downtime)
sudo docker rm -f kaspad1
sudo docker volume rm docker-kaspad_kaspad1
sudo docker-compose up -d

⁠Donations welcome

If you appreciate the Docker images and guides I create and maintain, please consider a donation:
kaspa:qrjtsnnpjyvlmkffdqyayrny3qyen9yjkpuw7xvhsz36n69wmrfdyf3nwv67t or (btc) 3GaNNrhkpPpq7V1v1LCYzayvbyWWeBd5vx

Tag summary

Content type

Image

Digest

sha256:ab309fca9…

Size

17.7 MB

Last updated

about 2 years ago

docker pull supertypo/kaspad