Xai Network
English
English
  • About Xai
    • Welcome to Xai
    • Xai Introduction
      • Xai Blockchain
      • Xai Foundation
      • Xai Token
      • Blockchain Gaming
        • Current Limitations
        • The Future of Gaming
        • Gaming Evolved
      • Ex Populus Partnership
      • Offchain Labs Partnership
      • Vanguard League
      • FAQ
      • Important Links
      • Xai Brand Kit
    • Xai Protocol
      • Xai Basic Concepts
      • AnyTrust: Revolutionizing Blockchain Infrastructure
        • Reducing Costs through Trust Assumptions
        • Keysets for Flexibility
        • Data Availability Certificates (DACerts)
        • Dual Data Posting Mechanisms
        • Data Availability Servers (DAS)
        • Sequencer-Committee Interaction
      • Security considerations
    • Xai Governance Voting Guide
    • XAI Tokenomics
      • XAI Token’s Utility & Purpose
      • esXAI Token’s Utility & Purpose
      • The Redemption Process
      • Token metrics and initial allocation
      • XAI & esXAI Emissions & Burning
      • Network Rewards
      • Sentry Key Pricing Tiers
    • Sentry Keys Explained
      • How do Sentry Nodes Work
      • Who Can Operate A Sentry Node
      • Referee Smart Contract
        • Submission of Assertions
        • Claiming Rewards
        • Creating Assertion Hash and Checking Payout
      • Challenger Component
      • Key (NFT-based)
      • Sentry Download and Operation
      • Sentry Wallet Functionality
      • Licensing Impact
      • Sentry Node Hardware Requirements
      • Sentry Node Utility
      • Accruing Key Rewards
    • Sentry Key Purchase & Setup
      • Step 1: Purchase a Sentry Key
        • Option 1: Buy Sentry Key via the website
        • Option 2: Buy Sentry Key via Xai Sentry Node desktop app
        • Option 3: Buy Sentry Key via Xai Sentry Node CLI (command line interface)
          • How to view the price of a Key via the CLI
        • Option 4: Buy Sentry Key via Node License Contract on Arbiscan
      • Step 2: Download & Run the Xai Sentry Node
      • Step 3: Complete Requirements to Accrue esXAI
        • Step 3a: Set Up & Fund the Sentry Wallet
          • How to Obtain Arbitrum ETH
          • How to import your wallet as the Sentry Wallet in the desktop app
        • Step 3b: Start the Sentry Wallet (a.k.a Operator)
          • How to create a wallet using the CLI
        • Step 3c: Assign Keys to the Sentry Wallet
      • Step 4: Complete KYC (or KYB) to Claim XAI redemptions
        • How to interpret a Pending KYC status
      • Common Troubleshooting Steps
        • How do I run a Xai Node on VPS?
          • Step 1: Choose a VPS
          • Step 2: Log in to a server
          • Step 3: Set up Xai Sentry Node
          • Step 4: Set up a Screen
          • Step 5: Start Xai Sentry Node
          • Step 6: Monitor your Node via Screen
          • Step 7: Updating your node
        • How do I prevent others from using my Sentry Wallet or Operator?
        • Why don't I see the KYC link on the desktop app?
        • How do I know my Node is running in the CLI?
        • How do I KYC if I'm using the CLI?
        • How can I see my rewards?
        • Crashing, inconsistent Emissions / missing revert data errors
        • According to BlockPass, my KYC is approved, but the desktop app still says I am not approved
        • I see "Transaction in progress" message after assigning my wallet. Did my wallet not get assigned?
        • How do I delegate my Keys to another user's operator?
        • Why did my Accrued esXAI balance decrease?
        • What are the legitimate contracts owned & operated by Xai Foundation?
        • Why do I get an error for challenge 2012?
      • How To Videos
        • Desktop Client
          • Download & Install Xai Node Desktop Client
          • Import & Start Your Sentry Wallet
          • Assign Wallets Containing Keys to the Sentry Wallet
          • Fund Sentry Wallet with Arbitrum One ETH
          • Submit KYC
          • Claim Node Rewards after Passing KYC
        • Command Line Interface (CLI)
          • Download & Install Xai Node CLI
          • Boot Operator & Interpret Status Logs
          • Add Custom Operator
          • Track Accrued esXAI
          • KYC When Using CLI
      • Redeem Referral Rewards
    • Open Initiatives
      • Completed Initiatives
      • Xai & Sentry Nodes Initiatives
      • Xai Protocol Initiatives
  • Staking Explained
    • Staking v1 and v2
    • Staking Pool Guide
      • Create a Pool
      • Stake esXAI
      • Stake Sentry Keys
      • Generating Rewards
      • Unstaking
    • Staking Rewards & Tiers
    • Time Cooldown
    • Gas Optimizations
  • Tiny Sentry Key FAQ
    • FAQ (Indonesian / Bahasa Indonesia)
    • FAQ (Korean / 한국어)
    • FAQ (Hindi / हिन्दी) - कुंजी विभाजन सामान्य प्रश्न
    • FAQ (Chinese / 中文)
  • Key Sale Referrals
  • Key Split Update (technical)
  • Build on Xai
    • Xai Chains & Parameters
      • Connect to Xai Mainnet
      • Bridge to Xai Mainnet
      • Connect to Xai Testnet (Sepolia)
      • Bridge to Xai Testnet
      • Bridged Token Addresses
      • Contract Addresses
    • How to run a full node for Xai chain
    • How to get $XAI
      • Centralized Exchanges
      • Decentralized Exchanges
        • Camelot
    • Developer Tools
      • Block Explorers
      • RPC
        • Ankr
        • Nirvana
        • QuickNode
      • Token Bridges
        • Xai native bridge
        • Gas.zip
        • Relay
      • Wallets
      • Marketplace
        • Reservoir
        • Snag Solutions
        • RaribleX
      • On chain randomisation
        • Supra VRF
  • Xai Gaming Dev Resources
    • Xai Connect
      • Overview
      • Integrate with Xai Connect
    • Build with thirdweb
      • Overview
      • Connect
      • Contracts
      • Wallets
      • Account Abstraction
      • SDKs
      • Engine
      • Web3 APIs
    • Build with Sequence
    • Subgraph
    • Xai Gas Subsidy
  • Xai Vanguard: Genesis
    • Getting Started
      • Leaderboard
      • Discord
    • Chapter 01: Onboarding
    • Chapter 02: Minting
      • Minting from Contract
    • Chapter 03: Discord
      • Obtaining esXAI
      • Obtaining XAI
      • Buy Sentry Key
    • Chapter 04: Xai Staking Pools
    • Chapter 05: Unicorn Bingo
    • Chapter 06: Bridging
    • Chapter 08: Build on Xai
      • Thirdweb: Creator Portal Walkthrough
      • Sequence: Xai Builder Walkthrough
    • Chapter 09: Camelot
    • Chapter 10: Crypto Unicorns
    • Chapter 11: Tarochi
    • Chapter 12 - My Angry Yakuza Girlfriend
    • Chapter 13 - Rainbow Rumble
    • Chapter 14 - The Lost Glitches
  • Xai Vanguard: Previous Seasons
    • XAI Token Claim
      • Claim Details
  • Play Games on Xai
    • Connect your wallet to Xai
    • Xai Games Catalog
    • Final Form
      • Card Sets
      • Card System
      • Where to Get Cards
      • ❔FAQ
Powered by GitBook
On this page
  1. Xai Gaming Dev Resources

Subgraph

Goldsky is a powerful subgraph provider that allows game developers to efficiently query blockchain data on Xai. By leveraging Goldsky, you can access real-time data for both the testnet and mainnet environments, enabling seamless integration and enhanced functionality for your games.

Why Use Goldsky Subgraphs?

Subgraphs are essential for indexing and querying blockchain data quickly and efficiently. Goldsky provides robust and scalable subgraph solutions, making it easier to interact with complex blockchain data structures. Key benefits include:

  • Real-time Data Access: Obtain up-to-date information from the blockchain, ensuring your game logic remains current and accurate.

  • Efficient Queries: Optimize your data retrieval processes with high-performance querying capabilities.

  • Seamless Integration: Easily integrate subgraph data into your game development workflows.

Accessing Goldsky Subgraphs

Goldsky provides endpoints for both the Xai testnet and mainnet, allowing you to test and deploy your game with reliable data sources.

Testnet Subgraph

To access the Xai testnet subgraph, use the following endpoint:

bashCopy codehttps://api.goldsky.com/api/public/project_cl8ylkiw00krx0hvza0qw17vn/subgraphs/blocks/xai-sepolia/gn

This endpoint provides access to testnet data, enabling you to develop and test your game in a safe environment before deploying to mainnet.

Mainnet Subgraph

For live data on the Xai mainnet, use this endpoint:

bashCopy codehttps://api.goldsky.com/api/public/project_cl8ylkiw00krx0hvza0qw17vn/subgraphs/blocks/xai/gn

This endpoint ensures you can access real-time mainnet data, crucial for deploying your game to production with accurate and reliable information.

How to Use Goldsky Subgraphs

  1. Setup Your Environment: Ensure your development environment is configured to make HTTP requests. Common tools include cURL, Postman, or integrated directly within your codebase using libraries like Axios (JavaScript) or Requests (Python).

  2. Querying Data: Construct your GraphQL queries to fetch the necessary data from the subgraphs. Here is a basic example of a GraphQL query to get block information:

    graphqlCopy code{
      blocks(first: 5) {
        id
        number
        timestamp
      }
    }
  3. Integrating into Your Game: Use the data retrieved from Goldsky subgraphs to enhance your game logic. Whether you need player stats, game state information, or other blockchain-related data, subgraphs provide a reliable source.

  4. Testing: Always test your queries on the testnet first to ensure they return the expected data. Once validated, you can confidently switch to the mainnet endpoint for production.

Additional Resources

For more detailed information and advanced usage, refer to the Goldsky documentation:

By leveraging Goldsky subgraphs, you can build more dynamic, data-driven games on the Xai blockchain, ensuring a smooth and enriched gaming experience for your users.

PreviousBuild with SequenceNextXai Gas Subsidy

Last updated 11 months ago

Goldsky Documentation