Skip to content

Commit

Permalink
Read node rpc urls from process.env instead of config
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadranjbarz committed Nov 29, 2023
1 parent 2fb2e21 commit cf3fc85
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,30 +148,30 @@ export function getProvider(networkId: number) {
let options;
switch (networkId) {
case NETWORK_IDS.MORDOR_ETC_TESTNET:
url = config.get('MORDOR_ETC_TESTNET') as string;
url = process.env.MORDOR_ETC_TESTNET as string;
break;
case NETWORK_IDS.ETC:
url = config.get('ETC_NODE_HTTP_URL') as string;
url = process.env.ETC_NODE_HTTP_URL as string;
break;
case NETWORK_IDS.XDAI:
url = config.get('XDAI_NODE_HTTP_URL') as string;
url = process.env.XDAI_NODE_HTTP_URL as string;
break;

case NETWORK_IDS.BSC:
// 'https://bsc-dataseed.binance.org/'
url = config.get('BSC_NODE_HTTP_URL') as string;
url = process.env.BSC_NODE_HTTP_URL as string;
options = { name: NETWORK_NAMES.BSC, chainId: NETWORK_IDS.BSC };
break;

case NETWORK_IDS.CELO:
url =
(config.get('CELO_NODE_HTTP_URL') as string) ||
(process.env.CELO_NODE_HTTP_URL as string) ||
`https://celo-mainnet.infura.io/v3/${INFURA_ID}`;
break;

case NETWORK_IDS.CELO_ALFAJORES:
url =
(config.get('CELO_ALFAJORES_NODE_HTTP_URL') as string) ||
(process.env.CELO_ALFAJORES_NODE_HTTP_URL as string) ||
`https://celo-alfajores.infura.io/v3/${INFURA_ID}`;
break;

Expand Down

0 comments on commit cf3fc85

Please sign in to comment.