add ETHERSCAN_API_URL env to allow customizing the api endpoint per network

This commit is contained in:
srwadleigh 2021-04-11 18:56:52 +00:00
parent 473178e810
commit 02c23d7305
3 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,6 @@
SERVER_PORT=3000 SERVER_PORT=3000
SERVER_HOST=127.0.0.1 SERVER_HOST=127.0.0.1
ETHERSCAN_API_URL="https://api.etherscan.io"
ETHERSCAN_API_KEY= ETHERSCAN_API_KEY=
# DB Statediff # DB Statediff

View File

@ -25,6 +25,7 @@ And then open in browser `http://172.17.0.2:3000/metrics`
``` ```
docker run \ docker run \
-e SERVER_HOST=0.0.0.0 \ -e SERVER_HOST=0.0.0.0 \
-e ETHERSCAN_API_KEY="https://api.etherscan.io" \
-e ETHERSCAN_API_KEY=*** \ -e ETHERSCAN_API_KEY=*** \
-e STATEDIFF_PG_HOST=*** \ -e STATEDIFF_PG_HOST=*** \
-d vulcanize/eth-state-metrics -d vulcanize/eth-state-metrics

View File

@ -2,7 +2,7 @@ const axios = require('axios');
const AppError = require('./error'); const AppError = require('./error');
const etherscanClient = axios.create({ const etherscanClient = axios.create({
baseURL: 'https://api.etherscan.io', baseURL: process.env.ETHERSCAN_API_URL,
}); });