Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/operate/consensus-validators/_meta.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const meta = {
"install-celestia-app": "Install celestia-app",
docker: "Docker images",
"consensus-node": "Run a consensus node",
"validator-node": "Run a validator node",
"cli-reference": "CLI commands reference",
Expand Down
188 changes: 188 additions & 0 deletions app/operate/consensus-validators/docker/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
---
sidebar_label: Docker images
description: Running celestia-app using Docker images.
---

import { Callout, Steps, Tabs } from 'nextra/components'

# 🐳 Docker setup for celestia-app

This page has instructions to run `celestia-appd` using Docker images.

If you are looking for instructions to run `celestia-node` using Docker, refer
to the [celestia-node Docker page](/operate/getting-started/docker).

## Prerequisites

- [Docker Desktop for Mac or Windows](https://docs.docker.com/get-docker)
- [Docker Engine for Linux](https://docs.docker.com/engine/install/)
- `curl` and `jq`

## Quick start with persistent storage

<Steps>

### Set network and version variables

<Tabs items={['Mainnet Beta', 'Mocha', 'Arabica']}>
<Tabs.Tab>
```bash
export NETWORK=celestia
export CHAIN_ID={{constants['mainnetChainId']}}
export APP_VERSION={{mainnetVersions['app-latest-tag']}}
export NODE_VERSION={{mainnetVersions['node-latest-tag']}}
```
</Tabs.Tab>
<Tabs.Tab>
```bash
export NETWORK=mocha
export CHAIN_ID={{constants['mochaChainId']}}
export APP_VERSION={{mochaVersions['app-latest-tag']}}
export NODE_VERSION={{mochaVersions['node-latest-tag']}}
```
</Tabs.Tab>
<Tabs.Tab>
```bash
export NETWORK=arabica
export CHAIN_ID={{constants['arabicaChainId']}}
export APP_VERSION={{arabicaVersions['app-latest-tag']}}
export NODE_VERSION={{arabicaVersions['node-latest-tag']}}
```
</Tabs.Tab>
</Tabs>

<Callout type="warning">
If you are block syncing Mainnet Beta from genesis, use
`export APP_VERSION=v3.0.2` as a temporary workaround for
[celestia-app issue #4370](https://github.com/celestiaorg/celestia-app/issues/4370).
After sync completes, upgrade to the latest version.
</Callout>

### Create the node home directory

```bash
mkdir -p $HOME/celestia-app-docker
```

Before mounting this directory, Linux users may need to set permissions:

```bash
sudo chown 10001:10001 $HOME/celestia-app-docker
```

### Initialize the node home

```bash
docker run --rm \
-v $HOME/celestia-app-docker:/home/celestia/.celestia-app \
ghcr.io/celestiaorg/celestia-app:$APP_VERSION \
init "docker-node" --chain-id $CHAIN_ID
```

### Download the genesis file

```bash
docker run --rm \
-v $HOME/celestia-app-docker:/home/celestia/.celestia-app \
ghcr.io/celestiaorg/celestia-app:$APP_VERSION \
download-genesis $CHAIN_ID
```

### Configure persistent peers

<Tabs items={['Mainnet Beta', 'Mocha', 'Arabica']}>
<Tabs.Tab>
```bash
PERSISTENT_PEERS=$(curl -sL https://raw.githubusercontent.com/cosmos/chain-registry/master/{{constants['mainnetChainId']}}/chain.json | jq -r '.peers.persistent_peers[].address' | tr '\n' ',' | sed 's/,$//')
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PERSISTENT_PEERS\"/" $HOME/celestia-app-docker/config/config.toml
```
</Tabs.Tab>
<Tabs.Tab>
```bash
PERSISTENT_PEERS=$(curl -sL https://raw.githubusercontent.com/celestiaorg/networks/master/{{constants['mochaChainId']}}/peers.txt | tr '\n' ',' | sed 's/,$//')
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PERSISTENT_PEERS\"/" $HOME/celestia-app-docker/config/config.toml
```
</Tabs.Tab>
<Tabs.Tab>
```bash
PERSISTENT_PEERS=$(curl -sL https://raw.githubusercontent.com/celestiaorg/networks/master/{{constants['arabicaChainId']}}/peers.txt | tr '\n' ',' | sed 's/,$//')
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PERSISTENT_PEERS\"/" $HOME/celestia-app-docker/config/config.toml
```
</Tabs.Tab>
</Tabs>

### Start the container

```bash
docker run -d \
--name celestia-app \
--restart unless-stopped \
-v $HOME/celestia-app-docker:/home/celestia/.celestia-app \
-p 26656:26656 \
-p 26657:26657 \
-p 9090:9090 \
ghcr.io/celestiaorg/celestia-app:$APP_VERSION \
start --home /home/celestia/.celestia-app --rpc.laddr tcp://0.0.0.0:26657
```

### Check node status

```bash
docker logs -f celestia-app
curl -s http://localhost:26657/status | jq '.result.sync_info'
```

</Steps>

## Run celestia-node in Docker against your containerized celestia-app

<Callout type="info">
If you run a bridge node, make sure your consensus node config follows the
[bridge requirements](/operate/consensus-validators/consensus-node#optional-connect-a-consensus-node-to-a-bridge-node).
</Callout>

<Steps>

### Create a shared Docker network

```bash
docker network create celestia-network
```

### Recreate celestia-app on the shared network

```bash
docker stop celestia-app && docker rm celestia-app

docker run -d \
--name celestia-app \
--restart unless-stopped \
--network celestia-network \
--network-alias celestia-app \
-v $HOME/celestia-app-docker:/home/celestia/.celestia-app \
-p 26656:26656 \
-p 26657:26657 \
-p 9090:9090 \
ghcr.io/celestiaorg/celestia-app:$APP_VERSION \
start --home /home/celestia/.celestia-app --rpc.laddr tcp://0.0.0.0:26657
```

### Start celestia-node in the same Docker network

```bash
docker run --rm -it \
--name celestia-node \
--network celestia-network \
-e NODE_TYPE=light \
-e P2P_NETWORK=$NETWORK \
ghcr.io/celestiaorg/celestia-node:$NODE_VERSION \
celestia light start --core.ip celestia-app --core.port 26657 --p2p.network $NETWORK
```

</Steps>

## Next steps

- [Consensus node guide](/operate/consensus-validators/consensus-node)
- [Validator node guide](/operate/consensus-validators/validator-node)
- [celestia-node Docker guide](/operate/getting-started/docker)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import { Steps, Tabs } from 'nextra/components'

This tutorial will guide you through installing celestia-app, both
[from source](#building-binary-from-source) and with
[a pre-built binary](#installing-a-pre-built-binary)
[a pre-built binary](#installing-a-pre-built-binary). If you are looking for
Docker-based setup instructions, refer to the
[celestia-app Docker page](/operate/consensus-validators/docker).

Celestia-app is the software that enables you to run
consensus nodes (including validators) and provide RPC endpoints.
Expand Down
2 changes: 2 additions & 0 deletions app/operate/getting-started/docker/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { Steps, Tabs } from 'nextra/components'
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](/operate/data-availability/install-celestia-node).
If you are looking for instructions to run celestia-app in Docker, refer to
the [celestia-app Docker page](/operate/consensus-validators/docker).

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
Expand Down