Get the IP address of the host machine, you can use the following command in a terminal or command prompt
curlifconfig.me
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. Example video of How to Point a Domain Name to an IP Address
Create base directory
The first command, mkdir base, will create a new directory named base in the current location. The second command, cd base, will change your current working directory to the newly created base directory. Now you are inside the base directory and can start storing docker-compose and related files in it.
mkdirbasecdbase
Create .env file
sudonano.env
Paste the following into the file.
EMAIL={YOUR_EMAIL}#Your email to receive SSL renewal emailsDOMAIN={YOUR_DOMAIN}##Domain should be something like rpc.mywebsite.com, e.g. linea.infradao.orgWHITELIST={YOUR_REMOTE_MACHINE_IP}#the server's IP itself and IP's allowed to connect to RPC (eg. Indexer)LAYER_1_RPC={YOUR_L1_RPC}#Your preferred L1 (Ethereum, not Base) node RPC URLL1_BEACON={YOUR_L1_BEACON}#Your preferred L1 CL (Consensus Layer) Beacon endpoint, e.g. Lighthouse
ctrl + x and y to save file
Ensure you have an Ethereum L1 full node RPC available. It needs to be synced before Base will be able to fully sync
It's required to initialize Geth if you plan to sync from scratch.
If you are going to sync using the snapshot, you shouldn't need to initialize Geth. The docker-compose would do the trick
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
docker run -v base_geth_data:/data -v /root/base/config:/config us-docker.pkg.dev/oplabs-tools-artifacts/images/op-geth:0402d543c3d0cff3a3d344c0f4f83809edb44f10 --datadir=/data init /config/genesis-l2.json
You should receive a quick output that your genesis file has been initialized.
INFO [08-14|19:31:15.573] Successfully wrote genesis state
Create jwt.hex
openssl rand -hex 32 | tr -d "\n" > "./jwt.hex"
Create docker-compose.yml
cd~/basesudonanodocker-compose.yml
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.
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.
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. 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.
As downloading a snapshot takes about 9 hrs it is better to run it in a screen session
screen -S archive
Use aria2c to download the most recent Mainnet Archive Snapshot
press ctrl+A and D to return to previous screen and continue installation
screen-rarchive#will bring you back to monitor downloading progress
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)
tar-xvzffilename.tar.gz# tar -xvzf base-mainnet-archive-1712388985.tar.gz
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: