Skip to content

Commit

Permalink
Make node url configable
Browse files Browse the repository at this point in the history
  • Loading branch information
Lbqds committed Nov 14, 2023
1 parent 4be7fc8 commit 86cb928
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions relayer-engine/.env.devnet
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@ ETHEREUM_ADDRESSES=0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0
BSC_ADDRESSES=0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0
ALEPHIUM_ADDRESSES=1DrDyTr9RpRsQnDnXo2YRiPzPW4ooHX5LLoqXrqfMrpQH

ETHEREUM_NODE_URL=127.0.0.1:8545
BSC_NODE_URL=127.0.0.1:8546
ALEPHIUM_NODE_URL=http://127.0.0.1:22973

SPY_URL=localhost:7072
REDIS_URL=localhost:6379
3 changes: 2 additions & 1 deletion relayer-engine/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ export function getGovernanceAddress(network: NetworkId, chainId: ChainId): stri

export function getNodeUrl(network: NetworkId, chainId: ChainId): string {
try {
return chainConfigs[chainId][network].nodeUrl
const chainName = coalesceChainName(chainId).toUpperCase()
return process.env[`${chainName}_NODE_URL`] ?? chainConfigs[chainId][network].nodeUrl
} catch (_) {
throw new Error(`Failed to get node url for ${coalesceChainName(chainId)}, network: ${network}`)
}
Expand Down

0 comments on commit 86cb928

Please sign in to comment.