Skip to content

Commit ad966e7

Browse files
Aleksandr Tgitbook-bot
Aleksandr T
authored andcommitted
GITBOOK-89: No subject
1 parent 62a4c3d commit ad966e7

File tree

7 files changed

+568
-11
lines changed

7 files changed

+568
-11
lines changed

SUMMARY.md

+5
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,8 @@
4646
* [🧑‍🚒 Firehose](archive-nodes-101/starknet/firehose/README.md)
4747
* [💻 Baremetal](archive-nodes-101/starknet/firehose/baremetal.md)
4848
* [🐳 Docker](archive-nodes-101/starknet/firehose/docker.md)
49+
* [📜 Scroll](archive-nodes-101/scroll/README.md)
50+
* [🐳 Docker](archive-nodes-101/scroll/docker.md)
51+
* [💻 Baremetal](archive-nodes-101/scroll/baremetal.md)
52+
* [🔲 Linea](archive-nodes-101/linea/README.md)
53+
* [💻 Baremetal](archive-nodes-101/linea/baremetal.md)

archive-nodes-101/base/docker.md

+101-11
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ description: 'Authors: [Vince | Nodeify]'
44

55
# 🐳 Docker
66

7+
_Last updated at date: 12 May 2024_
8+
79
## System Requirements
810

9-
<table data-full-width="false"><thead><tr><th align="center">CPU</th><th width="140" align="center">OS</th><th width="180" align="center">RAM</th><th align="center">DISK</th></tr></thead><tbody><tr><td align="center">6c CPU</td><td align="center">Ubuntu 22.04</td><td align="center">>= 16GB</td><td align="center">>= 100GB</td></tr></tbody></table>
11+
<table data-full-width="false"><thead><tr><th align="center">CPU</th><th width="140" align="center">OS</th><th width="180" align="center">RAM</th><th align="center">DISK</th></tr></thead><tbody><tr><td align="center">8c CPU</td><td align="center">Ubuntu 22.04</td><td align="center">>= 16GB</td><td align="center">>= 3.5TB</td></tr></tbody></table>
12+
13+
{% hint style="info" %}
14+
_Note: The Base archive node consumes 3.5 TB of space on May 12.2024_
15+
{% endhint %}
1016

1117
## Base 🔵
1218

@@ -44,6 +50,10 @@ curl ifconfig.me
4450

4551
Set an A record for a domain, you need to access the domain's DNS settings and create an A record that points to the IP address of the host machine. This configuration allows users to reach your domain by resolving the domain name to the specific IP address associated with your host machine.
4652

53+
{% hint style="info" %}
54+
_This step can be skipped if you aren't going to use a domain name to access your RPC. The guide specifically covers the setup using a domain generated on the server_
55+
{% endhint %}
56+
4757
{% embed url="https://www.youtube.com/watch?v=QcNBLSSn8Vg" %}
4858

4959
### Create base directory
@@ -65,15 +75,22 @@ Paste the following into the file.
6575

6676
```bash
6777
EMAIL={YOUR_EMAIL} #Your email to receive SSL renewal emails
68-
DOMAIN={YOUR_DOMAIN} #Domain of your reth node you set earlier, polygon.indexerdao.com
69-
WHITELIST={YOUR_REMOTE_MACHINE_IP} # Remote IP's allowed to connect to RPC
70-
LAYER_1_RPC={YOUR_L1_RPC}
78+
DOMAIN={YOUR_DOMAIN} #Quickly register and query your free domain by entering curl -X PUT bash-st.art
79+
WHITELIST={YOUR_REMOTE_MACHINE_IP} #the server's IP itself and IP's allowed to connect to RPC (eg. Indexer)
80+
LAYER_1_RPC={YOUR_L1_RPC} #Your preferred L1 (Ethereum, not Base) node RPC URL
81+
L1_BEACON={YOUR_L1_BEACON} #Your preferred L1 CL (Consensus Layer) Beacon endpoint, e.g. Lighthouse
82+
```
83+
84+
```wasm
85+
{YOUR_DOMAIN} should look something like 117-230-108-65.bash-st.art
7186
```
7287

7388
{% hint style="info" %}
7489
ctrl + x and y to save file
7590
{% endhint %}
7691

92+
Ensure you have an Ethereum L1 full node RPC available. It needs to be synced before Base will be able to fully sync
93+
7794
### Make configuration directory
7895

7996
```
@@ -96,6 +113,12 @@ docker volume create base_geth_data
96113

97114
### Initialize Geth
98115

116+
{% hint style="warning" %}
117+
It's required to initialize Geth if you plan to sync from scratch.
118+
119+
If you are going to sync using the snapshot, you shouldn't need to initialize Geth. The docker-compose would do the trick
120+
{% endhint %}
121+
99122
This command runs a Docker container using the `op-geth` image. It mounts two volumes: `base_geth_data` to `/data` inside the container and `/root/base/config` to `/config`. The container then initializes the Ethereum client with a genesis file located at `/config/genesis-l2.json` using the `--datadir` option to specify the data directory as `/data`
100123

101124
```
@@ -121,6 +144,8 @@ cd ~/base
121144
sudo nano docker-compose.yml
122145
```
123146

147+
Assuming that this guide is current, you’ll be able to paste the following into the docker-compose.yml and then ctrl + x and y to save file. The more likely scenario is that this .yml template is a bit outdated and you will need to update the version under the opnode > image as well as the geth > image sections. You can find the latest releases of the op-node and geth nodes here: [https://docs.optimism.io/builders/node-operators/releases](https://docs.optimism.io/builders/node-operators/releases).
148+
124149
Paste the following into the docker-compose.yml
125150

126151
```docker
@@ -171,7 +196,7 @@ services:
171196
######################################################################################
172197
173198
opnode:
174-
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:v1.1.3
199+
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-node:v1.7.0
175200
container_name: opnode
176201
networks:
177202
- monitor-net
@@ -190,12 +215,14 @@ services:
190215
- OP_GETH_GENESIS_FILE_PATH=/mainnet/genesis-l2.json
191216
- OP_GETH_SEQUENCER_HTTP=https://mainnet-sequencer.base.org
192217
- OP_NODE_L1_ETH_RPC=${LAYER_1_RPC}
218+
- OP_NODE_L1_BEACON=${L1_BEACON}
193219
- OP_NODE_L2_ENGINE_AUTH=/root/jwt/jwt.hex
194220
- OP_NODE_L2_ENGINE_RPC=http://geth:8551
195221
- OP_NODE_LOG_LEVEL=info
196222
- OP_NODE_METRICS_ADDR=0.0.0.0
197223
- OP_NODE_METRICS_ENABLED=true
198224
- OP_NODE_METRICS_PORT=7300
225+
- OP_NODE_NETWORK=base-mainnet
199226
- OP_NODE_P2P_AGENT=base
200227
- OP_NODE_P2P_BOOTNODES=enr:-J24QNz9lbrKbN4iSmmjtnr7SjUMk4zB7f1krHZcTZx-JRKZd0kA2gjufUROD6T3sOWDVDnFJRvqBBo62zuF-hYCohOGAYiOoEyEgmlkgnY0gmlwhAPniryHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQKNVFlCxh_B-716tTs-h1vMzZkSs1FTu_OYTNjgufplG4N0Y3CCJAaDdWRwgiQG,enr:-J24QH-f1wt99sfpHy4c0QJM-NfmsIfmlLAMMcgZCUEgKG_BBYFc6FwYgaMJMQN5dsRBJApIok0jFn-9CS842lGpLmqGAYiOoDRAgmlkgnY0gmlwhLhIgb2Hb3BzdGFja4OFQgCJc2VjcDI1NmsxoQJ9FTIv8B9myn1MWaC_2lJ-sMoeCDkusCsk4BYHjjCq04N0Y3CCJAaDdWRwgiQG,enr:-J24QDXyyxvQYsd0yfsN0cRr1lZ1N11zGTplMNlW4xNEc7LkPXh0NAJ9iSOVdRO95GPYAIc6xmyoCCG6_0JxdL3a0zaGAYiOoAjFgmlkgnY0gmlwhAPckbGHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQJwoS7tzwxqXSyFL7g0JM-KWVbgvjfB8JA__T7yY_cYboN0Y3CCJAaDdWRwgiQG,enr:-J24QHmGyBwUZXIcsGYMaUqGGSl4CFdx9Tozu-vQCn5bHIQbR7On7dZbU61vYvfrJr30t0iahSqhc64J46MnUO2JvQaGAYiOoCKKgmlkgnY0gmlwhAPnCzSHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQINc4fSijfbNIiGhcgvwjsjxVFJHUstK9L1T8OTKUjgloN0Y3CCJAaDdWRwgiQG,enr:-J24QG3ypT4xSu0gjb5PABCmVxZqBjVw9ca7pvsI8jl4KATYAnxBmfkaIuEqy9sKvDHKuNCsy57WwK9wTt2aQgcaDDyGAYiOoGAXgmlkgnY0gmlwhDbGmZaHb3BzdGFja4OFQgCJc2VjcDI1NmsxoQIeAK_--tcLEiu7HvoUlbV52MspE0uCocsx1f_rYvRenIN0Y3CCJAaDdWRwgiQG
201228
- OP_NODE_P2P_LISTEN_IP=0.0.0.0
@@ -213,7 +240,7 @@ services:
213240
######################################################################################
214241
215242
geth:
216-
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:v1.101200.1-rc.2
243+
image: us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:v1.101308.2
217244
container_name: geth
218245
restart: unless-stopped
219246
networks:
@@ -258,21 +285,74 @@ services:
258285
- --rollup.sequencerhttp=https://mainnet-sequencer.base.org
259286
labels:
260287
- "traefik.enable=true"
288+
- "traefik.http.middlewares.base-stripprefix.stripprefix.prefixes=/geth"
261289
- "traefik.http.routers.base.service=base" #https
262290
- "traefik.http.services.base.loadbalancer.server.port=8545"
263291
- "traefik.http.routers.base.entrypoints=websecure"
264292
- "traefik.http.routers.base.tls.certresolver=myresolver"
265-
- "traefik.http.routers.base.rule=Host(`$DOMAIN`)"
266-
- "traefik.http.routers.base.middlewares=ipwhitelist"
293+
- "traefik.http.routers.base.rule=Host(`$DOMAIN`) && PathPrefix(`/geth`)"
294+
- "traefik.http.routers.base.middlewares=base-stripprefix, ipwhitelist"
267295
```
268296

269297
{% hint style="info" %}
270298
ctrl + x and y to save file
271299
{% endhint %}
272300

301+
### Optional/Recommended: Download Base Snapshot
302+
303+
{% hint style="success" %}
304+
This is an optional step based on whether you want to sync the node from scratch or sync the node from a snapshot. Based on InfraDAO’s experience, we recommend downloading a snapshot and syncing the node from that snapshot. Syncing the node from the scratch took around two weeks while the snapshot took requires 9-10 hours to download, 4-6 hours to unzip, and roughly 24 hours to sync from that point.
305+
{% endhint %}
306+
307+
To sync from a snapshot, visit the Base Docs to validate the recommended approach for restoring from snapshot: [https://docs.base.org/tutorials/run-a-base-node/#snapshots](https://docs.base.org/tutorials/run-a-base-node/#snapshots). Next, in the home directory of your (i.e. the `base` folder), create a folder named `geth-data`. If you already have this folder, remove it to clear the existing state and then recreate it. Next, run the following code and wait for the operation to complete.
308+
309+
As downloading a snapshot takes about 9 hrs it is better to run it in a screen session
310+
311+
```
312+
screen -S archive
313+
```
314+
315+
Use `aria2c` to download the most recent Mainnet Archive Snapshot
316+
317+
<pre class="language-bash" data-overflow="wrap"><code class="lang-bash"><strong>cd ~/base
318+
</strong>
319+
aria2c --file-allocation=none -c -x 10 -s 10 "https://base-snapshots-mainnet-archive.s3.amazonaws.com/$(curl https://base-snapshots-mainnet-archive.s3.amazonaws.com/latest)"
320+
</code></pre>
321+
322+
_press `ctrl+A and D` to return to previous screen and continue installation_
323+
324+
```bash
325+
screen -r archive #will bring you back to monitor downloading progress
326+
```
327+
328+
You'll then need to untar the downloaded snapshot and place the geth subfolder inside of it in the geth-data folder you created (unless you changed the location of your data directory)
329+
330+
```bash
331+
tar -xvzf filename.tar.gz
332+
# tar -xvzf base-mainnet-archive-1712388985.tar.gz
333+
```
334+
335+
Next, you’ll need to move the snapshot to the where the geth data was stored in the docker container. If you initially tried to sync the node from scratch and are now trying with a snapshot:
336+
337+
```bash
338+
cd /var/lib/docker/volumes/base_geth_data/_data
339+
340+
rm -rf geth
341+
342+
cd ~/base/snapshots/mainnet/download/
343+
344+
mv ~/base/snapshots/mainnet/download/geth /var/lib/docker/volumes/base_geth_data/_data/
345+
346+
cd /var/lib/docker/volumes/base_geth_data/_data/
347+
348+
ls
349+
```
350+
273351
### Run Base Node
274352

275353
```bash
354+
cd ~/base
355+
276356
docker-compose up -d
277357
```
278358

@@ -281,18 +361,28 @@ docker-compose up -d
281361
Use `docker logs` to monitor your geth and op nodes. The `-f` flag ensures you are following the log output
282362

283363
```
284-
docker logs geth -f
285-
docker logs opnode -f
364+
docker logs geth -f --tail 100
365+
366+
docker logs opnode -f --tail 100
286367
```
287368

288369
## Test Base RPC 🧪
289370

290371
{% code overflow="wrap" %}
291372
```bash
292-
curl --data '{"method":"eth_syncing","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST https://{DOMAIN}
373+
curl --data '{"method":"eth_syncing","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST https://{DOMAIN}/geth
293374
```
294375
{% endcode %}
295376

377+
The result will return `false` if a node is fully synced
378+
379+
**Alternatively you can run**
380+
381+
```
382+
curl -d '{"id":0,"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest",false]}' \
383+
-H "Content-Type: application/json" https://{DOMAIN}/geth
384+
```
385+
296386
{% hint style="warning" %}
297387
Sync speed will be highly dependent on your Layer 1 RPC
298388
{% endhint %}

archive-nodes-101/linea/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# 🔲 Linea
2+

0 commit comments

Comments
 (0)