Run a docker testnet node
Run a node with Docker
In this guide, you learn how to run a node on your Linux computer that participates in the Concordium network. This means that you receive blocks and transactions from other nodes, as well as propagate information about blocks and transactions to the nodes in the Concordium network. After following this guide, you will be able to
run a Concordium node
observe it on the network dashboard
query the state of the Concordium blockchain directly from your machine.
You do not need an account to run a node.
Note
Subscribe to the Mainnet status page or Testnet status page and the release information on Discourse to stay informed about updates and changes that may affect you as a node runner, including node software releases and protocol updates.
To subscribe to updates on the Mainnet/Testnet status page click Subscribe to get all updates or click Get updates to choose to get all updates or only updates for specific products.
Before you begin
Before running a Concordium node you will need to
Install and run Docker.
On Linux, allow Docker to be run as a non-root user.
Running/upgrading a node
Concordium provides two Docker images, a mainnet one and a testnet one. These images are designed to be used together with docker-compose, or a similar driver. This guide provides a sample configuration using docker-compose
.
The node requires a database which must be stored on the host system so that it persists when the docker container is stopped. It is up to the user to select the location of the database on their host system. In the guide the location used is /var/lib/concordium-mainnet
or /var/lib/concordium-testent
but any location to which the user that runs the Docker command has access to will do.
Note
Node version 4.5.0 introduced the GRPC V2 interface which is enabled by the sample configurations listed below. If you have done special configuration of your node and want to re-use the configuration file and have the new API enabled, make sure to edit your configuration, adding CONCORDIUM_NODE_GRPC2_LISTEN_PORT
and CONCORDIUM_NODE_GRPC2_LISTEN_ADDRESS
as in the sample configurations.
Note
When upgrading, you can only upgrade one minor version at a time, or from the last release of major version X to major version X+1. You cannot skip versions. For patches, you can skip versions e.g. X.X.0 to X.X.3, or X.1.1 to X.2.3.
If you are running version 4.2.3 you can migrate to the latest version. If you are running any version older than 4.2.3 you will have to delete your database and start over using the instructions on this page.
Run a testnet node
To run a node on testnet use the following configuration file and follow the steps below.
Save the contents as
testnet-node.yaml
.Possibly modify the volume mount to map the database directory to a different location on the host system. The volume mount is the following section.
Modify the node name that appears on the network dashboard. This is set by the environment variable
This name can be set to any non-empty string. If the name has spaces it should be quoted.
Start the node and the collector.
The configuration starts two containers, one running the node, and another running the node collector that reports the node state to the network dashboard.
If you wish to have the node running in the background, then add a -d
option to the above command.
Note
The sample configuration always downloads the latest node image. It is good practice to choose the version deliberately. To choose a specific version, find the correct version in hub.docker.com/concordium/testnet-node and change the image
value from
to, e.g.,
Enable inbound connections
If you are running your node behind a firewall, or behind your home router, then you will probably only be able to connect to other nodes, but other nodes will not be able to initiate connections to your node. This is perfectly fine, and your node will fully participate in the Concordium network. It will be able to send transactions and, if so configured, to bake and finalize.
However you can also make your node an even better network participant by enabling inbound connections. The sample configuration above makes the node listen on port 8889
for inbound connections. Depending on your network and platform configuration you will either need to forward an external port to 8889
on your router, open it in your firewall, or both. The details of how this is done will depend on your configuration.
Retrieve node logs
The sample configuration presented above logs data using Dockerâs default logging infrastructure. To retrieve the logs for the node run:
This outputs the logs to stdout
.
Migration from the previous Docker distribution
In the past Concordium provided a concordium-software
package which contained a concordium-node
binary which orchestrated downloading a Docker image and running the node. To migrate from that setup:
Stop the running node (e.g., using
concordium-node-stop
)Either modify the relevant example configuration file above by mapping the existing node database directory for use by the new container, i.e., replacing
with
Or, alternatively, moving the contents of
~/.local/share/concordium
to, e.g.,/var/lib/concordium-testnet
and keeping the configuration files as they are.If your node is an existing baker node, update the configuration file above to include
into the
environment
section of thenode
service section of the file.Start the node and the collector.
The configuration starts two containers, one running the node, and another running the node collector that reports the node state to the network dashboard.
If you wish to have the node running in the background, then add a -d
option to the above command.
Note
The sample configuration always downloads the latest node image. It is good practice to choose the version deliberately. To choose a specific version, find the correct version in hub.docker.com/concordium/testnet-node and change the image
value from
to, e.g.,
Last updated