Filecoin Docs
BasicsStorage providersNodesNetworksSmart contractsReference
  • Welcome to Filecoin Docs
  • Basics
    • What is Filecoin
      • Crypto-economics
      • Blockchain
      • Storage model
      • Storage market
      • Retrieval market
      • Programming on Filecoin
      • Networks
    • The blockchain
      • Actors
      • Addresses
      • Blocks and tipsets
      • Consensus
      • Drand
      • Proofs
    • Assets
      • The FIL token
      • Wallets
      • Metamask setup
      • Get FIL
      • Transfer FIL
    • Interplanetary consensus
    • How storage works
      • Filecoin plus
      • Storage onramps
      • Filecoin and IPFS
    • How retrieval works
      • Basic retrieval
      • Serving retrievals
      • Saturn
    • Project and community
      • Forums and FIPs
      • Filecoin compared to
      • Filecoin FAQs
      • Related projects
      • Social media
      • The Filecoin project
      • Ways to contribute
  • Storage providers
    • Basics
      • Quickstart guide
    • Filecoin economics
      • Storage proving
      • FIL collateral
      • Block rewards
      • Slashing
      • Committed capacity
    • Filecoin deals
      • Storage deals
      • Verified deals
      • Filecoin programs and tools
      • Snap deals
      • Charging for data
      • Auxiliary services
      • Return-on-investment
    • Architecture
      • Software components
      • Storage provider automation
      • Sealing pipeline
      • Sealing rate
      • Sealing-as-a-service
      • Network indexer
    • Infrastructure
      • Storage
      • Network
      • Backup and disaster recovery
      • Reference architectures
    • Skills
      • Linux
      • Network
      • Security
      • Storage
      • Sales
      • Industry
    • PDP
      • Prerequisites
      • Install & Run Lotus
      • Install & Run YugabyteDB
      • Install & Run Curio
      • Enable PDP
      • Use PDP
  • Nodes
    • Implementations
      • Lotus
      • Venus
    • Full-nodes
      • Pre-requisites
      • Basic setup
      • Node providers
    • Lite-nodes
      • Spin up a lite-node
  • Smart contracts
    • Fundamentals
      • The Filecoin Virtual Machine
      • Filecoin EVM runtime
      • ERC-20 quickstart
      • Roadmap
      • Support
      • FAQs
    • Filecoin EVM-runtime
      • Actor types
      • Address types
      • FILForwarder
      • Difference with Ethereum
      • How gas works
      • Precompiles
    • Programmatic storage
      • Aggregated deal-making
      • Direct deal-making
      • Cross-Chain Data Bridge(CCDB)
      • Data replication, renewal and repair (RaaS)
      • RaaS interfaces
    • Developing contracts
      • Get test tokens
      • Remix
      • Hardhat
      • Foundry
      • Solidity libraries
      • Call built-in actors
      • Filecoin.sol
      • Direct deal-making with Client contract
      • Using RaaS
      • Verify a contract
      • Best practices
    • Advanced
      • Wrapped FIL
      • Oracles
      • Multicall
      • Multisig
      • FEVM Indexers
      • Cross-chain bridges
      • Aggregated deal-making
      • Contract automation
      • Relay
  • Networks
    • Mainnet
      • Explorers
      • RPCs
      • Network performance
    • Calibration
      • Explorers
      • RPCs
    • Local testnet
      • Get test tokens
    • Deprecated networks
  • Reference
    • General
      • Glossary
      • Specifications
      • Tools
    • Exchanges
      • Exchange integration
    • Built-in actors
      • Protocol API
      • Filecoin.sol
    • JSON-RPC
      • Auth
      • Chain
      • Client
      • Create
      • Eth
      • Gas
      • I
      • Log
      • Market
      • Miner
      • Mpool
      • Msig
      • Net
      • Node
      • Paych
      • Raft
      • Start
      • State
      • Sync
      • Wallet
      • Web3
  • Builder Cookbook
    • Overview
    • Table of Contents
    • Data Storage
      • Store Data
      • Retrieve Data
      • Privacy & Access Control
    • dApps
      • Chain-Data Query
      • Oracles
      • Cross-Chain Bridges
      • Decentralized Database
Powered by GitBook
LogoLogo

Basics

  • Overview
  • Crypto-economics
  • Storage model
  • Reference

Developers

  • The FVM
  • EVM-runtime
  • Quickstart
  • Transfer FIL

Contact

  • GitHub
  • Slack
  • Twitter
On this page
  • Goldsky
  • Prerequisites
  • Deploy a subgraph
  • Query the Subgraph
  • The Graph
  • Deploying Subgraphs
  • Querying Existing Subgraphs

Was this helpful?

Edit on GitHub
Export as PDF
  1. Smart contracts
  2. Advanced

FEVM Indexers

FEVM Indexers allow users and developers to query Filecoin chain data in an extremely quick manner. Learn what FEVM indexers are available on Filecoin and how to use them through existing data provide

PreviousMultisigNextCross-chain bridges

Last updated 12 days ago

Was this helpful?

Not to be confused with

Blockchain indexers are used for accessing blockchain data efficiently. They process and organize storage-optimized raw blockchain data into retrieve-optimized and well-queryable formats. This benefits developers and users looking to retrieve specific information because they don't need to:

  1. Run their own .

  2. Parse entire blockchain histories to crawl for events that might not exist for thousands of .

  3. Spend significant time required to retrieve data from the blockchain node.

  4. Determine complex interconnections between smart contracts.

  5. Spend substantial compute power to calculate advanced queries.

Additionally, blockchain indexers provide a better developer experience by leveraging well-known API standards and query languages like GraphQL.

Goldsky

offers high-performance subgraph hosting and real-time data indexing for blockchain data. These are GraphQL-based APIs built on top of smart contracts. With Goldsky, developers can access structured blockchain data quickly and efficiently without needing to run their own nodes or build custom indexing backends.

Goldsky officially supports the Filecoin, allowing developers to create subgraphs that index smart contract data from the Filecoin mainnet & testnet.

Ways to Deploy a Subgraph with Goldsky

1. Goldsky Web App (No-Code) A visual interface that guides you step-by-step to configure and deploy a subgraph. Ideal for quick prototyping or less technical users.

2. Goldsky CLI (Developer Tooling) A command-line interface for creating, editing, and deploying subgraphs programmatically.

  • From Subgraph source code

  • Migrating from The Graph or any other subgraph host

  • Via instant, no-code subgraphs

In this tutorial, we will use no-code Goldsky’s deploy wizard to create a subgraph for the wFIl ERC-20 token on the Filecoin testnet.

Prerequisites

Make sure you have the following tools and setup ready:

  • Node.js

  • Create a Goldsky account and generate a Goldsky API key

  • Goldsky CLI installed

    curl https://goldsky.com | sh
  • Authenticate Goldsky CLI with your API key

    goldsky login
  • wFIl Contract information

    • contract address: 0xaC26a4Ab9cF2A8c5DBaB6fb4351ec0F4b07356c4

Deploy a subgraph

Goldsky’s Deploy Wizard simplifies the creation of subgraphs using a CLI-guided flow.

Run:

goldsky subgraph init

Follow the prompts from the Goldsky subgraph configuration wizard:

  • Subgraph name: wfil-subgraph

  • Subgraph version: 1.0.0

  • Subgraph target path: Choose default or specify your own

  • Contract ABI source: path/to/wfil_abi.json

  • Contract Address: 0xaC26a4Ab9cF2A8c5DBaB6fb4351ec0F4b07356c4

  • Contract network: filecoin-testnet

  • Start block: Which block is the wfil created, can be 0.

  • Contract name: wfil

  • Enable subgraph call handlers?: no

Once you complete the above information following the prompt, the Goldsky wizard will guide you through building and deploying your subgraph. Once the subgraph is successfully deployed, Goldsky will output a deployment URL (GraphQL endpoint).

Query the Subgraph

You can use the provided GraphQL endpoint to query the subgraph.

For example:

{
  transfers(
    where: {from: "0xf49d33f54ce41354dcd7e698aa54256781a6dd30"}
    orderBy: timestamp_
    orderDirection: desc
    first: 10
  ) {
    id
    from
    to
    amount
    timestamp_
  }
}

Use the Goldsky Playground or integrate it into your app to consume indexed data.

The Graph

Glossary

  • Subgraphs: Customizable schemas that define how to index data from specific blockchain smart contracts and events.

  • GraphQL: A query language that allows clients to request exactly the data they need, making data fetching more efficient.

Querying Subgraphs on Filecoin FEVM

Developing Subgraphs on Filecoin FEVM

Deploying Subgraphs

Example: Deploying a Subgraph with Glif Nodes (Protofire)

  1. Connect Your Wallet

  2. Create an API Key

    • Choose the API keys tab.

    • Click Create new key.

    • Generate an API key to authenticate your requests.

  3. Activate Your Free Subscription

    • Go to the Subscription tab.

    • If you have created a key, you will see one The Graph subscription pending.

    • Click Pay and proceed with providing your credit card details to activate a free subscription.

Glif Nodes currently offers this service completely free of charge. If this ever changes, you will be notified at least one month in advance. It is recommended to provide your contact details on the Glif Nodes website to receive updates. Credit card details are used solely for DDoS protection. No charges will be made without prior notification.

  1. Create a Subgraph

    • Switch back to the Subgraphs tab.

    • Click on Create a New Subgraph to set up a new subgraph instance.

  2. Manage Your Subgraphs

    • Select MY in the subgraphs switcher.

    • Select the subgraph you just created to access deployment instructions and endpoints.

    • Should you have any additional inquiries, do not hesitate to contact the Glif Nodes team through the Contact us button in the website header.

Querying Existing Subgraphs

One of the popular subgraphs is a subgraph containing information about all the blocks on the network, essentially providing an alternative to the eth_getBlock... subset of commands. Let's see how we can query the eth_getBlockByNumber using the Linux command-line interface and the Protofire (Glif Nodes) platform.

  • Navigate to the SUBGRAPHS tab.

  • In the opened Playground tab, click the Show GraphQL Explorer button (folder icon, 3rd from the top in the left bar) to verify the subgraph schema.

  • Click the elements that you are looking to query and adjust the query if necessary. For the sake of this example, let's query the first block this subgraph supports (#2867000). The resulting query should look like the following:

      query MyQuery {
      blocks(block: {number: 2867000}) {
        number
        id
        timestamp
        gasLimit
        gasUsed
      }
    }
  • Click Execute query (alternatively Ctrl+Enter, the icon with white triangle in the red square) and adjust query if needed.

    {
      "data": {
        "blocks": [
          {
            "number": "2867000",
            "id": "0x2df02173a94343c971733e0c94b854dee9100fbd37c70d69956bf35bca7020da",
            "timestamp": "1684316400",
            "gasLimit": "70000000000",
            "gasUsed": "24086592799"
          }
        ]
      }
    }
  • Copy Queries (HTTP) URL on the top of the Playground as well as resulting query to your code. The subgraph querying is free so far, although it requires an API key.

: saved it as wfil_abi.json locally.

Indexing all the data for your smart contract will take time after the subgraph is deployed. You can also check the indexing status of your subgraph from the .

is a decentralized protocol for indexing blockchain data. It enables developers to build and publish custom open APIs, known as subgraphs, that applications can query to retrieve blockchain data using GraphQL in a time-efficient manner.

There are many ways to query existing subgraphs, including numerous well-known libraries for and . But even without any third-party tooling, querying a subgraph is no more complicated than querying . The only complexity is that you have to know the schema of the subgraph beforehand, similar to knowing SQL database tables and columns before being able to query them. Luckily, The Graph provides several ways to discover the subgraph schema. The most convenient one is called the , and it is available upon a GET request to the subgraph query URL. Alternatively, you may use the discovery method that exists on every subgraph, called the .

Developing a subgraph requires specialized knowledge that can be obtained through .

Just as with database data queried through SQL, subgraphs have to be stored somewhere. You may run a self-hosted instance as described in and deploy a subgraph there. However, as with RPC nodes and databases, running subgraphs locally in production is not recommended from an uptime standpoint. For hosting the subgraph, it is reasonable to use online web services such as AWS or refer to professional subgraph providers such as .

offers public access to The Graph services, simplifying the process of deploying and managing subgraphs.

On the , connect your .

Visit the .

Select the relevant subgraph from .

IPNI Indexer
archival node
tipsets
Goldsky
contract ABI
Goldsky dashboard
The Graph
JavaScript
Python
RPC nodes
"Playground"
Introspection Query
The Graph Academy
The Graph Academy examples
Protofire (aka Glif Nodes)
Protofire (aka Glif Nodes)
Protofire (Glif Nodes) platform - SUBGRAPHS
Filecoin-compatible wallet
Protofire (Glif Nodes) platform
Protofire