Skip to content

Commit

Permalink
Fix polygon rate limit
Browse files Browse the repository at this point in the history
  • Loading branch information
yorhodes committed Nov 10, 2023
1 parent be14261 commit 3a8164b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
3 changes: 2 additions & 1 deletion typescript/infra/fork-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ if [ -z "$ENVIRONMENT" ] || [ -z "$MODULE" ]; then
exit 1
fi

CHAINS=`yarn ts-node ./scripts/print-chain-metadatas.ts -e mainnet3 | \
CHAINS=`yarn ts-node ./scripts/print-chain-metadatas.ts -e $ENVIRONMENT | \
jq -r 'to_entries | map(select(.value.protocol=="ethereum")) | map(.key) ' | \
tr -d '\"[],'`

for CHAIN in $CHAINS; do
echo "=== Run $MODULE on $CHAIN ==="
./fork.sh $ENVIRONMENT $MODULE $CHAIN
done
2 changes: 1 addition & 1 deletion typescript/infra/fork.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set -e

RPC_URL=`yarn ts-node ./scripts/print-chain-metadatas.ts -e $ENVIRONMENT | jq -r ".$CHAIN.rpcUrls[0].http"`

anvil --fork-url $RPC_URL --silent &
anvil --fork-url $RPC_URL --fork-retry-backoff 3 --compute-units-per-second 200 --silent &
ANVIL_PID=$!

while ! cast bn &> /dev/null; do
Expand Down
7 changes: 1 addition & 6 deletions typescript/sdk/src/consts/chainMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -651,12 +651,7 @@ export const polygon: ChainMetadata = {
nativeToken: etherToken,
rpcUrls: [
{
http: 'https://rpc-mainnet.matic.quiknode.pro',
pagination: {
// Needs to be low to avoid RPC timeouts
maxBlockRange: 10000,
minBlockNumber: 19657100,
},
http: 'https://polygon-bor.publicnode.com',
},
{ http: 'https://polygon-rpc.com' },
],
Expand Down

0 comments on commit 3a8164b

Please sign in to comment.