From 91499da37b19496461a4c3622efe048c7e9f0e31 Mon Sep 17 00:00:00 2001 From: Sebastian Gerske Date: Wed, 5 Dec 2018 10:46:50 +0100 Subject: [PATCH 1/4] refactored to use different blockchain nodes underneath --- brizo.env | 8 +- compose-files/brizo.yml | 4 +- compose-files/keeper_contracts.yml | 14 ++-- compose-files/nodes/ganache_node.yml | 9 ++ compose-files/nodes/kovan_node.yml | 19 +++++ .../pond_node.yml} | 2 +- compose-files/pleuston.yml | 4 +- compose-files/secret_store.yml | 25 ++++-- parity/docker-compose.yml | 10 +-- start_ocean.sh | 83 ++++++++++++++----- 10 files changed, 128 insertions(+), 50 deletions(-) create mode 100644 compose-files/nodes/ganache_node.yml create mode 100644 compose-files/nodes/kovan_node.yml rename compose-files/{parity_client.yml => nodes/pond_node.yml} (98%) diff --git a/brizo.env b/brizo.env index 2f64e90..91a7b50 100755 --- a/brizo.env +++ b/brizo.env @@ -1,17 +1,13 @@ # Use this file to set the env vars required for Brizo. -KEEPER_URL=http://parity-node:8545 -LOCAL_CONTRACTS=true -KEEPER_NETWORK_NAME=ocean_poa_net_local - -SECRET_STORE_URL=http://secret-store:12001 -PARITY_URL=http://parity-node:8545 # Set a valid parity address and password to have seamless interaction with the `keeper` PARITY_ADDRESS=0x00bd138abd70e2f00903268f3db08f2d25677c9e PARITY_PASSWORD=node0 AQUARIUS_URL=http://aquarius:5000 BRIZO_URL=http://brizo:8030 +SECRET_STORE_URL=http://secret-store:12001 +RPC_URL=${KEEPER_URL} AZURE_ACCOUNT_NAME= AZURE_ACCOUNT_KEY= diff --git a/compose-files/brizo.yml b/compose-files/brizo.yml index 0c2fa4f..b6d5bdc 100644 --- a/compose-files/brizo.yml +++ b/compose-files/brizo.yml @@ -8,10 +8,10 @@ services: backend: ipv4_address: 172.15.0.17 depends_on: - - keeper-contracts + - blockchain-node env_file: - ${BRIZO_ENV_FILE} environment: - KEEPER_URL: http://${RPC_URL}:8545 + KEEPER_URL: http://${KEEPER_RPC_URL}:${KEEPER_RPC_PORT} volumes: - ${ARTIFACTS_FOLDER}:/usr/local/keeper-contracts/:ro diff --git a/compose-files/keeper_contracts.yml b/compose-files/keeper_contracts.yml index 0c4dd5b..1770eec 100644 --- a/compose-files/keeper_contracts.yml +++ b/compose-files/keeper_contracts.yml @@ -2,18 +2,16 @@ version: '2.1' services: keeper-contracts: image: oceanprotocol/keeper-contracts:${OCEAN_VERSION:-stable} - ports: - - "${KEEPER_PORT}:8545" networks: backend: ipv4_address: 172.15.0.14 environment: - LOCAL_CONTRACTS: "true" + LOCAL_CONTRACTS: "false" DEPLOY_CONTRACTS: ${DEPLOY_CONTRACTS} - DATABASE_PATH: "/ganache-db" - REUSE_DATABASE: ${REUSE_DATABASE} + REUSE_DATABASE: "false" NETWORK_NAME: ${KEEPER_NETWORK_NAME} - POA_HOST: "parity-node" + POA_HOST: ${KEEPER_RPC_URL} + depends_on: + - blockchain-node volumes: - - ${ARTIFACTS_FOLDER}:/keeper-contracts/artifacts/ - - ${GANACHE_DATABASE_PATH}/ganache-db:/ganache-db + - ${KEEPER_ARTIFACTS_FOLDER}:/keeper-contracts/artifacts/ diff --git a/compose-files/nodes/ganache_node.yml b/compose-files/nodes/ganache_node.yml new file mode 100644 index 0000000..520d9b1 --- /dev/null +++ b/compose-files/nodes/ganache_node.yml @@ -0,0 +1,9 @@ +version: '2.1' +services: + blockchain-node: + image: trufflesuite/ganache-cli:latest + ports: + - 8545:8545 + networks: + backend: + ipv4_address: 172.15.0.12 diff --git a/compose-files/nodes/kovan_node.yml b/compose-files/nodes/kovan_node.yml new file mode 100644 index 0000000..7bc2654 --- /dev/null +++ b/compose-files/nodes/kovan_node.yml @@ -0,0 +1,19 @@ +version: '2.1' +services: + blockchain-node: + image: oceanprotocol/parity-ethereum:beta + entrypoint: /opt/parity/parity + command: + --chain kovan + --light + --ws-interface all + --jsonrpc-cors all + --jsonrpc-interface all + --jsonrpc-hosts all + --jsonrpc-apis all + --unsafe-expose + ports: + - 8545:8545 + networks: + backend: + ipv4_address: 172.15.0.12 diff --git a/compose-files/parity_client.yml b/compose-files/nodes/pond_node.yml similarity index 98% rename from compose-files/parity_client.yml rename to compose-files/nodes/pond_node.yml index 1b8fe97..eef98a9 100644 --- a/compose-files/parity_client.yml +++ b/compose-files/nodes/pond_node.yml @@ -1,6 +1,6 @@ version: '2.1' services: - parity-node: + blockchain-node: image: oceanprotocol/parity-ethereum:beta entrypoint: /opt/parity/parity command: diff --git a/compose-files/pleuston.yml b/compose-files/pleuston.yml index 095062d..4f8464e 100644 --- a/compose-files/pleuston.yml +++ b/compose-files/pleuston.yml @@ -4,7 +4,7 @@ services: image: oceanprotocol/pleuston:${OCEAN_VERSION:-stable} networks: backend: - ipv4_address: 172.15.0.18 + ipv4_address: 172.15.0.19 ports: - 3000:3000 depends_on: @@ -14,6 +14,6 @@ services: # Need browser to connect to exposed ports KEEPER_HOST: localhost AQUARIUS_HOST: localhost - LOCAL_CONTRACTS: 'true' + LOCAL_CONTRACTS: ${DEPLOY_CONTRACTS} volumes: - ${ARTIFACTS_FOLDER}:/pleuston/node_modules/@oceanprotocol/keeper-contracts/artifacts/:ro diff --git a/compose-files/secret_store.yml b/compose-files/secret_store.yml index 748d7db..0a37766 100644 --- a/compose-files/secret_store.yml +++ b/compose-files/secret_store.yml @@ -7,12 +7,12 @@ services: command: --config /etc/parity/secretstore/config.toml --jsonrpc-cors all --jsonrpc-interface all --jsonrpc-hosts all --jsonrpc-apis all volumes: - - ../parity/secret_store/config/:/etc/parity/secretstore/ - - secret-store:/parity_data/ - - ../parity/secret_store/keys/:/parity_data/keys/ocean-network/ + - ../parity/secret_store/config/:/etc/parity/secretstore/ + - secret-store:/parity_data/ + - ../parity/secret_store/keys/:/parity_data/keys/ocean-network/ ports: - - 12000:12000 - - 12001 + - 12000:12000 + - 12001 networks: backend: ipv4_address: 172.15.0.13 @@ -29,3 +29,18 @@ services: backend: ipv4_address: 172.15.0.16 command: nginx -g 'daemon off;' + + secret-store-signing-node: + image: oceanprotocol/parity-ethereum:master + entrypoint: /opt/parity/parity + command: + --chain dev + --light + --jsonrpc-interface all + --jsonrpc-apis secretstore + --jsonrpc-cors all + ports: + - 9545:8545 + networks: + backend: + ipv4_address: 172.15.0.18 \ No newline at end of file diff --git a/parity/docker-compose.yml b/parity/docker-compose.yml index 1c658cc..9e6f2b8 100644 --- a/parity/docker-compose.yml +++ b/parity/docker-compose.yml @@ -14,8 +14,8 @@ services: volumes: - ./parity/config:/parity/config:ro - validator0:/root/.local/share/io.parity.ethereum/ - - ./parity/authorities/validator0.json:/root/.local/share/io.parity.ethereum/keys/${NETWORK_NAME}/validator.json:ro - - ./parity/keys:/root/.local/share/io.parity.ethereum/keys/${NETWORK_NAME} + - ./parity/authorities/validator0.json:/root/.local/share/io.parity.ethereum/keys/${KEEPER_NETWORK_NAME}/validator.json:ro + - ./parity/keys:/root/.local/share/io.parity.ethereum/keys/${KEEPER_NETWORK_NAME} - ./parity/authorities/validator0.pwd:/parity/validator.pwd:ro - ./parity/node0.network.key:/root/.local/share/io.parity.ethereum/network/key:ro ports: @@ -32,7 +32,7 @@ services: volumes: - ./parity/config:/parity/config:ro - validator1:/root/.local/share/io.parity.ethereum/ - - ./parity/authorities/validator1.json:/root/.local/share/io.parity.ethereum/keys/${NETWORK_NAME}/validator.json:ro + - ./parity/authorities/validator1.json:/root/.local/share/io.parity.ethereum/keys/${KEEPER_NETWORK_NAME}/validator.json:ro - ./parity/authorities/validator1.pwd:/parity/validator.pwd:ro - ./parity/node1.network.key:/root/.local/share/io.parity.ethereum/network/key:ro networks: @@ -47,7 +47,7 @@ services: volumes: - ./parity/config:/parity/config:ro - validator2:/root/.local/share/io.parity.ethereum/ - - ./parity/authorities/validator2.json:/root/.local/share/io.parity.ethereum/keys/${NETWORK_NAME}/validator.json:ro + - ./parity/authorities/validator2.json:/root/.local/share/io.parity.ethereum/keys/${KEEPER_NETWORK_NAME}/validator.json:ro - ./parity/authorities/validator2.pwd:/parity/validator.pwd:ro - ./parity/node2.network.key:/root/.local/share/io.parity.ethereum/network/key:ro networks: @@ -64,7 +64,7 @@ services: --unsafe-expose volumes: - ./parity/config:/parity/config:ro - - ./parity/keys:/root/.local/share/io.parity.ethereum/keys/${NETWORK_NAME} + - ./parity/keys:/root/.local/share/io.parity.ethereum/keys/${KEEPER_NETWORK_NAME} ports: - 8180:8180 - 8546:8546 diff --git a/start_ocean.sh b/start_ocean.sh index 8220dfd..fa16ab0 100755 --- a/start_ocean.sh +++ b/start_ocean.sh @@ -2,19 +2,25 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" COMPOSE_DIR="${DIR}/compose-files" -# Must be set to true for the first run, change it to "false" to avoid migrating the smart contracts on each run. -export DEPLOY_CONTRACTS="true" + +export PROJECT_NAME="ocean" + +# 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, or ocean_poa_net_local +export KEEPER_NETWORK_NAME="development" + # Ganache specific option, these two options have no effect when not running ganache-cli export GANACHE_DATABASE_PATH="${DIR}" -export REUSE_DATABASE="false" -# Specify which ethereum client to run or connect to: kovan, ganache, or ocean_poa_net_local -export KEEPER_NETWORK_NAME="ganache" -export ARTIFACTS_FOLDER=$HOME/.ocean/keeper-contracts/artifacts +export GANACHE_REUSE_DATABASE="false" + export BRIZO_ENV_FILE=$DIR/brizo.env -export PROJECT_NAME="ocean" + # Specify the ethereum default RPC container provider -export RPC_URL='keeper-contracts' -export KEEPER_PORT='8545' +export KEEPER_RPC_URL='blockchain-node' +export KEEPER_RPC_PORT='8545' +export KEEPER_URL="http://"${KEEPER_RPC_URL}:${KEEPER_RPC_PORT} # colors @@ -42,33 +48,68 @@ export OCEAN_VERSION=latest COMPOSE_FILES="" COMPOSE_FILES+=" -f ${COMPOSE_DIR}/network_volumes.yml" COMPOSE_FILES+=" -f ${COMPOSE_DIR}/mongo.yml" -COMPOSE_FILES+=" -f ${COMPOSE_DIR}/keeper_contracts.yml" COMPOSE_FILES+=" -f ${COMPOSE_DIR}/pleuston.yml" COMPOSE_FILES+=" -f ${COMPOSE_DIR}/aquarius.yml" COMPOSE_FILES+=" -f ${COMPOSE_DIR}/brizo.yml" +COMPOSE_FILES+=" -f ${COMPOSE_DIR}/secret_store.yml" while :; do case $1 in + ################################################# + # Version switches + ################################################# --latest) export OCEAN_VERSION=latest printf $COLOR_Y'Switched to latest components...\n\n'$COLOR_RESET ;; - --reuse-database) - export REUSE_DATABASE="true" - printf $COLOR_Y'Starting and reusing the database ...\n\n'$COLOR_RESET - ;; + ################################################# + # Exclude switches + ################################################# --no-pleuston) COMPOSE_FILES=${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/pleuston.yml/} printf $COLOR_Y'Starting without Pleuston...\n\n'$COLOR_RESET ;; - --local-parity-node) - COMPOSE_FILES+=" -f ${COMPOSE_DIR}/parity_client.yml" - COMPOSE_FILES+=" -f ${COMPOSE_DIR}/secret_store.yml" - export RPC_URL='parity-node' - export KEEPER_NETWORK_NAME="ocean_poa_net_local" - export KEEPER_PORT='8546' - printf $COLOR_Y'Starting with local Parity node...\n\n'$COLOR_RESET + ################################################# + # Contract/Storage switches + ################################################# + --reuse-ganache-database) + export GANACHE_REUSE_DATABASE="true" + printf $COLOR_Y'Starting and reusing the database ...\n\n'$COLOR_RESET ;; + ################################################# + # Node type switches + ################################################# + # connect you to kovan + --local-kovan-node) + COMPOSE_FILES+=" -f ${COMPOSE_DIR}/nodes/kovan_node.yml" + export KEEPER_NETWORK_NAME="kovan" + printf $COLOR_Y'Starting with local Kovan node...\n\n'$COLOR_RESET + ;; + # connects to ocean testnet + --local-lake-node) + COMPOSE_FILES+=" -f ${COMPOSE_DIR}/nodes/lake_node.yml" + export KEEPER_NETWORK_NAME="ocean_poa_aws" + printf $COLOR_Y'Starting with local Pond node...\n\n'$COLOR_RESET + ;; + # spins up a new ganache blockchain + --local-ganache-node) + COMPOSE_FILES+=" -f ${COMPOSE_DIR}/keeper_contracts.yml" + COMPOSE_FILES+=" -f ${COMPOSE_DIR}/nodes/ganache_node.yml" + export KEEPER_NETWORK_NAME="development" + export KEEPER_DEPLOY_CONTRACTS="true" + printf $COLOR_Y'Starting with local Ganache node...\n\n'$COLOR_RESET + ;; + # spins up pond local testnet + --local-pond-node) + COMPOSE_FILES+=" -f ${COMPOSE_DIR}/keeper_contracts.yml" + COMPOSE_FILES+=" -f ${COMPOSE_DIR}/nodes/pond_node.yml" + export KEEPER_NETWORK_NAME="ocean_poa_net_local" + export KEEPER_DEPLOY_CONTRACTS="true" + printf $COLOR_Y'Starting with local Pond node...\n\n'$COLOR_RESET + ;; + ################################################# + # Cleaning switches + ################################################# --purge) docker network rm $PROJECT_NAME_backend || true docker network rm $PROJECT_NAME_default || true From 1695301c2631dc91114257bfe190a354779a84fe Mon Sep 17 00:00:00 2001 From: Sebastian Gerske Date: Wed, 5 Dec 2018 10:56:31 +0100 Subject: [PATCH 2/4] made node exclusive --- compose-files/{mongo.yml => mongodb.yml} | 0 start_ocean.sh | 15 ++++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) rename compose-files/{mongo.yml => mongodb.yml} (100%) diff --git a/compose-files/mongo.yml b/compose-files/mongodb.yml similarity index 100% rename from compose-files/mongo.yml rename to compose-files/mongodb.yml diff --git a/start_ocean.sh b/start_ocean.sh index fa16ab0..4723971 100755 --- a/start_ocean.sh +++ b/start_ocean.sh @@ -6,7 +6,7 @@ COMPOSE_DIR="${DIR}/compose-files" export PROJECT_NAME="ocean" # keeper options -export KEEPER_DEPLOY_CONTRACTS="false" +export KEEPER_DEPLOY_CONTRACTS="true" export KEEPER_ARTIFACTS_FOLDER=$HOME/.ocean/keeper-contracts/artifacts # Specify which ethereum client to run or connect to: development, kovan, or ocean_poa_net_local export KEEPER_NETWORK_NAME="development" @@ -44,10 +44,11 @@ show_banner # default to latest versions export OCEAN_VERSION=latest +export NODE_FILE=${COMPOSE_DIR}/nodes/pond_node.yml COMPOSE_FILES="" COMPOSE_FILES+=" -f ${COMPOSE_DIR}/network_volumes.yml" -COMPOSE_FILES+=" -f ${COMPOSE_DIR}/mongo.yml" +COMPOSE_FILES+=" -f ${COMPOSE_DIR}/mongodb.yml" COMPOSE_FILES+=" -f ${COMPOSE_DIR}/pleuston.yml" COMPOSE_FILES+=" -f ${COMPOSE_DIR}/aquarius.yml" COMPOSE_FILES+=" -f ${COMPOSE_DIR}/brizo.yml" @@ -81,20 +82,20 @@ while :; do ################################################# # connect you to kovan --local-kovan-node) - COMPOSE_FILES+=" -f ${COMPOSE_DIR}/nodes/kovan_node.yml" + export NODE_FILE=${COMPOSE_DIR}/nodes/kovan_node.yml export KEEPER_NETWORK_NAME="kovan" printf $COLOR_Y'Starting with local Kovan node...\n\n'$COLOR_RESET ;; # connects to ocean testnet --local-lake-node) - COMPOSE_FILES+=" -f ${COMPOSE_DIR}/nodes/lake_node.yml" + export NODE_FILE=${COMPOSE_DIR}/nodes/lake_node.yml export KEEPER_NETWORK_NAME="ocean_poa_aws" printf $COLOR_Y'Starting with local Pond node...\n\n'$COLOR_RESET ;; # spins up a new ganache blockchain --local-ganache-node) COMPOSE_FILES+=" -f ${COMPOSE_DIR}/keeper_contracts.yml" - COMPOSE_FILES+=" -f ${COMPOSE_DIR}/nodes/ganache_node.yml" + export NODE_FILE=${COMPOSE_DIR}/nodes/ganache_node.yml export KEEPER_NETWORK_NAME="development" export KEEPER_DEPLOY_CONTRACTS="true" printf $COLOR_Y'Starting with local Ganache node...\n\n'$COLOR_RESET @@ -102,7 +103,7 @@ while :; do # spins up pond local testnet --local-pond-node) COMPOSE_FILES+=" -f ${COMPOSE_DIR}/keeper_contracts.yml" - COMPOSE_FILES+=" -f ${COMPOSE_DIR}/nodes/pond_node.yml" + export NODE_FILE=${COMPOSE_DIR}/nodes/pond_node.yml export KEEPER_NETWORK_NAME="ocean_poa_net_local" export KEEPER_DEPLOY_CONTRACTS="true" printf $COLOR_Y'Starting with local Pond node...\n\n'$COLOR_RESET @@ -132,7 +133,7 @@ while :; do ;; *) printf $COLOR_Y'Starting Ocean...\n\n'$COLOR_RESET - docker-compose --project-name=$PROJECT_NAME $COMPOSE_FILES up + docker-compose --project-name=$PROJECT_NAME $COMPOSE_FILES -f ${NODE_FILE} up break esac shift From dbdd0c355f25455d259739972394c99d370c7ac3 Mon Sep 17 00:00:00 2001 From: Sebastian Gerske Date: Wed, 5 Dec 2018 12:16:18 +0100 Subject: [PATCH 3/4] fix brizo env --- .env | 14 ++++++++------ brizo.env | 2 +- compose-files/brizo.yml | 4 ++-- compose-files/keeper_contracts.yml | 10 ++++++---- compose-files/pleuston.yml | 4 ++-- start_ocean.sh | 17 ++++++++--------- 6 files changed, 27 insertions(+), 24 deletions(-) diff --git a/.env b/.env index 8fa94d0..faa6ee2 100644 --- a/.env +++ b/.env @@ -1,11 +1,13 @@ # Must be set to true for the first run, change it to "false" to avoid migrating the smart contracts on each run. -DEPLOY_CONTRACTS=true +KEEPER_DEPLOY_CONTRACTS=true + +# Specify which ethereum client to run or connect to: kovan, ganache, or ocean_poa_net_local +KEEPER_NETWORK_NAME=development +KEEPER_ARTIFACTS_FOLDER=~/.ocean/keeper-contracts/artifacts + # Ganache specific option, these two options have no effect when not running ganache-cli GANACHE_DATABASE_PATH=. -REUSE_DATABASE=false -# Specify which ethereum client to run or connect to: kovan, ganache, or ocean_poa_net_local -KEEPER_NETWORK_NAME=ganache -ARTIFACTS_FOLDER=~/.ocean/keeper-contracts/artifacts +GANACHE_REUSE_DATABASE=false + # Specify which ocean version use: stable, latests, ... OCEAN_VERSION=stable -COMPOSE_FILE=docker-compose.yml diff --git a/brizo.env b/brizo.env index 91a7b50..e4106ff 100755 --- a/brizo.env +++ b/brizo.env @@ -7,7 +7,7 @@ PARITY_PASSWORD=node0 AQUARIUS_URL=http://aquarius:5000 BRIZO_URL=http://brizo:8030 SECRET_STORE_URL=http://secret-store:12001 -RPC_URL=${KEEPER_URL} +RPC_URL=http://blockchain-node:8545 AZURE_ACCOUNT_NAME= AZURE_ACCOUNT_KEY= diff --git a/compose-files/brizo.yml b/compose-files/brizo.yml index b6d5bdc..70c3e14 100644 --- a/compose-files/brizo.yml +++ b/compose-files/brizo.yml @@ -12,6 +12,6 @@ services: env_file: - ${BRIZO_ENV_FILE} environment: - KEEPER_URL: http://${KEEPER_RPC_URL}:${KEEPER_RPC_PORT} + KEEPER_URL: ${KEEPER_RPC_URL} volumes: - - ${ARTIFACTS_FOLDER}:/usr/local/keeper-contracts/:ro + - ${KEEPER_ARTIFACTS_FOLDER}:/usr/local/keeper-contracts/:ro diff --git a/compose-files/keeper_contracts.yml b/compose-files/keeper_contracts.yml index 1770eec..d2402f0 100644 --- a/compose-files/keeper_contracts.yml +++ b/compose-files/keeper_contracts.yml @@ -6,11 +6,13 @@ services: backend: ipv4_address: 172.15.0.14 environment: - LOCAL_CONTRACTS: "false" - DEPLOY_CONTRACTS: ${DEPLOY_CONTRACTS} - REUSE_DATABASE: "false" + DEPLOY_CONTRACTS: ${KEEPER_DEPLOY_CONTRACTS} + REUSE_DATABASE: ${GANACHE_REUSE_DATABASE} + DATABASE_PATH: "/ganache-db" NETWORK_NAME: ${KEEPER_NETWORK_NAME} - POA_HOST: ${KEEPER_RPC_URL} + KEEPER_RPC_HOST: ${KEEPER_RPC_HOST} + KEEPER_RPC_PORT: ${KEEPER_RPC_PORT} + KEEPER_RPC_URL: ${KEEPER_RPC_URL} depends_on: - blockchain-node volumes: diff --git a/compose-files/pleuston.yml b/compose-files/pleuston.yml index 4f8464e..41145c2 100644 --- a/compose-files/pleuston.yml +++ b/compose-files/pleuston.yml @@ -14,6 +14,6 @@ services: # Need browser to connect to exposed ports KEEPER_HOST: localhost AQUARIUS_HOST: localhost - LOCAL_CONTRACTS: ${DEPLOY_CONTRACTS} + LOCAL_CONTRACTS: ${KEEPER_DEPLOY_CONTRACTS} volumes: - - ${ARTIFACTS_FOLDER}:/pleuston/node_modules/@oceanprotocol/keeper-contracts/artifacts/:ro + - ${KEEPER_ARTIFACTS_FOLDER}:/pleuston/node_modules/@oceanprotocol/keeper-contracts/artifacts/:ro diff --git a/start_ocean.sh b/start_ocean.sh index 4723971..7e74e6c 100755 --- a/start_ocean.sh +++ b/start_ocean.sh @@ -18,10 +18,9 @@ export GANACHE_REUSE_DATABASE="false" export BRIZO_ENV_FILE=$DIR/brizo.env # Specify the ethereum default RPC container provider -export KEEPER_RPC_URL='blockchain-node' +export KEEPER_RPC_HOST='blockchain-node' export KEEPER_RPC_PORT='8545' -export KEEPER_URL="http://"${KEEPER_RPC_URL}:${KEEPER_RPC_PORT} - +export KEEPER_RPC_URL="http://"${KEEPER_RPC_HOST}:${KEEPER_RPC_PORT} # colors COLOR_R="\033[0;31m" # red @@ -112,15 +111,15 @@ while :; do # Cleaning switches ################################################# --purge) - docker network rm $PROJECT_NAME_backend || true - docker network rm $PROJECT_NAME_default || true - docker volume rm $PROJECT_NAME_parity-node || true - docker volume rm $PROJECT_NAME_secret-store || true - read -p "Are you sure you want to delete $ARTIFACTS_FOLDER? " -n 1 -r + docker network rm ${PROJECT_NAME}_backend || true + docker network rm ${PROJECT_NAME}_default || true + docker volume rm ${PROJECT_NAME}_parity-node || true + docker volume rm ${PROJECT_NAME}_secret-store || true + read -p "Are you sure you want to delete $KEEPER_ARTIFACTS_FOLDER? " -n 1 -r echo if [[ $REPLY =~ ^[Yy]$ ]] then - rm -rf $ARTIFACTS_FOLDER + rm -rf ${KEEPER_ARTIFACTS_FOLDER} fi ;; --) # End of all options. From e10d515d8f7d0fcb30c741423e7e317fad39ba3b Mon Sep 17 00:00:00 2001 From: Sebastian Gerske Date: Wed, 5 Dec 2018 14:03:41 +0100 Subject: [PATCH 4/4] refactor more --- brizo.env | 3 +-- compose-files/aquarius.yml | 7 +++++++ compose-files/brizo.yml | 2 +- compose-files/keeper_contracts.yml | 2 +- compose-files/mongodb.yml | 8 -------- compose-files/network_volumes.yml | 2 +- compose-files/nodes/ganache_node.yml | 2 +- compose-files/nodes/kovan_node.yml | 2 +- compose-files/nodes/pond_node.yml | 4 ++-- compose-files/pleuston.yml | 1 + compose-files/secret_store.yml | 3 +++ start_ocean.sh | 21 ++++++++++----------- 12 files changed, 29 insertions(+), 28 deletions(-) delete mode 100644 compose-files/mongodb.yml diff --git a/brizo.env b/brizo.env index e4106ff..bb3d2f9 100755 --- a/brizo.env +++ b/brizo.env @@ -5,9 +5,8 @@ PARITY_ADDRESS=0x00bd138abd70e2f00903268f3db08f2d25677c9e PARITY_PASSWORD=node0 AQUARIUS_URL=http://aquarius:5000 -BRIZO_URL=http://brizo:8030 SECRET_STORE_URL=http://secret-store:12001 -RPC_URL=http://blockchain-node:8545 +RPC_URL=http://keeper-node:8545 AZURE_ACCOUNT_NAME= AZURE_ACCOUNT_KEY= diff --git a/compose-files/aquarius.yml b/compose-files/aquarius.yml index 6daeb4c..f0aab6f 100644 --- a/compose-files/aquarius.yml +++ b/compose-files/aquarius.yml @@ -11,3 +11,10 @@ services: - mongodb environment: DB_HOSTNAME: mongodb + + mongodb: + image: mongo:3.6 + command: mongod + networks: + backend: + ipv4_address: 172.15.0.11 diff --git a/compose-files/brizo.yml b/compose-files/brizo.yml index 70c3e14..06fa6a6 100644 --- a/compose-files/brizo.yml +++ b/compose-files/brizo.yml @@ -8,7 +8,7 @@ services: backend: ipv4_address: 172.15.0.17 depends_on: - - blockchain-node + - keeper-node env_file: - ${BRIZO_ENV_FILE} environment: diff --git a/compose-files/keeper_contracts.yml b/compose-files/keeper_contracts.yml index d2402f0..5462e5c 100644 --- a/compose-files/keeper_contracts.yml +++ b/compose-files/keeper_contracts.yml @@ -14,6 +14,6 @@ services: KEEPER_RPC_PORT: ${KEEPER_RPC_PORT} KEEPER_RPC_URL: ${KEEPER_RPC_URL} depends_on: - - blockchain-node + - keeper-node volumes: - ${KEEPER_ARTIFACTS_FOLDER}:/keeper-contracts/artifacts/ diff --git a/compose-files/mongodb.yml b/compose-files/mongodb.yml deleted file mode 100644 index 0a5751a..0000000 --- a/compose-files/mongodb.yml +++ /dev/null @@ -1,8 +0,0 @@ -version: '2.1' -services: - mongodb: - image: mongo:3.6 - command: mongod - networks: - backend: - ipv4_address: 172.15.0.11 diff --git a/compose-files/network_volumes.yml b/compose-files/network_volumes.yml index c83814b..14bf031 100644 --- a/compose-files/network_volumes.yml +++ b/compose-files/network_volumes.yml @@ -10,5 +10,5 @@ networks: gateway: 172.15.0.1 volumes: - parity-node: + keeper-node: secret-store: diff --git a/compose-files/nodes/ganache_node.yml b/compose-files/nodes/ganache_node.yml index 520d9b1..23404be 100644 --- a/compose-files/nodes/ganache_node.yml +++ b/compose-files/nodes/ganache_node.yml @@ -1,6 +1,6 @@ version: '2.1' services: - blockchain-node: + keeper-node: image: trufflesuite/ganache-cli:latest ports: - 8545:8545 diff --git a/compose-files/nodes/kovan_node.yml b/compose-files/nodes/kovan_node.yml index 7bc2654..eb4c8dc 100644 --- a/compose-files/nodes/kovan_node.yml +++ b/compose-files/nodes/kovan_node.yml @@ -1,6 +1,6 @@ version: '2.1' services: - blockchain-node: + keeper-node: image: oceanprotocol/parity-ethereum:beta entrypoint: /opt/parity/parity command: diff --git a/compose-files/nodes/pond_node.yml b/compose-files/nodes/pond_node.yml index eef98a9..0d74921 100644 --- a/compose-files/nodes/pond_node.yml +++ b/compose-files/nodes/pond_node.yml @@ -1,6 +1,6 @@ version: '2.1' services: - blockchain-node: + keeper-node: image: oceanprotocol/parity-ethereum:beta entrypoint: /opt/parity/parity command: @@ -18,7 +18,7 @@ services: --unlock 0x00bd138abd70e2f00903268f3db08f2d25677c9e volumes: - ../parity/parity/config:/home/parity/parity/config - - parity-node:/home/parity/.local/share/io.parity.ethereum/ + - keeper-node:/home/parity/.local/share/io.parity.ethereum/ - ../parity/parity/authorities/validator0.json:/home/parity/.local/share/io.parity.ethereum/keys/ocean-network/validator.json - ../parity/parity/keys:/home/parity/.local/share/io.parity.ethereum/keys/ocean-network - ../parity/parity/authorities/validator0.pwd:/home/parity/parity/validator.pwd diff --git a/compose-files/pleuston.yml b/compose-files/pleuston.yml index 41145c2..e56bb07 100644 --- a/compose-files/pleuston.yml +++ b/compose-files/pleuston.yml @@ -8,6 +8,7 @@ services: ports: - 3000:3000 depends_on: + - keeper-node - aquarius - brizo environment: diff --git a/compose-files/secret_store.yml b/compose-files/secret_store.yml index 0a37766..68233fa 100644 --- a/compose-files/secret_store.yml +++ b/compose-files/secret_store.yml @@ -39,8 +39,11 @@ services: --jsonrpc-interface all --jsonrpc-apis secretstore --jsonrpc-cors all + --keys-path /home/parity/.local/keys ports: - 9545:8545 + volumes: + - ../parity/parity/keys:/home/parity/.local/keys/DevelopmentChain:ro networks: backend: ipv4_address: 172.15.0.18 \ No newline at end of file diff --git a/start_ocean.sh b/start_ocean.sh index 7e74e6c..76af9a2 100755 --- a/start_ocean.sh +++ b/start_ocean.sh @@ -9,7 +9,7 @@ export PROJECT_NAME="ocean" export KEEPER_DEPLOY_CONTRACTS="true" export KEEPER_ARTIFACTS_FOLDER=$HOME/.ocean/keeper-contracts/artifacts # Specify which ethereum client to run or connect to: development, kovan, or ocean_poa_net_local -export KEEPER_NETWORK_NAME="development" +export KEEPER_NETWORK_NAME="ocean_poa_net_local" # Ganache specific option, these two options have no effect when not running ganache-cli export GANACHE_DATABASE_PATH="${DIR}" @@ -18,7 +18,7 @@ export GANACHE_REUSE_DATABASE="false" export BRIZO_ENV_FILE=$DIR/brizo.env # Specify the ethereum default RPC container provider -export KEEPER_RPC_HOST='blockchain-node' +export KEEPER_RPC_HOST='keeper-node' export KEEPER_RPC_PORT='8545' export KEEPER_RPC_URL="http://"${KEEPER_RPC_HOST}:${KEEPER_RPC_PORT} @@ -47,7 +47,6 @@ export NODE_FILE=${COMPOSE_DIR}/nodes/pond_node.yml COMPOSE_FILES="" COMPOSE_FILES+=" -f ${COMPOSE_DIR}/network_volumes.yml" -COMPOSE_FILES+=" -f ${COMPOSE_DIR}/mongodb.yml" COMPOSE_FILES+=" -f ${COMPOSE_DIR}/pleuston.yml" COMPOSE_FILES+=" -f ${COMPOSE_DIR}/aquarius.yml" COMPOSE_FILES+=" -f ${COMPOSE_DIR}/brizo.yml" @@ -79,18 +78,12 @@ while :; do ################################################# # Node type switches ################################################# - # connect you to kovan + # connects you to kovan --local-kovan-node) export NODE_FILE=${COMPOSE_DIR}/nodes/kovan_node.yml export KEEPER_NETWORK_NAME="kovan" printf $COLOR_Y'Starting with local Kovan node...\n\n'$COLOR_RESET ;; - # connects to ocean testnet - --local-lake-node) - export NODE_FILE=${COMPOSE_DIR}/nodes/lake_node.yml - export KEEPER_NETWORK_NAME="ocean_poa_aws" - printf $COLOR_Y'Starting with local Pond node...\n\n'$COLOR_RESET - ;; # spins up a new ganache blockchain --local-ganache-node) COMPOSE_FILES+=" -f ${COMPOSE_DIR}/keeper_contracts.yml" @@ -99,6 +92,12 @@ while :; do export KEEPER_DEPLOY_CONTRACTS="true" printf $COLOR_Y'Starting with local Ganache node...\n\n'$COLOR_RESET ;; + # connects you to ocean testnet + --local-lake-node) + export NODE_FILE=${COMPOSE_DIR}/nodes/lake_node.yml + export KEEPER_NETWORK_NAME="ocean_poa_aws" + printf $COLOR_Y'Starting with local Lake node...\n\n'$COLOR_RESET + ;; # spins up pond local testnet --local-pond-node) COMPOSE_FILES+=" -f ${COMPOSE_DIR}/keeper_contracts.yml" @@ -113,7 +112,7 @@ while :; do --purge) docker network rm ${PROJECT_NAME}_backend || true docker network rm ${PROJECT_NAME}_default || true - docker volume rm ${PROJECT_NAME}_parity-node || true + docker volume rm ${PROJECT_NAME}_keeper-node || true docker volume rm ${PROJECT_NAME}_secret-store || true read -p "Are you sure you want to delete $KEEPER_ARTIFACTS_FOLDER? " -n 1 -r echo