Skip to content

Commit

Permalink
quick update to env prop
Browse files Browse the repository at this point in the history
  • Loading branch information
codenamejason committed Mar 10, 2022
1 parent 13c1fb1 commit 3e9cdf1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/react-app/.sample.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
REACT_APP_INFURA_ID=INFURA-PROJECT-ID
REACT_APP_PROVIDER=https://rinkeby.infura.io/v3/INFURA-PROJECT-ID
REACT_APP_RINKEBY_PROVIDER=https://rinkeby.infura.io/v3/INFURA-PROJECT-ID
REACT_APP_ETHERSCAN_ID=YOUR Etherscan API key token
REACT_APP_MAINNET_RPC_ENDPOINT=https://eth-mainnet.alchemyapi.io/v2/ALCHEMY-ID
REACT_APP_MAINNET_RPC_ENDPOINT=https://eth-mainnet.alchemyapi.io/v2/ALCHEMY-ID
REACT_APP_NETWORK=rinkeby
4 changes: 2 additions & 2 deletions packages/react-app/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ const mainnetInfura = navigator.onLine

// 🏠 Your local provider is usually pointed at your local blockchain
const localProviderUrl = targetNetwork.rpcUrl;
// as you deploy to other networks you can set REACT_APP_PROVIDER=https://dai.poa.network in packages/react-app/.env
const localProviderUrlFromEnv = process.env.REACT_APP_PROVIDER ? process.env.REACT_APP_PROVIDER : localProviderUrl;
// as you deploy to other networks you can set REACT_APP_RINKEBY_PROVIDER=https://dai.poa.network in packages/react-app/.env
const localProviderUrlFromEnv = process.env.REACT_APP_RINKEBY_PROVIDER ? process.env.REACT_APP_RINKEBY_PROVIDER : localProviderUrl;
if (DEBUG) console.log("🏠 Connecting to provider:", localProviderUrlFromEnv);
const localProvider = new ethers.providers.StaticJsonRpcProvider(localProviderUrlFromEnv);

Expand Down

0 comments on commit 3e9cdf1

Please sign in to comment.