See: https://thegraph.com/docs/en/deploying/subgraph-studio/#publish-your-subgraphs
npm install -g @graphprotocol/graph-cli
To deploy any changes to a subgraph you must be authed with the specific deploy_key for that subgraph, ask a code owner for these keys before attempting to deploy.
graph auth --studio DEPLOY_KEY
Requires Node 16 !
nvm use
Install
npm install
Prepare subgraph.yaml for selected chain
npm run prep:mainnet || npm run prep:goerli
Codegen
npm run codegen
Build Subgraph
npm run build
Deploy the Subgraph
npm run deploy:mainnet || npm run deploy:goerli
Goerli Faucet for test GRT tokens
Must belong to the knownorigin
github:
https://thegraph.com/hosted-service/subgraph/knownorigin/known-origin
https://thegraph.com/hosted-service/subgraph/knownorigin/known-origin-goerli
https://thegraph.com/hosted-service/subgraph/knownorigin/knownoriginrinkeby Deprecated
Purpose | URL |
---|---|
Production (mainnet) | https://thegraph.com/explorer/subgraph/knownorigin/known-origin |
Staging (mainnet) | https://thegraph.com/explorer/subgraph/knownorigin/known-origin-staging |
Development (goerli) | https://thegraph.com/hosted-service/subgraph/knownorigin/known-origin-goerli |
Alpha Studio (mainnet) | https://thegraph.com/studio/subgraph/known-origin |
graph init --from-contract <address> knownorigin/known-origin graph-known-origin
npm install -g @graphprotocol/graph-cli
graph auth https://api.thegraph.com/deploy/ <auth-token>
graph auth https://api.thegraph.com/deploy/ <ACCESS_TOKEN>
Requires Node 16 !
Install
yarn install
If schema changes
yarn codegen
Compile mappings
yarn build
Push that puppy!
yarn deploy
See: https://thegraph.com/docs/en/developing/unit-testing-framework/
brew install postgresql
yarn test