Aller au contenu principal

🐳 Docker setup

This page has instructions to run celestia-node using Docker. If you are looking for instructions to run celestia-node using a binary, please refer to the celestia-node page.

Using Docker is the easiest way to run celestia-node for most users. Docker is a containerization platform that allows you to run celestia-node in an isolated environment.

This means that you can run celestia-node on your machine without having to worry about installing and configuring all of the dependencies required to run the node.

If you would like to learn more about key management in Docker, visit the Docker and cel-key section.

The easiest way to install Docker is to use the Docker Desktop installer or Ubuntu. You can find the instructions for your operating system here.

Prerequisites

  • Docker and basic understanding of Docker

Quick start

Blockspace Race light node setup

Run the image from the command line:

docker run -e NODE_TYPE=light -e P2P_NETWORK=blockspacerace ghcr.io/celestiaorg/celestia-node:v0.10.2 celestia light start --core.ip https://rpc-blockspacerace.pops.one --gateway --gateway.addr 127.0.0.1 --gateway.port 26659 --p2p.network blockspacerace
astuce

Please refer to the ports section for information on which ports are required to be open on your machine.

Congratulations! You now have a Celestia light node running on the Blockspace Race testnet.

If you would like to run the node with custom flags, you can refer to the celestia-node tutorial page.

Light node setup with persistent storage

If you delete a container that you started above, all data will be lost. To avoid this, you can mount a volume to the container. This will allow you to persist data even after the container is deleted.

First, you will need to create a directory on your host machine. This directory will be used to store the data for the container. Create a directory on your host machine and give it a name. For example, you can name it my-node-store:

cd $HOME
mkdir my-node-store

Now, you can mount this directory to the container. Before mounting a volume, you may need to set permissions for the user on the host machine by running:

sudo chown 10001:10001 $HOME/my-node-store

Initialize the node store and key

In order to mount a volume to the container, you need to specify the path to the volume. When you run your container, you can specify the path to the volume using the --volume (or -v for short) flag. In this command, we'll create our key and initialize the node store:

# --volume == -v [local path]:[container path]
docker run [...args] -v $HOME/my-node-store:/home/celestia celestia <node-type> init [...args]

An example init command for the Blockspace Race will look similar to below:

docker run -e NODE_TYPE=light -e P2P_NETWORK=blockspacerace -v $HOME/my-node-store:/home/celestia ghcr.io/celestiaorg/celestia-node:v0.10.2 celestia light init --p2p.network blockspacerace

Start the node

Run the following command to start the node:

# --volume == -v [local path]:[container path]
docker run [...args] -v $HOME/my-node-store:/home/celestia celestia <node-type> start [...args]

A full start command will look similar to below. This is an example using a light node on Blockspace Race:

docker run -e NODE_TYPE=light -e P2P_NETWORK=blockspacerace -v $HOME/my-node-store:/home/celestia ghcr.io/celestiaorg/celestia-node:v0.10.2 celestia light start --core.ip https://rpc-blockspacerace.pops.one --gateway --gateway.addr 127.0.0.1 --gateway.port 26659 --p2p.network blockspacerace

Video walkthrough

2.5 minute version