Skip to content

Commit 9601c21

Browse files
committedMar 9, 2024
Set container tag & add usage to readme
1 parent 498b37b commit 9601c21

File tree

4 files changed

+68
-9
lines changed

4 files changed

+68
-9
lines changed
 

‎.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
.vscode
33
.DS_Store
44

5+
/assets/*
56
/data
67
/docker-compose.override.yml
78

9+
!.gitkeep
810
!.env.sample

‎README.md

+54
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,56 @@
11
# verse-layer-opstack
22
Docker configuration for running the OPSack version of Verse Layer middleware.
3+
4+
## Place build artifacts
5+
Place `deploy-config.json` and `addresses.json` files downloaded from the [verse build tool](https://tools-fe.oasys.games/) into the assets directory.
6+
```shell
7+
mv /downloads/deploy-config.json ./assets
8+
mv /downloads/addresses.json ./assets
9+
```
10+
11+
## Create `.env`
12+
Create an environment variables file for containers. Please copy the sample file and edit it.
13+
```shell
14+
cp .env.sample .env
15+
```
16+
17+
The `OP_L2OO_ADDR` is obtained from the `addresses.json`.
18+
```shell
19+
jq .L2OutputOracleProxy ./assets/addresses.json
20+
```
21+
22+
If you do not know how to create a private key, you can use [oasys-pos-cli](https://github.com/oasysgames/oasys-pos-cli). Please download the binary from the [release page](https://github.com/oasysgames/oasys-pos-cli/releases) and execute the key generation command.
23+
24+
```shell
25+
$ oaspos crypto:create-account
26+
Address : 0xabcd1234...
27+
Key : 0xabcd1234...
28+
```
29+
30+
## Create `jwt.txt`
31+
Create the JWT secret used for authentication between `op-node` and `op-geth`. This secret does not need to be backed up.
32+
```shell
33+
openssl rand -hex 32 > ./assets/jwt.txt
34+
```
35+
36+
## Generate chain configurations
37+
Generates `genesis.json` and `rollup.json` into the assets directory.
38+
```shell
39+
docker-compose run --rm --no-deps op-node genesis l2 \
40+
--l1-rpc "$(grep L1_ETH_RPC_HTTP .env | cut -d= -f2)" \
41+
--deploy-config /assets/deploy-config.json \
42+
--l1-deployments /assets/addresses.json \
43+
--outfile.l2 /assets/genesis.json \
44+
--outfile.rollup /assets/rollup.json
45+
```
46+
47+
## Generate genesis block
48+
Generate the genesis block (number=0).
49+
```shell
50+
docker-compose run --rm --no-deps op-geth init /assets/genesis.json
51+
```
52+
53+
## Run services
54+
```shell
55+
docker-compose up -d op-geth op-node op-batcher op-proposer
56+
```

‎assets/.gitkeep

Whitespace-only changes.

‎docker-compose.yml

+12-9
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ x-resident: &resident
1212
services:
1313
op-geth:
1414
<<: *resident
15-
image: ghcr.io/oasysgames/oasys-op-geth:latest
15+
image: ghcr.io/oasysgames/oasys-op-geth:v0.0.0-389fd30
1616
entrypoint: geth
1717
command: >
1818
--http
@@ -37,16 +37,18 @@ services:
3737
--authrpc.port=8551
3838
--authrpc.jwtsecret=/assets/jwt.txt
3939
--txpool.pricelimit=0
40+
environment:
41+
GETH_DATADIR: /data
4042
volumes:
41-
- ./assets:/assets:ro
42-
- ./data/op-geth:/home/nobody/.ethereum
43+
- ./assets:/assets
44+
- ./data/op-geth:/data
4345
ports:
4446
- $OP_ETH_RPC_HTTP_PORT:8545/tcp
4547
- $OP_ETH_RPC_WS_PORT:8546/tcp
4648

4749
op-node:
4850
<<: *resident
49-
image: ghcr.io/oasysgames/oasys-opstack/op-node:latest
51+
image: ghcr.io/oasysgames/oasys-opstack/op-node:v0.0.0-a55f01e
5052
entrypoint: op-node
5153
command: >
5254
--l1=$L1_ETH_RPC_HTTP
@@ -55,7 +57,7 @@ services:
5557
--l1.http-poll-interval=15s
5658
--l2=$OP_ENGINE_RPC
5759
--l2.jwt-secret=/assets/jwt.txt
58-
--rollup.config=/data/rollup.json
60+
--rollup.config=/assets/rollup.json
5961
--sequencer.enabled
6062
--sequencer.l1-confs=5
6163
--verifier.l1-confs=5
@@ -66,20 +68,21 @@ services:
6668
--snapshotlog.file=/data/snapshotlog
6769
--p2p.disable
6870
volumes:
69-
- ./assets:/assets:ro
71+
- ./assets:/assets
7072
- ./data/op-node:/data
7173
links:
7274
- op-geth
7375

7476
op-batcher:
7577
<<: *resident
76-
image: ghcr.io/oasysgames/oasys-opstack/op-batcher:latest
78+
image: ghcr.io/oasysgames/oasys-opstack/op-batcher:v0.0.0-a55f01e
7779
entrypoint: op-batcher
7880
command: >
7981
--l1-eth-rpc=$L1_ETH_RPC_HTTP
80-
--l2-eth-rpc=$OP_ETH_RPC_HTTP
82+
--l2-eth-rpc=$OP_ETH_RPC_WS
8183
--rollup-rpc=$OP_ROLLUP_RPC
8284
--private-key=$OP_BATCHER_KEY
85+
--max-channel-duration=1
8386
--num-confirmations=5
8487
--resubmission-timeout=60s
8588
--txmgr.receipt-query-interval=15s
@@ -89,7 +92,7 @@ services:
8992

9093
op-proposer:
9194
<<: *resident
92-
image: ghcr.io/oasysgames/oasys-opstack/op-proposer:latest
95+
image: ghcr.io/oasysgames/oasys-opstack/op-proposer:v0.0.0-a55f01e
9396
entrypoint: op-proposer
9497
command: >
9598
--l1-eth-rpc=$L1_ETH_RPC_HTTP

0 commit comments

Comments
 (0)
Please sign in to comment.