Introduction
TezGraph is an open-source GraphQL API that provides access to historical and real-time Tezos blockchain data with the convenience of GraphQL.
TezGraph allows Application Developers building on Tezos blockchain to create more complex user workflows and build faster, whether in the cloud or on-premise.
What problems TezGraph is solving?
- The ability to query historical and real-time blockchain data using Tezos RPC directly is time-consuming. There are operational considerations for applications since it takes time to traverse the blockchain and development considerations since more in-depth knowledge of the Tezos domain is required.
Building an indexer solution by every wallet application or dApp developer is not feasible. Current indexer solutions require ramp-up time and need client tools to be a good fit for development environments.
- Development solutions that provide practical and straightforward subscriptions and notifications for near real-time new blockchain events are not as developed and hence not adopted by applications. Events notification could trigger workflows and business rules based on the changes to enrich end-user experiences.
Information points that require significant effort:
- account's balance
- account operations within a period
- most recent real-time operations
- smart-contract execution
- paged results of the above
- Existing Tezos indexing offerings are typically available as a SaaS and operated by a single entity. Centralized indexer infrastructure puts the risk on builders. It is possible to self-host an indexer, but the undertaking to self-host an incumbent indexer is non-trivial and introduces cost.
Benefits
Developer Benefits
- Allows providing richer end-user experiences
- Faster development cycle and quicker adoption due to:
- Simplicity. Straightforward API, easy to use technology, and out of the box indexed data
- Compatibility. Easy to use with various technologies and applications, GraphQL has mature client libraries readily available for all major programming languages, including OCaml/Reason, Haskell, Rust, etc.
- Discoverability. GraphQL makes exploration and discovery of the API and underlying data far more straightforward than REST or RPC based APIs.
- API efficiency due to GraphQL's incremental delivery for state-less queries. It serves only the data properties requested by the client. Furthermore, it supports @defer and @stream directives.
Operational benefits
- Easy to deploy
- TezGraph is easily deploy-able to cloud or on-premise infrastructure
Features
Functional
Beta v1.0
- Near real-time notifications on newly created head blocks, account/smart contract operations, validation and voting operations
- Ability to efficiently query information about accounts and operations (translations, delegations, originations, reveals, and endorsements).
- Ability to use out of the box Indexer node with Public API
- Ability to set up Indexer node on-premise
Non-functional
- Operational:
- GitLab CI/CD
- Easy to deploy in a maximum of 4 steps
- Automatic Indexer data dumps with each release and for specific branches
- Design:
- Consistent terminology between Query API and Subscription API
- Extendable design
- Monitoring: operations and performance
Next phases
- Taquito integration
- Dealing with uncle blocks
- Indexing smart contracts
- Ability to efficiently query information about validation and voting operations
- Ability to get a list of current delegates
- Filtering improvements
- Other data statistics: daily transaction number, daily amounts, gas prices per transaction, etc.