From 842b899470f97cfa7eadf61aaa5aa2c0c9f9ec07 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 9 Feb 2021 13:48:09 +0100 Subject: [PATCH] tweak deployment instruction --- README.md | 48 ++++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 143ac4b..de52cdc 100644 --- a/README.md +++ b/README.md @@ -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