{"id":28471233,"url":"https://github.com/requestnetwork/storage-subgraph","last_synced_at":"2025-07-01T21:32:20.469Z","repository":{"id":95887609,"uuid":"440428162","full_name":"RequestNetwork/storage-subgraph","owner":"RequestNetwork","description":"A Subgraph to index Request transactions.","archived":false,"fork":false,"pushed_at":"2024-11-14T10:33:52.000Z","size":131,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-07T10:48:44.421Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RequestNetwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-21T07:27:47.000Z","updated_at":"2025-02-08T02:39:24.000Z","dependencies_parsed_at":"2024-05-16T13:29:41.074Z","dependency_job_id":"a0ee46fe-b9c1-4630-8dda-3a22f397e236","html_url":"https://github.com/RequestNetwork/storage-subgraph","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RequestNetwork/storage-subgraph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RequestNetwork%2Fstorage-subgraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RequestNetwork%2Fstorage-subgraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RequestNetwork%2Fstorage-subgraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RequestNetwork%2Fstorage-subgraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RequestNetwork","download_url":"https://codeload.github.com/RequestNetwork/storage-subgraph/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RequestNetwork%2Fstorage-subgraph/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263039359,"owners_count":23404163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-07T10:39:55.091Z","updated_at":"2025-07-01T21:32:20.439Z","avatar_url":"https://github.com/RequestNetwork.png","language":"TypeScript","readme":"# Request Network Storage Subgraph\n\nA Subgraph to index Request transactions.\n\n## Getting started\n\n- Do the usual\n\n```\ngit clone ...\ncd ...\nyarn\n```\n\n- Prepare your environment\n\n```\ncp .env.example .env\n```\n\n- Start a Graph Node and an IPFS node (connected to Request dedicated IPFS network)\n\n```\ndocker-compose up -d\n```\n\n- Create the subgraph. Do this only once (or each time you clear the Graph node)\n\n```\nyarn create-local\n```\n\n- Generate types for the subgraph. Do this again if you modify the [indexer's code](./src/mapping.ts) or the [graphql schema](./schema.graphql)\n\n```\nyarn codegen ./subgraph-private.yaml\n```\n\n- Test the subgraph with [matchstick-as](https://thegraph.com/docs/en/developing/unit-testing-framework/#calling-a-mapping-function-with-an-event)\n\n```\nyarn test\n# or, run in Docker\nyarn test:docker\n```\n\n- Build the subgraph. Do this again if you modify the [indexer's code](./src/mapping.ts) or the [graphql schema](./schema.graphql),\n  or if you want to deploy on another chain.\n\n```\nyarn build ./subgraph-private.yaml\n```\n\n- Deploy and start indexing. Do this again if you modify the [indexer's code](./src/mapping.ts) or the [graphql schema](./schema.graphql)\n\n```\nyarn deploy-local ./subgraph-private.yaml\n```\n\n- Monitor the deployment of your new subgraph\n\n```\nyarn monitor-deployment-local\n```\n\nYou can go to http://localhost:8000/ to see the GraphiQL ui.\n\n## Example queries\n\n- Get all transactions\n\n```graphql\nquery AllTransactions {\n  transactions {\n    id\n    hash\n    channelId\n    blockNumber\n    blockTimestamp\n    smartContractAddress\n    topics\n    data\n    encryptedData\n    encryptionMethod\n    publicKeys\n  }\n}\n```\n\n- Get transactions by channelId\n\n```graphql\nquery ByChannelId($channelId: String!) {\n  transactions(where: { channelId: $channelId }) {\n    id\n    hash\n    channelId\n    blockNumber\n    blockTimestamp\n    smartContractAddress\n    topics\n    data\n    encryptedData\n    encryptionMethod\n    publicKeys\n  }\n}\n```\n\n- Get transactions by topic\n\n```graphql\nquery ByChannelId($topics: [String!]) {\n  transactions(where: { topics_contains: $topics }) {\n    id\n    hash\n    channelId\n    blockNumber\n    blockTimestamp\n    smartContractAddress\n    topics\n    data\n    encryptedData\n    encryptionMethod\n    publicKeys\n  }\n}\n```\n\n## Run on another network\n\nTo test this on another network than your local Ganache:\n\n- change the .env values to your own\n- run `docker-compose down`\n- run `docker-compose up -d`\n- re-create \u0026 deploy the subgraph, with the right subgraph manifest (xdai, rinkeby...)\n\n## Troubleshooting\n\nThe admin API is available at http://localhost:8030/graphql\n\n```graphql\nfragment status on SubgraphIndexingStatus {\n  subgraph\n  synced\n  health\n  entityCount\n  chains {\n    network\n    earliestBlock {\n      number\n    }\n    chainHeadBlock {\n      number\n    }\n    latestBlock {\n      number\n    }\n    latestBlock {\n      number\n    }\n  }\n  fatalError {\n    message\n  }\n  nonFatalErrors {\n    message\n  }\n}\n\nquery {\n  indexingStatusForCurrentVersion(\n    subgraphName: \"RequestNetwork/request-storage\"\n  ) {\n    ...status\n  }\n\n  indexingStatusForPendingVersion(\n    subgraphName: \"RequestNetwork/request-storage\"\n  ) {\n    ...status\n  }\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frequestnetwork%2Fstorage-subgraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frequestnetwork%2Fstorage-subgraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frequestnetwork%2Fstorage-subgraph/lists"}