Skip to content
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

Use Alchemy provider on mainnet #1339

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/release-netlify-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ jobs:
env:
NEXT_PUBLIC_ALCHEMY_TESTING_API_KEY: ${{ secrets.NEXT_PUBLIC_ALCHEMY_TESTING_API_KEY }}
NEXT_PUBLIC_INFURA_API_KEY: ${{ secrets.NEXT_PUBLIC_INFURA_API_KEY }}
NEXT_PUBLIC_SITE_URL: ${{ secrets.NEXT_PUBLIC_SITE_URL }}
NEXT_PUBLIC_SITE_URL: ${{ secrets.NEXT_PUBLIC_SITE_URL }}
NEXT_PUBLIC_ALCHEMY_API_KEY: ${{ secrets.NEXT_PUBLIC_ALCHEMY_API_KEY }}
1 change: 1 addition & 0 deletions .github/workflows/release-netlify-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ jobs:
NETLIFY_DEPLOY_TO_PROD: true
NEXT_PUBLIC_ALCHEMY_TESTING_API_KEY: ${{ secrets.NEXT_PUBLIC_ALCHEMY_TESTING_API_KEY }}
NEXT_PUBLIC_INFURA_API_KEY: ${{ secrets.NEXT_PUBLIC_INFURA_API_KEY }}
NEXT_PUBLIC_ALCHEMY_API_KEY: ${{ secrets.NEXT_PUBLIC_ALCHEMY_API_KEY }}
NEXT_PUBLIC_SITE_URL: ${{ secrets.NEXT_PUBLIC_SITE_URL }}
1 change: 1 addition & 0 deletions .github/workflows/release-netlify-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ jobs:
NETLIFY_DEPLOY_TO_PROD: true
NEXT_PUBLIC_ALCHEMY_TESTING_API_KEY: ${{ secrets.NEXT_PUBLIC_ALCHEMY_TESTING_API_KEY }}
NEXT_PUBLIC_INFURA_API_KEY: ${{ secrets.NEXT_PUBLIC_INFURA_API_KEY }}
NEXT_PUBLIC_ALCHEMY_API_KEY: ${{ secrets.NEXT_PUBLIC_ALCHEMY_API_KEY }}
NEXT_PUBLIC_SITE_URL: ${{ secrets.NEXT_PUBLIC_SITE_URL }}
15 changes: 11 additions & 4 deletions src/providers/NetworkConfig/rainbow-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,17 @@ if (process.env.NEXT_PUBLIC_TESTING_ENVIRONMENT) {
export const { chains, provider } = configureChains(supportedWagmiChains, [
jsonRpcProvider({
rpc: (chain: Chain) => {
const networkUrl = `${
chain.id === mainnet.id ? 'ethereum' : 'ethereum-' + chain.name
}.publicnode.com`;
return { http: `https://${networkUrl}`, webSocket: `wss://${networkUrl}` };
const publicNodeNetworkUrl = `ethereum-${chain.name}.publicnode.com`;
if (chain.id === mainnet.id) {
return {
http: `https://eth-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_API_KEY}`,
webSocket: `wss://eth-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_API_KEY}`,
};
}
return {
http: `https://${publicNodeNetworkUrl}`,
webSocket: `wss://${publicNodeNetworkUrl}`,
};
},
}),
]);
Expand Down
Loading