Deploy

Learn how to deploy a Relay Chain.

Deployment

This page provides instructions on how to deploy a chain to a server.

Before we begin, please note that this document only covers the method of downloading and using the chain spec file via the network. If you prefer not to proceed this way, you can upload the file or directly create the chain spec file on the server using various methods.

There are three methods for server deployment:

  • Systemd

  • Docker

  • Kubernetes

Let's explore how to deploy using these three methods.

Systemd

Systemd is a common method for managing services on Linux hosts. It allows you to check if a process is active and running, set policies for restarts, configure the user running the host, and limit memory usage, among other tasks.

You can also use environment variable files to abstract variables into separate files for each server.

To use systemd, you need to first register the service. To do this, create a file named Infrablockspace.service in the /etc/systemd/system directory. Then, copy and paste the code below, replacing <binary file> and <options> with the necessary option values. For a Relay Chain, use infrablockspace as the <binary file>, and for a parachain, use infrablockspace-parachain.

#/etc/systemd/system/Infrablockspace.service
[Unit]
Description=Infrablockspace Validator

[Service]
User=Infrablockspace
ExecStart=/home/Infrablockspace/<binary file> <options>
Restart=always
RestartSec=90

[Install]
WantedBy=multi-user.target

After writing the file, register the service using the following commands:

Docker

When using Docker, it is recommended to use a docker-compose.yml file for execution.

Before running Docker Compose, you need to download the chain spec file. Use the following command to download the file:

For a Relay Chain:

For a parachain:

Place the downloaded file in the chain-spec folder. If the folder does not exist, create it.

Next, create the Docker Compose-related files as shown below:

For a Relay Chain:

For a parachain:

For a parachain, the boot node ID of the Relay Chain is required. Therefore, you need to fill in <bootnode id>.

Run the following command to execute the Docker Compose:

Kubernetes

To deploy a chain in Kubernetes, you need to create the following files:

Please note that dynamic persistent volume claims are assumed to be possible. If dynamic persistent volume claims are not possible, please create persistent volumes.

For a Relay Chain:

statefuleset.yaml

service.yaml

pvc.yaml

For a parachain, let's take a look at the writing method.

The following code is written for InfraDID.

statefuleset.yaml

service.yaml

pvc.yaml

By running the following command in Kubernetes, you can confirm that the code is generated correctly.

For Helm charts and operators, they will be updated in the future during development.

Learn More

Last updated