Skip to main content

CreateIndexer

Creates a new indexer to listen to chain events

Request Parameters

  • name (required)

    A name for the indexer

  • binary_id (required)

    The ID of the executable binary to run as the indexer. This should be the ID provided by UploadBinary

  • subscriptions (required)

    The event subscriptions to configure for the indexer, which determines which events the indexer will receive. At least one subscription must be provided.

    • transactions

      Subscribe the indexer to transaction events

      • filter_programs (optional)

        A list of program addresses to filter transactions by. If provided, the indexer will only receive transactions that include an instruction for at least one of the specified programs.

      • filter_accounts (optional)

        A list of account addresses to filter transactions by. If provided, the indexer will only receive transactions that include at least one of the specified accounts.

Response

  • indexer (object)

    The created indexer object

    • id (string)

      The ID of the new indexer

    • name (string)

      The name of the indexer

    • binary_id (string)

      The ID of the binary used by the indexer

    • state (integer)

      The state of the indexer:

      • 0: Pending
      • 1: Running
      • 4: Terminated

Example Request

{
"jsonrpc": "2.0",
"method": "dyndexer_createIndexer",
"params": [
{
"name": "my-indexer",
"binary_id": "binary-123456",
"subscriptions": [
{ "transaction": {} }
]
}
],
}

Example Response

{
"jsonrpc": "2.0",
"result": {
"indexer": {
"id": "indexer-123456",
"name": "my-indexer",
"binary_id": "binary-123456",
}
}
}