https://ghostgraph.xyz
GhostGraph | The new Smart Contract Indexing Stack
Introducing the blazingly fast way to spin up an indexer for your smart contracts. All in Solidity.
GhostGraph | The new Smart Contract Indexing StackProductsFeaturesChainsPricingDevelopersSign inSign upThe new Smart Contract Indexing StackWith GhostGraph, you can write your indexers in the same language as your contracts: Solidity. This means less context switching and faster time to market.Sign upLearn MoreTrusted byIntroducing the blazingly fast way to spin up an indexer for your smart contracts. All in Solidity 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 struct Pair { address id; address token0; address token1; uint256 reserve0; uint256 reserve1; @many(Swap.pairId) swaps; uint32 createdAt; } struct Swap { string id; @belongsTo(Pair.id) pairId; uint256 amount0In; uint256 amount1In; uint256 amount0Out; uint256 amount1Out; }Define your SchemaCreate your schema by defining entities. In GhostGraph, you write your entities using Solidity structs1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 contract MyIndex is GhostGraph { using StringHelpers for EventDetails; function registerHandles() external { graph.registerFactory(0xb4A7D971D0ADea1c73198C97d7ab3f9CE4aaFA13, GhostEventName.PairCreated, "pair"); graph.registerHandle(0xb4A7D971D0ADea1c73198C97d7ab3f9CE4aaFA13); } function onSwap(EventDetails memory details, SwapEvent memory ev) external { Swap memory swap = graph.getSwap(details.uniqueId()); swap.amount0In = ev.amount0In; swap.amount0Out = ev.amount0Out; swap.amount1In = ev.amount1In; swap.amount1Out = ev.amount1Out; swap.pairId = details.emitter; graph.saveSwap(swap); } function onSync(EventDetails memory details, SyncEvent memory ev) external { Pair memory pair = graph.getPair(ev.pair); pair.reserve0 = ev.reserve0; pair.reserve1 = ev.reserve1; graph.savePair(pair); } function onPairCreated(EventDetails memory details, PairCreatedEvent memory ev) external { Pair memory pair = graph.getPair(ev.pair); pair.token0 = ev.token0; pair.token1 = ev.token1; pair.createdAt = details.timestamp; graph.savePair(pair); } }Write your handlersAfter you've defined your schema and events, GhostGraph will generate a base indexer.sol file for you. Here you can register contracts (and factory addresses) and fill in the callback functions with your indexer logic. All in Solidity1 2 3 4 5 6 7 8 9 10 11 12 13 query GetAllSwaps { swaps { items { id txHash pairId amount0In amount0Out amount1In amount1Out } } }Query via GraphQLDeploy your graph to the hosted GhostGraph service. Once the indexing engine has synced to the tip of the chain, you can query your index using GraphQL. There's also a playground for you to test your queriesSupported ChainsTestimonialsThis advanced tool can make your life a lot easier by handling the event based data which your dapp needs from the chain. You can move all the onchain data fetching logic from your dapp into their graph and access it very easily. Highly recommending to check it out.ArcanumCo-FounderIndexing is always a pain point for web3 projects, but GhostGraph makes the job a lot easier. Easy-to-customize data fetching logic, along with great performance from their backend, makes this a tool worth trying out for your next projectRizzoCTOOne of the standout features of GhostGraph is the ability to share, fork, and modify other GhostGraphs. This functionality fosters a collaborative environment and greatly enhances the developer experience. By leveraging shared graphs, I can quickly gain insights from others' work, adapt their solutions to my specific needs, and significantly reduce the time it takes to go from a question to an actionable insight. This means I can spend more time focusing on analysis and less on building and maintaining data pipelines. Overall, GhostGraph’s robust set of features and collaborative capabilities make it an indispensable tool in my workflow, enabling me to tackle complex data challenges with greater efficiency and effectiveness.Pat DoyleHead of Blockchain ResearchFrequently asked questionsHow do I contact customer support if I have a question or issue?You can reach out to us in our community TelegramWhat are some use cases of GhostGraph?Check out our documentation for use cases and examplesWrite your first GhostGraph in Solidity TodaySign upBrandingBranding KitProductGhostGraphGhostLogsPricingLegalTermsPrivacyContactPrivacy Policy • Terms of ServiceCopyright © Ghost. All rights reserved.
en
en
1727747523
https://ghostgraph.xyz
แก้ไขไซต์ของคุณ?
คุณกำลังทำอะไร?