This deep dive into the subgraph infrastructure used by PulseChain is designed to provide Pulsechain users with a clear understanding of data indexing, which is crucial for the functionality and scalability of decentralized applications (dApps) on Pulsechain. This article will cover the core principles of PoS, the role of subgraphs in the PulseChain ecosystem, and how they support efficient, scalable, and user-friendly dApps.
Proof of Stake (PoS) is a consensus mechanism used by certain blockchains to validate transactions and create new blocks. Unlike its predecessor, Proof of Work (PoW), which requires computational work to mine blocks, PoS selects validators based on the number of tokens they hold and are willing to “stake” as collateral. This method is seen as more energy-efficient and scalable, with validators being rewarded with transaction fees or new tokens for their service to the network.
Key attributes of PoS include:
Subgraphs are essentially open APIs that allow developers to query specific data from the Ethereum blockchain (and other compatible blockchains) efficiently. They are created using The Graph Protocol, which indexes blockchain data into easily accessible formats. This makes subgraphs invaluable for dApps that require real-time data from the blockchain but don’t have the resources to index and manage this data themselves.
Key features of subgraphs include:
In the context of Pulsechain, subgraphs play a crucial role in enhancing the overall ecosystem. Here’s how:
Subgraphs are primarily deployed and run by a variety of participants in the Web3 ecosystem, each playing a critical role in the development, maintenance, and usage of these tools. The operation of subgraphs involves several key types of participants:
The primary creators and users of subgraphs are developers and project teams who are building decentralized applications (dApps) on blockchain platforms. These developers design subgraphs to index and query the data their applications need from PulseChain in an efficient and scalable way. They define the schema for the data they want to index, the events that trigger data indexing, and write the mappings that process and format this data for their dApps.
Once a subgraph is defined, it needs to be hosted on a node that runs the Graph Node software (in the context of The Graph protocol, which is a prominent platform for running subgraphs). These nodes, operated by indexers, are responsible for ingesting blockchain data, processing it according to the subgraph definitions, and serving queries against the indexed data. Indexers are typically incentivized through query fees or network tokens, making it a potentially profitable endeavor for those with the necessary resources and expertise to operate nodes at scale.
For subgraphs that utilize The Graph protocol, there are several roles within the ecosystem:
While not running the subgraphs themselves, data consumers are an essential part of the ecosystem. These can be dApp users, other dApps, or analytics platforms that query subgraphs for blockchain data. Their usage patterns and demands can influence which subgraphs are developed and prioritized for indexing.
In many cases, especially within open-source projects and community-driven initiatives, volunteers or community members contribute to the development and maintenance of subgraphs. These contributions range from adding new features, fixing bugs, updating subgraph schemas in response to smart contract updates, or even running nodes to support the network.
Some companies and organizations specialize in providing subgraph development and hosting services for projects that prefer not to manage their infrastructure. These service providers can help with everything from subgraph creation and optimization to running high-availability nodes that ensure reliable data access for dApps.
Coast does not run a custom Subgraph for Pulsechain. Our fiat onramp to Pulsechain does not currently require this level of indexing as the vast majority of our data is not stored on-chain.
The lack of subgraphs in PulseChain has the potential to create significant challenges affecting both developers and users. Subgraphs, in the context of blockchain, are particularly associated with The Graph protocol, which indexes blockchain data to make it easily accessible and queryable via GraphQL. This indexing and querying capability is crucial for decentralized applications (dApps) to efficiently retrieve the data they need from the blockchain. Here are some of the implications of not having subgraphs:
Subgraph providers, particularly in the context of The Graph protocol, are compensated through a combination of fees and network incentives designed to ensure the decentralized and efficient functioning of the network. Here’s how the compensation mechanisms typically work:
Subgraph providers, known as Indexers in The Graph ecosystem, earn query fees for serving data queries to users. When a decentralized application (dApp) or an end-user queries a subgraph for data, the Indexer that processes and responds to the query can charge a fee. These fees are usually paid in the native cryptocurrency of the network or in the specific tokens of the protocol (e.g., GRT in The Graph). The cost per query can vary based on the complexity of the query, the demand for the data, and the agreement terms set by the Indexer.
In addition to query fees, Indexers may also earn indexing rewards. These rewards are distributed by the network to incentivize the indexing of data on the blockchain. In The Graph, these rewards come from the network’s inflationary token mechanism, where new tokens are minted and distributed to participants who contribute to the network’s security and efficiency. The amount of indexing rewards an Indexer receives can depend on factors such as the amount of stake they have in the network (their own tokens plus any delegated to them) and their performance in terms of accurately and efficiently serving data.
Delegators are token holders who do not run their own Indexer nodes but wish to participate in the network by delegating their tokens to an Indexer. Delegators earn a portion of the query fees and indexing rewards earned by the Indexer they delegate to. This mechanism incentivizes the delegation of tokens to Indexers who contribute positively to the network, thus securing and scaling the network’s data indexing and query processing capabilities.
Curators play a role in signaling which subgraphs are of high quality and should be prioritized for indexing. Curators stake tokens on subgraphs they believe are valuable, and this “signal” helps direct Indexers to prioritize certain subgraphs. While Curators primarily influence the network rather than provide indexing services directly, they can earn a portion of query fees generated from the subgraphs they signal on, based on the protocols of specific networks like The Graph.
The compensation for running subgraphs is designed to create a self-sustaining economic model where the interests of all participants are aligned towards the growth and health of the network. Indexers are incentivized to provide high-quality, efficient data access; Delegators support the best Indexers; and Curators help ensure that the most useful and high-quality subgraphs are indexed and available.
These mechanisms encourage the ongoing development, maintenance, and operation of subgraphs, ensuring that the PulseChain remains robust, decentralized, and capable of serving the needs of a growing number of dApps and users in the Web3 space.
If you have any subgraph issues on PulseChain, you’re welcome to reach out to our support team.