checkpoint
  • Introduction
  • Guides
    • Quickstart
    • Step-by-step setup
    • Indexing Ethereum contracts
    • Templates
    • One-to-one relations
    • BigInt and BigDecimal
    • ApolloServer usage
    • Time-travel queries
    • Advanced options
    • Media
  • Core Concepts
    • Models
    • Checkpoint configuration
    • Entity schema
    • Data writers (Starknet)
    • Data writers (EVM)
    • Internal data query
  • Use Cases
    • Snapshot X API
  • Community
    • Discord
    • Telegram
    • GitHub
Powered by GitBook
On this page
  • How it works
  • Installation
  • Guides: jump right in
  • Core concepts: dive a little deeper

Was this helpful?

Export as PDF

Introduction

NextQuickstart

Last updated 1 year ago

Was this helpful?

Checkpoint is a library for indexing data from Starknet events and making it accessible through GraphQL. Checkpoint is inspired by The Graph and focused on providing similar functionality for Starknet.

How it works

Checkpoint learns what and how to index Starknet data based on configuration parameters, known as the . Checkpoint configuration defines the smart contracts of interest and the relevant events to be tracked. The logic for how to map events to data that Checkpoint will store in its database is defined in user-defined Javascript functions called . Checkpoint then exposes the stored data to the public through a GraphQL API.

This diagram gives more detail about the flow of data once a Checkpoint instance has started processing Starknet transactions:

As highlighted in the flow diagram above:

  1. A decentralized application adds data to Starknet through a transaction on a smart contract.

  2. The smart contract emits one or more events while processing the transaction. Checkpoint continually scans Starknet for new blocks and checks if it contains events for your configured contracts they may contain.

  3. The decentralized application queries the Checkpoint GraphQL API. Checkpoint translates the GraphQL queries into SQL queries to fetch this entity data from the database. The decentralized application displays this data in a rich UI for end-users, which they can also use to issue new transactions on Starknet, and the cycle repeats.

Installation

Checkpoint is an NPM package that can be installed through the following command:

npm install @snapshot-labs/checkpoint@beta

Guides: jump right in

Follow our handy guides to get started with Checkpoint as quickly as possible:

Core concepts: dive a little deeper

Learn the fundamentals of Checkpoint to get a deeper understanding of how it works:

Checkpoint calls the data writer function for the respective event. are responsible for writing entity objects to the database.

For each block where Checkpoint encounters relevant events, it creates a record in the database to keep track of it. These records can be queried through the GraphQL API using the _checkpoints query. You can read more about how to do that .

Writers
Quickstart
Step-by-step setup
Advanced options
Checkpoint configuration
Entity schema
Data writers (Starknet)
Checkpoint configuration
Checkpoint data writers
Checkpoint Flow Diagram
here