From 17849a811e869c29c1490f5eecf5e5795111896e Mon Sep 17 00:00:00 2001 From: Curtis Faith Date: Sat, 9 Dec 2017 17:45:25 -0500 Subject: [PATCH] Removed warnings in Smart Contracts --- agent/sn_agent/network/ethereum/core | 2 +- tools.sh | 90 +++++++++++++++++----------- 2 files changed, 56 insertions(+), 36 deletions(-) diff --git a/agent/sn_agent/network/ethereum/core b/agent/sn_agent/network/ethereum/core index d4e6a93..acf47b1 160000 --- a/agent/sn_agent/network/ethereum/core +++ b/agent/sn_agent/network/ethereum/core @@ -1 +1 @@ -Subproject commit d4e6a93dd4f2a6b164c8e1bb6be18712bf73c375 +Subproject commit acf47b1dcbad4b3a33be6b5f38a87fd72ae9979e diff --git a/tools.sh b/tools.sh index f78a957..6ed8098 100755 --- a/tools.sh +++ b/tools.sh @@ -10,19 +10,9 @@ export SN_NETWORK_ACCOUNT_PASSWORD case "$1" in -init) - #https://www.vaultproject.io/intro/getting-started/deploy.html#initializing-the-vault+ - ;; - -demo) - docker-compose -f docker/docker-compose.demo.yml create --build --force-recreate demo - docker-compose -f docker/docker-compose.demo.yml run --service-ports demo ./agent.sh run - ;; - -demo-down) - docker-compose -f docker/docker-compose.demo.yml down --remove-orphans - ;; - +# Deploys the Smart Contracts in agent/sn_agent/network/ethereum/core to the specififed network via a +# dockerized version of the Truffle environment and copies the compiled code and deployed addresses to +# the docker/agent/data/dev directory where the Agent's web3.py network class can find it. deploy-contracts) DOCKERNET=$(docker network ls | grep dockernet | awk '{print $2}') if [ "$DOCKERNET" != "dockernet" ] @@ -45,57 +35,69 @@ deploy-contracts) fi export TRUFFLE_NETWORK echo "TRUFFLE_NETWORK = '$TRUFFLE_NETWORK'" - docker-compose -f docker/docker-compose.dev.yml create --build --force-recreate truffle + docker-compose -f docker/docker-compose.dev.yml create --build truffle docker-compose -f docker/docker-compose.dev.yml run --service-ports truffle ;; +# The main developer command for testing and bring up a developer agent dev) docker-compose -f docker/docker-compose.dev.yml create --build dev docker-compose -f docker/docker-compose.dev.yml run --service-ports dev ./agent.sh run ;; +# Rebuilds the dev image in case of stale docker caches dev-force-build) docker-compose -f docker/docker-compose.dev.yml create --build --force-recreate dev ;; +# Builds the image only but does not run ig dev-build) docker-compose -f docker/docker-compose.dev.yml create --build dev ;; +# Just run the built image. dev-run) docker-compose -f docker/docker-compose.dev.yml run --service-ports dev ./agent.sh run ;; +# Take down all the dev containers - defined in docker/docker-compose-dev.yml dev-down) docker-compose -f docker/docker-compose.dev.yml down --remove-orphans ;; + +# ABC - Alice, Bob and Charlie (she's a girl) + +# Brings up the Alice server fo demonstrate many agents interacting. alice) - docker-compose -f docker/docker-compose.abc.yml create --build --force-recreate alice + docker-compose -f docker/docker-compose.abc.yml create --build alice docker-compose -f docker/docker-compose.abc.yml run --service-ports alice ./agent.sh run ;; +# Brings up Bob bob) - docker-compose -f docker/docker-compose.abc.yml create --build --force-recreate bob + docker-compose -f docker/docker-compose.abc.yml create --build bob docker-compose -f docker/docker-compose.abc.yml run --service-ports bob ./agent.sh run ;; +# Brings up Charlie - she likes to be last... charlie) - docker-compose -f docker/docker-compose.abc.yml create --build --force-recreate charlie + docker-compose -f docker/docker-compose.abc.yml create --build charlie docker-compose -f docker/docker-compose.abc.yml run --service-ports charlie ./agent.sh run ;; -agent-docs) - docker-compose -f docker/docker-compose.yml create --build --force-recreate test - docker-compose -f docker/docker-compose.ymlrun test ./agent.sh docs + demo) + docker-compose -f docker/docker-compose.demo.yml create --build --force-recreate demo + docker-compose -f docker/docker-compose.demo.yml run --service-ports demo ./agent.sh run ;; -agent-test) - docker-compose -f docker/docker-compose.yml start testrpc - docker-compose -f docker/docker-compose.yml create --build test - docker-compose -f docker/docker-compose.yml run test ./agent.sh test +demo-down) + docker-compose -f docker/docker-compose.demo.yml down --remove-orphans ;; + +# Experimental code - don't count on this staying around + opendht) docker-compose -f docker/docker-compose.yml create --build --force-recreate opendht docker-compose -f docker/docker-compose.yml run --service-ports opendht @@ -120,28 +122,46 @@ vault) docker-compose -f docker/docker-compose.yml run --service-ports vault $2 ;; -relex) - docker-compose -f docker/docker-compose.dev.yml run --service-ports relex +ipfs) + docker-compose -f docker/docker-compose.yml run --service-ports ipfs daemon ;; -testrpc) - docker-compose -f docker/docker-compose.yml create --build --force-recreate testrpc - docker-compose -f docker/docker-compose.yml run --service-ports testrpc +init) + #https://www.vaultproject.io/intro/getting-started/deploy.html#initializing-the-vault+ ;; -prepare-dao) - docker-compose -f docker-compose.dao.yml create --build --force-recreate dao - docker-compose -f docker-compose.dao.yml run --service-ports dao ./dao.sh $2 +# Support + +# Builds the docs +agent-docs) + docker-compose -f docker/docker-compose.yml create --build test + docker-compose -f docker/docker-compose.ymlrun test ./agent.sh docs ;; -ipfs) - docker-compose -f docker/docker-compose.yml run --service-ports ipfs daemon +# Runs the test suite +agent-test) + docker-compose -f docker/docker-compose.yml start testrpc + docker-compose -f docker/docker-compose.yml create --build test + docker-compose -f docker/docker-compose.yml run test ./agent.sh test + ;; + +# Brings up the OpenCog relationship extracter node +relex) + docker-compose -f docker/docker-compose.dev.yml run --service-ports relex + ;; + +# A test Ethereum client RPC server (ganache-cli) docker image +testrpc) + docker-compose -f docker/docker-compose.yml create --build testrpc + docker-compose -f docker/docker-compose.yml run --service-ports testrpc ;; +# Cleans recent docker images... useful when working on docker-compose and Dockerfiles clean) docker-compose -f docker/docker-compose.yml down --rmi all --remove-orphans ;; +# Clears the entire docker cache - generally only necessary when doing work with Dockerfiles themselves hard-clean) docker image prune docker-compose -f docker/docker-compose.dev.yml down --rmi all --remove-orphans @@ -161,7 +181,7 @@ gen-ssl) openssl req -nodes -new -x509 -keyout server.key -out server.crt -subj '/CN=localhost' ;; -*) echo 'No operation specified' +*) echo "Command '$1' not found - No operation specified" exit 0; ;;