-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Anchorage node operation (#1342)
* Add Anchorage node operation * Add Anchorage node operation * Add Geth documentation * Fix minor issues
- Loading branch information
1 parent
fb9c957
commit b930823
Showing
12 changed files
with
531 additions
and
108 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Node Operators |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Node Operators (Anchorage) | ||
|
||
The anchorage is activated on Sepolia Testnet. For other networks, please refer to [Replica Node (Legacy)](../../boba_community/boba-node/README.md). | ||
|
||
## Overview | ||
|
||
The repliace node section is a collection of guides and tutorials help you run your own BOBA node. | ||
|
||
## Node Architecture | ||
|
||
Every node is made up of two main parts: the Rollup Node and the Execution Client. Additionally, there's an optional part called Legacy Geth, which is used for looking up information about blocks and transactions that were made before the [Anchorage Upgrade](https://github.com/bobanetwork/v3-anchorage/blob/develop/boba-chain-ops/README.md#migration). | ||
|
||
### Rollup Node | ||
|
||
The Rollup Node is responsible for taking data from Layer 1 (L1) and use it to create Layer 2 (L2) block information, which it then sends to the Execution Client. Additionally, the Rollup Node can choose to join a network that lets it get blocks straight from the Sequencer before those blocks are sent to L1. | ||
|
||
### Execution Client | ||
|
||
The Execution Client takes care of running the block information it gets from the Rollup Node. It does this through a common method called JSON-RPC, using a set of rules known as the [Engine API](https://github.com/ethereum/execution-apis/blob/main/src/engine/common.md#engine-api----common-definitions). Boba allows the use of either geth or erigon as the Execution Client. | ||
|
||
### Legacy Geth | ||
|
||
Boba switched its database from **Geth** to **Erigon** during a significant update called the [Anchorage Upgrade](https://github.com/bobanetwork/v3-anchorage/blob/develop/boba-chain-ops/README.md#migration). The old data from Geth, before this upgrade, can still be accessed with the new system but needs a special part called Legacy Geth to work properly. This means if you need to use certain commands, like `eth_call`, on the old data, you'll have to use Legacy Geth. | ||
|
||
You don't always need Legacy Geth, though. It's mainly for those who want to keep a full historical record of Boba nodes. | ||
|
||
### Diagram | ||
|
||
The diagram below explains how three parts - the Rollup Node, Execution Client, and Legacy Geth - fit together to make a full Boba node. It uses examples called `op-node` for the Rollup Node and `op-erigon` for the Execution Client, but this setup is similar for other versions too. | ||
|
||
![image](../../boba_documentation/diagrams/node-operator.png) | ||
|
||
### Software Release | ||
|
||
Make sure to update your node software regularly. This keeps your node working well with others, especially when new updates come out. Updates can fix problems and improve stability. Check the [Software Releases](./releases.md) page to see the newest versions of the software. Also, follow the [@Boba Twitter account](https://twitter.com/bobanetwork) to get alerts about important updates. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
# Running a Node with Docker | ||
|
||
This tutorial will walk you through the process of using Docker to run an BOBA Sepolia node, OP Mainnet node and OP Sepolia node. You can find all Docker Compose files [here](https://github.com/bobanetwork/v3-anchorage/tree/develop/boba-community). | ||
|
||
## Prerequisites | ||
|
||
* [docker](https://docs.docker.com/engine/install/) | ||
* [docker-compose](https://docs.docker.com/compose/install/) | ||
|
||
## Setup | ||
|
||
Clone the `v3-anchorage` repository to get started | ||
|
||
```bash | ||
git clone https://github.com/bobanetwork/v3-anchorage.git | ||
cd v3-anchorage | ||
cd boba-community | ||
``` | ||
|
||
## Configuration | ||
|
||
Configuration for the `docker-compose` is handled through environment variables inside of an `.env` file. | ||
|
||
### Create an `.env` file | ||
|
||
The repository includes a sample environment variable file located at `.env.example` that you can copy and modify to get started. Make a copy of this file and name it `.env`. | ||
|
||
```bash | ||
cp .env.example .env | ||
``` | ||
|
||
### Configure the `.env` file | ||
|
||
Open the `.env` in your directory and set the variables inside. Read the descriptions of each variable to understand what they do and how to set them. Read the [software release](./software-release.md) page to set the correct version. | ||
|
||
## DB Configuration | ||
|
||
### Download Snapshots | ||
|
||
You can download the database snapshot for the client and network you wish to run. | ||
|
||
Always verify snapshots by comparing the sha256sum of the downloaded file to the sha256sum listed on this [page](./snapshot-downloads.md). Check the sha256sum of the downloaded file by running `sha256sum <filename>`in a terminal. | ||
|
||
- BOBA Sepolia | ||
|
||
The **erigon** db can be downloaded from the [boba sepolia erigon db](https://boba-db.s3.us-east-2.amazonaws.com/sepolia/boba-sepolia-erigon-db.tgz). | ||
|
||
```bash | ||
curl -o boba-sepolia-erigon-db.tgz -sL https://boba-db.s3.us-east-2.amazonaws.com/sepolia/boba-sepolia-erigon-db.tgz | ||
``` | ||
|
||
The **geth** db can be downloaded from [boba sepolia geth db](https://boba-db.s3.us-east-2.amazonaws.com/sepolia/boba-sepolia-geth-db.tgz). | ||
|
||
```bash | ||
curl -o boba-sepolia-geth-db.tgz -sL https://boba-db.s3.us-east-2.amazonaws.com/sepolia/boba-sepolia-geth-db.tgz | ||
``` | ||
|
||
- OP Mainnet | ||
|
||
The **erigon** db can be downloaded from [Test in Prod OP Mainnet](https://op-erigon-backup.mainnet.testinprod.io). | ||
|
||
- OP Sepolia | ||
|
||
The genesis file can be downloaded from [Optimsim](https://networks.optimism.io/op-sepolia/genesis.json). | ||
|
||
```bash | ||
curl -o op-sepolia-genesis.json -sL https://networks.optimism.io/op-sepolia/genesis.json | ||
``` | ||
|
||
Once the genesis file is downloaded to the local directory, you can initialize the data directory with the genesis file. | ||
|
||
```bash | ||
erigon init --datadir=/db genesis.json | ||
``` | ||
|
||
The erigon can be built from the [source](https://github.com/bobanetwork/v3-erigon) using `make erigon` . | ||
|
||
|
||
### Extract Snapshots | ||
|
||
Once you've downloaded the database snapshot, you'll need to extract it to a directory on your machine. This will take some time to complete. | ||
|
||
```bash | ||
tar xvf data.tgz | ||
``` | ||
|
||
### Create a Shared Secret (JWT Token) | ||
|
||
```bash | ||
openssl rand -hex 32 > jwt-secret.txt | ||
``` | ||
|
||
### Modify Volume Location | ||
|
||
The volumes of l2 and op-node should be modified to your file locations. | ||
|
||
```yaml | ||
l2: | ||
volumes: | ||
- ./jwt-secret.txt:/config/jwt-secret.txt | ||
- DATA_DIR:/db | ||
op-node: | ||
volumes: | ||
- ./jwt-secret.txt:/config/jwt-secret.txt | ||
``` | ||
## Run the Node | ||
Once you've configured your `.env` file, you can run the node using Docker Compose. The following command will start the node in the background. | ||
|
||
```bash | ||
docker-compose -f [docker-compose-file] up -d | ||
``` | ||
|
||
## Optional: Run the Node with Geth | ||
|
||
We support both geth and erigon as the execution engines for Boba Sepolia node. You can start the node with geth using the following command: | ||
|
||
```bash | ||
docker-compose -f docker-compose-sepolia-geth.yml up -d | ||
``` | ||
|
||
## Operating the Node | ||
|
||
### Start | ||
|
||
```bash | ||
docker-compose -f [docker-compose-file] up -d | ||
``` | ||
|
||
Will start the node in a detatched shell (`-d`), meaning the node will continue to run in the background. | ||
|
||
### View Logs | ||
|
||
```bash | ||
docker-compose logs -f --tail 10 | ||
``` | ||
|
||
To view logs of all containers. | ||
|
||
```bash | ||
docker-compose logs <CONTAINER_NAME> -f --tail 10 | ||
``` | ||
|
||
### Stop | ||
|
||
```bash | ||
docker-compose -f [docker-compose-file] down | ||
``` | ||
|
||
### Wipe [DANGER] | ||
|
||
```bash | ||
docker-compose -f [docker-compose-file] down -v | ||
``` | ||
|
Oops, something went wrong.