Skip to content
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
2 changes: 2 additions & 0 deletions .github/workflows/update-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
shell: sh
run: yarn cache:update
env:
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
CORE_NETWORK: ${{ matrix.network }}
RPC_POLYGON: ${{ secrets.RPC_POLYGON }}
RPC_OPTIMISM: ${{ secrets.RPC_OPTIMISM }}
Expand All @@ -46,6 +47,7 @@ jobs:
shell: sh
run: yarn cache:parse
env:
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
CORE_NETWORK: ${{ matrix.network }}
RPC_POLYGON: ${{ secrets.RPC_POLYGON }}
RPC_OPTIMISM: ${{ secrets.RPC_OPTIMISM }}
Expand Down
20 changes: 15 additions & 5 deletions src/scripts/update-cache-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ async function updatePayloadsEvents(
) {
const client = createViemClient({
chain: ChainList[chainId as SupportedChainIds],
rpcUrl: getRPCUrl(chainId as SupportedChainIds),
rpcUrl: getRPCUrl(chainId as SupportedChainIds, {
alchemyKey: process.env.ALCHEMY_API_KEY,
}),
});
const payloadsPath = `${chainId}/payloads`;

Expand Down Expand Up @@ -128,7 +130,9 @@ async function updatePayloadsData(

const client = createViemClient({
chain: ChainList[chainId as SupportedChainIds],
rpcUrl: getRPCUrl(chainId as SupportedChainIds),
rpcUrl: getRPCUrl(chainId as SupportedChainIds, {
alchemyKey: process.env.ALCHEMY_API_KEY,
}),
});
const contract = getContract({
abi: IPayloadsControllerCore_ABI,
Expand Down Expand Up @@ -178,7 +182,9 @@ async function updateGovCoreEvents(

const client = createViemClient({
chain: ChainList[govCoreChainId as SupportedChainIds],
rpcUrl: getRPCUrl(govCoreChainId as SupportedChainIds),
rpcUrl: getRPCUrl(govCoreChainId as SupportedChainIds, {
alchemyKey: process.env.ALCHEMY_API_KEY,
}),
});
const currentBlockOnGovernanceChain = await getBlockNumber(client);
const contract = getContract({
Expand Down Expand Up @@ -250,7 +256,9 @@ async function updateVMEvents(
const address = machine;
const client = createViemClient({
chain: ChainList[chainId as SupportedChainIds],
rpcUrl: getRPCUrl(chainId as SupportedChainIds),
rpcUrl: getRPCUrl(chainId as SupportedChainIds, {
alchemyKey: process.env.ALCHEMY_API_KEY,
}),
});
const currentBlockOnVotingMachineChain = await getBlockNumber(client);
const votesCache =
Expand Down Expand Up @@ -309,7 +317,9 @@ export async function updateCache({
// initialize contracts
const govCoreClient = createViemClient({
chain: ChainList[govCoreChainId as SupportedChainIds],
rpcUrl: getRPCUrl(govCoreChainId as SupportedChainIds),
rpcUrl: getRPCUrl(govCoreChainId as SupportedChainIds, {
alchemyKey: process.env.ALCHEMY_API_KEY,
}),
});
const govCore = getContract({
address: govCoreContractAddress,
Expand Down