Skip to content

Commit 5724ea6

Browse files
chore: add fallback RPC (#105)
# 🤖 Linear Closes PAR-946 ## Description ## Checklist before requesting a review - [x] I have conducted a self-review of my code. - [x] I have conducted a QA. - [ ] If it is a core feature, I have included comprehensive tests. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced blockchain connectivity with updated endpoints and fallback options across multiple networks. - Introduced a sample environment configuration template to simplify user setup. - **Chores** - Improved the container build process by updating package management support. - **Documentation** - Revised user guidance to recommend fallback configurations, helping to mitigate potential connectivity issues. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents 81e9831 + 38a7997 commit 5724ea6

File tree

4 files changed

+54
-19
lines changed

4 files changed

+54
-19
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM node:20-slim AS base
22
ENV PNPM_HOME="/pnpm"
33
ENV PATH="$PNPM_HOME:$PATH"
4+
45
RUN npm install -g corepack@latest
56
RUN corepack enable
67

apps/indexer/.env.example

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Custom RPCs
2+
ENVIO_SEI_RPC_URL=YOUR_SEI_RPC_URL
3+
ENVIO_HEDERA_RPC_URL=YOUR_HEDERA_RPC_URL
4+
5+
# Fallback RPCs
6+
ENVIO_MAINNET_FALLBACK_RPC=YOUR_MAINNET_RPC_URL
7+
ENVIO_OPTIMISM_FALLBACK_RPC=YOUR_OPTIMISM_RPC_URL
8+
ENVIO_GNOSIS_FALLBACK_RPC=YOUR_GNOSIS_RPC_URL
9+
ENVIO_POLYGON_FALLBACK_RPC=YOUR_POLYGON_RPC_URL
10+
ENVIO_FANTOM_FALLBACK_RPC=YOUR_FANTOM_RPC_URL
11+
ENVIO_ZKSYNC_FALLBACK_RPC=YOUR_ZKSYNC_RPC_URL
12+
ENVIO_METIS_FALLBACK_RPC=YOUR_METIS_RPC_URL
13+
ENVIO_BASE_FALLBACK_RPC=YOUR_BASE_RPC_URL
14+
ENVIO_ARBITRUM_FALLBACK_RPC=YOUR_ARBITRUM_RPC_URL
15+
ENVIO_AVALANCHE_FALLBACK_RPC=YOUR_AVALANCHE_RPC_URL
16+
ENVIO_CELO_FALLBACK_RPC=YOUR_CELO_RPC_URL
17+
ENVIO_SCROLL_FALLBACK_RPC=YOUR_SCROLL_RPC_URL
18+
ENVIO_SEPOLIA_FALLBACK_RPC=YOUR_SEPOLIA_RPC_URL

apps/indexer/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ Use your values for the chain and the contracts you want to index.
7070
7171
Ensure each event is properly handled and thoroughly tested before redeploying the environment to prevent issues in the indexing process.
7272
73+
Hypersync can sometimes be unreliable, so it's recommended to provide a fallback RPC. Check the `.env.example` file and ensure the necessary variables are set in the hosted service before deployment.
74+
7375
## 🧪 Testing
7476

7577
To run tests, use the following command:

apps/indexer/config.yaml

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ networks:
137137
#######################
138138
- id: 1 # mainnet
139139
start_block: 18486688
140+
rpc: ${ENVIO_MAINNET_FALLBACK_RPC:-https://eth.llamarpc.com}
140141
contracts:
141142
- name: Allo
142143
address:
@@ -147,6 +148,7 @@ networks:
147148
- 0x4AAcca72145e1dF2aeC137E1f3C5E3D75DB8b5f3
148149

149150
- id: 10 # optimism
151+
rpc: ${ENVIO_OPTIMISM_FALLBACK_RPC:-https://optimism.llamarpc.com}
150152
start_block: 111678968
151153
contracts:
152154
- name: Registry
@@ -157,30 +159,33 @@ networks:
157159
address:
158160
- 0x1133eA7Af70876e64665ecD07C0A0476d09465a1
159161

160-
- id: 137 # polygon
161-
start_block: 49466006
162+
- id: 42 # lukso-mainnet
163+
start_block: 2400000
164+
rpc: http://34.91.99.187:854
162165
contracts:
163166
- name: Registry
164167
address:
165168
- 0x4AAcca72145e1dF2aeC137E1f3C5E3D75DB8b5f3
166169
- name: Strategy
167170
- name: Allo
168171
address:
169-
- 0x1133eA7Af70876e64665ecD07C0A0476d09465a1
172+
- 0xB087535DB0df98fC4327136e897A5985E5Cfbd66
170173

171-
- id: 42 # lukso-mainnet
172-
start_block: 2400000
174+
- id: 100 # gnosis
175+
rpc: ${ENVIO_GNOSIS_FALLBACK_RPC:-https://gnosis-rpc.publicnode.com}
176+
start_block: 35900000
173177
contracts:
174178
- name: Registry
175179
address:
176180
- 0x4AAcca72145e1dF2aeC137E1f3C5E3D75DB8b5f3
177181
- name: Strategy
178182
- name: Allo
179183
address:
180-
- 0xB087535DB0df98fC4327136e897A5985E5Cfbd66
184+
- 0x1133eA7Af70876e64665ecD07C0A0476d09465a1
181185

182-
- id: 100 # gnosis
183-
start_block: 35900000
186+
- id: 137 # polygon
187+
rpc: ${ENVIO_POLYGON_FALLBACK_RPC:-https://polygon.llamarpc.com}
188+
start_block: 49466006
184189
contracts:
185190
- name: Registry
186191
address:
@@ -191,6 +196,7 @@ networks:
191196
- 0x1133eA7Af70876e64665ecD07C0A0476d09465a1
192197

193198
- id: 250 # fantom
199+
rpc: ${ENVIO_FANTOM_FALLBACK_RPC:-https://rpc.ankr.com/fantom}
194200
start_block: 77624278
195201
contracts:
196202
- name: Registry
@@ -202,6 +208,7 @@ networks:
202208
- 0x1133eA7Af70876e64665ecD07C0A0476d09465a1
203209

204210
- id: 324 # zksync-era-mainnet
211+
rpc: ${ENVIO_ZKSYNC_FALLBACK_RPC:-https://1rpc.io/zksync2-era}
205212
start_block: 31154341
206213
contracts:
207214
- name: Registry
@@ -213,6 +220,7 @@ networks:
213220
- 0x9D1D1BF2835935C291C0f5228c86d5C4e235A249
214221

215222
- id: 1088 # metis
223+
rpc: ${ENVIO_METIS_FALLBACK_RPC:-https://metis-rpc.publicnode.com}
216224
start_block: 17860000
217225
contracts:
218226
- name: Registry
@@ -223,18 +231,8 @@ networks:
223231
address:
224232
- 0x1133eA7Af70876e64665ecD07C0A0476d09465a1
225233

226-
- id: 43114 # avalanche
227-
start_block: 34540051
228-
contracts:
229-
- name: Registry
230-
address:
231-
- 0x4AAcca72145e1dF2aeC137E1f3C5E3D75DB8b5f3
232-
- name: Strategy
233-
- name: Allo
234-
address:
235-
- 0x1133eA7Af70876e64665ecD07C0A0476d09465a1
236-
237234
- id: 8453 # base
235+
rpc: ${ENVIO_BASE_FALLBACK_RPC:-https://base-rpc.publicnode.com}
238236
start_block: 6083365
239237
contracts:
240238
- name: Registry
@@ -246,6 +244,7 @@ networks:
246244
- 0x1133eA7Af70876e64665ecD07C0A0476d09465a1
247245

248246
- id: 42161 # arbitrum
247+
rpc: ${ENVIO_ARBITRUM_FALLBACK_RPC:-https://arbitrum.llamarpc.com}
249248
start_block: 146489425
250249
contracts:
251250
- name: Registry
@@ -262,7 +261,20 @@ networks:
262261
address:
263262
- 0x2ce7E4cB5Edb140A9327e67De85463186E757C8f
264263

264+
- id: 43114 # avalanche
265+
rpc: ${ENVIO_AVALANCHE_FALLBACK_RPC:-https://avalanche.public-rpc.com}
266+
start_block: 34540051
267+
contracts:
268+
- name: Registry
269+
address:
270+
- 0x4AAcca72145e1dF2aeC137E1f3C5E3D75DB8b5f3
271+
- name: Strategy
272+
- name: Allo
273+
address:
274+
- 0x1133eA7Af70876e64665ecD07C0A0476d09465a1
275+
265276
- id: 42220 # celo-mainnet
277+
rpc: ${ENVIO_CELO_FALLBACK_RPC:-https://1rpc.io/celo}
266278
start_block: 22257475
267279
contracts:
268280
- name: Registry
@@ -274,6 +286,7 @@ networks:
274286
- 0x1133eA7Af70876e64665ecD07C0A0476d09465a1
275287

276288
- id: 534352 # scroll
289+
rpc: ${ENVIO_SCROLL_FALLBACK_RPC:-https://1rpc.io/scroll}
277290
start_block: 2683205
278291
contracts:
279292
- name: Registry
@@ -331,6 +344,7 @@ networks:
331344
#######################
332345

333346
- id: 11155111 # sepolia
347+
rpc: ${ENVIO_SEPOLIA_FALLBACK_RPC:-https://1rpc.io/sepolia}
334348
start_block: 4617051
335349
contracts:
336350
- name: Registry

0 commit comments

Comments
 (0)