Skip to content

Viper-Staking/Cardano-Node-Setup

Repository files navigation

Cardano-Node Setup

Tools for quickly setting up a Cardano-Node!

Quickstart

Follow our quickstart guide to get a relay node up and running in less than 10 minutes! The following sections provide other configuration examples.

Default configuration (cardano-node binary)

This container runs with the cardano-node as the ENTRYPOINT (see inside the entrypoint.sh script). A CMD statement provides a default argument if no arguments are provided when running the container. This will simply print the cardano-node version.

Note: Make sure to export HOME=/home/lovelace so that it can be resolved correctly within the container

The following command will run the container in this configuration:

docker run registry.gitlab.com/viper-staking/docker-containers/cardano-node:latest

Alternate configuration (block producing node)

Below is an example on overriding the default CMD arguments to run cardano-node as a block producing node:

docker run registry.gitlab.com/viper-staking/docker-containers/cardano-node:latest \
    run \
    --database-path $HOME/cardano-node/db/ \
    --socket-path $HOME/cardano-node/db/node.socket \
    --host-addr "0.0.0.0" \
    --port 4444 \
    --config $HOME/cardano-node/config.json \
    --topology $HOME/cardano-node/topology.json \
    --shelley-kes-key $HOME/cardano-node/pool_kes.skey \
    --shelley-vrf-key $HOME/cardano-node/pool_vrf.skey

Alternate configuration (relay node)

Below is an example on overriding the default CMD arguments to run cardano-node as a relay node:

docker run registry.gitlab.com/viper-staking/docker-containers/cardano-node:latest \
    run \
    --database-path $HOME/cardano-node/db/ \
    --socket-path $HOME/cardano-node/db/node.socket \
    --port 4444 \
    --host-addr "0.0.0.0" \
    --topology $HOME/cardano-node/topology.json \
    --config $HOME/cardano-node/config.json

Alternate configuration (shell entrypoint)

Below is an example on overriding the entrypoint to enter the container in a shell. This configuration boots the container into a ZSH shell so that the user can interact with the container and run any desired commands. Use this for debugging:

docker run -it --entrypoint /usr/bin/zsh registry.gitlab.com/viper-staking/docker-containers/cardano-node:latest

Running with run-cardano-node script

The script run-cardano-node.sh is provided to simplify running the cardano-node either via the docker container or from a local installation. The first argument accepts a command prefix string which specifies where to execute cardano-node so it may be used with the container as:

Docker execution

export CMD="docker run --mount type=bind,source=$PWD/config,target=/home/lovelace/cardano-node/ -p 9100:9100 -p 12798:12798 registry.gitlab.com/viper-staking/docker-containers/cardano-node:latest"
./run-cardano-node.sh $CMD

The run-cardano-node.sh script assumes the location of the node configuration files and may need to be adjuster per your setup.

You can open a shell in the running container with the following command:

docker exec -it <container_id> /usr/bin/zsh

You can get the ID of the running container by running docker ps.

Local execution

Use this to run cardano-node from a local cardano installation (or to run cardano-node when inside the docker container via shell):

export CMD="/usr/local/bin/cardano-node"
./run-cardano-node.sh $CMD

Required files

  • Node configuration files (latest files here)
    • config.json
    • topology.json
    • genesis.json

These files are different depending on the network (e.g., testnet vs. mainnet) and may be fetched automatically using the provided get_latest_config_files.sh script.

Monitor node with prometheus

  1. Ensure the node has been updated to enable prometheus by adding the following to the config.json file:
hasPrometheus:
   - "0.0.0.0"
   - 12789
  1. Pull prometheus docker container from Dockerhub:
docker pull prom/prometheus
  1. Get the IP address of the node you'd like to monitor. If using docker, you can get the IP with:
docker network inspect bridge
  1. Modify prometheus.yml and change localhost to the container's IP address
  2. Run the prometheus container:
docker run \
    -p 9090:9090 \
    -v $PWD/prometheus.yml:/etc/prometheus/prometheus.yml \
    prom/prometheus
  1. Access the prometheus web UI at <container IP>:9090/graph

Visit our website for information on our other open source Cardano tools. If you find our tools useful, please consider buying us a beer! 🍺 Contribute

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages