{"id":22789954,"url":"https://github.com/smartdev1990/graphnode","last_synced_at":"2025-08-01T08:10:26.662Z","repository":{"id":238197319,"uuid":"796072451","full_name":"SmartDev1990/GraphNode","owner":"SmartDev1990","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-10T02:08:08.000Z","size":10204,"stargazers_count":0,"open_issues_count":11,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T20:38:56.952Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SmartDev1990.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2024-05-04T21:15:33.000Z","updated_at":"2024-05-05T08:50:25.000Z","dependencies_parsed_at":"2025-02-05T18:17:17.482Z","dependency_job_id":"3bffa221-ab3b-4dbd-9a0d-41b8b0e6edd6","html_url":"https://github.com/SmartDev1990/GraphNode","commit_stats":null,"previous_names":["smartdev1990/graphnode"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartDev1990%2FGraphNode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartDev1990%2FGraphNode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartDev1990%2FGraphNode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartDev1990%2FGraphNode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SmartDev1990","download_url":"https://codeload.github.com/SmartDev1990/GraphNode/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246350674,"owners_count":20763223,"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":"2024-12-12T02:16:46.974Z","updated_at":"2025-03-30T16:41:02.433Z","avatar_url":"https://github.com/SmartDev1990.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Graph Node\n\n[![Build Status](https://github.com/graphprotocol/graph-node/actions/workflows/ci.yml/badge.svg)](https://github.com/graphprotocol/graph-node/actions/workflows/ci.yml?query=branch%3Amaster)\n[![Getting Started Docs](https://img.shields.io/badge/docs-getting--started-brightgreen.svg)](docs/getting-started.md)\n\n[The Graph](https://thegraph.com/) is a protocol for building decentralized applications (dApps) quickly on Ethereum and IPFS using GraphQL.\n\nGraph Node is an open source Rust implementation that event sources the Ethereum blockchain to deterministically update a data store that can be queried via the GraphQL endpoint.\n\nFor detailed instructions and more context, check out the [Getting Started Guide](docs/getting-started.md).\n\n## Quick Start\n\n### Prerequisites\n\nTo build and run this project you need to have the following installed on your system:\n\n- Rust (latest stable) – [How to install Rust](https://www.rust-lang.org/en-US/install.html)\n  - Note that `rustfmt`, which is part of the default Rust installation, is a build-time requirement.\n- PostgreSQL – [PostgreSQL Downloads](https://www.postgresql.org/download/)\n- IPFS – [Installing IPFS](https://docs.ipfs.io/install/)\n- Profobuf Compiler - [Installing Protobuf](https://grpc.io/docs/protoc-installation/)\n\nFor Ethereum network data, you can either run your own Ethereum node or use an Ethereum node provider of your choice.\n\n**Minimum Hardware Requirements:**\n\n- To build graph-node with `cargo`, 8GB RAM are required.\n\n### Running a Local Graph Node\n\nThis is a quick example to show a working Graph Node. It is a [subgraph for Gravatars](https://github.com/graphprotocol/example-subgraph).\n\n1. Install IPFS and run `ipfs init` followed by `ipfs daemon`.\n2. Install PostgreSQL and run `initdb -D .postgres` followed by `pg_ctl -D .postgres -l logfile start` and `createdb graph-node`.\n3. If using Ubuntu, you may need to install additional packages:\n   - `sudo apt-get install -y clang libpq-dev libssl-dev pkg-config`\n4. In the terminal, clone https://github.com/graphprotocol/example-subgraph, and install dependencies and generate types for contract ABIs:\n\n```\nyarn\nyarn codegen\n```\n\n5. In the terminal, clone https://github.com/graphprotocol/graph-node, and run `cargo build`.\n\nOnce you have all the dependencies set up, you can run the following:\n\n```\ncargo run -p graph-node --release -- \\\n  --postgres-url postgresql://USERNAME[:PASSWORD]@localhost:5432/graph-node \\\n  --ethereum-rpc NETWORK_NAME:[CAPABILITIES]:URL \\\n  --ipfs 127.0.0.1:5001\n```\n\nTry your OS username as `USERNAME` and `PASSWORD`. For details on setting\nthe connection string, check the [Postgres\ndocumentation](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING).\n`graph-node` uses a few Postgres extensions. If the Postgres user with which\nyou run `graph-node` is a superuser, `graph-node` will enable these\nextensions when it initializes the database. If the Postgres user is not a\nsuperuser, you will need to create the extensions manually since only\nsuperusers are allowed to do that. To create them you need to connect as a\nsuperuser, which in many installations is the `postgres` user:\n\n```bash\n    psql -q -X -U \u003cSUPERUSER\u003e graph-node \u003c\u003cEOF\ncreate extension pg_trgm;\ncreate extension pg_stat_statements;\ncreate extension btree_gist;\ncreate extension postgres_fdw;\ngrant usage on foreign data wrapper postgres_fdw to \u003cUSERNAME\u003e;\nEOF\n\n```\n\nThis will also spin up a GraphiQL interface at `http://127.0.0.1:8000/`.\n\n6.  With this Gravatar example, to get the subgraph working locally run:\n\n```\nyarn create-local\n```\n\nThen you can deploy the subgraph:\n\n```\nyarn deploy-local\n```\n\nThis will build and deploy the subgraph to the Graph Node. It should start indexing the subgraph immediately.\n\n### Command-Line Interface\n\n```\nUSAGE:\n    graph-node [FLAGS] [OPTIONS] --ethereum-ipc \u003cNETWORK_NAME:FILE\u003e --ethereum-rpc \u003cNETWORK_NAME:URL\u003e --ethereum-ws \u003cNETWORK_NAME:URL\u003e --ipfs \u003cHOST:PORT\u003e --postgres-url \u003cURL\u003e\n\nFLAGS:\n        --debug      Enable debug logging\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nOPTIONS:\n        --admin-port \u003cPORT\u003e                           Port for the JSON-RPC admin server [default: 8020]\n        --elasticsearch-password \u003cPASSWORD\u003e\n            Password to use for Elasticsearch logging [env: ELASTICSEARCH_PASSWORD]\n\n        --elasticsearch-url \u003cURL\u003e\n            Elasticsearch service to write subgraph logs to [env: ELASTICSEARCH_URL=]\n\n        --elasticsearch-user \u003cUSER\u003e                   User to use for Elasticsearch logging [env: ELASTICSEARCH_USER=]\n        --ethereum-ipc \u003cNETWORK_NAME:[CAPABILITIES]:FILE\u003e\n            Ethereum network name (e.g. 'mainnet'), optional comma-seperated capabilities (eg full,archive), and an Ethereum IPC pipe, separated by a ':'\n\n        --ethereum-polling-interval \u003cMILLISECONDS\u003e\n            How often to poll the Ethereum node for new blocks [env: ETHEREUM_POLLING_INTERVAL=]  [default: 500]\n\n        --ethereum-rpc \u003cNETWORK_NAME:[CAPABILITIES]:URL\u003e\n            Ethereum network name (e.g. 'mainnet'), optional comma-seperated capabilities (eg 'full,archive'), and an Ethereum RPC URL, separated by a ':'\n\n        --ethereum-ws \u003cNETWORK_NAME:[CAPABILITIES]:URL\u003e\n            Ethereum network name (e.g. 'mainnet'), optional comma-seperated capabilities (eg `full,archive), and an Ethereum WebSocket URL, separated by a ':'\n\n        --node-id \u003cNODE_ID\u003e\n            A unique identifier for this node instance. Should have the same value between consecutive node restarts [default: default]\n\n        --http-port \u003cPORT\u003e                            Port for the GraphQL HTTP server [default: 8000]\n        --ipfs \u003cHOST:PORT\u003e                            HTTP address of an IPFS node\n        --postgres-url \u003cURL\u003e                          Location of the Postgres database used for storing entities\n        --subgraph \u003c[NAME:]IPFS_HASH\u003e                 Name and IPFS hash of the subgraph manifest\n        --ws-port \u003cPORT\u003e                              Port for the GraphQL WebSocket server [default: 8001]\n```\n\n### Advanced Configuration\n\nThe command line arguments generally are all that is needed to run a\n`graph-node` instance. For advanced uses, various aspects of `graph-node`\ncan further be configured through [environment\nvariables](https://github.com/graphprotocol/graph-node/blob/master/docs/environment-variables.md). Very\nlarge `graph-node` instances can also split the work of querying and\nindexing across [multiple databases](./docs/config.md).\n\n## Project Layout\n\n- `node` — A local Graph Node.\n- `graph` — A library providing traits for system components and types for\n  common data.\n- `core` — A library providing implementations for core components, used by all\n  nodes.\n- `chain/ethereum` — A library with components for obtaining data from\n  Ethereum.\n- `graphql` — A GraphQL implementation with API schema generation,\n  introspection, and more.\n- `mock` — A library providing mock implementations for all system components.\n- `runtime/wasm` — A library for running WASM data-extraction scripts.\n- `server/http` — A library providing a GraphQL server over HTTP.\n- `store/postgres` — A Postgres store with a GraphQL-friendly interface\n  and audit logs.\n\n## Roadmap\n\n🔨 = In Progress\n\n🛠 = Feature complete. Additional testing required.\n\n✅ = Feature complete\n\n\n| Feature |  Status |\n| ------- |  :------: |\n| **Ethereum** |    |\n| Indexing smart contract events | ✅ |\n| Handle chain reorganizations | ✅ |\n| **Mappings** |    |\n| WASM-based mappings| ✅ |\n| TypeScript-to-WASM toolchain | ✅ |\n| Autogenerated TypeScript types | ✅ |\n| **GraphQL** |     |\n| Query entities by ID | ✅ |\n| Query entity collections | ✅ |\n| Pagination | ✅ |\n| Filtering | ✅ |\n| Block-based Filtering | ✅ |\n| Entity relationships | ✅ |\n| Subscriptions | ✅ |\n\n\n## Contributing\n\nPlease check [CONTRIBUTING.md](CONTRIBUTING.md) for development flow and conventions we use.\nHere's [a list of good first issues](https://github.com/graphprotocol/graph-node/labels/good%20first%20issue).\n\n## License\n\nCopyright \u0026copy; 2018-2019 Graph Protocol, Inc. and contributors.\n\nThe Graph is dual-licensed under the [MIT license](LICENSE-MIT) and the [Apache License, Version 2.0](LICENSE-APACHE).\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expressed or implied. See the License for the specific language governing permissions and limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartdev1990%2Fgraphnode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartdev1990%2Fgraphnode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartdev1990%2Fgraphnode/lists"}