Note: Assumes you already have Docker and TheGraph CLI installed (yarn global add @graphprotocol/graph-cli
)
-
Launch local node (hardhat,ganache,etc.)
-
Compile and deploy contract(s) (Currently part of
solidity-etched
repo) -
Boot "graph-docker" (
https://github.com/graphprotocol/graph-node
) instance:docker-compose up
-
Initialize new graph instance for a SINGLE contract:
graph init --protocol=ethereum --from-contract <0xADDRESS> --abi <PATH_TO_ABI> --contract-name <CONTRACT_NAME> --index-events --start-block=0 <OUTPUT_DIRECTORY>
a. Be sure to answerno
when asked if you'd like to add another contract -
cd <OUTPUT_DIRECTORY>
-
Add additional contracts as needed:
graph add <0xADDRESS> --abi <PATH_TO_ABI> --contract-name <CONTRACT_NAME> --start-block=0
-
Deploy graph from existing folder:
yarn create-local && yarn deploy-local
-
Use any test scripts (from
solidity-etched
or otherwise) to generate data on the local node.