This guide explains how to deploy a Blast node using docker compose with pre-built Docker images. This method is ideal for users who prefer not to build from source and want a straightforward setup.

Prerequisites

Before you begin, ensure that you have Docker and Docker Compose installed on your machine. You will also need access to a valid L1 RPC endpoint, such as those provided by Alchemy, Infura, or other services.

Usage Instructions

1

Clone Deployment Repository

Start by cloning the Blast deployment repository, which contains the necessary Docker Compose configurations:
git clone [email protected]:blast-io/deployment.git
cd deployment
2

Configure the Environment Variables

Copy the .env.example file to .env and configure the following variables:
cp .env.example .env
Edit the .env file to set the required variables:
  • NETWORK: Set to mainnet or sepolia depending on the network you want to connect to.
  • GETH_DATA_DIR: Set the path where you want to store the blockchain data.
  • L1_RPC_URL: Your L1 RPC endpoint URL.
  • L1_RPC_KIND: The type of RPC provider (alchemy, infura, etc.).
  • OP_NODE_L1_BEACON: Your L1 Beacon api endpoint. Required as of Ecotone upgrade.
These variables are essential for configuring the node to connect to the appropriate network and storage locations.
3

Start the Docker Containers

Once the environment variables are set, you can start the containers using Docker Compose:
docker compose up -d
This command pulls the latest versions of the pre-built Docker images and starts the necessary containers, including blast-geth and op-node.
The -d flag runs the containers in detached mode, allowing them to run in the background.
4

Test Your Node

To test your node, you can run the following command to query the latest L2 block.
curl -d '{ \
  "id":0,
  "jsonrpc":"2.0",
  "method":"eth_getBlockByNumber",
  "params":["latest",false]
}' -H "Content-Type: application/json" http://localhost:9545
You will need to wait for your node to fully sync before this command will return the actual latest block.
5

Monitor & Manage Containers

You can monitor the running containers with:
  docker compose ps
If you need to stop the containers, use:
docker compose down
To update to the latest versions of the images, use:
docker compose pull --policy=always
docker compose up -d

Additional Considerations

To fully participate in p2p, please ensure TCP/UDP is allowed on port 9003, and add the argument --p2p.advertise.ip=<host-machine-public-ip> to the op-node service in the docker-compose.yml file. For more details, refer to the official Blast deployment repository.