Developers
EVM Tools

The Graph

1min

The Graph is a decentralized protocol for indexing and querying data from blockchains such as Ethereum or Caduceus. It makes it possible to query data that is difficult to query directly.

Projects with complex smart contracts like Uniswap and NFTs initiatives like Bored Ape Yacht Club store data on the Ethereum blockchain, making it really difficult to read anything other than basic data directly from the blockchain.

In the case of Bored Ape Yacht Club, we can perform basic read operations on the contract like getting the owner of a certain Ape, getting the content URI of an Ape based on their ID, or the total supply, as these read operations are programmed directly into the smart contract, but more advanced real-world queries and operations like aggregation, search, relationships, and non-trivial filtering are not possible. For example, if we wanted to query for apes that are owned by a certain address, and filter by one of its characteristics, we would not be able to get that information by interacting directly with the contract itself.

To get this data, you would have to process every single transfer event ever emitted, read the metadata from IPFS using the Token ID and IPFS hash, and then aggregate it. Even for these types of relatively simple questions, it would take hours or even days for a decentralized application (dapp) running in a browser to get an answer.

You could also build out your own server, process the transactions there, save them to a database, and build an API endpoint on top of it all in order to query the data. However, this option is resource intensive, needs maintenance, presents a single point of failure, and breaks important security properties required for decentralization.

Running the Graph for Caduceus

Currently the graph does not run caduceus nodes, hence to enable the graph for Caduceus you would have to run a Graph Node to index the Caduceus blockchain. This is something you can do but it requires considerable technical expertise and infrastructure.

You can see the Graph's supported networks here. Eventually Caduceus will be supported.



Updated 25 Mar 2024
Doc contributor
Did this page help you?