aragon / court-subgraph

Aragon Court subgraph
GNU General Public License v3.0
13 stars 7 forks source link

Alternative fix for graph node setup issue #56

Open dapplion opened 4 years ago

dapplion commented 4 years ago

Trying to run this repo locally I got stuck on yarn create-local due to the node being unable to connect to a local node (issue https://github.com/graphprotocol/graph-node/issues/1132). The proposed solution did not work for me and graph node was still unable to connect to the node despite using 0.0.0.0.

To fix it I included ganache as a service in the graph-node/docker/docker-compose.yml and reference it with the docker's internal DNS "mainnet:http://ganache:8545"

I've opened the issue in case this solution can be other users find this solution useful to setup.

# graph-node/docker/docker-compose.yml

version: "3"
services:
  graph-node:
    image: graphprotocol/graph-node
    ports:
      - "8000:8000"
      - "8001:8001"
      - "8020:8020"
      - "8030:8030"
      - "8040:8040"
    depends_on:
      - ipfs
      - postgres
    environment:
      postgres_host: postgres:5432
      postgres_user: graph-node
      postgres_pass: let-me-in
      postgres_db: graph-node
      ipfs: "ipfs:5001"
+      ethereum: "mainnet: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
+  ganache:
+    image: trufflesuite/ganache-cli
+    ports:
+      - "8545:8545"
+    command: -i 15 --gasLimit 8000000 --deterministic

PD: Thanks @facuspagnuolo for the workshop, it motivated me to look deeper into graphprotocol :heart:

facuspagnuolo commented 4 years ago

Thx for sharing @dapplion ! Glad you enjoyed the workshop 😄

0xclem commented 4 years ago

@dapplion thanks for the fix!

haustasis commented 3 years ago

@dapplion Nice!

samuel-casey commented 3 years ago

@dapplion worked for me, thanks!