# Signal Scheme Staging Deployment ## Things to Note: - Network: **rinkeby** - contract to call address (Signal Scheme Addess) to use when creating/initializing a generic scheme: - **0xe06d896da40b73cb02650220e480e20f38e7be18** - Alchemy: - Shubhendu: **https://alchemy-signal-rinkeby.herokuapp.com/** - DAOStack: **https://alchemy-staging-rinkeby.herokuapp.com/** - Subgraph: **https://api.thegraph.com/subgraphs/name/shekhar-shubhendu/signal-scheme-one** - Enabled Attributes: - **`Header`** ## Branches: ### Subgraph - With Contract (primary): https://github.com/apeunit/subgraph/tree/signalscheme - Without Contract (secondary): https://github.com/apeunit/subgraph/tree/feat/signal-scheme - Implemented logic described here: https://github.com/daostack/subgraph/issues/448 ### Alchemy - with working logic and fixed css files: https://github.com/apeunit/alchemy/tree/feat/signal-scheme ## Known Issues: Creating a DAO on https://alchemy-signal-rinkeby.herokuapp.com/ creates a DAO on https://alchemy-staging-rinkeby.herokuapp.com/ (and you can not see the DAO on the signal scheme deployment). But if you create a DAO using a local deployment (instead of heroku) then then it shows up on https://alchemy-signal-rinkeby.herokuapp.com/ ## Deploying the Subgraph 1. Install Graph CLI https://thegraph.com/docs/define-a-subgraph#install-the-graph-cli 2. thegraph account and subgraph creation 2.1 https://thegraph.com/docs/deploy-a-subgraph#create-a-graph-explorer-account 2.2 https://thegraph.com/docs/deploy-a-subgraph#store-the-access-token 2.3 https://thegraph.com/docs/deploy-a-subgraph#create-the-subgraph 3. Clone the repo and install the dependencies ``` git clone git@github.com:apeunit/subgraph.git --branch=signalscheme cd subgraph npm install ``` 4. Run command to generate required files for deployment ``` network=rinkeby npm run codegen ``` you can use a different `network` if required. 5. Update the generated `subgraph.yaml` There are 2 things that are of interest here, 1. `startBlock` for every contract this is initially set to 0 and if you do not want the graph to scall the entire blockchain you can provide the appropriate block number i.e. for the new deployment where old data is of no interest this can be set to the latest block height. 2. Address of the `NewSignalScheme`: If you want to update it you can update it here. Currently, there is a default value set for `rinkeby` only in `ops/mappings.json`. Note: In an ideal world, this value should come from `@daostack/migrations` 6. Finally deploy using the below command ``` graph deploy \ --debug \ --node https://api.thegraph.com/deploy/ \ --ipfs https://api.thegraph.com/ipfs/ \ <github-username>/<subgraph-name> ```