Deploy an OP Stack devnet to Celestia
In order to deploy a devnet to Celestia, you will need to have a modified version of optimism-bedrock
. Refer to the steps to install dependencies and the modified version of OP Stack for your environment setup.
Pick your deployment type
Using Celestia and OP stack, you have the option to either run a light node of your own or a local-celestia-devnet
, both of which will give you a local devnet to test things out with.
Using a local devnet
If you'd like to use the local-celestia-devnet
, you're in luck! This is the default for the OP Stack + Celestia repository. Head to the previous page to get started.
Using a light node
This is a beta integration and we are working on resolving open issues.
In order to allow your light node to post and retrieve data without errors, you will need to change UseShareExchange
to false
in:
$HOME/.celestia-light/config.toml
$HOME/.celestia-light/config.toml
$HOME/.celestia-light-mocha-4/config.toml
$HOME/.celestia-light-mocha-4/config.toml
$HOME/.celestia-light-arabica-10/config.toml
$HOME/.celestia-light-arabica-10/config.toml
If you choose to use your own node store, the light node must be fully synced and funded for you to be able to submit and retrieve PayForBlobs
to a Celestia network.
If it is not synced, you will run into errors similar to this.
Visit the Arabica or Mocha pages to to visit their faucets.
In order to mount existing data, you must have a node store that is in this directory:
$HOME/.celestia-light
$HOME/.celestia-light
$HOME/.celestia-light-mocha-4
$HOME/.celestia-light-mocha-4
$HOME/.celestia-light-arabica-10
$HOME/.celestia-light-arabica-10
This is the default location of the node store when you initialize and run a new Celestia node.
By default, the node will run with the account named my_celes_key
.
If you have your own setup you'd like to try, you can always edit optimism/ops-bedrock/docker-compose.yml
to work with your setup.
Using a RaaS provider
If you'd like to use a Rollups as a Service (RaaS) provider, you can do so by going to the RaaS category in the menu.
Build the devnet
Build TypeScript definitions for TS dependencies:
cd $HOME
cd optimism
make
cd $HOME
cd optimism
make
Set environment variables to start network:
export SEQUENCER_BATCH_INBOX_ADDRESS=0xff00000000000000000000000000000000000000
export L2OO_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8
export SEQUENCER_BATCH_INBOX_ADDRESS=0xff00000000000000000000000000000000000000
export L2OO_ADDRESS=0x70997970C51812dc3A010C7d01b50e0d17dc79C8
Start the devnet
First, make sure your light node is synced and funded.
This example is for Mainnet Beta. You can modify the da:
section of your $HOME/optimism/ops-bedrock/docker-compose.yml
for your specific use, similarly to the example below:
WARNING
The user in the docker-compose.yml
is the root
user, but this is not meant to be used in production.
da:
user: root
platform: "${PLATFORM}"
platform: linux/x86_64
image: "ghcr.io/rollkit/local-celestia-devnet:v0.12.1"
image: "ghcr.io/celestiaorg/celestia-node:v0.12.0"
command: celestia light start --core.ip rpc.celestia.pops.one --p2p.network celestia --log.level debug --gateway
environment:
- NODE_TYPE=light
- P2P_NETWORK=mocha
ports:
- "26657:26657"
- "26658:26658"
- "26659:26659"
volumes:
- $HOME/.celestia-light/:/home/celestia/.celestia-light/
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:26659/header/1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
da:
user: root
platform: "${PLATFORM}"
platform: linux/x86_64
image: "ghcr.io/rollkit/local-celestia-devnet:v0.12.1"
image: "ghcr.io/celestiaorg/celestia-node:v0.12.0"
command: celestia light start --core.ip rpc.celestia.pops.one --p2p.network celestia --log.level debug --gateway
environment:
- NODE_TYPE=light
- P2P_NETWORK=mocha
ports:
- "26657:26657"
- "26658:26658"
- "26659:26659"
volumes:
- $HOME/.celestia-light/:/home/celestia/.celestia-light/
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:26659/header/1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
And in $HOME/optimism/bedrock-devnet/devnet__init__.py
result = run_command(["docker", "exec", "ops-bedrock-da-1", "celestia", "bridge", "auth", "admin", "--node.store", "/home/celestia/bridge"],
result = run_command(["celestia", "light", "auth", "admin"],
cwd=paths.ops_bedrock_dir, capture_output=True,
)
result = run_command(["docker", "exec", "ops-bedrock-da-1", "celestia", "bridge", "auth", "admin", "--node.store", "/home/celestia/bridge"],
result = run_command(["celestia", "light", "auth", "admin"],
cwd=paths.ops_bedrock_dir, capture_output=True,
)
View the logs of the devnet
If you'd like to view the logs of the devnet, run the following command from the root of the Optimism directory:
make devnet-logs
make devnet-logs
Stop the devnet
To safely stop the devnet, run the following command:
make devnet-down
make devnet-down
Clean the devnet
To remove all data from the devnet, run the following command:
make devnet-clean
make devnet-clean
Deploying to an L1 (or L2)
If you'd like to deploy to an EVM L1 or L2, reference the OP stack deployment guide.