Skip to content

Polymarket/positions-subgraph

Repository files navigation

positions-subgraph

Codegen

Run the following command to generate the generated folder:

yarn codegen

Environment Variables

Create a .env file with the following variables:

MATIC_RPC_URL=

Local Deployment

docker compose up

Restart graph node and clear volumes

docker compose down
sudo docker rm positions-subgraph_graph-node_1 && sudo docker rm positions-subgraph_ipfs_1 && sudo docker rm positions-subgraph_postgres_1 && sudo docker rm positions-subgraph_ganache_1

Create and deploy subgraph

While local subgraph node is running run:

yarn create-local
yarn deploy-local

Access the GraphQL editor at:

http://localhost:8000/subgraphs/name/positions-subgraph/graphql

Example query:

query tokenIdConditions {
  tokenIdConditions {
    id
    condition
    complement
  }
}

Goldsky

Build the subgraph with yarn build and then run the following to deploy:

goldsky subgraph deploy positions-subgraph/<version> --path .

Running on an M1 Chip

To run locally on an M1 chip, you'll need to build a local copy of the graph-node docker image. To do this, clone the graph-node repo and run the following commands:

# Remove the original image
docker rmi graphprotocol/graph-node:latest

# Build the image
./docker/build.sh

# Tag the newly created image
docker tag graph-node graphprotocol/graph-node:latest

Note: you likely will have to increase your Docker daemon memory capacity. In Docker desktop you can find this setting under Preferences > Resources > Advanced.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •