Create Startup Service
A Cardano blockchain data node written in Go which actively participates in network communications on the Cardano blockchain using the Ouroboros Network Node-to-Node family of mini-protocols.
⚠️ This is a work in progress and is currently under heavy development
For this guide we will walk you through setting up a systemd
service. Using a systemd
service to run a Dingo Node maximizes the uptime by automatically restarting the Dingo node when the computer reboots. To get started follow the steps below.
✅ This guide assumes typical Linux setup. Please adjust commands and paths as needed.
Step 1 - Move Dingo and dingo.yaml Files
Section titled “Step 1 - Move Dingo and dingo.yaml Files”Best Practices: Since we will be using a systemd
to startup Dingo we will move our Dingo binary to the /usr/local/bin/
and our dingo.yaml to the /etc/dingo/
directory by running the following:
⚠️ Please adjust paths below. Paths are based on our Quick Start guide and
USER=test
.💡 Tip: to find your path to the Dingo binary, navigate to your Dingo binary directory, then you can run the
realpath dingo
command.
sudo mv /home/test/dingo/dingo /usr/local/bin/
✅ You can check that Dingo binary was moved by running
which dingo
Now we will create the /etc/dingo/
directory:
sudo mkdir /etc/dingo/
Then we will move our dingo.yaml file to the /etc/dingo/
:
sudo mv /home/test/dingo/dingo.yaml /etc/dingo/
Step 2 - Edit Paths in dingo.yaml File
Section titled “Step 2 - Edit Paths in dingo.yaml File”Now we will edit our dingo.yaml file to update the following paths since we moved our yaml to /etc/dingo/
.
We will need to edit the following paths below: cardanoConfig:
, databasePath:
, socketPath:
, and topology:
.
✅ Please adjust as needed with correct paths to match your username and directories.
# Example config file for dingo# The values shown below correspond to the in-code defaults
# Public bind address for the Dingo serverbindAddr: "0.0.0.0"
# Path to the Cardano node configuration file## Can be overridden with the config environment variablecardanoConfig: "/home/test/dingo/config/cardano/preview/config.json"
# A directory which contains the ledger database filesdatabasePath: "/home/test/dingo/dingo"
# Path to the UNIX domain socket file used by the serversocketPath: "/home/test/dingo.socket"
# Name of the Cardano networknetwork: "preview"
# TLS certificate file path (for HTTPS)## Can be overridden with the TLS_CERT_FILE_PATH environment variabletlsCertFilePath: ""
# TLS key file path (for HTTPS)## Can be overridden with the TLS_KEY_FILE_PATH environment variabletlsKeyFilePath: ""
# Path to the topology configuration file for Cardano nodetopology: "/home/test/dingo/config/cardano/preview/topology.json"
# TCP port to bind for Prometheus metrics endpointmetricsPort: 12798
# Internal/private address to bind for listening for Ouroboros NtCprivateBindAddr: "127.0.0.1"
# TCP port to bind for listening for Ouroboros NtCprivatePort: 3002
# TCP port to bind for listening for Ouroboros NtN## Can be overridden with the port environment variablerelayPort: 3001
# TCP port to bind for listening for UTxO RPCutxorpcPort: 9090
# Ignore prior chain history and start from current tip (default: false)# This is experimental and may break — use with cautionintersectTip: false
# Maximum cache size in bytes used by BadgerDB for block/index cache# Default: 1073741824 (1 GB)badgerCacheSize: 1073741824
# Maximum total size (in bytes) of all transactions allowed in the mempool.# Transactions exceeding this limit will be rejected.# Default: 1048576 (1 MB)mempoolCapacity: 1048576
Step 3 - Create dingo.service Unit Configuration File
Section titled “Step 3 - Create dingo.service Unit Configuration File”Next, we will write the dingo.service unit configuration file or ‘service’ file, which will be run by systemd
.
⚠️ Please adjust the
User=
line below. In our Quick Start guide we used the usertest
please adjust this to your username.💡 Tip: you can run
echo $USER
command to find your username.
cat <<'ENDFILE' >> /tmp/dingo.service[Unit]Description=Dingo NodeAfter=network-online.target
[Service]Type=simpleRestart=on-failureRestartSec=10User=testExecStart=/usr/local/bin/dingoSyslogIdentifier=dingoTimeoutStopSec=3
[Install]WantedBy=multi-user.targetENDFILE
Step 4 - Move dingo.service
Section titled “Step 4 - Move dingo.service”Move dingo.service to /etc/systemd/system/
so it can operate via systemd by running:
sudo mv /tmp/dingo.service /etc/systemd/system/
Step 5 - Enable the Service and Start Service
Section titled “Step 5 - Enable the Service and Start Service”Now we will enable the service to run at start and turn it on by running:
sudo systemctl enable dingo.service
Then:
sudo systemctl start dingo.service
Step 6 - Check Status
Section titled “Step 6 - Check Status”You can ensure that dingo.service is active by checking its status by running:
sudo systemctl status dingo.service
If you have an error, you can use the following command to see the error logs:
journalctl -u dingo.service