Need help with graph-node?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

1.4K Stars 365 Forks Other 5.1K Commits 194 Opened issues


Graph Node indexes data from blockchains such as Ethereum and serves it over GraphQL

Services available


Need anything else?

Contributors list

Graph Node

Build Status Getting Started Docs

The Graph is a protocol for building decentralized applications (dApps) quickly on Ethereum and IPFS using GraphQL.

Graph 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.

For detailed instructions and more context, check out the Getting Started Guide.

Quick Start


To build and run this project you need to have the following installed on your system:

For Ethereum network data, you can either run your own Ethereum node or use an Ethereum node provider of your choice.

Running a Local Graph Node

This is a quick example to show a working Graph Node. It is a subgraph for Gravatars.

  1. Install IPFS and run
    ipfs init
    followed by
    ipfs daemon
  2. Install PostgreSQL and run
    initdb -D .postgres
    followed by
    pg_ctl -D .postgres -l logfile start
    createdb graph-node
  3. If using Ubuntu, you may need to install additional packages:
    • sudo apt-get install -y clang libpq-dev libssl-dev pkg-config
  4. In the terminal, clone, and install dependencies and generate types for contract ABIs:
yarn codegen
  1. In the terminal, clone, and run
    cargo build

Once you have all the dependencies set up, you can run the following:

cargo run -p graph-node --release -- \
  --postgres-url postgresql://USERNAME[:PASSWORD]@localhost:5432/graph-node \

Try your OS username as

. For details on setting the connection string, check the Postgres documentation.
uses a few Postgres extensions. If the Postgres user with which you run
is a superuser,
will enable these extensions when it initalizes the database. If the Postgres user is not a superuser, you will need to create the extensions manually since only superusers are allowed to do that. To create them you need to connect as a superuser, which in many installations is the
    psql -q -X -U  graph-node <;

This will also spin up a GraphiQL interface at
  1. With this Gravatar example, to get the subgraph working locally run:
yarn create-local

Then you can deploy the subgraph:

yarn deploy-local

This will build and deploy the subgraph to the Graph Node. It should start indexing the subgraph immediately.

Command-Line Interface

    graph-node [FLAGS] [OPTIONS] --ethereum-ipc  --ethereum-rpc  --ethereum-ws  --ipfs  --postgres-url 

FLAGS: --debug Enable debug logging -h, --help Prints help information -V, --version Prints version information

OPTIONS: --admin-port Port for the JSON-RPC admin server [default: 8020] --elasticsearch-password Password to use for Elasticsearch logging [env: ELASTICSEARCH_PASSWORD]

    --elasticsearch-url <url>
        Elasticsearch service to write subgraph logs to [env: ELASTICSEARCH_URL=]

    --elasticsearch-user <user>                   User to use for Elasticsearch logging [env: ELASTICSEARCH_USER=]
    --ethereum-ipc <network_name:>
        Ethereum network name (e.g. 'mainnet'), optional comma-seperated capabilities (eg full,archive), and an Ethereum IPC pipe, separated by a ':'

    --ethereum-polling-interval <milliseconds>
        How often to poll the Ethereum node for new blocks [env: ETHEREUM_POLLING_INTERVAL=]  [default: 500]

    --ethereum-rpc <network_name:>
        Ethereum network name (e.g. 'mainnet'), optional comma-seperated capabilities (eg 'full,archive'), and an Ethereum RPC URL, separated by a ':'

    --ethereum-ws <network_name:>
        Ethereum network name (e.g. 'mainnet'), optional comma-seperated capabilities (eg `full,archive), and an Ethereum WebSocket URL, separated by a ':'

    --http-port <port>                            Port for the GraphQL HTTP server [default: 8000]
    --ipfs <port>                            HTTP address of an IPFS node
    --node-id <node_id>                           a unique identifier for this node [default: default]
    --postgres-url <url>                          Location of the Postgres database used for storing entities
    --subgraph                  name and IPFS hash of the subgraph manifest
    --ws-port <port>                              Port for the GraphQL WebSocket server [default: 8001]

Advanced Configuration

The command line arguments generally are all that is needed to run a

instance. For advanced uses, various aspects of
can further be configured through environment variables. Very large
instances can also split the work of querying and indexing across multiple databases.

Project Layout

  • node
    — A local Graph Node.
  • graph
    — A library providing traits for system components and types for common data.
  • core
    — A library providing implementations for core components, used by all nodes.
  • chain/ethereum
    — A library with components for obtaining data from Ethereum.
  • graphql
    — A GraphQL implementation with API schema generation, introspection, and more.
  • mock
    — A library providing mock implementations for all system components.
  • runtime/wasm
    — A library for running WASM data-extraction scripts.
  • server/http
    — A library providing a GraphQL server over HTTP.
  • store/postgres
    — A Postgres store with a GraphQL-friendly interface and audit logs.


🔨 = In Progress

🛠 = Feature complete. Additional testing required.

✅ = Feature complete

| Feature | Status | | ------- | :------: | | Ethereum | | | Indexing smart contract events | ✅ | | Handle chain reorganizations | ✅ | | Mappings | | | WASM-based mappings| ✅ | | TypeScript-to-WASM toolchain | ✅ | | Autogenerated TypeScript types | ✅ | | GraphQL | | | Query entities by ID | ✅ | | Query entity collections | ✅ | | Pagination | ✅ | | Filtering | ✅ | | Entity relationships | ✅ | | Subscriptions | ✅ |


Please check for development flow and conventions we use. Here's a list of good first issues.


Copyright © 2018-2019 Graph Protocol, Inc. and contributors.

The Graph is dual-licensed under the MIT license and the Apache License, Version 2.0.

Unless 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.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.