Skip to content

Commit 414b6ba

Browse files
authored
feat: improve network configuration handling (#395)
* feat: improve network configuration handling * Update README.md
1 parent 311ea00 commit 414b6ba

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

README.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Base node
44

5-
Base is a secure, low-cost, developer-friendly Ethereum L2 built to bring the next billion users onchain. It's built on Optimisms open-source [OP Stack](https://stack.optimism.io/).
5+
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/).
66

77
This repository contains the relevant Docker builds to run your own node on the Base network.
88

@@ -55,7 +55,13 @@ If you encounter problems with your node, please open a [GitHub issue](https://g
5555
### Usage
5656

5757
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.
58-
2. Uncomment the line relevant to your network (`.env.sepolia`, or `.env.mainnet`) under the 2 `env_file` keys in `docker-compose.yml`.
58+
2. Set the `NETWORK_ENV` environment variable to specify your network:
59+
```bash
60+
# For mainnet:
61+
export NETWORK_ENV=.env.mainnet
62+
# For testnet:
63+
export NETWORK_ENV=.env.sepolia
64+
```
5965
3. Run:
6066

6167
```
@@ -117,7 +123,7 @@ $( curl -s -d '{"id":0,"jsonrpc":"2.0","method":"optimism_syncStatus"}' -H "Cont
117123

118124
## Disclaimer
119125

120-
Were 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.
126+
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.
121127

122128
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.
123129

docker-compose.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ services:
1313
volumes:
1414
- ${HOST_DATA_DIR}:/data
1515
env_file:
16-
# select your network here:
17-
# - .env.sepolia
18-
# - .env.mainnet
16+
- ${NETWORK_ENV:?.env.mainnet} # Requires NETWORK_ENV to be set, defaults to mainnet
1917
node:
2018
build:
2119
context: .
@@ -30,6 +28,4 @@ services:
3028
- "6060:6060" # pprof
3129
command: [ "bash", "./op-node-entrypoint" ]
3230
env_file:
33-
# select your network here:
34-
# - .env.sepolia
35-
# - .env.mainnet
31+
- ${NETWORK_ENV:?.env.mainnet} # Requires NETWORK_ENV to be set, defaults to mainnet

0 commit comments

Comments
 (0)