Skip to content

Commit

Permalink
Merge pull request #265 from balancer/gnosis-rpc
Browse files Browse the repository at this point in the history
set RPC from ENV and new default gnosis RPC
  • Loading branch information
gmbronco authored Mar 18, 2024
2 parents dadfc62 + b511648 commit ca1ad61
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modules/network/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ export default function template(templateString, templateVariables) {
export function getRpcUrl(networkId: number): string {
requireValidNetworkId(networkId);

const templateUrl = configs[networkId].rpc;
// Get the RPC from env, if it's not set, use the default one
const envRpcUrl = process.env[`RPC_URL_${networkId}`];
const templateUrl = envRpcUrl || configs[networkId].rpc;
if (templateUrl.match(/INFURA_PROJECT_ID/) && INFURA_PROJECT_ID == null) {
throw new Error(`INFURA_PROJECT_ID env variable must be set for network ${networkId}`)
}
Expand Down

0 comments on commit ca1ad61

Please sign in to comment.