From 414b6ba325292c95784ec675a2a5eed44e7a0d9d Mon Sep 17 00:00:00 2001 From: VolodymyrBg Date: Tue, 11 Feb 2025 11:06:52 +0200 Subject: [PATCH] feat: improve network configuration handling (#395) * feat: improve network configuration handling * Update README.md --- README.md | 12 +++++++++--- docker-compose.yml | 8 ++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 04b1f750..8545f066 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # Base node -Base is a secure, low-cost, developer-friendly Ethereum L2 built to bring the next billion users onchain. It's built on Optimism’s open-source [OP Stack](https://stack.optimism.io/). +Base is a secure, low-cost, developer-friendly Ethereum L2 built to bring the next billion users onchain. It's built on Optimism's open-source [OP Stack](https://stack.optimism.io/). This repository contains the relevant Docker builds to run your own node on the Base network. @@ -55,7 +55,13 @@ If you encounter problems with your node, please open a [GitHub issue](https://g ### Usage 1. Ensure you have an Ethereum L1 full node RPC available (not Base), and set `OP_NODE_L1_ETH_RPC` (in the `.env.*` file if using docker-compose). If running your own L1 node, it needs to be synced before Base will be able to fully sync. -2. Uncomment the line relevant to your network (`.env.sepolia`, or `.env.mainnet`) under the 2 `env_file` keys in `docker-compose.yml`. +2. Set the `NETWORK_ENV` environment variable to specify your network: + ```bash + # For mainnet: + export NETWORK_ENV=.env.mainnet + # For testnet: + export NETWORK_ENV=.env.sepolia + ``` 3. Run: ``` @@ -117,7 +123,7 @@ $( curl -s -d '{"id":0,"jsonrpc":"2.0","method":"optimism_syncStatus"}' -H "Cont ## Disclaimer -We’re excited for you to build on Base 🔵 — but we want to make sure that you understand the nature of the node software and smart contracts offered here. +We're excited for you to build on Base 🔵 — but we want to make sure that you understand the nature of the node software and smart contracts offered here. THE NODE SOFTWARE AND SMART CONTRACTS CONTAINED HEREIN ARE FURNISHED AS IS, WHERE IS, WITH ALL FAULTS AND WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING ANY WARRANTY OF MERCHANTABILITY, NON- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE. IN PARTICULAR, THERE IS NO REPRESENTATION OR WARRANTY THAT THE NODE SOFTWARE AND SMART CONTRACTS WILL PROTECT YOUR ASSETS — OR THE ASSETS OF THE USERS OF YOUR APPLICATION — FROM THEFT, HACKING, CYBER ATTACK, OR OTHER FORM OF LOSS OR DEVALUATION. diff --git a/docker-compose.yml b/docker-compose.yml index 2f29bc70..3c88d2c6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,9 +13,7 @@ services: volumes: - ${HOST_DATA_DIR}:/data env_file: - # select your network here: -# - .env.sepolia -# - .env.mainnet + - ${NETWORK_ENV:?.env.mainnet} # Requires NETWORK_ENV to be set, defaults to mainnet node: build: context: . @@ -30,6 +28,4 @@ services: - "6060:6060" # pprof command: [ "bash", "./op-node-entrypoint" ] env_file: - # select your network here: -# - .env.sepolia -# - .env.mainnet + - ${NETWORK_ENV:?.env.mainnet} # Requires NETWORK_ENV to be set, defaults to mainnet