LUXDocumentation
Docs/G-Chain (Graph)

G-Chain (Graph)

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

Features

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

Quick Start

Install the Lux SDK and start interacting with Graph Chain.

Installation

npm install luxnet

Example

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 }
  }
}`)

SDKs & Libraries

API Reference

Full API reference documentation is available at docs.lux.network.

View Full API Docs