Skip to content

Commit

Permalink
add files for running a rinkeby replica (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
CAPtheorem authored Apr 22, 2022
1 parent 2574e1d commit 5df4c58
Show file tree
Hide file tree
Showing 6 changed files with 115,574 additions and 5 deletions.
34 changes: 29 additions & 5 deletions boba_community/boba-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ This repo runs a local replica of the Boba L2geth, which is useful for generatin
## Prerequisites

\- docker

\- docker-compose

## Start Replica service
Expand All @@ -21,7 +20,10 @@ This repo runs a local replica of the Boba L2geth, which is useful for generatin
```bash
$ git clone https://github.com/bobanetwork/boba.git
$ cd boba_community/boba-node
$ docker compose pull

$ docker compose pull # for mainnet
# or...
$ docker compose -f docker-compose-rinkeby.yml pull #for rinkeby
```

Then, add your Infura key to `boba_community/boba-node/docker-compose.yaml`. If you do not have an Infura key, you can obtain one for free from [Infura](https://infura.io) or any other node provider.
Expand All @@ -34,18 +36,40 @@ x-l1_rpc_geth: &l1_rpc_geth
ETH1_HTTP: 'https://mainnet.infura.io/v3/YOUR_INFURA_KEY'
```

Bring up the services:
For Rinkeby, replace `https://mainnet.infura.io/` with `https://rinkeby.infura.io/`. Then, select the correct state dump file from `/state-dumps`, move it up one level, and rename it to `state-dump.latest.json`. Then, bring up the services:

```bash
$ docker-compose up # for mainnet
# or...
$ docker compose -f docker-compose-rinkeby.yml up #for rinkeby
```

The DTL will first sync with the chain. During the sync, you will see the DTL and Replica gradually catch up with the Boba L2. This can take several minutes to several hours, depending on which chain you are replicating.

**DTL syncing**

```bash
dtl | {"level":30,"time":1650658119224,"fromBlock":13001,"toBlock":14001,"msg":"Synchronizing unconfirmed transactions from Layer 2 (Optimism)"}
```

docker-compose up
**Replica replaying transactions**

```bash
dtl | {"level":30,"time":1650659925936,"method":"GET","url":"/transaction/index/8074?backend=l2","elapsed":0,"msg":"Served HTTP Request"}
replica | TRACE[04-22|20:38:45.938] Applying indexed transaction index=8074
replica | DEBUG[04-22|20:38:45.938] Applying transaction to tip index=8074 hash=0x6ae363fcfe8ef71f115d643844b0bed340e95f8a9ec311b466f952b38c94b18b origin=sequencer
replica | TRACE[04-22|20:38:45.938] Waiting for transaction to be added to chain hash=0x6ae363fcfe8ef71f115d643844b0bed340e95f8a9ec311b466f952b38c94b18b
replica | DEBUG[04-22|20:38:45.938] Attempting to commit rollup transaction hash=0x6ae363fcfe8ef71f115d643844b0bed340e95f8a9ec311b466f952b38c94b18b
replica | DEBUG[04-22|20:38:45.941] Adding extra L2 fee extra-l2-fee=543000000000
replica | DEBUG[04-22|20:38:45.941] Total fee total-fee=500543000000000
```

## Updating services

There will be occasional updates to both services. You can update them by running:

```bash
docker compose pull
```

and bringing the services up again. We suggest you keep the storage volume of the replica mounted on the host. The replica stores its data in `/root/.ethereum/`.
and bringing the services up again. **We suggest you keep the storage volume of the replica mounted on the host**. The replica stores its data in `/root/.ethereum/`.
76 changes: 76 additions & 0 deletions boba_community/boba-node/docker-compose-rinkeby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@

x-l1_rpc_dtl: &l1_rpc_dtl
DATA_TRANSPORT_LAYER__L1_RPC_ENDPOINT: 'https://rinkeby.infura.io/v3/YOUR_INFURA_KEY'

x-l1_rpc_geth: &l1_rpc_geth
ETH1_HTTP: 'https://rinkeby.infura.io/v3/YOUR_INFURA_KEY'

version: "3.9"

services:
dtl:
container_name: dtl
image: bobanetwork/data-transport-layer:release
env_file:
- ../../ops/envs/dtl-rinkeby.env
environment:
<< : *l1_rpc_dtl
DATA_TRANSPORT_LAYER__L2_RPC_ENDPOINT: https://rinkeby.boba.network
DATA_TRANSPORT_LAYER__SYNC_FROM_L1: 'false'
DATA_TRANSPORT_LAYER__SYNC_FROM_L2: 'true'
DATA_TRANSPORT_LAYER__L2_CHAIN_ID: 28
DATA_TRANSPORT_LAYER__ETH1_CTC_DEPLOYMENT_HEIGHT: 10268193
DATA_TRANSPORT_LAYER__ADDRESS_MANAGER: '0x93A96D6A5beb1F661cf052722A1424CDDA3e9418'
DATA_TRANSPORT_LAYER__BSS_HARDFORK_1_INDEX: 0
DATA_TRANSPORT_LAYER__TURING_V0_HEIGHT: 0
DATA_TRANSPORT_LAYER__TURING_V1_HEIGHT: 0
volumes:
- ./:/opt/optimism/packages/data-transport-layer/state-dumps/
logging:
driver: "json-file"
options:
max-file: "5"
max-size: "10m"
ports:
- ${DTL_PORT:-7878}:7878
- ${REGISTRY_PORT:-8080}:8081

replica:
container_name: replica
depends_on:
- dtl
image: bobanetwork/l2geth:release
deploy:
replicas: 1
entrypoint: sh ./geth.sh
env_file:
- ../../ops/envs/geth-rinkeby.env
#volumes:
# - ./<YOUR PERSISTED STORAGE>:/root/.ethereum/
environment:
<< : *l1_rpc_geth
ROLLUP_TIMESTAMP_REFRESH: 5s
ROLLUP_STATE_DUMP_PATH: http://dtl:8081/state-dump.latest.json
ROLLUP_CLIENT_HTTP: http://dtl:7878
ROLLUP_BACKEND: 'l2'
ROLLUP_VERIFIER_ENABLE: 'true'
RETRIES: 1000
# no need to keep this secret, only used internally to sign blocks
BLOCK_SIGNER_KEY: "6587ae678cf4fc9a33000cdbf9f35226b71dcc6a4684a31203241f9bcfd55d27"
BLOCK_SIGNER_ADDRESS: "0x00000398232E2064F896018496b4b44b3D62751F"
ROLLUP_POLL_INTERVAL_FLAG: "10s"
ROLLUP_ENFORCE_FEES: 'true'
SEQUENCER_CLIENT_HTTP: https://rinkeby.boba.network
# turing
TURING_CREDIT_ADDRESS: "0x208c3CE906cd85362bd29467819d3AcbE5FC1614"
# fee token
L2_BOBA_TOKEN_ADDRESS: "0xF5B97a4860c1D81A1e915C40EcCB5E4a5E6b8309"
BOBA_GAS_PRICE_ORACLE_ADDRESS: "0x7F974A09a251dEA6b75af3e0A0e29D1133DaCf4b"
logging:
driver: "json-file"
options:
max-file: "5"
max-size: "10m"
ports:
- ${L2GETH_HTTP_PORT:-8549}:8545
- ${L2GETH_WS_PORT:-8550}:8546
115,427 changes: 115,427 additions & 0 deletions boba_community/boba-node/state-dumps/state-dump-rinkeby.latest.json

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions ops/envs/dtl-rinkeby.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
DATA_TRANSPORT_LAYER__DB_PATH=/db
DATA_TRANSPORT_LAYER__SERVER_PORT=7878
DATA_TRANSPORT_LAYER__TRANSACTIONS_PER_POLLING_INTERVAL=1000
DATA_TRANSPORT_LAYER__CONFIRMATIONS=8
DATA_TRANSPORT_LAYER__POLLING_INTERVAL=5000
DATA_TRANSPORT_LAYER__LOGS_PER_POLLING_INTERVAL=2000
DATA_TRANSPORT_LAYER__DANGEROUSLY_CATCH_ALL_ERRORS=true
DATA_TRANSPORT_LAYER__SERVER_HOSTNAME=0.0.0.0
34 changes: 34 additions & 0 deletions ops/envs/geth-rinkeby.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
ETH1_CTC_DEPLOYMENT_HEIGHT=10265999
ETH1_SYNC_SERVICE_ENABLE=true
ETH1_CONFIRMATION_DEPTH=0

ROLLUP_CLIENT_HTTP=
ROLLUP_POLL_INTERVAL_FLAG=4500ms
ROLLUP_ENABLE_L2_GAS_POLLING=true
ROLLUP_ENFORCE_FEES=true

ETHERBASE=0x7E5F4552091A69125d5DfCb7b8C2659029395Bdf

RPC_ENABLE=true
RPC_ADDR=0.0.0.0
RPC_PORT=8545
RPC_API=eth,net,rollup,web3,debug
RPC_CORS_DOMAIN=*
RPC_VHOSTS=*

WS=true
WS_ADDR=0.0.0.0
WS_PORT=8546
WS_API=eth,net,rollup,web3
WS_ORIGINS=*

CHAIN_ID=28
DATADIR=/root/.ethereum
GASPRICE=0
GCMODE=archive
IPC_DISABLE=true
NETWORK_ID=28
NO_USB=true
NO_DISCOVER=true
TARGET_GAS_LIMIT=11000000
USING_OVM=true

0 comments on commit 5df4c58

Please sign in to comment.