Skip to content

Commit 86c61b4

Browse files
committed
README.md: Incorporate review suggestions
1 parent a595a0a commit 86c61b4

File tree

1 file changed

+39
-36
lines changed

1 file changed

+39
-36
lines changed

README.md

+39-36
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,16 @@
33
[![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)
44
[![Getting Started Docs](https://img.shields.io/badge/docs-getting--started-brightgreen.svg)](docs/getting-started.md)
55

6-
[The Graph](https://thegraph.com/) is a protocol that organizes and serves web3 data.
6+
## Overview
77

8-
Graph Node extracts and transforms blockchain data and makes the transformed
9-
data available to decentralized applications (dApps) via GraphQL queries.
10-
You can find more details on how to write these transformations, called
11-
_subgraphs_, in the official [Graph
12-
documentation](https://thegraph.com/docs/en/subgraphs/quick-start/). If you
13-
are not familiar already with subgraphs, we highly recommend at least
14-
reading through that documentation first.
8+
[The Graph](https://thegraph.com/) is decentralized protocol that organizes and distributes blockchain data across the leading Web3 networks. A key component of The Graph's tech stack is Graph Node.
159

16-
The rest of this page is geared towards two audiences:
10+
Before using `graph-node,` it is highly recommended that you read the [official Graph documentation](https://thegraph.com/docs/en/subgraphs/quick-start/) to understand Subgraphs, which are the central mechanism for extracting and organizing blockchain data.
1711

18-
1. Subgraph developers who want to run `graph-node` locally so they can test
19-
their subgraphs during development
20-
2. Developers who want to contribute bug fixes and features to `graph-node`
21-
itself
12+
This guide is for:
13+
14+
1. Subgraph developers who want to run `graph-node` locally to test their Subgraphs during development
15+
2. Contributors who want to add features or fix bugs to `graph-node` itself
2216

2317
## Running `graph-node` from Docker images
2418

@@ -32,26 +26,28 @@ This is usually only needed for developers who want to contribute to `graph-node
3226

3327
### Prerequisites
3428

35-
To build and run this project you need to have the following installed on your system:
29+
To build and run this project, you need to have the following installed on your system:
3630

37-
- Rust (latest stable) – [How to install Rust](https://www.rust-lang.org/en-US/install.html)
38-
has general instructions. Run `rustup install stable` in this directory to make
39-
sure all required components are installed. The `graph-node` code assumes that the
40-
latest available `stable` compiler is used.
41-
- PostgreSQL – [PostgreSQL Downloads](https://www.postgresql.org/download/) lists
42-
downloads for almost all operating systems. For OSX users, we highly recommend
43-
using [Postgres.app](https://postgresapp.com/). Linux users can simply use the
44-
Postgres version that comes with their distribution.
45-
- IPFS – [Installing IPFS](https://docs.ipfs.io/install/)
46-
- Protobuf Compiler - [Installing Protobuf](https://grpc.io/docs/protoc-installation/)
31+
- Rust (latest stable): Follow [How to install
32+
Rust](https://www.rust-lang.org/en-US/install.html). Run `rustup install
33+
stable` in _this directory_ to make sure all required components are
34+
installed. The `graph-node` code assumes that the latest available
35+
`stable` compiler is used.
36+
- PostgreSQL: [PostgreSQL Downloads](https://www.postgresql.org/download/) lists
37+
downloads for almost all operating systems.
38+
- For OSX: We highly recommend [Postgres.app](https://postgresapp.com/).
39+
- For Linux: Use the Postgres version that comes with the distribution.
40+
- IPFS: [Installing IPFS](https://docs.ipfs.io/install/)
41+
- Protobuf Compiler: [Installing Protobuf](https://grpc.io/docs/protoc-installation/)
4742

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

5045
### Create a database
5146

5247
Once Postgres is running, you need to issue the following commands to create a database
53-
and set it up so that `graph-node` can use it. The name of the `SUPERUSER` depends
54-
on your installation, but is usually `postgres` or your username.
48+
and configure it for use with `graph-node`.
49+
50+
The name of the `SUPERUSER` depends on your installation, but is usually `postgres` or your username.
5551

5652
```bash
5753
psql -U <SUPERUSER> <<EOF
@@ -62,20 +58,24 @@ create extension btree_gist;
6258
create extension postgres_fdw;
6359
grant usage on foreign data wrapper postgres_fdw to graph;
6460
EOF
61+
```
6562

66-
# Save this in ~/.bashrc or similar
63+
For convenience, set the connection string to the database in an environment
64+
variable, and save it, e.g., in `~/.bashrc`:
65+
66+
```bash
6767
export POSTGRES_URL=postgresql://graph:<password>@localhost:5432/graph-node
6868
```
6969

70-
With this setup, the URL that you will use to have `graph-node` connect to the
71-
database will be `postgresql://graph:<password>@localhost:5432/graph-node`. If
72-
you ever need to manually inspect the contents of your database, you can do
73-
that by running `psql $POSTGRES_URL`.
70+
Use the `POSTGRES_URL` from above to have `graph-node` connect to the
71+
database. If you ever need to manually inspect the contents of your
72+
database, you can do that by running `psql $POSTGRES_URL`. Running this
73+
command is also a convenient way to check that the database is up and
74+
running and that the connection string is correct.
7475

75-
### Build `graph-node`
76+
### Build and Run `graph-node`
7677

77-
To build `graph-node`, clone this repository and run this command at the
78-
root of the repository:
78+
Clone this repository and run this command at the root of the repository:
7979

8080
```bash
8181
export GRAPH_LOG=debug
@@ -91,13 +91,16 @@ of the Ethereum node you want to connect to, usually a `https` URL, so that the
9191
entire argument might be `mainnet:archive,traces:https://provider.io/some/path`.
9292

9393
When `graph-node` starts, it prints the various ports that it is listening on.
94-
The most important of these is the GraphQL HTTP server, which is by default
94+
The most important of these is the GraphQL HTTP server, which by default
9595
is at `http://localhost:8000`. You can use routes like `/subgraphs/name/<subgraph-name>`
9696
and `/subgraphs/id/<IPFS hash>` to query subgraphs once you have deployed them.
9797

9898
### Deploying a Subgraph
9999

100-
Instructions for how to deploy subgraphs can be found [here](https://thegraph.com/docs/en/subgraphs/developing/introduction/) After setting up `graph-cli` as described there, you can deploy a subgraph to your local Graph Node instance.
100+
Follow the [Subgraph deployment
101+
guide](https://thegraph.com/docs/en/subgraphs/developing/introduction/).
102+
After setting up `graph-cli` as described, you can deploy a Subgraph to your
103+
local Graph Node instance.
101104

102105
### Advanced Configuration
103106

0 commit comments

Comments
 (0)