@@ -26,7 +26,8 @@ openssl rand -hex 32 > jwt.txt
2626## Prepare the data directory
2727
2828``` bash
29- mkdir datadir
29+ mkdir datadir
30+ chmod 777 datadir
3031```
3132
3233## Start a Op-besu node
@@ -35,10 +36,11 @@ mkdir datadir
3536 <TabItem value =" op sepolia " label =" op sepolia " default >
3637
3738``` shell
38- docker run -it -p 8545:8545 -p 8551:8551 -v ./jwt.txt:/jwt/jwtsecret \
39+ docker run -it --name op-besu - p 8545:8545 -p 8551:8551 -v ./jwt.txt:/jwt/jwtsecret \
3940-v ./datadir:/data/ \
4041ghcr.io/optimism-java/op-besu:latest \
4142--network=OP_SEPOLIA \
43+ --sync-mode=FULL \
4244--p2p-enabled=false \
4345--discovery-enabled=false \
4446--data-path=" /data/" \
@@ -56,10 +58,12 @@ ghcr.io/optimism-java/op-besu:latest \
5658<TabItem value =" devnet or other " label =" devnet or other " >
5759
5860``` shell
59- docker run -it -p 8545:8545 -p 8551:8551 -v ./jwt.txt:/jwt/jwtsecret \
61+ docker run -it --name op-besu-devnet - p 8545:8545 -p 8551:8551 -v ./jwt.txt:/jwt/jwtsecret \
6062-v ./datadir:/data/ \
6163ghcr.io/optimism-java/op-besu:latest \
6264--genesis-file=< devnet genesis file> \
65+ --network-id=< network id> \
66+ --sync-mode=FULL \
6367--p2p-enabled=false \
6468--discovery-enabled=false \
6569--data-path=" /data/" \
@@ -83,4 +87,50 @@ The following settings are a security risk in production environments:
8387- Setting ` --host-allowlist ` to ` "*" ` allows JSON-RPC API access from any host.
8488- Setting ` --rpc-http-cors-origins ` to ` "all" ` or ` "*" ` allows cross-origin resource sharing (CORS) access from any domain.
8589
86- :::
90+ :::
91+
92+ ## Start Hildr node to sync L2 state
93+
94+ After starting the Op-Besu node, you can start the Hildr node to sync state.
95+
96+ Pull docker image of hildr:
97+
98+ ``` shell
99+ docker pull ghcr.io/optimism-java/hildr:latest
100+ ```
101+
102+ Get IP of the op-besu container, and hildr container will use it to connect to op-besu via the docker bridge:
103+
104+ ``` shell
105+ docker inspect -f ' {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' op-besu
106+ ```
107+
108+ Start Hildr node:
109+
110+ ``` shell
111+ docker run -d -it --name hildr -p 11545:11545 \
112+ -v ./jwt.txt:/jwt/jwtsecret \
113+ ghcr.io/optimism-java/hildr:latest \
114+ --network optimism-sepolia \
115+ --jwt-file /jwt/jwtsecret \
116+ --l1-rpc-url < l1_sepolia_rpc_url> \
117+ --l1-ws-rpc-url < l1_sepolia_ws_rpc_url> \
118+ --l1-beacon-url < l1_beacon_chain_sepolia_rpc_url> \
119+ --l2-rpc-url < op_besu_rpc> \
120+ --l2-engine-url < op_besu_engine_rpc> \
121+ --rpc-port 11545 \
122+ --log-level INFO \
123+ --sync-mode full
124+ ```
125+
126+ The synchronization needs to handle empty messages at the beginning, and the actual block synchronization will take place about 10 minutes later.
127+
128+ For example, use curl get block data from op-besu:
129+
130+ ``` bash
131+ curl --request POST ' https://localhost:8545' \
132+ --header ' Content-Type: application/json' \
133+ --data-raw ' {"id":2, "jsonrpc":"2.0", "method": "eth_getBlockByNumber", "params":["0xe", true]}'
134+ ```
135+
136+ You can confirm whether the block and transaction information is correct through the [ Sepolia network's blockchain explorer] ( https://sepolia-optimism.etherscan.io/ ) .
0 commit comments