diff --git a/README.md b/README.md index ad13ee1..43c2240 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,115 @@ # GNO Voting Power -This repo is a collection of subgraphs which aggregate the balance of GNO held in multiple contracts on several networks. +This repo is a collection of subgraphs which aggregate the balance of GNO held in multiple contracts across different networks. Currently, it tracks GNO balances in: - Ethereum Mainnet: - [x] GNO - [x] LGNO - - [x] Uniswap v3 - - [x] Balancer - Gnosis Chain: - [x] GNO - - [x] mGNO - [x] sGNO - [x] LGNO - - [x] Beacon Chain validator deposits - - [x] 1Hive - - [x] Swapper - - [x] SushiSwap - - [x] Elk - - [x] Baoswap - - [x] Symmetric + +These subgraphs allow the calculation of voting power associated with these balances for various dApps and protocols. + +## Prerequisites +Before you start, make sure you have the following tools installed on your machine: + +- [Node.js](https://nodejs.org/) v18 or higher +- [Yarn](https://yarnpkg.com/) +- [Graph CLI](https://github.com/graphprotocol/graph-cli) + +## Installation + +1. Clone this repository: +``` +git clone https://github.com/username/subgraph-voting-power.git +``` + +2. Install the dependencies with Yarn: +``` +yarn install +``` + +## Available Scripts +clean +Removes generated directories (to clean up before rebuilding): +``` +yarn clean +``` + +codegen +Generates TypeScript code from the GraphQL schema and entities for both networks: +``` +yarn codegen +``` + +build +Builds the subgraph for Ethereum: +``` +yarn build +``` + +build:gc +Builds the subgraph for Gnosis Chain: +``` +yarn build:gc +``` + +doall +Executes the full sequence: clean, code generation, and build for both Ethereum and Gnosis Chain: +``` +yarn doall +``` + +deploy +Deploys the subgraph for Ethereum to The Graph Studio: +``` +yarn deploy +``` + +deploy:gc +Deploys the subgraph for Gnosis Chain to The Graph Studio: +``` +yarn deploy:gc +``` + +test +Runs tests to verify the functionality of the subgraph: +``` +yarn test +``` + +## Running Tests +This project uses matchstick-as for testing subgraphs written in AssemblyScript. + +Run the tests with the command: + +``` +yarn test +``` + +The tests will use the generated files and simulate events to verify that the mappings and entities in the subgraph function as expected. + +## Deploying the Subgraph +### On Ethereum Mainnet +To deploy the subgraph to the Ethereum Mainnet, first make sure you are connected to The Graph Studio. Then, use the following command to deploy: + +``` +yarn deploy +``` + +### On Gnosis Chain +To deploy the subgraph to Gnosis Chain, use the following command: + +``` +yarn deploy:gc +``` + +## Contributing +Contributions are welcome! If you find a bug or have improvement ideas, feel free to open an issue or submit a pull request. + +## License +This project is licensed as UNLICENSED. \ No newline at end of file diff --git a/package.json b/package.json index 73c354e..92d9f11 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,6 @@ "doall": "yarn clean && yarn codegen && yarn build && yarn build:gc", "deploy": "graph deploy --studio gno-vote-weight---ethereum", "deploy:gc": "graph deploy --studio gno-vote-weight---gc -o build-gc subgraph-gnosis-chain.yaml", - "deployProd": "graph deploy --studio gno-vote-weight-ethereum", - "deployProd:gc": "graph deploy --studio gno-vote-weight-gc -o build-gc subgraph-gnosis-chain.yaml", "test": "graph test" }, "dependencies": {