From 99640d206eacfabb509d632753f706d023e59065 Mon Sep 17 00:00:00 2001 From: ssallam Date: Wed, 9 Sep 2020 18:25:24 +0200 Subject: [PATCH] add ocean-contracts compose file. --- compose-files/aquarius.yml | 4 ++++ compose-files/aquarius_elasticsearch.yml | 3 +++ compose-files/ocean_contracts.yml | 24 ++++++++++++++++++++++++ compose-files/provider.yml | 4 ++++ start_ocean.sh | 21 +++++++++++++++------ 5 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 compose-files/ocean_contracts.yml diff --git a/compose-files/aquarius.yml b/compose-files/aquarius.yml index 9338156..d472ec2 100644 --- a/compose-files/aquarius.yml +++ b/compose-files/aquarius.yml @@ -7,6 +7,8 @@ services: networks: backend: ipv4_address: 172.15.0.5 + depends_on: + - ocean-contracts environment: DB_MODULE: ${DB_MODULE} DB_HOSTNAME: ${DB_HOSTNAME} @@ -18,3 +20,5 @@ services: DB_CA_CERTS: ${DB_CA_CERTS} DB_CLIENT_KEY: ${DB_CLIENT_KEY} DB_CLIENT_CERT: ${DB_CLIENT_CERT} + volumes: + - ${OCEAN_ARTIFACTS_FOLDER}:/ocean-contracts/artifacts/ diff --git a/compose-files/aquarius_elasticsearch.yml b/compose-files/aquarius_elasticsearch.yml index c29fa11..db07371 100644 --- a/compose-files/aquarius_elasticsearch.yml +++ b/compose-files/aquarius_elasticsearch.yml @@ -19,6 +19,7 @@ services: ipv4_address: 172.15.0.5 depends_on: - elasticsearch + - ocean-contracts environment: DB_MODULE: ${DB_MODULE} DB_HOSTNAME: ${DB_HOSTNAME} @@ -36,3 +37,5 @@ services: EVENTS_RPC: "http://172.15.0.3:8545" EVENTS_ALLOW: "0" RUN_EVENTS_MONITOR: "1" + volumes: + - ${OCEAN_ARTIFACTS_FOLDER}:/ocean-contracts/artifacts/ diff --git a/compose-files/ocean_contracts.yml b/compose-files/ocean_contracts.yml new file mode 100644 index 0000000..f30bb6e --- /dev/null +++ b/compose-files/ocean_contracts.yml @@ -0,0 +1,24 @@ +version: '3' +services: + ocean-contracts: + image: oceanprotocol/ocean-contracts:$CONTRACTS_VERSION + networks: + backend: + ipv4_address: 172.15.0.14 + environment: + MNEMONIC: ${GANACHE_MNEMONIC} + OWNER_ROLE_ADDRESS: ${CONTRACTS_OWNER_ROLE_ADDRESS} + DEPLOY_CONTRACTS: ${CONTRACTS_DEPLOY_CONTRACTS} + LOCAL_CONTRACTS: ${CONTRACTS_DEPLOY_CONTRACTS} + REUSE_DATABASE: ${GANACHE_REUSE_DATABASE} + DATABASE_PATH: "/ganache-db" + NETWORK_NAME: ${CONTRACTS_NETWORK_NAME} + CONTRACTS_RPC_HOST: ${NETWORK_RPC_HOST} + CONTRACTS_RPC_PORT: ${NETWORK_RPC_PORT} + CONTRACTS_RPC_URL: ${NETWORK_RPC_URL} + LOCAL_USER_ID: ${LOCAL_USER_ID} + LOCAL_GROUP_ID: ${LOCAL_GROUP_ID} + depends_on: + - ganache + volumes: + - ${OCEAN_ARTIFACTS_FOLDER}:/ocean-contracts/artifacts/ diff --git a/compose-files/provider.yml b/compose-files/provider.yml index 1e8beb4..42da1d2 100644 --- a/compose-files/provider.yml +++ b/compose-files/provider.yml @@ -7,6 +7,8 @@ services: networks: backend: ipv4_address: 172.15.0.4 + depends_on: + - ocean-contracts environment: ARTIFACTS_PATH: ${OCEAN_ARTIFACTS_FOLDER:-/ocean-provider/artifacts} NETWORK_URL: ${NETWORK_RPC_URL} @@ -21,3 +23,5 @@ services: IPFS_GATEWAY: ${PROVIDER_IPFS_GATEWAY} OCEAN_PROVIDER_TIMEOUT: '9000' OPERATOR_SERVICE_URL: ${OPERATOR_SERVICE_URL} + volumes: + - ${OCEAN_ARTIFACTS_FOLDER}:/ocean-contracts/artifacts/ diff --git a/start_ocean.sh b/start_ocean.sh index 5941b5a..feb5a6c 100755 --- a/start_ocean.sh +++ b/start_ocean.sh @@ -33,6 +33,10 @@ export PROVIDER_VERSION=${PROVIDER_VERSION:-latest} export PROJECT_NAME="ocean" export FORCEPULL="false" +# Export User UID and GID +export LOCAL_USER_ID=$(id -u) +export LOCAL_GROUP_ID=$(id -g) + # Specify the ethereum default RPC container provider if [ ${IP} = "localhost" ]; then @@ -42,9 +46,16 @@ else fi export NETWORK_RPC_PORT="8545" export NETWORK_RPC_URL="http://"${NETWORK_RPC_HOST}:${NETWORK_RPC_PORT} -# Use this seed only on Spree! (Spree is the default.) +# Use this seed on ganache to always create the same wallets export GANACHE_MNEMONIC=${GANACHE_MNEMONIC:-"taxi music thumb unique chat sand crew more leg another off lamp"} +# Ocean contracts +export OCEAN_HOME="${HOME}/.ocean" +export CONTRACTS_OWNER_ROLE_ADDRESS="${CONTRACTS_OWNER_ROLE_ADDRESS}" +export CONTRACTS_DEPLOY_CONTRACTS="true" +export OCEAN_ARTIFACTS_FOLDER="${OCEAN_HOME}/ocean-contracts/artifacts" +# Specify which ethereum client to run or connect to: development +export CONTRACTS_NETWORK_NAME="ganache" # Default Aquarius parameters: use Elasticsearch export DB_MODULE="elasticsearch" @@ -81,11 +92,6 @@ fi export OPERATOR_SERVICE_URL=https://operator-api.operator.dev-ocean.com -# Export User UID and GID -export LOCAL_USER_ID=$(id -u) -export LOCAL_GROUP_ID=$(id -g) - - #add aquarius to /etc/hosts if [ ${IP} = "localhost" ]; then @@ -150,6 +156,8 @@ COMPOSE_FILES+=" -f ${COMPOSE_DIR}/dashboard.yml" COMPOSE_FILES+=" -f ${COMPOSE_DIR}/aquarius_elasticsearch.yml" COMPOSE_FILES+=" -f ${COMPOSE_DIR}/provider.yml" COMPOSE_FILES+=" -f ${COMPOSE_DIR}/ganache.yml" +COMPOSE_FILES+=" -f ${COMPOSE_DIR}/ocean_contracts.yml" + DOCKER_COMPOSE_EXTRA_OPTS="${DOCKER_COMPOSE_EXTRA_OPTS:-}" while :; do @@ -176,6 +184,7 @@ while :; do ;; --no-ganache) COMPOSE_FILES="${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/ganache.yml/}" + COMPOSE_FILES="${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/ocean_contracts.yml/}" printf $COLOR_Y'Starting without Ganache...\n\n'$COLOR_RESET ;; --no-aquarius)