From 10fbe08448016891772a4b72c7637ea32ef752f5 Mon Sep 17 00:00:00 2001 From: Sebastian Gerske Date: Tue, 11 Dec 2018 11:54:06 +0100 Subject: [PATCH] updated readme --- README.md | 142 ++++++++++++++++++++++++++----------------------- start_ocean.sh | 6 +-- 2 files changed, 79 insertions(+), 69 deletions(-) diff --git a/README.md b/README.md index 7122df5..008f10b 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,16 @@ - [Prerequisites](#prerequisites) - [Get Started](#get-started) - [Script Options](#script-options) - - [Ocean Protocol components](#ocean-protocol-components) - - [Environment Variables](#environment-variables) - - [Parity Client Accounts](#parity-client-accounts) + - [Docker Building Blocks](#docker-building-blocks) + - [Keeper Node](#keeper-node) + - [Aquarius](#aquarius) + - [Brizo](#brizo) + - [Secret Store](#secret-store) + - [Spree Network](#spree-network) + - [Nile Network](#nile-network) - [Contributing](#contributing) - [License](#license) - + --- ## Prerequisites @@ -49,11 +53,13 @@ cd docker-images/ screen shot 2018-10-10 at 12 20 48 +--- + This will bring up the `stable` versions of all components, referring to their respective `master` branches. -To get the `latest` versions of all components, referring to their `develop` branches, pass the argument `--latest`: +To run as a publisher, `Brizo` configuration must be set with valid Azure account credentials. This is done in the file [brizo.env](./brizo.env). -To run as a publisher, `Brizo` configuration must be set with valid Azure account credentials. This is done in +To get the `latest` versions of all components, referring to their `develop` branches, pass the argument `--latest`: ```bash ./start_ocean.sh --latest @@ -67,89 +73,93 @@ After getting everything running, you can open the **Pleuston Frontend** applica The `start_ocean.sh` script provides the following options: -Option | Description ---- | --- -`--latest` | Get the `latest` versions of all components, referring to their `develop` branches. -`--no-pleuston` | Start up Ocean without an instance of `pleuston`. Helpful for development on `pleuston`. -`--local-parity-node` | Runs a local parity POA node and Secret Store instead of ganache-cli. -`--reuse-database` | Start up Ocean and reuse the Database from ganache. Helpful for development. -`--purge` | Remove the volumes, local folder and networks used by the script. +Option | Description +----------------------------| ----------- +`--latest` | Get the `latest` versions of all components instead of stable, referring to their `develop` branches. +`--no-pleuston` | Start up Ocean without an instance of `pleuston`. Helpful for development on `pleuston`. +`--no-aquarius` | Start up Ocean without an instance of `aquarius` and `mongodb`. +`--no-brizo` | Start up Ocean without an instance of `brizo`. +`--no-secret-store` | Start up Ocean without an instance of `secret-store`. +`--local-ganache-node` | Runs a local ganache node. +`--local-spree-node` | Runs a local node of the `spree` network. +`--local-nile-node` | Runs a node of the `nile` network and connects to the `nile` network. +`--local-kovan-node` | Runs a light node of the `kovan` network and connects to the `kovan` network. +`--reuse-ganache-database` | Runs the ganache node with a persistent database. +`--purge` | Removes the containers, volumes, artifact folder and networks used by the script. -For example, if you do: +## Docker Building Blocks -```bash -./start_ocean.sh --latest -``` +Ocean compose consist of a set of building Blocks that can be combined to form a local test environment. -then the main/default [docker-compose.yml](docker-compose.yml) will be used, so the following Docker images will all be started: +### Keeper Node -- mongo:3.6 -- oceanprotocol/keeper-contracts:latest -- oceanprotocol/aquarius:latest -- oceanprotocol/brizo:latest -- oceanprotocol/pleuston:latest +Controlled by the `--local-*-node` config switches will start a container `keeper-node` that uses port `8545` to expose an rpc endpoint to the Ethereum Protocol. Internal Url: `http://keeper-node:8545`. -To see what ports each of those listens on, read [docker-compose.yml](docker-compose.yml). Note that `keeper-contracts` runs a local Ganache node (not a local Parity Ethereum POA node). +Hostname | External Port | Internal Url | Description +--------------|---------------|-------------------------|------------------- +`keeper-node` | `8545` | http://keeper-node:8545 | An Ethereum RPC node -If you do: +This node can be one of the following implementations: -```bash -./start_ocean.sh --no-pleuston -``` +Node | Description +----------|------------- +`ganache` | Runs a local `ganache-cli` node that is not persistent by default. The contracts from the desired `keeper-contracts` version will be deployed upon launch of this node. +`spree` | Runs a local instance of the `spree` network. See [Spree Network](#spree-network) for details. +`nile` | Runs a instance of the `nile` network and connects to the Nile testnet. See [Nile Network](#nile-network) for details. +`kovan` | Runs a instance of the `kovan` network and connects to the Kovan testnet. -then [docker-compose-no-pleuston.yml](docker-compose-no-pleuston.yml) will be used, so these images will be started: +### Aquarius -- mongo:3.6 -- oceanprotocol/keeper-contracts:stable -- oceanprotocol/aquarius:stable -- oceanprotocol/brizo:stable +Controlled by the `--no-aquarius` config switch will start two containers: -If you do: +Hostname | External Port | Internal Url | Description +-----------|---------------|----------------------|------------------- +`aquarius` | `5000` | http://aquarius:5000 | [Aquarius](https://github.com/oceanprotocol/aquarius) +`mongodb` | | | MongoDB used by Aquarius -```bash -./start_ocean.sh --latest --local-parity-node -``` +### Brizo -then [docker-compose-local-parity-node.yml](docker-compose-local-parity-node.yml) will be used. Read it to see what images it starts. Note that it _doesn't_ start Pleuston, and it _does_ start a Parity Secret Store. +Controlled by the `--no-brizo` config switch will start one container: -If you do: +Hostname | External Port | Internal Url | Description +-----------|---------------|--------------------|------------------- +`brizo` | `8030` | http://brizo:8030 | [Brizo](https://github.com/oceanprotocol/brizo) -```bash -./start_ocean.sh --latest --no-pleuston --local-parity-node -``` +### Pleuston -then the last-selected Docker Compose file will be used, i.e. the one selected by `--local-parity-node`: [docker-compose-local-parity-node.yml](docker-compose-local-parity-node.yml). +Controlled by the `--no-pleuston` config switch will start one container: -### Parity Client Accounts +Hostname | External Port | Internal Url | Description +-----------|---------------|-----------------------|------------------- +`pleuston` | `3000` | http://pleuston:3000 | [Pleuston](https://github.com/oceanprotocol/pleuston) -If you run the `start_ocean.sh` script with the `--local-parity-node` option, you will have available a Parity Client instance with the following accounts enabled: +You can reach it on http://localhost:3000 -Account | Password | Balance ---------|----------|-------- -0x00bd138abd70e2f00903268f3db08f2d25677c9e | node0 | 10000000111000111000111000 -0x068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0 | secret | 100000000 -0xa99d43d86a0758d5632313b8fa3972b6088a21bb | secret | 100000000 +### Secret Store +Controlled by the `--no-secret-store` config switch will start three containers: + +Hostname | External Ports | Internal Url | Description +----------------------------|-----------------|---------------------------------------|------------------- +`secret-store` | `12000`, `32771` | http://secret-store:12000 | An instance of the Ocean Secret Store +`secret-store-cors-proxy` | `12001` | http://secret-store-cors-proxy:12001 | A nginx proxy to enable CORS on the secret store +`secret-store-signing-node` | `9545` | http://secret-store-signing-node:9545 | A parity node to `sign` messages for the secret store and to `decrypt` and `encrypt` + +### Spree Network + +If you run the `start_ocean.sh` script with the `--local-spree-node` option, you will have available a keeper node instance with the following accounts enabled: + +Account | Password | Balance +-------------------------------------------|------------|-------- +0x00bd138abd70e2f00903268f3db08f2d25677c9e | node0 | 10000000111000111000111000 +0x068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0 | secret | 100000000 +0xa99d43d86a0758d5632313b8fa3972b6088a21bb | secret | 100000000 Use one of the above accounts to populate `PARITY_ADDRESS` and `PARITY_PASSWORD` in `brizo.env` file to avoid asccount `locked` issues from the keeper contracts. -### Environment Variables +### Nile Network -The `start_ocean.sh` script and `.env` file sets defaults for the following environment variables but you can use these in combination with the Docker Compose files for further customization, e.g.: - -```bash -export REUSE_DATABASE="true" -docker-compose --project-name=ocean -f docker-compose-no-pleuston.yml up -``` - -Variable | Description ---- | --- -`REUSE_DATABASE` | The keeper-contracts component runs with ganache by default and every run will produce and deploy new instances of the keeper contracts. Ganache can be run with a specific database path by setting the env var `REUSE_DATABASE` to `"true"`. By default, the ganache database will be setup in the cwd. -`DEPLOY_CONTRACTS` | skip deploying smart contracts by setting this to `"false"`, in this case `REUSE_DATABASE` should be set to `"true"` in the previous run when using ganache -`KEEPER_NETWORK_NAME` | set to one of `"ganache"` (default), `"kovan"`, or `"ocean_poa_net_local"` -`ARTIFACTS_FOLDER` | this is where the deployed smart contracts abi files will be available. This can be pointed at any path you like. - -In addition to these variables, when running Brizo you need to provide the Azure credentials to allow Brizo to connect to Azure. These variables can be configured in the file `brizo.env`. +tbd ## Contributing diff --git a/start_ocean.sh b/start_ocean.sh index 9bcf19e..d56ceb7 100755 --- a/start_ocean.sh +++ b/start_ocean.sh @@ -5,14 +5,14 @@ COMPOSE_DIR="${DIR}/compose-files" export PROJECT_NAME="ocean" # default to latest versions -export OCEAN_VERSION=latest +export OCEAN_VERSION=stable # keeper options export KEEPER_DEPLOY_CONTRACTS="false" export KEEPER_ARTIFACTS_FOLDER=$HOME/.ocean/keeper-contracts/artifacts # Specify which ethereum client to run or connect to: development, kovan, spree or nile export KEEPER_NETWORK_NAME="nile" -export NODE_FILE=${COMPOSE_DIR}/nodes/nile_node.yml +export NODE_COMPOSE_FILE=${COMPOSE_DIR}/nodes/nile_node.yml # Ganache specific option, these two options have no effect when not running ganache-cli export GANACHE_DATABASE_PATH="${DIR}" @@ -144,7 +144,7 @@ while :; do ;; *) printf $COLOR_Y'Starting Ocean...\n\n'$COLOR_RESET - docker-compose --project-name=$PROJECT_NAME $COMPOSE_FILES -f ${NODE_FILE} up --remove-orphans + docker-compose --project-name=$PROJECT_NAME $COMPOSE_FILES -f ${NODE_COMPOSE_FILE} up --remove-orphans break esac shift