LogoLogo
  • Overview
  • Basics
    • Architecture
  • Key Concepts
    • EVM Ledger
    • UTXO Chain
      • Confidential transfers
        • Overview
        • Concepts
        • Technical Specifications
    • Prism++ Transfer
    • Triple Masking
      • Overview
      • SDK Installation
      • Bar to Abar
      • Abar to Bar
      • Abar Transfer
    • Staking
      • Overview
      • EVM Staking
        • UTXO Staking and EVM Staking
        • EVM Staking Portal User Guide
      • Consensus
      • Rewards
      • Penalties
  • Developers
    • Acquire Testnet FRA
    • EVM Tools & Tutorials
      • Contract Deployment
        • Ganache
        • Hardhat
        • Remix
        • Truffle
        • Waffle
      • The Graph
      • Band Protocol
      • Mint NFTs
        • Deploy NFT Contract (1 of 3)
        • Mint NFT (2 of 3)
        • View NFT (3 of 3)
    • Developer SDKs
      • UTXO Native Chain SDK
        • UTXO Native Chain SDK Installation
        • Developer Tools
          • Findora CLI Tool
        • UTXO API Reference
          • Account
          • Keypair
          • Network
          • Asset
          • Staking
          • Transaction
          • Helpers
      • ZkRouting SDK
      • zkDID SDK
        • zkDID SDK Installation
        • zkDID API Reference
        • zkDID Example Code
      • Prism++ SDK
    • EVM References
      • Metamask
      • Local Development Network Setup
      • EVM API Reference
      • Precompiled Contracts
    • Resources
      • Bug Bounties
      • Events
        • 🏗️ETH San Francisco 2022
          • zkDID and Credentials
        • 🏗️ETH Denver 2023
    • Game-Specific Chains
      • GSC Highlights
      • User Guide
      • Developer Tools
  • Network Settings
    • Contract Addresses
    • Network Settings
  • General User Materials
    • Acquire FRA
    • Acquire FRA (Testnet)
    • Stake FRA
    • Use Wallets
      • MetaMask
        • Download
        • Configure (Auto)
        • Configure (Manual)
      • Findora Wallet
        • Download
        • New Wallet
        • Transfer
        • Prism++
        • Adding Assets to the Findora Wallet
        • Manage Assets
      • Ledger Hardware Wallet
    • Bridging Tokens to Findora
    • Use Block Explorers
    • Explore Testnet
      • Triple Masking
        • Triple Masking Demo
      • EVM Staking
      • Prism++
        • Prism++ Testing Campaign
          • 💰Testnet Wallet Setup/Funding
          • 👨‍🌾👨🌾 Peasant: Prism++ Campaign Signup
          • 🧒Pupil: FRC20 Token Transfers
          • 🧑‍🎨🧑🎨 Pilgrim: FRC 721 Token Transfers
          • 🧑‍🎓🧑🎓 Prodigy: FRC1155 Token Transfers
          • 🧑‍🚀🧑🚀 Pioneer: Mainnet Transfers
          • Prism++ Testnet Campaign FAQs
    • Gaxle Events
      • Game Chain Challenges
        • Getting Started
        • The Campaigns
        • The Reward Raffles
  • Validator Materials
    • Findora's University Program
    • Validator Setup Guides
      • System Requirements
      • Acquire a Server
      • Validator Toolbox Setup
        • New Build
        • Existing Build
        • Additional Info
      • Manual Setup
      • Automated Setup (Deprecated)
    • Upgrade Guides
      • Node Upgrade (Toolbox)
      • Node Upgrade (Manual)
      • fn CLI Upgrade (Wallet)
    • Operational Guides
      • Emergency Recovery
      • Data Backup
      • CLI Staking
Powered by GitBook
On this page
  • Findora Graph
  • How to create and test your subgraph locally
  • Submit and deploy your subgraph

Was this helpful?

Edit on GitHub
  1. Developers
  2. EVM Tools & Tutorials

The Graph

The Graph is an indexing protocol for organizing blockchain data and making it easily accessible with GraphQL.

PreviousWaffleNextBand Protocol

Last updated 2 years ago

Was this helpful?

Findora Graph

Findora Network has hosted a Graph Node server to empower developers to build dApps on the Findora chain. Subgraphs can be deployed and updated using a pull request (see below for instructions).

Graph node is an opensource Rust implementation that indexes the blockchain to deterministically update a datastore that can be queried via the GraphQL endpoint.

Check out the Graph Node for detailed instructions and more context.

How to create and test your subgraph locally

This example will walk you through the steps to create a new subgraph and test it on a local node on your machine.

Generate a subgraph

1- Clone .

2- Generate base types from your schema.graphql settings.

# graph codegen FindoraNetwork/example-subgraph/subgraph.yaml
$ yarn gen FindoraNetwork/example-subgraph/subgraph.yaml
# ...
# ...
# ✔ Generate types for GraphQL schema
#
# Types generated successfully

3- Edit event mappings, such as src/handleFRC721Transfer.ts in the example directory.

4- After editing, compile them to web assembly files:

# graph build FindoraNetwork/example-subgraph/subgraph.yaml
$ yarn build FindoraNetwork/example-subgraph/subgraph.yaml
# ...
# ✔ Write compiled subgraph to build/
#
# Build completed: .../FindoraNetwork/findora-graph/build/subgraph.yaml

Run a local graph node to deploy and test your subgraph:

2- Start graph-node:

# In the project root:
$ docker-compose up
# Starting findora-graph_ipfs_1       ... done
# Recreating findora-graph_postgres_1 ... done
# Recreating findora-graph_graph-node_1 ... done
# ...

3- Create a new subgraph edge:

# graph create --node http://127.0.0.1:8020 findora/example
$ yarn create:local findora/example

4- Deploy your subgraph:

# graph deploy                                    \
#    --product hosted-service                     \
#    --node http://127.0.0.1:8020                 \
#    --ipfs http://127.0.0.1:5001                 \
#    findora/example                              \
#    FindoraNetwork/example-subgraph/subgraph.yaml
$ yarn deploy:local findora/example FindoraNetwork/example-subgraph/subgraph.yaml
# ? Version Label (e.g. v0.0.1) ›
# ...

Submit and deploy your subgraph

When you've tested your subgraph locally, you can now submit it to be deployed on the Findora mainnet node. This is done by submitting a pull request.

Deploy a new subgraph

2- Copy the FindoraNetwork/ directory and rename the root directory to be the same as your github handle.

$ cp -r FindoraNetwork <github-handle> && cd $_

## Edit `authors.json`
#
#  Those PRs edit the directory contents but not in the author's list (authors.json) wouldn't be accepted!

$ mv example-subgraph <subgraph-name> && cd $_

## Edit subgraph settings in `subgraph.yaml`
#
#  * dataSources.name must rename to your directory name to avoid naming collision

## Edit your graph relations in `schema.graphql` and mapping scripts.

3- Create a pull request and follow the template instructions before submitting your PR.

4- Your subgraph will be deployed upon review and made available at https://graph.findora.org/subgraphs/name/<github-handle>/<your-subgraph>/graphql

Update subgraphs

To update an existing subgraph, you may simply create another PR with you modifications.

PRs may only modify one directory at a time.

1- Install on your machine.

5- Browse to explore.

1- Fork

e.g.

here
Getting Started Guide
this repo
Docker
http://127.0.0.1:8000/subgraphs/name/findora/example/graphql
this repo.
https://graph.findora.org/subgraphs/name/FindoraNetwork/example-subgraph/graphql