Skip to content

Commit 7793d45

Browse files
shenkeyaoQuentinI
authored andcommitted
Provide docker for deployment (#167)
* Add docker compose and update dockerfile * Add env, remove ports * Remove optional script * Fix build * Fix in progress * Fix services * Fix l1 connection * Add hash check, remove auto generated file * Move to espresso dir * Add genesis file * Fix chain ID * Add op-geth, fix hashes, remove l1 genesis file. * Fix op geth, update hashes * Fix caff node errors * Commit jwt file as well * Remove jwt * Add L1 genesis file * Add back l2 genesis file but rename it * Update gitignore, remove unnecessary commands * Update readme * Update readme
1 parent 5003362 commit 7793d45

File tree

9 files changed

+468
-4
lines changed

9 files changed

+468
-4
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,6 @@ gha-creds-*.json
6060

6161
# Ignore generated credentials from google-github-actions/auth
6262
gha-creds-*.json
63+
64+
# Ignore the JWT secret for devnet.
65+
config/jwt.txt

README_ESPRESSO.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,61 @@ git submodule update --init --recursive
208208
nix --extra-experimental-features "nix-command flakes" develop
209209
just espresso-enclave-tests
210210
```
211+
212+
## Docker Compose
213+
214+
### Run Docker Compose
215+
216+
* Shut down all containers.
217+
```
218+
docker compose down
219+
```
220+
221+
* Build and start all services in the background.
222+
```
223+
docker compose up --build -d
224+
```
225+
226+
* Run the services and check the log.
227+
```
228+
docker compose logs -f
229+
```
230+
231+
### Investigate a Service
232+
233+
* Shut down all containers.
234+
```
235+
docker compose down
236+
```
237+
238+
* Build and start the specific service and check the log.
239+
```
240+
docker compose up <service-name>
241+
```
242+
243+
### Apply a Change
244+
245+
* In most cases, simply remove all containers and run commands as normal.
246+
```
247+
docker compose down
248+
```
249+
250+
* To start the project fresh, remove containers, volumes, and network, from this project.
251+
```
252+
docker compose down -v
253+
```
254+
255+
* To start the system fresh, remove all volumes.
256+
```
257+
docker volume prune -f
258+
```
259+
260+
* If the genesis file is updated, initialize the chain data directory with the updated file.
261+
```
262+
docker run --rm \
263+
-v $(pwd)/../config:/config \
264+
-v espresso_op-geth-data:/data \
265+
us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:v1.101503.2-rc.3 \
266+
init --datadir=/data --state.scheme=path /config/<genesis-file>
267+
```
268+
`<genesis-file>` is either `l1-genesis-devnet.json` or `l2-genesis-devnet.json`.

config/l1-genesis-devnet.json

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{
2+
"config": {
3+
"chainId": 1337,
4+
"homesteadBlock": 0,
5+
"eip150Block": 0,
6+
"eip155Block": 0,
7+
"eip158Block": 0,
8+
"byzantiumBlock": 0,
9+
"constantinopleBlock": 0,
10+
"petersburgBlock": 0,
11+
"istanbulBlock": 0,
12+
"muirGlacierBlock": 0,
13+
"berlinBlock": 0,
14+
"londonBlock": 0,
15+
"arrowGlacierBlock": 0,
16+
"grayGlacierBlock": 0,
17+
"shanghaiTime": 0,
18+
"cancunTime": 0,
19+
"pragueTime": 0,
20+
"terminalTotalDifficulty": 0,
21+
"depositContractAddress": "0x0000000000000000000000000000000000000000",
22+
"blobSchedule": {
23+
"cancun": {
24+
"target": 3,
25+
"max": 6,
26+
"baseFeeUpdateFraction": 3338477
27+
},
28+
"prague": {
29+
"target": 6,
30+
"max": 9,
31+
"baseFeeUpdateFraction": 5007716
32+
}
33+
}
34+
},
35+
"nonce": "0x0",
36+
"timestamp": "0x0",
37+
"extraData": "0x",
38+
"gasLimit": "0xaf79e0",
39+
"difficulty": "0x0",
40+
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
41+
"coinbase": "0x0000000000000000000000000000000000000000",
42+
"alloc": {
43+
"0000000000000000000000000000000000000001": {
44+
"balance": "0x1"
45+
},
46+
"0000000000000000000000000000000000000002": {
47+
"balance": "0x1"
48+
},
49+
"0000000000000000000000000000000000000003": {
50+
"balance": "0x1"
51+
},
52+
"0000000000000000000000000000000000000004": {
53+
"balance": "0x1"
54+
},
55+
"0000000000000000000000000000000000000005": {
56+
"balance": "0x1"
57+
},
58+
"0000000000000000000000000000000000000006": {
59+
"balance": "0x1"
60+
},
61+
"0000000000000000000000000000000000000007": {
62+
"balance": "0x1"
63+
},
64+
"0000000000000000000000000000000000000008": {
65+
"balance": "0x1"
66+
},
67+
"0000000000000000000000000000000000000009": {
68+
"balance": "0x1"
69+
},
70+
"00000961ef480eb55e80d19ad83579a64c007002": {
71+
"code": "0x3373fffffffffffffffffffffffffffffffffffffffe1460cb5760115f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff146101f457600182026001905f5b5f82111560685781019083028483029004916001019190604d565b909390049250505036603814608857366101f457346101f4575f5260205ff35b34106101f457600154600101600155600354806003026004013381556001015f35815560010160203590553360601b5f5260385f601437604c5fa0600101600355005b6003546002548082038060101160df575060105b5f5b8181146101835782810160030260040181604c02815460601b8152601401816001015481526020019060020154807fffffffffffffffffffffffffffffffff00000000000000000000000000000000168252906010019060401c908160381c81600701538160301c81600601538160281c81600501538160201c81600401538160181c81600301538160101c81600201538160081c81600101535360010160e1565b910180921461019557906002556101a0565b90505f6002555f6003555b5f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14156101cd57505f5b6001546002828201116101e25750505f6101e8565b01600290035b5f555f600155604c025ff35b5f5ffd",
72+
"balance": "0x0",
73+
"nonce": "0x1"
74+
},
75+
"0000bbddc7ce488642fb579f8b00f3a590007251": {
76+
"code": "0x3373fffffffffffffffffffffffffffffffffffffffe1460d35760115f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1461019a57600182026001905f5b5f82111560685781019083028483029004916001019190604d565b9093900492505050366060146088573661019a573461019a575f5260205ff35b341061019a57600154600101600155600354806004026004013381556001015f358155600101602035815560010160403590553360601b5f5260605f60143760745fa0600101600355005b6003546002548082038060021160e7575060025b5f5b8181146101295782810160040260040181607402815460601b815260140181600101548152602001816002015481526020019060030154905260010160e9565b910180921461013b5790600255610146565b90505f6002555f6003555b5f54807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff141561017357505f5b6001546001828201116101885750505f61018e565b01600190035b5f555f6001556074025ff35b5f5ffd",
77+
"balance": "0x0",
78+
"nonce": "0x1"
79+
},
80+
"0000f90827f1c53a10cb7a02335b175320002935": {
81+
"code": "0x3373fffffffffffffffffffffffffffffffffffffffe14604657602036036042575f35600143038111604257611fff81430311604257611fff9006545f5260205ff35b5f5ffd5b5f35611fff60014303065500",
82+
"balance": "0x0",
83+
"nonce": "0x1"
84+
},
85+
"000f3df6d732807ef1319fb7b8bb8522d0beac02": {
86+
"code": "0x3373fffffffffffffffffffffffffffffffffffffffe14604d57602036146024575f5ffd5b5f35801560495762001fff810690815414603c575f5ffd5b62001fff01545f5260205ff35b5f5ffd5b62001fff42064281555f359062001fff015500",
87+
"balance": "0x0",
88+
"nonce": "0x1"
89+
}
90+
},
91+
"number": "0x0",
92+
"gasUsed": "0x0",
93+
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
94+
"baseFeePerGas": "0x3b9aca00",
95+
"excessBlobGas": null,
96+
"blobGasUsed": null
97+
}

config/l2-genesis-devnet.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"config": {
3+
"chainId": 1,
4+
"homesteadBlock": 0,
5+
"eip150Block": 0,
6+
"eip155Block": 0,
7+
"eip158Block": 0,
8+
"byzantiumBlock": 0,
9+
"constantinopleBlock": 0,
10+
"petersburgBlock": 0,
11+
"istanbulBlock": 0,
12+
"muirGlacierBlock": 0,
13+
"berlinBlock": 0,
14+
"londonBlock": 0,
15+
"arrowGlacierBlock": 0,
16+
"grayGlacierBlock": 0,
17+
"mergeNetsplitBlock": 0,
18+
"terminalTotalDifficulty": 0,
19+
"terminalTotalDifficultyPassed": true,
20+
"shanghaiTime": 0,
21+
"cancunTime": 0,
22+
"bedrockBlock": 0,
23+
"optimism": {
24+
"eip1559Elasticity": 6,
25+
"eip1559Denominator": 50
26+
}
27+
},
28+
"nonce": "0x0",
29+
"timestamp": "0x66e5c98e",
30+
"extraData": "0x",
31+
"gasLimit": "0x1c9c380",
32+
"difficulty": "0x0",
33+
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
34+
"coinbase": "0x0000000000000000000000000000000000000000",
35+
"alloc": {
36+
"0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc": {
37+
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
38+
}
39+
},
40+
"number": "0x0",
41+
"gasUsed": "0x0",
42+
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
43+
}

config/op-node/rollup-devnet.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"genesis": {
3+
"l1": {
4+
"hash": "0xfc3c494d08d1e07af2b32ab3a4b771cdb3de9272bfe48017d7049d6af7d7e555",
5+
"number": 0
6+
},
7+
"l2": {
8+
"hash": "0x989d7c9b1642192d130f73d6bd1f80c0719ed3fbe15ea1219a87af85025ea0d1",
9+
"number": 0
10+
},
11+
"l2_time": 1728358574,
12+
"system_config": {
13+
"batcherAddr": "0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc",
14+
"overhead": "0x0000000000000000000000000000000000000000000000000000000000000834",
15+
"scalar": "0x00000000000000000000000000000000000000000000000000000000000f4240",
16+
"gasLimit": 30000000
17+
}
18+
},
19+
"block_time": 2,
20+
"max_sequencer_drift": 300,
21+
"seq_window_size": 200,
22+
"channel_timeout": 120,
23+
"l1_chain_id": 1337,
24+
"l2_chain_id": 1,
25+
"batch_inbox_address": "0xff00000000000000000000000000000000000901",
26+
"deposit_contract_address": "0x55bdfb0bfef1070c457124920546359426153833",
27+
"chain_op_config": {
28+
"eip1559Elasticity": 6,
29+
"eip1559Denominator": 50,
30+
"eip1559DenominatorCanyon": 250
31+
},
32+
"alt_da": {
33+
"da_challenge_contract_address": "0x0000000000000000000000000000000000000000",
34+
"da_commitment_type": "GenericCommitment",
35+
"da_challenge_window": 160,
36+
"da_resolve_window": 160
37+
}
38+
}

0 commit comments

Comments
 (0)