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

chore: replace rpc to rate-limited one #3187

Merged
merged 1 commit into from
Oct 26, 2023
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
6 changes: 3 additions & 3 deletions apps/cowswap-frontend/.env
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ REACT_APP_FULL_APP_DATA_DEVELOPMENT='{"version":"0.7.0","appCode":"CoW Swap","en
REACT_APP_FULL_APP_DATA_LOCAL='{"version":"0.7.0","appCode":"CoW Swap","environment":"local","metadata":{}}'

# INFURA KEY
REACT_APP_INFURA_KEY=586e7e6b7c7e437aa41f5da496a749f5
REACT_APP_INFURA_KEY=2af29cd5ac554ae3b8d991afe1ba4b7d
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing that I'd like to raise is that, REACT_APP_INFURA_KEY is required and the app will fail to start when it's not set:

https://github.com/cowprotocol/cowswap/blob/0bf6c4eb2d940682abb242571003d03afd538a4c/libs/common-const/src/networks.ts#L23-L22

But it's not used at all if the other keys are set, which they are by default:

[SupportedChainId.MAINNET]: REACT_APP_NETWORK_URL_1 || `https://mainnet.infura.io/v3/${INFURA_KEY}`,
[SupportedChainId.GNOSIS_CHAIN]: REACT_APP_NETWORK_URL_100 || `https://rpc.gnosis.gateway.fm`,
[SupportedChainId.GOERLI]: REACT_APP_NETWORK_URL_5 || `https://goerli.infura.io/v3/${INFURA_KEY}`,

So I suggest to:

  1. Make it a requirement only if one of the other env vars are missing
  2. Remove it from .env files as it's redundant, and leads to confusion

I mention that because locally I changed only REACT_APP_INFURA_KEY in my .env.local and couldn't figure out why it was not being picked up.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great suggestion.

This PR is about is about replacing the KEY only.
I will iterate in another PR for this


# Cypress Integration Tests
INTEGRATION_TEST_PRIVATE_KEY=
Expand All @@ -29,8 +29,8 @@ INTEGRATION_TESTS_INFURA_KEY=
#REACT_APP_BLOCKNATIVE_API_KEY=

# RPC Nodes
REACT_APP_NETWORK_URL_1=https://mainnet.infura.io/v3/586e7e6b7c7e437aa41f5da496a749f5
REACT_APP_NETWORK_URL_5=https://goerli.infura.io/v3/586e7e6b7c7e437aa41f5da496a749f5
REACT_APP_NETWORK_URL_1=https://mainnet.infura.io/v3/2af29cd5ac554ae3b8d991afe1ba4b7d
REACT_APP_NETWORK_URL_5=https://goerli.infura.io/v3/2af29cd5ac554ae3b8d991afe1ba4b7d
REACT_APP_NETWORK_URL_100=https://rpc.gnosischain.com

# Wallet Connect
Expand Down
6 changes: 3 additions & 3 deletions apps/cowswap-frontend/.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ REACT_APP_PRICE_FEED_PARASWAP_ENABLED=true
REACT_APP_PRICE_FEED_1INCH_ENABLED=true
REACT_APP_PRICE_FEED_0X_ENABLED=true
# INFURA KEY
REACT_APP_INFURA_KEY=586e7e6b7c7e437aa41f5da496a749f5
REACT_APP_INFURA_KEY=2af29cd5ac554ae3b8d991afe1ba4b7d

# BLOCKNATIVE KEY
# Loaded from GH secrets
#REACT_APP_BLOCKNATIVE_API_KEY=

# RPC Nodes
REACT_APP_NETWORK_URL_1=https://mainnet.infura.io/v3/586e7e6b7c7e437aa41f5da496a749f5
REACT_APP_NETWORK_URL_5=https://goerli.infura.io/v3/586e7e6b7c7e437aa41f5da496a749f5
REACT_APP_NETWORK_URL_1=https://mainnet.infura.io/v3/2af29cd5ac554ae3b8d991afe1ba4b7d
REACT_APP_NETWORK_URL_5=https://goerli.infura.io/v3/2af29cd5ac554ae3b8d991afe1ba4b7d
#REACT_APP_NETWORK_URL_100=https://rpc.gnosischain.com/oe-only
REACT_APP_NETWORK_URL_100=https://rpc.gnosischain.com

Expand Down
6 changes: 3 additions & 3 deletions libs/common-utils/.env
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ REACT_APP_FULL_APP_DATA_DEVELOPMENT='{"version":"0.7.0","appCode":"CoW Swap","en
REACT_APP_FULL_APP_DATA_LOCAL='{"version":"0.7.0","appCode":"CoW Swap","environment":"local","metadata":{}}'

# INFURA KEY
REACT_APP_INFURA_KEY=586e7e6b7c7e437aa41f5da496a749f5
REACT_APP_INFURA_KEY=2af29cd5ac554ae3b8d991afe1ba4b7d

# Cypress Integration Tests
INTEGRATION_TEST_PRIVATE_KEY=
Expand All @@ -31,8 +31,8 @@ INTEGRATION_TESTS_INFURA_KEY=
# Node
REACT_APP_CHAIN_ID="1"
REACT_APP_SUPPORTED_CHAIN_IDS="1,100,5"
REACT_APP_NETWORK_URL_1=https://mainnet.infura.io/v3/586e7e6b7c7e437aa41f5da496a749f5
REACT_APP_NETWORK_URL_5=https://goerli.infura.io/v3/586e7e6b7c7e437aa41f5da496a749f5
REACT_APP_NETWORK_URL_1=https://mainnet.infura.io/v3/2af29cd5ac554ae3b8d991afe1ba4b7d
REACT_APP_NETWORK_URL_5=https://goerli.infura.io/v3/2af29cd5ac554ae3b8d991afe1ba4b7d
REACT_APP_NETWORK_URL_100=https://rpc.gnosischain.com

# Wallet Connect
Expand Down
Loading