Emblem is a dApp for identifying and rewarding noteworthy behavior on the Ethereum blockchain by issuing NFT badges. This repo houses the subgraph responsible for monitoring and rewarding users within The Graph protocol. For more information, please visit our website or join our Discord.
- Install dependencies
npm i
-
Start your local graph-node. If you have a M1 Macbook, please talk with us on Discord for some custom workarounds for the following steps.
- Clone graph-node
git clone https://github.com/graphprotocol/graph-node
-
Sign up for Alchemy and create your own Ethereum node. You can alternatively use your own Ethereum node if you have the hardware.
-
Edit your graph-node/docker/docker-compose.yml file. Change the "ethereum" environment variable to point to your Ethereum node. If you are using Alchemy, be sure to update <YOUR_API_KEY> and change <YOUR_NETWORK> to "mainnet" or "rinkeby".
... ... graph-node: ... ... environment: ... ... # ethereum: 'mainnet:http://host.docker.internal:8545' ethereum: "<YOUR_NETWORK>:https://eth-rinkeby.alchemyapi.io/v2/<YOUR_API_KEY>" ... ... ... ...
- Start your docker processes
docker-compose up
-
Create your subgraph.yaml on Rinkeby or Mainent
npm run prep:addresses:rinkeby
OR
npm run prep:addresses:mainnet
- Generate code & build your subgraph
npm run build
- Deploy Locally
npm run create-local
npm run deploy-local
- Authenticate
graph auth --studio <YOUR_AUTH_TOKEN_HERE>
- Deploy to The Graph Studio.
npm run deploy
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.