-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support More Web3 Providers #47
Support More Web3 Providers #47
Conversation
efee6f6
to
5c78503
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. One minor comment, and then just let me know when you are able to get the integ tests passing then I'll approve
Also please update the PR title!
lib/handlers/injector-sor.ts
Outdated
case 'alchemy': | ||
// todo: add logic to generate alchemy rpc urls | ||
case 'moralis': | ||
// todo: todo: add logic to generate moralis rpc urls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you fill in alchemy just so its ready if we need to switch out?
Think we can remove moralis too for now
lib/handlers/injector-sor.ts
Outdated
case 'moralis': | ||
// todo: todo: add logic to generate moralis rpc urls | ||
default: | ||
throw Error('Fatal: Unknown Provider Not Supported') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should default be infura to keep old behavior if no provider_name set?
bb54087
to
61eb791
Compare
ac5d3bf
to
27aa63d
Compare
2577323
to
c2be7fb
Compare
Integ tests are failing :'( |
4962f92
to
430687e
Compare
a6509db
to
d5a8ef4
Compare
353ef73
to
08634ae
Compare
fbd5666
to
70fc8ea
Compare
bin/app.ts
Outdated
let jsonRpcProviders = {} as { [chainId: string]: string } | ||
SUPPORTED_CHAINS.forEach((chainId: ChainId) => { | ||
const key = `WEB3_RPC_${chainId}` | ||
jsonRpcProviders[key] = jsonRpcProvidersSecret.secretValueFromJson(key) as unknown as string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use .toString()
like we do below
WEB3_RPC_1: process.env.WEB3_RPC_1!, | ||
WEB3_RPC_3: process.env.WEB3_RPC_3!, | ||
WEB3_RPC_4: process.env.WEB3_RPC_4!, | ||
WEB3_RPC_5: process.env.WEB3_RPC_5!, | ||
WEB3_RPC_42: process.env.WEB3_RPC_42!, | ||
WEB3_RPC_10: process.env.WEB3_RPC_10!, | ||
WEB3_RPC_69: process.env.WEB3_RPC_69!, | ||
WEB3_RPC_42161: process.env.WEB3_RPC_42161!, | ||
WEB3_RPC_421611: process.env.WEB3_RPC_421611!, | ||
WEB3_RPC_137: process.env.WEB3_RPC_137!, | ||
WEB3_RPC_80001: process.env.WEB3_RPC_80001!, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update the package README so people know to do this?
lib/handlers/injector-sor.ts
Outdated
const projectId = process.env.PROJECT_ID | ||
const url = `https://${chainName}.infura.io/v3/${projectId}` | ||
const url = process.env[`WEB3_RPC_${chainId.toString()}`]! | ||
log.info({ url: url }, `GENERATED URL`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets remove this log
lib/handlers/injector-sor.ts
Outdated
const url = process.env[`WEB3_RPC_${chainId.toString()}`]! | ||
log.info({ url: url }, `GENERATED URL`) | ||
|
||
if (typeof url == undefined || url == '') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just !url
is fine
bin/app.ts
Outdated
const jsonRpcProvidersSecret = sm.Secret.fromSecretAttributes(this, 'RPCProviderUrls', { | ||
secretCompleteArn: | ||
'arn:aws:secretsmanager:us-east-2:644039819003:secret:routing-api-rpc-urls-json-primary-ixS8mw', | ||
//backup Arn: arn:aws:secretsmanager:us-east-2:644039819003:secret:routing-api-rpc-urls-json-backup-D2sWoe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a bit more context to this comment so other people know why this exists?
Also add a note that you must update the multicall chunk size to 50 for optimism when switching to the backup
e8602e7
to
c8a9fe5
Compare
683c6c7
to
8c5e06d
Compare
06678d0
to
bb73b04
Compare
3a58b18
to
8ab345b
Compare
Initial Commit for adding support for web3 providers outside of infura. Currently, the project only supports infura web3 providers, and more flexibility is needed since infura has had outages.
#38