tweak deployment instruction

This commit is contained in:
Matthias Kretschmann 2021-02-09 13:48:09 +01:00 committed by GitHub
parent f2aeffee73
commit 842b899470
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 28 additions and 20 deletions

View File

@ -11,8 +11,7 @@
- [🧶 Example Queries](#-example-queries)
- [🦑 Development](#-development)
- [✨ Code Style](#-code-style)
- [⬆️ Releases](#-releases)
- [🛳 Production](#-production)
- [🛳 Releases](#-releases)
- [⬆️ Deployment](#-deployment)
- [🏛 License](#-license)
@ -75,7 +74,7 @@ This subgraph is deployed under `/subgraphs/name/oceanprotocol/ocean-subgraph/`
## 🦑 Development
First clone repo and install dependencies:
First, clone the repo and install dependencies:
```bash
git clone https://github.com/oceanprotocol/ocean-subgraph/
@ -99,7 +98,7 @@ cp .env.example .env
docker-compose --env-file .env up
```
The default network for development is Rinkeby. If you want to switch to another network you have to modify the `docker/docker-compose.yml` file within `environment.ethereum`.
The default network for development is set to Rinkeby. If you want to switch to another network you have to modify the `docker/docker-compose.yml` file within `environment.ethereum`.
You now have a local graph-node running and can start deploying your changes to it. To do so, follow the [Deployment instructions](#-deployment).
@ -115,7 +114,7 @@ npm run lint
npm run format
```
## ⬆️ Releases
## 🛳 Releases
Releases are managed semi-automatically. They are always manually triggered from a developer's
machine with release scripts. From a clean `main` branch you can run the release task bumping
@ -136,33 +135,42 @@ The task does the following:
For the GitHub releases steps a GitHub personal access token, exported as `GITHUB_TOKEN` is required. [Setup](https://github.com/release-it/release-it#github-releases)
## 🛳 Production
## ⬆️ Deployment
Do the following to deploy the ocean-subgraph to a graph-node running locally:
Do the following to deploy the ocean-subgraph to a graph-node running locally, pointed against `mainnet`:
```bash
npm run codegen
# deploy
npm run create:local
npm run deploy:local
```
The above will deploy ocean-subgraph connecting to mainnet. To create/deploy subgraph connecting to Rinkeby or Ropsten test net,
use :local-rinkeby or :local-ropsten with either create or deploy command.
To deploy a subgraph connected to Rinkeby or Ropsten test networks, use instead:
- You can edit the event handler code and then run `npm run deploy:local`
- Running deploy will fail if the code has no changes
- Sometimes deploy will fail no matter what, in this case:
- Stop the docker-compose run (`docker-compose down` or Ctrl+C)
```bash
# Rinkeby
npm run create:local-rinkeby
npm run deploy:local-rinkeby
# Ropsten
npm run create:local-ropsten
npm run deploy:local-ropsten
```
You can edit the event handler code and then run `npm run deploy:local`, with some caveats:
- Running deploy will fail if the code has no changes
- Sometimes deploy will fail no matter what, in this case:
- Stop the docker-compose run (`docker-compose down` or Ctrl+C)
This should stop the graph-node, ipfs and postgres containers
- Delete the `ipfs` and `postgres` folders in `/docker/data` (`rm -rf ./docker/data/*`)
- Run `docker-compose up` to restart graph-node, ipfs and postgres
- Run `npm run create:local` to create the ocean-subgraph
- Run `npm run deploy:local` to deploy the ocean-subgraph
- Delete the `ipfs` and `postgres` folders in `/docker/data` (`rm -rf ./docker/data/*`)
- Run `docker-compose up` to restart graph-node, ipfs and postgres
- Run `npm run create:local` to create the ocean-subgraph
- Run `npm run deploy:local` to deploy the ocean-subgraph
Note: to deploy to one of the remote nodes run by Ocean, you can do port-forwarding then using the
above `local` create/deploy commands will work as is.
> To deploy to one of the remote nodes run by Ocean, you can do port-forwarding and the above `:local` commands will work as is.
## 🏛 License