The whole stack consists of:
- https://github.com/daostack/arc
- https://github.com/daostack/infra
- https://github.com/daostack/migration
- https://github.com/daostack/subgraph
- https://github.com/daostack/client
- https://github.com/daostack/alchemy-server
- https://github.com/daostack/alchemy
- Merge everything you want to deploy to
master - Create a branch from
mastercalledv{version}. The version if of the form{arc_version}-v{migration_version}, for examle0.0.1-rc.14-v5 - Change the version number in
package.jsonandpackage-lock.jsonand commit the result - Create a new release by running
npm run prepare-releaseandnpm run release. This will upload a new docker image to https://hub.docker.com/r/daostack/migration/tags - Commit the changes and create a pull request.
Consult the https://github.com/daostack/migration/blob/master/README.md for further instructions.
npm run pre-release has options to deploy contracts to rinkeby and main net.
- Merge everything you want to deploy into
master - Create a branch from
mastercalledv{version}. The version is of formX.Y.Z(i.e. normal semantic release version) - Change the version number in
package.jsonandpackage-lock.jsonand commit the result - If there is a new migration version:
- change the
@doastack/migrationversion inpackage.jsonto the new version, and runnpm install. - Change the
ganache:imagevalue indocker-compose.yml. - Commit the results and make sure the tests pass on travis.
- change the
- Create a new release by running
./release.sh. This will upload new docker images to https://hub.docker.com/r/daostack/subgraph-postgres/tags and to https://hub.docker.com/r/daostack/subgraph-ipfs/tags . The tags of these docker images are of the form{ganache|..}-{migration-version}-{subgraph-version}. - Commit the changes and create a pull request.
To deploy the subgraph, please follow the instructions below:
- If you are deploying to The Graph for the first time, start with installing the Graph CLI:
npm install -g @graphprotocol/graph-cliThen follow this by logging into your Graph Explorer account using:graph auth https://api.thegraph.com/deploy/ <ACCESS_TOKEN>
It is also recommended to read this guide: https://thegraph.com/docs/deploy-a-subgraph
- Decide which version of the subgraph you want to deploy, and checkout the corresponding tag:
git checkout git checkout ganache-0.0.1-rc.19-v3-0.0.19
And install the package:
npm ci
- Create a
.envfile like the following:
network="rinkeby"
subgraph="v19"
ethereum_node="https://rinkeby.infura.io/v3/69b4a42f71a8446e8b167062e3d5e317"
postgres_password='letmein'
ipfs_port=5002
graph_node="http://localhost:8620"
ipfs_node="http://localhost:5002"
- Run:
npm run deploy
- Rinkeby subgraphs are here: https://rinkeby.subgraph.daostack.io/subgraphs/name/daostack-alchemy-rinkeby/graphql
- Main net subgraphs here: https://subgraph.daostack.io/subgraphs/name/daostack-alchemy-rinkeby/graphql
TODO: use policy to publish subgraphs to https://rinkeby.subgraph.daostack.io/subgraphs/name/v${subgraph-version}, for example: https://rinkeby.subgraph.daostack.io/subgraphs/name/v0-0-6 (replace dots with dashes)
- Merge everything you want to deploy into
master - Create a branch from
mastercalledv{version}. The version is of formX.Y.Z(i.e. normal semantic release version) - Make sure tests pass on travis
- If there is a new subgraph version:
- Update
package.jsonand change - Update version in
package.jsonandpackage-lock.jsondesired version<version> - Run
npm i - Commit your changes
git ci package.json package-lock.json -m "publish version <version>" - Create a git tag for this version:
git tag <version_number> && git push --tag - Publish the package on npmjs.org:
npm publish
- Merge everything you want to deploy into
master - Push to production:
git push production master(assuming you have a git remote setup called production which points to the production Heroku server) heroku run node server/migrate.js --app=daostack-alchemygit tag <version_number>git push —tags
https://github.com/daostack/alchemy
The dev branch is automaticlly deployed to staging.
For production: we deploy from dev to production by:
- Make sure the settings (specifically
graphqlHttpProviderandgraphqlWSProviderare using the correct URLs) - Merge
devinto themasterbranch - In
heroku, do a manual deployment
If the stack has changed (say a contract update) we need to run through the following steps:
- Update migration and create a new release and docker image
- Update subgraph with new latest migration and create a new release and docker images
- Update client with latest subgraph and docker images of the previous steps, and create a new release
- Update alchemy with latest client version
- To staging:
- Deploy contracts to Rinkeby
- Deploy subgraph to rinkeby.subgraph.daostack.io
- Update subgraph URL in the alchemy source code
- Commit and push to staging
- To Production:
- Deploy contracts to main net
- Deploy new subgraph to subgraph.daostack.io
- Update subgraph URL in the alchemy source code
- Commit and push to master