{"id":18857788,"url":"https://github.com/portalnetwork/graph-node","last_synced_at":"2026-02-07T11:30:17.220Z","repository":{"id":40289323,"uuid":"242896893","full_name":"PortalNetwork/graph-node","owner":"PortalNetwork","description":"Graph Node indexes data from blockchains such as Ethereum and serves it over GraphQL","archived":false,"fork":false,"pushed_at":"2023-01-24T01:28:18.000Z","size":8059,"stargazers_count":1,"open_issues_count":15,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-08T04:08:09.495Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/PortalNetwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2020-02-25T03:04:54.000Z","updated_at":"2021-06-11T20:54:28.000Z","dependencies_parsed_at":"2023-01-27T11:45:58.896Z","dependency_job_id":null,"html_url":"https://github.com/PortalNetwork/graph-node","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PortalNetwork%2Fgraph-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PortalNetwork%2Fgraph-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PortalNetwork%2Fgraph-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PortalNetwork%2Fgraph-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PortalNetwork","download_url":"https://codeload.github.com/PortalNetwork/graph-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231907796,"owners_count":18444185,"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-11-08T04:08:13.738Z","updated_at":"2026-02-07T11:30:17.175Z","avatar_url":"https://github.com/PortalNetwork.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Graph Node\n\n[![Build Status](https://travis-ci.org/graphprotocol/graph-node.svg?branch=master)](https://travis-ci.org/graphprotocol/graph-node)\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- PostgreSQL – [PostgreSQL Downloads](https://www.postgresql.org/download/)\n- IPFS – [Installing IPFS](https://ipfs.io/docs/install/)\n\nFor Ethereum network data, you can either run a local node or use Infura.io:\n\n- Local node – [Installing and running Ethereum node](https://ethereum.gitbooks.io/frontier-guide/content/getting_a_client.html)\n- Infura infra – [Infura.io](https://infura.io/)\n\n### Running a Local Graph Node\n\nThis is a quick example to show a working Graph Node. It is a [subgraph for the Ethereum Name Service (ENS)](https://github.com/graphprotocol/ens-subgraph) that The Graph team built.\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/ens-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 mainnet:https://mainnet.infura.io/v3/[PROJECT_ID] \\\n  --ipfs 127.0.0.1:5001\n```\n\nTry your OS username as `USERNAME` and `PASSWORD`. The password might be optional. It depends on your setup.\n\nIf you're using Infura you should [sign up](https://infura.io/register) to get a PROJECT_ID, it's free.\n\nThis will also spin up a GraphiQL interface at `http://127.0.0.1:8000/`.\n\n6.  With this ENS 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:FILE\u003e\n            Ethereum network name (e.g. 'mainnet') and 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:URL\u003e\n            Ethereum network name (e.g. 'mainnet') and Ethereum RPC URL, separated by a ':'\n\n        --ethereum-ws \u003cNETWORK_NAME:URL\u003e\n            Ethereum network name (e.g. 'mainnet') and Ethereum WebSocket URL, separated by a ':'\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        --node-id \u003cNODE_ID\u003e                           a unique identifier for this node [default: default]\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### Environment Variables\n\nSee [here](https://github.com/graphprotocol/graph-node/blob/master/docs/environment-variables.md) for a list of\nthe environment variables that can be configured.\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| 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%2Fportalnetwork%2Fgraph-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fportalnetwork%2Fgraph-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fportalnetwork%2Fgraph-node/lists"}