Enable Indexing on your rollup
Conduit Indexing simplifies the process of indexing your chain and querying events, simplifying the development experience for your projects and users. This guide will walk you through enabling Indexing and sending your first query.
Sign in
Log into the Conduit app and head to the Indexing
tab.
Select a Rollup
Click Enable
and choose the rollup where you want to enable Conduit Indexing.
Set up billing
Enter your billing details and subscribe to the Testnet or Mainnet Indexing plan. For pricing details, check out Pricing & Costs.
How To Query Events
Once you’ve finished setting up billing your rollup will immediately begin indexing. It will then show up on the Query builder on the Indexing dashboard and you can begin querying events with your newly created API key.
There are two ways to query; with the Query builder on the Indexing dashboard, or directly via the API.
Using the Indexing API directly
The base API url to use is https://indexing.conduit.xyz/v2/query
.
To use your API key you can either;
- Append the API key directly in a query parameter
?api-key=KEY
- Add a field to the request body
{ "api-key": "KEY", ... }
using aPOST
request - Submit an
api-key
input value as part of a multipart form request to the above base url.
You can copy the API url with your key appended in the API keys section at the bottom of the Indexing page in the Conduit app.
An example query is:
curl 'https://indexing.conduit.xyz/v2/query?api-key=SECRET_KEY' \
-G \
--data-urlencode 'query=select "from", "to", tokens from transfer where chain = 8453 limit 1' \
--data-urlencode 'signatures=Transfer(address indexed from, address indexed to, uint tokens)' | jq .
The response would look like:
[
{
"cursor": "8453-30138481",
"columns": [
{
"name": "from",
"pgtype": "bytea"
},
{
"name": "to",
"pgtype": "bytea"
},
{
"name": "tokens",
"pgtype": "numeric"
}
],
"rows": [
[
"0x0000000000000000000000000000000000000000",
"0x0cf966857325db9a9b4dada66e80ce581c18aca1",
"0"
]
]
}
]
There is also an official Typescript SDK for Index Supply, which you can find here .