SPO-Kissa Cardano SPOs Documentation

website·Indexed 30 days ago

https://docs.spo-kissa.org

A community-driven documentation resource for Cardano Stake Pool Operators (SPOs). It provides guides on cardano-node installation, Midnight testnet-02 setup, Partner-Chains-Node configuration, Docker Airgap environments, and monitoring with Prometheus and Grafana.

Tokens
13.3K
Snippets
90
Records
99
Agent score
50%

What's inside SPO-Kissa

  1. Overview of Docker Airgap for Cardano

    Docker Airgap provides a fully automated way to build a lightweight Ubuntu environment for air-gapped operations. It ensures consistent operation across Windows, macOS (Intel and Apple Silicon), and Linux. The environment comes pre-installed with cardano-cli and cardano-signer commands, as well as a helper utility called ctool to improve workflow efficiency.
  2. Download the latest Cardano DB snapshot using Mithril

    To synchronize the node quickly, remove the existing database folder and download the latest snapshot using the mithril-client. This example targets the testing-preview run-mode.
    # Remove existing DB folder
    rm -rf $NODE_HOME/db
    
    # Download latest snapshot
    mithril-client cardano-db download \
      --backend v2 \
      --run-mode testing-preview \
      --download-dir "$NODE_HOME" \
      --include-ancillary \
      latest
  3. Import Midnight Validator dashboard into Grafana

    Import the pre-configured Midnight validator dashboard by uploading the JSON configuration file:

    1. Download the grafana-midnight-validator.json file from the official repository.
    2. In Grafana, go to Import dashboard.
    3. Upload the downloaded JSON file and click Import.
  4. Update the Mithril Signer binary

    To update the Mithril Signer, stop the systemd service, download the latest binary into a temporary directory, replace the existing system binary in /usr/local/bin/, and restart the service.
    # 1. Stop the service
    sudo systemctl stop mithril-signer.service
    
    # 2. Create and move to a temporary update directory
    mkdir -p ~/mithril-signer-update
    cd ~/mithril-signer-update
    
    # 3. Download the latest Mithril Signer binary
    curl --proto '=https' --tlsv1.2 -sSf \
    https://raw.githubusercontent.com/input-output-hk/mithril/refs/heads/main/mithril-install.sh \
    | sh -s -- -c mithril-signer -d latest -p $(pwd)
    
    # 4. Verify the downloaded version
    ./mithril-signer -V
    
    # 5. Overwrite the system binary
    sudo cp ./mithril-signer /usr/local/bin/mithril-signer
    
    # 6. Verify the system binary version
    mithril-signer -V
    
    # 7. Restart the service
    sudo systemctl restart mithril-signer.service
    
    # 8. Clean up temporary files
    cd ~
    rm -r ~/mithril-signer-update
  5. Configure Midnight Node firewall for Prometheus

    On the Midnight node, allow incoming TCP traffic on port 9615 from the Relay node's IP address to enable metrics collection.
    # Replace XX.XXX.XX.XXX with the Relay Node IP
    sudo ufw allow from XX.XXX.XX.XXX to any port 9615 proto tcp comment 'Grafana'
  6. Install Mithril client for node synchronization

    Install the mithril-client to accelerate the synchronization of the Cardano node using the Mithril network.
    mkdir -p $HOME/git
    cd $HOME/git
    
    # Download mithril-client
    curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/input-output-hk/mithril/refs/heads/main/mithril-install.sh | sh -s -- -c mithril-client -d latest -p $HOME/git/
    
    # Install to system path
    sudo mv $HOME/git/mithril-client /usr/local/bin/mithril-client
    
    # Verify version
    mithril-client -V
  7. Configure SSH key-based authentication

    Generate an Ed25519 key pair, authorize the public key, and set strict permissions on the SSH directory and authorized keys file to enable secure key-based login.
    # Generate key pair
    ssh-keygen -t ed25519 -N '' -C ssh_connect -f ~/.ssh/ssh_ed25519
    
    # Authorize the public key
    cat ~/.ssh/ssh_ed25519.pub >> ~/.ssh/authorized_keys
    
    # Set secure permissions
    chmod 600 ~/.ssh/authorized_keys
    chmod 700 ~/.ssh
  8. Update Cardano node database using Mithril

    To quickly synchronize the node database after an upgrade, use the Mithril client to download the latest snapshot. This involves installing the Mithril client, configuring environment variables for the mainnet, and replacing the existing database directory.
    # Install Mithril Client
    cd $HOME/git
    curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/input-output-hk/mithril/refs/heads/main/mithril-install.sh | sh -s -- -c mithril-client -d latest -p $(pwd)
    sudo install -m 755 mithril-client /usr/local/bin/mithril-client
    rm mithril-client
    
    # Set Environment Variables
    export AGGREGATOR_ENDPOINT=https://aggregator.release-mainnet.api.mithril.network/aggregator
    export GENESIS_VERIFICATION_KEY=$(wget -q -O - https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/release-mainnet/genesis.vkey)
    export ANCILLARY_VERIFICATION_KEY=$(wget -q -O - https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/release-mainnet/ancillary.vkey)
    export SNAPSHOT_DIGEST=latest
    
    # Update Database
    rm -rf $NODE_HOME/db
    mithril-client cardano-db download --download-dir $NODE_HOME --include-ancillary $SNAPSHOT_DIGEST