From 1629f1449d7cb4389b478e56dea728efb91798ec Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Mon, 28 Jan 2019 11:36:00 +0100 Subject: [PATCH] Added acl contract addresses for nile and kovan --- compose-files/secret_store.yml | 4 +++- kovan_acl_contract_addresses.txt | 17 +++++++++++++++++ nile_acl_contract_addresses.txt | 17 +++++++++++++++++ start_ocean.sh | 24 +++++++++++++++++++----- 4 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 kovan_acl_contract_addresses.txt create mode 100644 nile_acl_contract_addresses.txt diff --git a/compose-files/secret_store.yml b/compose-files/secret_store.yml index ef21a12..095842d 100644 --- a/compose-files/secret_store.yml +++ b/compose-files/secret_store.yml @@ -5,6 +5,8 @@ services: entrypoint: /entrypoint.sh environment: CONFIGURE_ACL: "${CONFIGURE_ACL}" + ACL_CONTRACT_ADDRESS: "${ACL_CONTRACT_ADDRESS}" + NETWORK: "${KEEPER_NETWORK_NAME}" command: --config /etc/parity/secretstore/config.toml --jsonrpc-cors all @@ -52,4 +54,4 @@ services: - ../networks/secret-store/keys:/home/parity/.local/keys/DevelopmentChain:ro networks: backend: - ipv4_address: 172.15.0.18 \ No newline at end of file + ipv4_address: 172.15.0.18 diff --git a/kovan_acl_contract_addresses.txt b/kovan_acl_contract_addresses.txt new file mode 100644 index 0000000..78279f4 --- /dev/null +++ b/kovan_acl_contract_addresses.txt @@ -0,0 +1,17 @@ +Kovan +Version=address +v0.5.1=0x53CF7c49188C3d5c6e22d2d25619bA5e51367344 +v0.5.2=0x53CF7c49188C3d5c6e22d2d25619bA5e51367344 +v0.5.3=0xD82184412E6bbe2F737A35867ec6242A477ca440 +v0.6.0=0xD82184412E6bbe2F737A35867ec6242A477ca440 +v0.6.1=0xD82184412E6bbe2F737A35867ec6242A477ca440 +v0.6.2=0xD82184412E6bbe2F737A35867ec6242A477ca440 +v0.6.3=0xD82184412E6bbe2F737A35867ec6242A477ca440 +v0.6.4=0xD82184412E6bbe2F737A35867ec6242A477ca440 +v0.6.5=0xD82184412E6bbe2F737A35867ec6242A477ca440 +v0.6.6=0x294aabd9559b547069c48b45d14bb1ea8d81e440 +v0.6.7=0x294aabd9559b547069c48b45d14bb1ea8d81e440 +v0.6.8=0x294aabd9559b547069c48b45d14bb1ea8d81e440 +v0.6.9=0x294aabd9559b547069c48b45d14bb1ea8d81e440 +v0.6.10=0xa5a8c65a5db8f1d18ccbb4759692e4dbe1434974 +latest=0xa5a8c65a5db8f1d18ccbb4759692e4dbe1434974 diff --git a/nile_acl_contract_addresses.txt b/nile_acl_contract_addresses.txt new file mode 100644 index 0000000..572a1da --- /dev/null +++ b/nile_acl_contract_addresses.txt @@ -0,0 +1,17 @@ +Nile +Version=address +v0.5.1=0x38ba43fFa8C7715F0f2A5d52E78a392d2bD71176 +v0.5.2=0x31a64a1DCdD9e1b8db84ef94431a61C6B462Ad0c +v0.5.3=0x771136ebC55A1747B52722D1bb95323D98550293 +v0.6.0=0x771136ebC55A1747B52722D1bb95323D98550293 +v0.6.1=0x771136ebC55A1747B52722D1bb95323D98550293 +v0.6.2=0x771136ebC55A1747B52722D1bb95323D98550293 +v0.6.3=0x771136ebC55A1747B52722D1bb95323D98550293 +v0.6.4=0x771136ebC55A1747B52722D1bb95323D98550293 +v0.6.5=0x771136ebC55A1747B52722D1bb95323D98550293 +v0.6.6=0x416276914b5a6dd1b88bb0e35096200b08131113 +v0.6.7=0x416276914b5a6dd1b88bb0e35096200b08131113 +v0.6.8=0x416276914b5a6dd1b88bb0e35096200b08131113 +v0.6.9=0x416276914b5a6dd1b88bb0e35096200b08131113 +v0.6.10=0x6bd5fdc37b9c87ba73dda230e5dc18e9fda71ff9 +latest=0x6bd5fdc37b9c87ba73dda230e5dc18e9fda71ff9 diff --git a/start_ocean.sh b/start_ocean.sh index bae059c..fa6f1a2 100755 --- a/start_ocean.sh +++ b/start_ocean.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash + DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" export BRIZO_ENV_FILE="${DIR}/brizo.env" @@ -31,7 +32,8 @@ export KEEPER_RPC_URL="http://"${KEEPER_RPC_HOST}:${KEEPER_RPC_PORT} export KEEPER_MNEMONIC='' # Enable acl-contract validation in Secret-store -export CONFIGURE_ACL="false" +export CONFIGURE_ACL="true" +export ACL_CONTRACT_ADDRESS="" # Export User UID and GID export LOCAL_USER_ID=$(id -u) @@ -48,6 +50,14 @@ COLOR_C="\033[0;36m" # cyan # reset COLOR_RESET="\033[00m" +function get_acl_address { + local version="${1:-latest}" + line=$(grep "^${version}=" "${DIR}/${KEEPER_NETWORK_NAME}_acl_contract_addresses.txt") + address="$(line##*=)" + [ -z "${address}" ] && echo "Cannot determine the ACL Contract Address for ${KEEPER_NETWORK_NAME} version ${version}. Exiting" && exit 1 + echo "${address}" +} + function show_banner { local output=$(cat .banner) echo -e "$COLOR_B$output$COLOR_RESET" @@ -129,9 +139,9 @@ while :; do ################################################# # Secret-Store validation switch ################################################# - --acl-contract) - export CONFIGURE_ACL="true" - printf $COLOR_Y'Enabling acl validation in secret-store...\n\n'$COLOR_RESET + --no-acl-contract) + export CONFIGURE_ACL="false" + printf $COLOR_Y'Disabling acl validation in secret-store...\n\n'$COLOR_RESET ;; ################################################# # Node type switches @@ -140,6 +150,7 @@ while :; do --local-kovan-node) export NODE_COMPOSE_FILE="${COMPOSE_DIR}/nodes/kovan_node.yml" export KEEPER_NETWORK_NAME="kovan" + export ACL_CONTRACT_ADDRESS="$(get_acl_address ${KEEPER_VERSION})" printf $COLOR_Y'Starting with local Kovan node...\n\n'$COLOR_RESET ;; # spins up a new ganache blockchain @@ -149,12 +160,14 @@ while :; do export KEEPER_NETWORK_NAME="development" export KEEPER_DEPLOY_CONTRACTS="true" rm -f ${KEEPER_ARTIFACTS_FOLDER}/ready + rm -f ${KEEPER_ARTIFACTS_FOLDER}/*.development.json printf $COLOR_Y'Starting with local Ganache node...\n\n'$COLOR_RESET ;; # connects you to nile ocean testnet --local-nile-node) export NODE_COMPOSE_FILE="${COMPOSE_DIR}/nodes/nile_node.yml" export KEEPER_NETWORK_NAME="nile" + export ACL_CONTRACT_ADDRESS="$(get_acl_address ${KEEPER_VERSION})" printf $COLOR_Y'Starting with local Nile node...\n\n'$COLOR_RESET ;; # spins up spree local testnet @@ -165,7 +178,8 @@ while :; do export KEEPER_MNEMONIC="taxi music thumb unique chat sand crew more leg another off lamp" export KEEPER_NETWORK_NAME="spree" export KEEPER_DEPLOY_CONTRACTS="true" - #rm -f ${KEEPER_ARTIFACTS_FOLDER}/ready + rm -f ${KEEPER_ARTIFACTS_FOLDER}/ready + rm -f ${KEEPER_ARTIFACTS_FOLDER}/*.spree.json printf $COLOR_Y'Starting with local Spree node...\n\n'$COLOR_RESET ;; #################################################