Skip to content

Commit

Permalink
Add Anchorage node operation (#1342)
Browse files Browse the repository at this point in the history
* Add Anchorage node operation

* Add Anchorage node operation

* Add Geth documentation

* Fix minor issues
  • Loading branch information
boyuan-chen authored Feb 8, 2024
1 parent fb9c957 commit b930823
Show file tree
Hide file tree
Showing 12 changed files with 531 additions and 108 deletions.
Binary file added .gitbook/assets/sepolia 28882.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@
* [Development Stack](boba\_documentation/developer/local-stack.md)
* [Fees](boba\_documentation/developer/fee-scheme.md)
* [xDomain Transaction Status](boba\_documentation/developer/xdomain-tx-status.md)
* [Replica node](boba\_community/boba-node/README.md)
* [Exchange Integration](boba\_documentation/developer/exchange-integration.md)
* [Contracts Registration](for-developers/register.md)
* [Token Addresses](boba\_documentation/developer/token-addresses.md)
* [Node Operators](for-developers/node-operators/README.md)
* [Overview](for-developers/node-operators/overview.md)
* [Run a Node With Docker](for-developers/node-operators/run-node-docker.md)
* [Run a Node From Source](for-developers/node-operators/run-node-source.md)
* [Snapshot downloads](for-developers/node-operators/snapshot-downloads.md)
* [Software release](for-developers/node-operators/software-release.md)
* [Replica node (Legacy)](boba\_community/boba-node/README.md)
* [Oracles](for-developers/oracles/README.md)
* [Boba Straw Price Feed Oracle](oracles/oracle.md)
* [Gas Price Oracle](oracles/gas-price-oracle.md)
Expand Down
2 changes: 1 addition & 1 deletion boba_community/boba-node/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Replica node
# Replica node (Legacy)

The [boba\_community/boba-node](./) repo runs a replica of the Boba L2geth, which is useful for generating analytics for blockexplorers and other specialized use cases.

Expand Down
Binary file added boba_documentation/diagrams/node-operator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
106 changes: 0 additions & 106 deletions for-developers/multichain/network-avalanche.md

This file was deleted.

15 changes: 15 additions & 0 deletions for-developers/multichain/network-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ description: A collection of links and addresses to get started on Boba-Ethereum

# Contract Addresses Boba/Ethereum

<figure><img src="../../.gitbook/assets/sepolia 28882.png" alt=""><figcaption></figcaption></figure>

For **primary network contracts and addresses** see [packages/contracts-bedrock/deployments/boba-sepolia](https://github.com/bobanetwork/v3-anchorage/tree/develop/packages/contracts-bedrock/deployments/boba-sepolia)

### Sepolia Links and Endpoints

| | |
| -------------- | ------------------------------------------------------------ |
| Sepolia ChainID | 28882 |
| Sepolia RPC | <p><a href="https://sepolia.boba.network">https://sepolia.boba.network</a><br><br><em><strong>This endpoint is not for production systems and is rate limited.</strong></em></p><p></a></p> |
| Gateway | [https://gateway.boba.network](https://gateway.boba.network) |
| Blockexplorer | **TDB** |
| Websocket | [wss://wss.sepolia.boba.network](wss://wss.sepolia.boba.network) |
| Gas Cap | 50000000 |

<figure><img src="../../.gitbook/assets/goerli 2888.png" alt=""><figcaption></figcaption></figure>

### Goerli Addresses
Expand Down
1 change: 1 addition & 0 deletions for-developers/node-operators/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Node Operators
35 changes: 35 additions & 0 deletions for-developers/node-operators/overview.md
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.
156 changes: 156 additions & 0 deletions for-developers/node-operators/run-node-docker.md
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
```

Loading

0 comments on commit b930823

Please sign in to comment.