LUX
All Chains
G

G-Chain (Graph)

InfrastructureLinear Consensus

GraphQL-based data indexing and querying across all Lux chains. Schema management, cross-chain federation, subscriptions, and automatic indexing with DGraph.

Overview

The Graph Chain provides a decentralized data indexing and query layer for all Lux chains. Using GraphQL as the query language and DGraph as the storage backend, G-Chain enables efficient cross-chain data federation.

Developers define schemas and indexing rules, and G-Chain validators automatically index blockchain data as it's produced. Subscriptions provide real-time updates, and cross-chain federation allows queries that span multiple Lux chains in a single request.

G-Chain eliminates the need for custom indexing infrastructure. Any dApp can query historical and real-time blockchain data through a standard GraphQL endpoint.

Technical Specifications

Query LanguageGraphQL
StorageDGraph
FederationCross-chain
UpdatesReal-time (subscriptions)
IndexingAutomatic
Chain TypeOptional

Key Features

  • GraphQL query language
  • DGraph storage backend
  • Cross-chain data federation
  • Real-time subscriptions
  • Automatic blockchain indexing
  • Custom schema definitions

SDK Example

Quick start using the Lux JavaScript SDK.

g-chain-example.ts
import { GraphClient } from 'luxnet/graph'

const graph = new GraphClient('https://graph.lux.network')

// Query cross-chain data
const result = await graph.query(`{
  transfers(chain: "C", first: 10) {
    from
    to
    amount
    block { number timestamp }
  }
}`)