Skip to content

HashRei/fairmint-ethereum-subgraph

Repository files navigation

Fairmint Ethereum Subgraph

Description

The Fairmint Ethereum subgraph index data from the CAFE and the whitelist contracts deployed by Fairmint on Ethereum.

Deployed subgraphs

All subgraphs are deployed on the decentralized network:

Production network

Test network

Usage

The subgraph can be queried directly from the graph explorer, or from another application.

Example querie

Get all the information about an organization with its id identifier.

{
  organizations(where: {id: "<ORGANIZATION-ID"}) {
    id
    address
    name
    symbol
    initGoal
    initReserve
    equityCommitment
    fundraisingGoal
    totalSupply
    beneficiary
    buySlopeNum
    buySlopeDen
    stakeholdersPoolIssued
    stakeholdersPoolAuthorized
    shareholders
    minInvestment
    whitelist
    control
    state
    version
    decimals
    currency
 }
}

Get all the information about a user with its id identifier.

{
  users(where: {id: "<USER-ID"}) {
    id
    address
    invested
    received
    totalTokensLocked
    startIndex
    endIndex
    jurisdictionId
    organizationName
    organizationAddress
    whitelistContractAddress
  }
}

Quickstart

Installation

  • Install Graph CLI
yarn global add @graphprotocol/graph-cli

Update

Update package.json with the slug of your subgraph on Subgraph Studio.

Deployment

  • Code generation for the subgraph
yarn codegen
  • Build the subgraph and check compilation errors
yarn build
  • Authentification
graph auth --studio '<ACCESS_TOKEN>'
  • Deployment
yarn  deploy 

Troubleshooting

If there is an error while indexing the subgraph, it may not be displayed in the Explorer logs.

You can query the health of your subgraph as shown here.

About

Subgraph of the Fairmint contracts - on Ethereum

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published