This repository has been archived by the owner on Feb 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e1b3851
Showing
24 changed files
with
6,360 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
generated/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint"], | ||
"extends": [ | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:prettier/recommended" | ||
], | ||
"rules": { | ||
"prefer-const": "off" // Not possible for AssemblyScript | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# next.js build output | ||
.next | ||
|
||
build/ | ||
generated/ | ||
subgraph.yaml | ||
abis/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"includes": ["*.graphql"], | ||
"excludes": ["build/**/*.graphql"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"semi": false, | ||
"trailingComma": "all", | ||
"printWidth": 80, | ||
"singleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Changelog | ||
|
||
## Next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 The Graph | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# mStable Governance Subgraph | ||
|
||
TODO write me | ||
|
||
--- | ||
|
||
## Setup | ||
|
||
### Prerequisites | ||
|
||
First, ensure these are installed: | ||
|
||
- [Ganache](https://www.trufflesuite.com/ganache) | ||
- [Truffle](https://www.trufflesuite.com/truffle) | ||
- [Docker](https://docs.docker.com/install) | ||
|
||
Next, ensure the Docker daemon is running. | ||
|
||
After that, clone [the Graph Node project](https://github.com/graphprotocol/graph-node) locally, | ||
and navigate to the `docker` directory in that project (e.g. `cd graph-node/docker`). | ||
|
||
If you're on Linux, run `./setup.sh` in that directory to set the host IP address in the docker config. | ||
|
||
At this point, it should be possible to run the node: `docker-compose up`. Check that its services are running in the logs (GraphQL, Postgres, and IPFS). | ||
|
||
Finally, run Ganache on `http://0.0.0.0:7545` such that it is available to running Docker images (`ganache-cli -p 7545 -h 0.0.0.0`) | ||
|
||
### Installation | ||
|
||
1. `yarn` | ||
2. `yarn prepare:<config>` (i.e `ropsten`, `local`, `staging`, `mainnet`) | ||
3. `yarn codegen` | ||
|
||
### Development | ||
|
||
Firstly, the subgraph can be created by running: `yarn create:local`; this should lead to a number of logs on the graph node. | ||
|
||
Once the subgraph has been created, it can be deployed at any time with: `yarn deploy:local`. | ||
|
||
This will cause the graph to start processing blocks and mapping events. Eventually, the | ||
subgraph will have been (re)created. | ||
|
||
If changes are made to the contracts, `subgraph.yaml`, or the GraphQL schema, run `yarn codegen`; | ||
this re-create the `generated` folder. | ||
|
||
**NB:** Type-checking is performed at build time; `yarn tsc` won't work. | ||
|
||
--- | ||
|
||
## Deployment | ||
|
||
1. `yarn` | ||
2. Ensure correct config in `/config/<config>.json` | ||
3. `yarn prepare:<config>` | ||
4. `yarn codegen` | ||
5. `yarn deploy:<config> <access token>` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"network": "development" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"network": "kovan" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"network": "mainnet" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"network": "ropsten" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"network": "mainnet" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"name": "mstable-governance-subgraph", | ||
"version": "0.10", | ||
"scripts": { | ||
"codegen": "yarn graph codegen", | ||
"build": "yarn graph build", | ||
"prepare:local": "mustache config/development.json subgraph.template.yaml > subgraph.yaml", | ||
"prepare:ropsten": "mustache config/ropsten.json subgraph.template.yaml > subgraph.yaml", | ||
"prepare:kovan": "mustache config/kovan.json subgraph.template.yaml > subgraph.yaml", | ||
"prepare:staging": "mustache config/staging.json subgraph.template.yaml > subgraph.yaml", | ||
"prepare:mainnet": "mustache config/mainnet.json subgraph.template.yaml > subgraph.yaml", | ||
"create:local": "yarn graph create mStable/mStable-governance --node http://127.0.0.1:8020", | ||
"deploy:local": "yarn graph deploy mStable/mStable-governance --ipfs http://localhost:5001 --node http://127.0.0.1:8020", | ||
"deploy:ropsten": "yarn graph deploy mStable/mStable-governance-ropsten --debug --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/ --access-token ", | ||
"deploy:kovan": "yarn graph deploy mStable/mStable-governance-kovan --debug --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/ --access-token ", | ||
"deploy:staging": "yarn graph deploy mStable/mStable-governance-staging --debug --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/ --access-token ", | ||
"deploy:mainnet": "yarn graph deploy mStable/mStable-governance --debug --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/ --access-token ", | ||
"lint": "yarn run eslint './src/**/*.{ts,tsx}' --fix" | ||
}, | ||
"devDependencies": { | ||
"@graphprotocol/graph-cli": "^0.18.0", | ||
"@graphprotocol/graph-ts": "^0.18.1", | ||
"@typescript-eslint/eslint-plugin": "^3.5.0", | ||
"@typescript-eslint/parser": "^3.5.0", | ||
"chalk": "^4.1.0", | ||
"eslint": "^7.3.1", | ||
"eslint-config-prettier": "^6.11.0", | ||
"eslint-plugin-prettier": "^3.1.4", | ||
"husky": "^4.2.1", | ||
"lint-staged": "^10.0.7", | ||
"mustache": "^4.0.1", | ||
"prettier": "^2.0.5", | ||
"typescript": "^4.0.2" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged" | ||
} | ||
}, | ||
"lint-staged": { | ||
"*.{ts,js,json,graphql}": [ | ||
"yarn run lint", | ||
"git add" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// TODO |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
specVersion: 0.0.2 | ||
description: mStable Governance | ||
repository: https://github.com/mstable/mStable-governance-subgraph | ||
schema: | ||
file: ./schema.graphql | ||
|
||
# TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# These stubs are defined here for the benefit of IDEs; it isn't | ||
# included in the build. | ||
|
||
scalar BigInt | ||
scalar BigDecimal | ||
scalar Boolean | ||
scalar Bytes | ||
scalar ID | ||
scalar String | ||
|
||
directive @entity on OBJECT | ||
|
||
directive @derivedFrom(field: String!) on FIELD_DEFINITION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": "./node_modules/@graphprotocol/graph-ts/tsconfig.json", | ||
"compilerOptions": { | ||
"types": ["./node_modules/@graphprotocol/graph-ts"] | ||
} | ||
} |
Oops, something went wrong.