Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ src/types/
yarn-error.log
.idea
.vscode
data/ipfs
data/postgres
20 changes: 1 addition & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,13 @@ Only the factory address is needed in subgraph.yaml, new pool addresses are auto
### Prerequisites

- Global Yarn Packages
- ganache-cli
- truffle
- graph-cli
- Docker

### Services

Start a ganache chain using 0.0.0.0 as a host so docker can connect

```
ganache-cli -h 0.0.0.0 -d -l 4294967295 --allowUnlimitedContractSize
```

Run a local graph node

```
git clone https://github.com/graphprotocol/graph-node/
```

Update ethereum value in docker-compose.yml to `ganache:http://host.docker.internal:8545`

```
cd graph-node/docker
```

Start a ganache chain and a graph node by running
```
docker-compose up
```
Expand Down
47 changes: 47 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
version: '3'
services:
ganache:
image: trufflesuite/ganache-cli:v6.10.1
ports:
- "8545:8545"
# Nota Bene - the mnemonic below is *INSECURE* and shouldn't be used for real funds, only local development
# it serves only to create deterministic contract addresses that can be shared with subgraph
command: ganache-cli --mnemonic "album wire record stuff abandon mesh museum piece bean allow refuse below"
graph-node:
image: graphprotocol/graph-node
ports:
- '8000:8000'
- '8001:8001'
- '8020:8020'
- '8030:8030'
- '8040:8040'
depends_on:
- ipfs
- postgres
- ganache
environment:
postgres_host: postgres
postgres_user: graph-node
postgres_pass: let-me-in
postgres_db: graph-node
ipfs: 'ipfs:5001'
#ethereum: 'mainnet:http://host.docker.internal:8545'
ethereum: 'ganache:http://ganache:8545'
RUST_LOG: info
ipfs:
image: ipfs/go-ipfs:v0.4.23
ports:
- '5001:5001'
volumes:
- ./data/ipfs:/data/ipfs
postgres:
image: postgres
ports:
- '5432:5432'
command: ["postgres", "-cshared_preload_libraries=pg_stat_statements"]
environment:
POSTGRES_USER: graph-node
POSTGRES_PASSWORD: let-me-in
POSTGRES_DB: graph-node
volumes:
- ./data/postgres:/var/lib/postgresql/data