Meme Factory subgraph for The Graph.
Like other subgraphs, the Meme Factory subgraph is built with
# Once (installs dependencies)
yarn
# Each time you want to build
yarn build-ipfs [--verbosity debug]However, in order to index the subgraph, graph-node needs to run against a Ganache testnet rather than a real Ethereum node. This is because the Meme Factory contracts have not been deployed to a public Ethereum network yet and we need some test data and events to index.
In order to bring up the Ganache testnet, run the following two commands:
# Once
tar xf ganache-db.tar.bz2
# Each time
yarn testnetThis will run Ganache on http://localhost:8546, allowing to run
graph-node as follows:
graph-node \
... \
--ethereum-rpc http://localhost:8546 \
--subgraph IPFS_HASH- Identify if there are other contracts/events we should watch
- Identify how to handle remaining types and fields (see questions in GraphQL schema)
- GraphQL interfaces
BigIntmath (required for adding votes for and votes against in challenges)- Aggregation / counting
This subgraph manifest is based on the following MemeFactory resources:
{
users {
id
user_address
}
memes {
id
regEntry_address
regEntry_status
regEntry_version
regEntry_creator {
id
user_address
}
regEntry_deposit
regEntry_createdOn
regEntry_challengePeriodEnd
challenge_comment
challenge_votesFor
challenge_createdOn
challenge_challenger {
id
user_address
}
challenge_rewardPool
challenge_votesTotal
challenge_votesAgainst
challenge_commitPeriodEnd
challenge_claimedRewardOn
challenge_revealPeriodEnd
}
memeVotes {
id
vote_option
vote_amount
vote_createdOn
vote_secretHash
vote_revealedOn
vote_claimedRewardOn
vote_meme {
id
challenge_votes {
id
}
}
}
paramChanges {
id
regEntry_address
regEntry_status
regEntry_version
regEntry_creator {
id
user_address
}
regEntry_deposit
regEntry_createdOn
regEntry_challengePeriodEnd
challenge_comment
challenge_votesFor
challenge_createdOn
challenge_challenger {
id
user_address
}
challenge_rewardPool
challenge_votesTotal
challenge_votesAgainst
challenge_commitPeriodEnd
challenge_claimedRewardOn
challenge_revealPeriodEnd
}
users {
id
user_address
}
}