tryghost.xyz
Open in
urlscan Pro
2606:4700:3032::6815:153a
Public Scan
Submitted URL: http://tryghost.xyz/
Effective URL: https://tryghost.xyz/graph
Submission: On September 26 via api from US — Scanned from DE
Effective URL: https://tryghost.xyz/graph
Submission: On September 26 via api from US — Scanned from DE
Form analysis
0 forms found in the DOMText Content
Products Features Chains Pricing Developers Sign in Sign up The new Smart Contract Indexing Stack With 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 up Learn More -------------------------------------------------------------------------------- Trusted by -------------------------------------------------------------------------------- Introducing the blazingly fast way to spin up an indexer for your smart contracts. All in Solidity 1struct Pair { 2 address id; 3 address token0; 4 address token1; 5 uint256 reserve0; 6 uint256 reserve1; 7 @many(Swap.pairId) swaps; 8 uint32 createdAt; 9} 10 11struct Swap { 12 string id; 13 @belongsTo(Pair.id) pairId; 14 uint256 amount0In; 15 uint256 amount1In; 16 uint256 amount0Out; 17 uint256 amount1Out; 18} Define your Schema Create your schema by defining entities. In GhostGraph, you write your entities using Solidity structs 1contract MyIndex is GhostGraph { 2 using StringHelpers for EventDetails; 3 4 function registerHandles() external { 5 graph.registerFactory(0xb4A7D971D0ADea1c73198C97d7ab3f9CE4aaFA13, GhostEventName.PairCreated, "pair"); 6 graph.registerHandle(0xb4A7D971D0ADea1c73198C97d7ab3f9CE4aaFA13); 7 } 8 9 function onSwap(EventDetails memory details, SwapEvent memory ev) external { 10 Swap memory swap = graph.getSwap(details.uniqueId()); 11 swap.amount0In = ev.amount0In; 12 swap.amount0Out = ev.amount0Out; 13 swap.amount1In = ev.amount1In; 14 swap.amount1Out = ev.amount1Out; 15 swap.pairId = details.emitter; 16 graph.saveSwap(swap); 17 } 18 19 function onSync(EventDetails memory details, SyncEvent memory ev) external { 20 Pair memory pair = graph.getPair(ev.pair); 21 pair.reserve0 = ev.reserve0; 22 pair.reserve1 = ev.reserve1; 23 graph.savePair(pair); 24 } 25 26 function onPairCreated(EventDetails memory details, PairCreatedEvent memory ev) external { 27 Pair memory pair = graph.getPair(ev.pair); 28 pair.token0 = ev.token0; 29 pair.token1 = ev.token1; 30 pair.createdAt = details.timestamp; 31 graph.savePair(pair); 32 } 33} Write your handlers After 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 Solidity 1query GetAllSwaps { 2 swaps { 3 items { 4 id 5 txHash 6 pairId 7 amount0In 8 amount0Out 9 amount1In 10 amount1Out 11 } 12 } 13} Query via GraphQL Deploy 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 queries -------------------------------------------------------------------------------- Supported Chains -------------------------------------------------------------------------------- Testimonials This 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-Founder Indexing 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 project RizzoCTO One 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 Research -------------------------------------------------------------------------------- Frequently asked questions HOW DO I CONTACT CUSTOMER SUPPORT IF I HAVE A QUESTION OR ISSUE? You can reach out to us in our community Telegram WHAT ARE SOME USE CASES OF GHOSTGRAPH? Check out our documentation for use cases and examples -------------------------------------------------------------------------------- Featured Blog Articles Index and Query Blockchain Data with Ghost using DYLI on Abstract This guide is in collaboration with DYLI to showcase how they are using Ghost to index and query their smart contract data on Abstract Chain Connecting your GhostGraph to your Frontend In this tutorial, we'll leverage GhostGraph to build an indexer that automatically ingests and transforms contract events and then we'll hook it up to a frontend UI. -------------------------------------------------------------------------------- Write your first GhostGraph in Solidity Today Sign up -------------------------------------------------------------------------------- Branding Branding Kit Product GhostGraphGhostLogsPricing Legal TermsPrivacyContact Privacy Policy • Terms of Service Copyright © Ghost. All rights reserved.