This subgraph tracks events occuring on Winding Tree's ORGiD contract.
The data can later be queried using a GraphQL API.
Get 5 random ORGiDs, their owner and the country of the legal entity:
curl -X POST \
    -d '{ "query": "query { organizations(first: 5) { id owner legalEntity { legalName } service {id} }}" }' \
    https://api.thegraph.com/subgraphs/name/windingtree/orgid-subgraphThe below instructions are adapted from The Graph quickstart.
Clone the source code:
git clone git@github.com:windingtree/orgid-subgraph.gitInstall dependencies:
yarn installIn a dedicated terminal:
# Clone the Graph Node repository
cd /tmp
git clone https://github.com/graphprotocol/graph-node/
# Change directory to Docker
cd graph-node/dockerBy default, the ethereum node will be assumed to be the docker host IP and the network mainnet, but you can update it in the docker-compose.yml file.
For Linux: the docket host IP must be updated using the setup.sh script:
# ! Linux Only ! run setup.sh to update the host IP in docker settings
./setup.shFor an externally hosted node type infura, the ethereum node URL must be updated in the docker-compose.yml file.
Then launch the node:
# Start the graph node
docker-compose upGenerate code:
yarn codegen:mainnetBuild the subgraph:
yarn buildAllocate the subgraph in the Graph Node with:
yarn create-localDeploy the subgraph locally:
yarn deploy-localThis will trigger the indexing of the subgraph in the Graph node and can take some time. Check the Graph node logs to check when data ingestion is completed.
Once the ingestion is completed, you can query the Graph Node, for example to get all organizations:
curl -X POST \
    -d '{ "query": "{organizations {id, owner, isActive}}" }' \
    http://localhost:8000/subgraphs/name/windingtree/orgid-subgraphCreate an access token and store it locally. <ACCESS_TOKEN> is from The Graph Dashboard.
graph auth https://api.thegraph.com/deploy/ <ACCESS_TOKEN>Then deploy, for example in Mainnet:
yarn deploy:mainnetFor Ropten:
yarn deploy:ropstenStatus on the syncronization can be retrieved using:
curl -X POST \
    -d '{ "query": "query { indexingStatusForPendingVersion(subgraphName: \"windingtree/orgid-subgraph\") { synced health fatalError { message handler} }}" }' \
    https://api.thegraph.com/index-node/graphql