These files contain the smart contract code and associated tests for Gheedra's GEX platform.
- In a terminal window run
yarn t
- In one terminal run
yarn buidler node
- Then in another run
yarn t
- First start up a server:
yarn buidler node
- Then run (in a different terminal tab):
yarn deploy
- Create/modify network config in
buidler.config.ts
and add API key and private key - Run
yarn buidler run --network goerli scripts/deploy.ts
- Add Etherscan API key to
buidler.config.ts
- Run
yarn buidler verify-contract --contract-name <CONTRACT_NAME> --address <DEPLOYED_ADDRESS>
This process deploys the GEX subgraph to The Graph
In subgraph.yaml
, update the following
- Set
repository
to your github repository (must be public for the deployment only) - Set
address
to the address where the contract is deployed - Set
startBlock
to 1 block before contract deployment
Note: your subgraph github repository must be public for deployment, but can be set back to private once deployed
- Code generation (run after changes to GraphQL schema or contract ABIs):
yarn graph codegen
- Build (final step before deployment):
yarn graph build
- Login to The Graph and retrieve your access token
- Run
graph auth https://api.thegraph.com/deploy/ <YOUR ACCESS TOKEN>
to authorize deployment
- Run
graph deploy <SUBGRAPH_NAME> --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/
to deploy the graph
For more information about deploying the graph:
https://thegraph.com/docs/deploy-a-subgraph#create-a-graph-explorer-account
https://thegraph.com/docs/deploy-a-subgraph#store-the-access-token
https://thegraph.com/docs/deploy-a-subgraph#create-the-subgraph