NEWTON

NEWTON


Popular tags

    What are Event Indexers in Cairo lang? What is a StarkNet indexer?

    Asked

    3 months ago

    54

    views


    1

    What are Event Indexers in Cairo lang? What is a StarkNet indexer? Can you explain more about how it work and is there any difference between StarkNet indexer and Solidity once?

      cairostarkneteventssolidityempiric

    Newton

    asked

    3 months ago


    1 answers

    0

    Accepted answer

    Event Indexers

    If you come from Solidity, you’ll know that Solidity allows you to create indexed parameters in your contract events. The indexed parameters allow you to search for these events using the parameters as filters.

    While StarkNet does not currently allow you to create indexed parameters by default in Cairo you can index your events using some available indexers such as Apibara and StarkNet Indexer.

    StarkNet Indexer

    StarkNet indexer is a service created to listen to blockchain events and decode and persist the emitted data, making it available for analysis with SQL, GraphQL, and HTTP queries.

    They’ve also created a GraphQL console that enables developers to query blockchain data for events, transactions and their inputs, as well as to filter, aggregate, and sum up values easily.

    Apibara

    Apibara is a framework and protocol that helps you build real-time, composable streams of Web3 and Web2 data. Apibara solves the challenge of streaming blockchain data: blocks are not immutable, and their data can be invalidated in response to a chain reorganization.

    There’s an amazing template to help you get started indexing events here and a tutorial guide here.

    Swagtimus.eth

    answered

    3 months ago

    Your answer

    NEWTON

    NEWTON