{"id":13651141,"url":"https://github.com/bitauth/chaingraph","last_synced_at":"2025-07-20T05:32:46.370Z","repository":{"id":41132784,"uuid":"411924807","full_name":"bitauth/chaingraph","owner":"bitauth","description":"A multi-node blockchain indexer and GraphQL API","archived":false,"fork":false,"pushed_at":"2024-11-14T02:45:02.000Z","size":1899,"stargazers_count":54,"open_issues_count":60,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-14T22:45:09.425Z","etag":null,"topics":["bitcoin","bitcoin-cash","blockchain","cryptocurrency","graphql","helm-chart","indexer","kubernetes"],"latest_commit_sha":null,"homepage":"https://chaingraph.cash/","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/bitauth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","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}},"created_at":"2021-09-30T04:42:10.000Z","updated_at":"2025-03-05T16:39:43.000Z","dependencies_parsed_at":"2023-12-13T16:47:27.051Z","dependency_job_id":null,"html_url":"https://github.com/bitauth/chaingraph","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/bitauth/chaingraph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitauth%2Fchaingraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitauth%2Fchaingraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitauth%2Fchaingraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitauth%2Fchaingraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitauth","download_url":"https://codeload.github.com/bitauth/chaingraph/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitauth%2Fchaingraph/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266071519,"owners_count":23871940,"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":["bitcoin","bitcoin-cash","blockchain","cryptocurrency","graphql","helm-chart","indexer","kubernetes"],"created_at":"2024-08-02T02:00:45.652Z","updated_at":"2025-07-20T05:32:46.342Z","avatar_url":"https://github.com/bitauth.png","language":"TypeScript","readme":"[![CI](https://img.shields.io/github/actions/workflow/status/bitauth/chaingraph/ci.yaml?branch=master)](https://github.com/bitauth/chaingraph/actions/workflows/ci.yaml)\n[![Codecov](https://img.shields.io/codecov/c/gh/bitauth/chaingraph?token=apQgrFecL5)](https://app.codecov.io/gh/bitauth/chaingraph/)\n[![Follow Chaingraph on Twitter](https://img.shields.io/badge/follow-chaingraph-1DA1F2?logo=twitter)](https://twitter.com/ChaingraphCash)\n[![Join Chat on Telegram](https://img.shields.io/badge/chat-Chaingraph%20Devs-0088CC?logo=telegram)](https://t.me/chaingraph_dev)\n[![Docker Pulls](https://img.shields.io/docker/pulls/chaingraph/agent?label=downloads\u0026logo=docker)](https://hub.docker.com/u/chaingraph)\n[![GitHub stars](https://img.shields.io/github/stars/bitauth/chaingraph.svg?style=social\u0026logo=github\u0026label=Stars)](https://github.com/bitauth/chaingraph)\n\n# Chaingraph\n\nA multi-node blockchain indexer and GraphQL API.\n\nFor more information, and for examples of live subscriptions and complex queries, see [**chaingraph.cash**](https://chaingraph.cash/).\n\n\u003ca href=\"https://youtu.be/kYVVfiH6CVc\"\u003e\u003cimg width=\"400\" alt=\"chaingraph-demo-video\" src=\"https://user-images.githubusercontent.com/904007/141193737-9c24f98c-8330-4ea4-afe4-7498ee0730b9.png\"\u003e\u003c/a\u003e\n\n## Quick Start\n\nChaingraph runs on [Kubernetes](https://kubernetes.io/), making it easy to deploy for production usage across many cloud providers or on self-managed hardware.\n\n**This guide describes a simple testnet deployment to a production Kubernetes cluster.**\n\nTo deploy Chaingraph locally, see the instructions in the [Contributing Guide](.github/CONTRIBUTING.md). For details about other configurations, see the [chart documentation](./charts/chaingraph/readme.md).\n\n### Create a Cluster\n\nAs of 2023, DigitalOcean is the most cost-effective cloud provider for Chaingraph deployments (differentiated primarily by pricing of egress bandwidth and persistent volume SSD storage).\n\nTo set up a new cluster, **consider using [Chaingraph's referral code for a $200\ncredit](https://m.do.co/c/cb25573fbfe7)** (supports `demo.chaingraph.cash`); this should cover a basic, production-ready BCH mainnet deployment for ~60 days (approximately $85/month for SSD storage, one $12/month droplet, and $12/month for the load balancer and egress bandwidth).\n\nWhichever cloud provider you choose, for the below testnet deployment, provision at least 1 Kubernetes node of the least expensive type.\n\nTypically, providers offer setup commands which add cluster authentication information to your local `kubectl` settings. Once your cluster is created, follow the provider's instructions for connecting to the cluster from your machine.\n\n### Add the Chart Repo\n\nTo deploy Chaingraph to your cluster, first install [Helm](https://helm.sh), then add the `bitauth` repo:\n\n```sh\nhelm repo add bitauth https://charts.bitauth.com/\n```\n\nIf you have previously added the `bitauth` repo, run `helm repo update` to fetch the latest charts.\n\n### Deploy a Release\n\nUsing the default configuration, Chaingraph will be installed with one `chipnet` and one `testnet4` [BCHN](https://gitlab.com/bitcoin-cash-node/bitcoin-cash-node) full node, an internally-managed Postgres instance, and no load balancer.\n\nThis is an ideal configuration for experimenting with Chaingraph, as it can be deployed on very low-powered clusters (often even within the free tier provided by many cloud Kubernetes providers). See the [chart readme](./charts/chaingraph/readme.md) for information about other options.\n\n```\nhelm install my-chaingraph bitauth/chaingraph\n```\n\nReview the notes which are logged after installation for more information about your deployment. You'll find an `API` section with instructions for exposing Chaingraph's GraphQL API.\n\nOnce the API is public, you're ready to start using Chaingraph. We recommend [graphqurl](https://github.com/hasura/graphqurl#graphiql) for exploring the API. Use `-i` to open the interactive GraphiQL UI:\n\n```\nnpm install -g graphqurl\ngq -i http://YOUR_IP:PORT/v1/graphql\n```\n\nChaingraph's API is available during the initial sync. Try monitoring it with a subscription:\n\n```gql\nsubscription MonitorSyncTips {\n  node {\n    name\n    user_agent\n    latest_tip: accepted_blocks(\n      limit: 1\n      order_by: { block_internal_id: desc }\n    ) {\n      block {\n        hash\n        height\n        transaction_count\n        size_bytes\n      }\n    }\n  }\n}\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003eMore details\u003c/summary\u003e\n\n\u003e This subscription returns the list of nodes connected to Chaingraph, their version information, and the hash, height, size, and transaction count of the most recently saved block accepted by that node.\n\u003e\n\u003e Note, Chaingraph saves blocks asynchronously, and large blocks can take longer to save to the database. During initial sync, this may cause the subscription to occasionally update its result with lower-height (more recently saved) blocks. Regardless, this subscription will roughly track sync progress for each connected node.\n\u003e\n\u003e This query could also be ordered by block height, but because non-primary indexes are created after initial sync (to reduce time required), ordering by block height can be slow until after the initial sync is complete.\n\n\u003c/details\u003e\n\nMainnet Chaingraph deployments may take 10 hours or more to sync fully and build all indexes (depending primarily on the performance of configured nodes and the write speed of the database volume). Testnet deployments typically finish in a few minutes.\n\nTo continue exploring the Chaingraph API, check out the example queries on [**chaingraph.cash**](https://chaingraph.cash).\n\n### Upgrade Chaingraph\n\nThese instructions upgrade the `my-chaingraph` cluster created in the [Quick Start](#quick-start) to the latest version of Chaingraph:\n\n```sh\nhelm repo update # Pull the latest bitauth/chaingraph helm chart\nhelm get values my-chaingraph -o yaml \u003e my-values.yaml\nhelm upgrade my-chaingraph bitauth/chaingraph --reset-values --values my-values.yaml\n```\n\nAs a best practice, consider preserving the `my-values.yaml` file for future reference. You can also preserve the latest deployment status and notes at any time:\n\n```sh\nhelm status my-chaingraph \u003e status.txt\n```\n\n## Architecture\n\nChaingraph is a Kubernetes application which manages a stack of open source software including one or more Bitcoin Cash full nodes, a syncing agent, a Postgres SQL database, and a Hasura instance.\n\nLearn more about [Chaingraph's Architecture \u0026rarr;](./docs/architecture.md)\n\n\u003cimg src=\"./docs/architecture.svg\" /\u003e\n\n## Schema\n\n\u003cimg align=\"right\" height=\"300\" src=\"./docs/schema.png\"/\u003e\n\nWhile many indexers are designed to support only one node implementation, Chaingraph is designed from the ground up to support multiple nodes.\n\nRather than assuming a single-node source-of-truth view of the network, the Chaingraph database schema and GraphQL API differentiate which nodes have acknowledged any particular transaction or block, and a full timeline is maintained for transaction validation, block acceptance, observed double-spends, and block re-organizations.\n\nThis additional information makes it possible for businesses to handle unusual network behavior without manual intervention by employing [defensive consensus](https://blog.bitjson.com/defensive-consensus-getting-to-a-multi-implementation-bitcoin-network/) strategies.\n\nLearn more about [Chaingraph's API Schema \u0026rarr;](./docs/schema.md)\n\n## New Developers\n\nNew developers to Chaingraph, Bitcoin Cash or blockchain development generally may benefit from some initial introductory information. See [Helpful Tips](./docs/helpful-tips.md).\n\n## Contributing\n\nTo set up a local cluster for development, please see the [Contributing Guide](./.github/CONTRIBUTING.md).\n","funding_links":[],"categories":["Blockchain dump","TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitauth%2Fchaingraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitauth%2Fchaingraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitauth%2Fchaingraph/lists"}