Skip to content

Commit 47d97a4

Browse files
Copilotjcstein
andcommitted
docs: add celestia-app Docker setup guide (#2438)
Co-authored-by: jcstein <46639943+jcstein@users.noreply.github.com>
1 parent f3b4ede commit 47d97a4

4 files changed

Lines changed: 194 additions & 1 deletion

File tree

app/operate/consensus-validators/_meta.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const meta = {
22
"install-celestia-app": "Install celestia-app",
3+
docker: "Docker images",
34
"consensus-node": "Run a consensus node",
45
"validator-node": "Run a validator node",
56
"cli-reference": "CLI commands reference",
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
---
2+
sidebar_label: Docker images
3+
description: Running celestia-app using Docker images.
4+
---
5+
6+
import { Callout, Steps, Tabs } from 'nextra/components'
7+
8+
# 🐳 Docker setup for celestia-app
9+
10+
This page has instructions to run `celestia-appd` using Docker images.
11+
12+
If you are looking for instructions to run `celestia-node` using Docker, refer
13+
to the [celestia-node Docker page](/operate/getting-started/docker).
14+
15+
## Prerequisites
16+
17+
- [Docker Desktop for Mac or Windows](https://docs.docker.com/get-docker)
18+
- [Docker Engine for Linux](https://docs.docker.com/engine/install/)
19+
- `curl` and `jq`
20+
21+
## Quick start with persistent storage
22+
23+
<Steps>
24+
25+
### Set network and version variables
26+
27+
<Tabs items={['Mainnet Beta', 'Mocha', 'Arabica']}>
28+
<Tabs.Tab>
29+
```bash
30+
export NETWORK=celestia
31+
export CHAIN_ID={{constants['mainnetChainId']}}
32+
export APP_VERSION={{mainnetVersions['app-latest-tag']}}
33+
export NODE_VERSION={{mainnetVersions['node-latest-tag']}}
34+
```
35+
</Tabs.Tab>
36+
<Tabs.Tab>
37+
```bash
38+
export NETWORK=mocha
39+
export CHAIN_ID={{constants['mochaChainId']}}
40+
export APP_VERSION={{mochaVersions['app-latest-tag']}}
41+
export NODE_VERSION={{mochaVersions['node-latest-tag']}}
42+
```
43+
</Tabs.Tab>
44+
<Tabs.Tab>
45+
```bash
46+
export NETWORK=arabica
47+
export CHAIN_ID={{constants['arabicaChainId']}}
48+
export APP_VERSION={{arabicaVersions['app-latest-tag']}}
49+
export NODE_VERSION={{arabicaVersions['node-latest-tag']}}
50+
```
51+
</Tabs.Tab>
52+
</Tabs>
53+
54+
<Callout type="warning">
55+
If you are block syncing Mainnet Beta from genesis, use
56+
`export APP_VERSION=v3.0.2` as a temporary workaround for
57+
[celestia-app issue #4370](https://github.com/celestiaorg/celestia-app/issues/4370).
58+
After sync completes, upgrade to the latest version.
59+
</Callout>
60+
61+
### Create the node home directory
62+
63+
```bash
64+
mkdir -p $HOME/celestia-app-docker
65+
```
66+
67+
Before mounting this directory, Linux users may need to set permissions:
68+
69+
```bash
70+
sudo chown 10001:10001 $HOME/celestia-app-docker
71+
```
72+
73+
### Initialize the node home
74+
75+
```bash
76+
docker run --rm \
77+
-v $HOME/celestia-app-docker:/home/celestia/.celestia-app \
78+
ghcr.io/celestiaorg/celestia-app:$APP_VERSION \
79+
init "docker-node" --chain-id $CHAIN_ID
80+
```
81+
82+
### Download the genesis file
83+
84+
```bash
85+
docker run --rm \
86+
-v $HOME/celestia-app-docker:/home/celestia/.celestia-app \
87+
ghcr.io/celestiaorg/celestia-app:$APP_VERSION \
88+
download-genesis $CHAIN_ID
89+
```
90+
91+
### Configure persistent peers
92+
93+
<Tabs items={['Mainnet Beta', 'Mocha', 'Arabica']}>
94+
<Tabs.Tab>
95+
```bash
96+
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/,$//')
97+
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PERSISTENT_PEERS\"/" $HOME/celestia-app-docker/config/config.toml
98+
```
99+
</Tabs.Tab>
100+
<Tabs.Tab>
101+
```bash
102+
PERSISTENT_PEERS=$(curl -sL https://raw.githubusercontent.com/celestiaorg/networks/master/{{constants['mochaChainId']}}/peers.txt | tr '\n' ',' | sed 's/,$//')
103+
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PERSISTENT_PEERS\"/" $HOME/celestia-app-docker/config/config.toml
104+
```
105+
</Tabs.Tab>
106+
<Tabs.Tab>
107+
```bash
108+
PERSISTENT_PEERS=$(curl -sL https://raw.githubusercontent.com/celestiaorg/networks/master/{{constants['arabicaChainId']}}/peers.txt | tr '\n' ',' | sed 's/,$//')
109+
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PERSISTENT_PEERS\"/" $HOME/celestia-app-docker/config/config.toml
110+
```
111+
</Tabs.Tab>
112+
</Tabs>
113+
114+
### Start the container
115+
116+
```bash
117+
docker run -d \
118+
--name celestia-app \
119+
--restart unless-stopped \
120+
-v $HOME/celestia-app-docker:/home/celestia/.celestia-app \
121+
-p 26656:26656 \
122+
-p 26657:26657 \
123+
-p 9090:9090 \
124+
ghcr.io/celestiaorg/celestia-app:$APP_VERSION \
125+
start --home /home/celestia/.celestia-app --rpc.laddr tcp://0.0.0.0:26657
126+
```
127+
128+
### Check node status
129+
130+
```bash
131+
docker logs -f celestia-app
132+
curl -s http://localhost:26657/status | jq '.result.sync_info'
133+
```
134+
135+
</Steps>
136+
137+
## Run celestia-node in Docker against your containerized celestia-app
138+
139+
<Callout type="info">
140+
If you run a bridge node, make sure your consensus node config follows the
141+
[bridge requirements](/operate/consensus-validators/consensus-node#optional-connect-a-consensus-node-to-a-bridge-node).
142+
</Callout>
143+
144+
<Steps>
145+
146+
### Create a shared Docker network
147+
148+
```bash
149+
docker network create celestia-network
150+
```
151+
152+
### Recreate celestia-app on the shared network
153+
154+
```bash
155+
docker stop celestia-app && docker rm celestia-app
156+
157+
docker run -d \
158+
--name celestia-app \
159+
--restart unless-stopped \
160+
--network celestia-network \
161+
--network-alias celestia-app \
162+
-v $HOME/celestia-app-docker:/home/celestia/.celestia-app \
163+
-p 26656:26656 \
164+
-p 26657:26657 \
165+
-p 9090:9090 \
166+
ghcr.io/celestiaorg/celestia-app:$APP_VERSION \
167+
start --home /home/celestia/.celestia-app --rpc.laddr tcp://0.0.0.0:26657
168+
```
169+
170+
### Start celestia-node in the same Docker network
171+
172+
```bash
173+
docker run --rm -it \
174+
--name celestia-node \
175+
--network celestia-network \
176+
-e NODE_TYPE=light \
177+
-e P2P_NETWORK=$NETWORK \
178+
ghcr.io/celestiaorg/celestia-node:$NODE_VERSION \
179+
celestia light start --core.ip celestia-app --core.port 26657 --p2p.network $NETWORK
180+
```
181+
182+
</Steps>
183+
184+
## Next steps
185+
186+
- [Consensus node guide](/operate/consensus-validators/consensus-node)
187+
- [Validator node guide](/operate/consensus-validators/validator-node)
188+
- [celestia-node Docker guide](/operate/getting-started/docker)

app/operate/consensus-validators/install-celestia-app/page.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ import { Steps, Tabs } from 'nextra/components'
88

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

1315
Celestia-app is the software that enables you to run
1416
consensus nodes (including validators) and provide RPC endpoints.

app/operate/getting-started/docker/page.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import { Steps, Tabs } from 'nextra/components'
1010
This page has instructions to run celestia-node using Docker. If you are
1111
looking for instructions to run celestia-node using a binary, please
1212
refer to the [celestia-node page](/operate/data-availability/install-celestia-node).
13+
If you are looking for instructions to run celestia-app in Docker, refer to
14+
the [celestia-app Docker page](/operate/consensus-validators/docker).
1315

1416
Using Docker is the easiest way to run celestia-node for most
1517
users. Docker is a containerization platform that allows you to run celestia-node

0 commit comments

Comments
 (0)