Skip to content

Commit f448f6c

Browse files
committed
add comments
1 parent 69ac0bd commit f448f6c

File tree

3 files changed

+58
-6
lines changed

3 files changed

+58
-6
lines changed

docs/hildr-docs/run-a-node/use_docker.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ cp /path/to/jwt.txt .
2525
```shell
2626
docker run -it -p 11545:11545 \
2727
-v <you jwt secret>:/jwt/jwt.hex \
28-
ghcr.io/optimism-java/op-besu:latest -- \
28+
ghcr.io/optimism-java/hildr:latest \
2929
--network optimism-sepolia \ # can be either: "optimism","base","base-sepolia"
3030
--jwt-file /jwt/jwt.hex \
3131
--l1-rpc-url http://localhost:9545 \
@@ -44,7 +44,7 @@ cp /path/to/jwt.txt .
4444
docker run -it -p 11545:11545 \
4545
-v <your jwt secret>:/jwt/jwt.hex \
4646
-v <your rollup.json file>:/network-configs/rollup.json
47-
ghcr.io/optimism-java/op-besu:latest -- \
47+
ghcr.io/optimism-java/hildr:latest \
4848
--devnet \
4949
--network=/network-configs/rollup.json \
5050
--jwt-file /jwt/jwt.hex \

docs/op-besu-docs/run-a-node/use_binaries.md

+2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ mkdir datadir
5858
```shell
5959
./bin/besu \
6060
--network=OP_SEPOLIA \
61+
--sync-mode=FULL \
6162
--p2p-enabled=false \
6263
--discovery-enabled=false \
6364
--data-path=datadir \
@@ -79,6 +80,7 @@ Also you could use the [optimism devnet tool](https://github.com/ethpandaops/opt
7980
```shell
8081
./bin/besu \
8182
--genesis-file=<devnet genesis file> \
83+
--network-id=<network id>
8284
--p2p-enabled=false \
8385
--discovery-enabled=false \
8486
--data-path=datadir \

docs/op-besu-docs/run-a-node/use_docker.md

+54-4
Original file line numberDiff line numberDiff line change
@@ -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/ \
4041
ghcr.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/ \
6163
ghcr.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

Comments
 (0)