You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes you need to run multiple indexes with similar configs whose only difference is contract addresses. In this case you can use index templates like this:
188
+
189
+
```yaml
190
+
templates:
191
+
trades:
192
+
kind: operation
193
+
datasource: tzkt_staging
194
+
contract: < dex >
195
+
handlers:
196
+
- callback: on_fa12_token_to_tez
197
+
pattern:
198
+
- destination: < dex >
199
+
entrypoint: tokenToTezPayment
200
+
- destination: < token >
201
+
entrypoint: transfer
202
+
- callback: on_fa20_tez_to_token
203
+
pattern:
204
+
- destination: < dex >
205
+
entrypoint: tezToTokenPayment
206
+
- destination: < token >
207
+
entrypoint: transfer
208
+
209
+
indexes:
210
+
trades_fa12:
211
+
template: trades
212
+
values:
213
+
dex: FA12_dex
214
+
token: FA12_token
215
+
216
+
trades_fa20:
217
+
template: trades
218
+
values:
219
+
dex: FA20_dex
220
+
token: FA20_token
221
+
```
222
+
223
+
185
224
### Optional: configure Hasura GraphQL Engine
186
225
187
226
`init` command generates Hasura metadata JSON in the package root. You can use `configure-graphql` command to apply it to the running GraphQL Engine instance:
0 commit comments