1
0
mirror of https://github.com/oceanprotocol/barge.git synced 2024-12-02 05:57:21 +01:00

Merge pull request #74 from oceanprotocol/feature/blockain_nodes

Feature/blockain nodes
This commit is contained in:
Sebastian Gerske 2018-12-05 14:04:17 +01:00 committed by GitHub
commit 6824e8309e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 162 additions and 79 deletions

14
.env
View File

@ -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

View File

@ -1,17 +1,12 @@
# 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=http://keeper-node:8545
AZURE_ACCOUNT_NAME=
AZURE_ACCOUNT_KEY=

View File

@ -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

View File

@ -8,10 +8,10 @@ services:
backend:
ipv4_address: 172.15.0.17
depends_on:
- keeper-contracts
- keeper-node
env_file:
- ${BRIZO_ENV_FILE}
environment:
KEEPER_URL: http://${RPC_URL}:8545
KEEPER_URL: ${KEEPER_RPC_URL}
volumes:
- ${ARTIFACTS_FOLDER}:/usr/local/keeper-contracts/:ro
- ${KEEPER_ARTIFACTS_FOLDER}:/usr/local/keeper-contracts/:ro

View File

@ -2,18 +2,18 @@ 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"
DEPLOY_CONTRACTS: ${DEPLOY_CONTRACTS}
DEPLOY_CONTRACTS: ${KEEPER_DEPLOY_CONTRACTS}
REUSE_DATABASE: ${GANACHE_REUSE_DATABASE}
DATABASE_PATH: "/ganache-db"
REUSE_DATABASE: ${REUSE_DATABASE}
NETWORK_NAME: ${KEEPER_NETWORK_NAME}
POA_HOST: "parity-node"
KEEPER_RPC_HOST: ${KEEPER_RPC_HOST}
KEEPER_RPC_PORT: ${KEEPER_RPC_PORT}
KEEPER_RPC_URL: ${KEEPER_RPC_URL}
depends_on:
- keeper-node
volumes:
- ${ARTIFACTS_FOLDER}:/keeper-contracts/artifacts/
- ${GANACHE_DATABASE_PATH}/ganache-db:/ganache-db
- ${KEEPER_ARTIFACTS_FOLDER}:/keeper-contracts/artifacts/

View File

@ -1,8 +0,0 @@
version: '2.1'
services:
mongodb:
image: mongo:3.6
command: mongod
networks:
backend:
ipv4_address: 172.15.0.11

View File

@ -10,5 +10,5 @@ networks:
gateway: 172.15.0.1
volumes:
parity-node:
keeper-node:
secret-store:

View File

@ -0,0 +1,9 @@
version: '2.1'
services:
keeper-node:
image: trufflesuite/ganache-cli:latest
ports:
- 8545:8545
networks:
backend:
ipv4_address: 172.15.0.12

View File

@ -0,0 +1,19 @@
version: '2.1'
services:
keeper-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

View File

@ -1,6 +1,6 @@
version: '2.1'
services:
parity-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

View File

@ -4,16 +4,17 @@ 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:
- keeper-node
- aquarius
- brizo
environment:
# Need browser to connect to exposed ports
KEEPER_HOST: localhost
AQUARIUS_HOST: localhost
LOCAL_CONTRACTS: 'true'
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

View File

@ -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,21 @@ 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
--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

View File

@ -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

View File

@ -2,20 +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="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="ocean_poa_net_local"
# 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 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 GANACHE_REUSE_DATABASE="false"
export BRIZO_ENV_FILE=$DIR/brizo.env
# Specify the ethereum default RPC container provider
export KEEPER_RPC_HOST='keeper-node'
export KEEPER_RPC_PORT='8545'
export KEEPER_RPC_URL="http://"${KEEPER_RPC_HOST}:${KEEPER_RPC_PORT}
# colors
COLOR_R="\033[0;31m" # red
@ -38,47 +43,82 @@ 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}/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
#################################################
# 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
;;
# spins up a new ganache blockchain
--local-ganache-node)
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/keeper_contracts.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
;;
# 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"
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
;;
#################################################
# 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}_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
if [[ $REPLY =~ ^[Yy]$ ]]
then
rm -rf $ARTIFACTS_FOLDER
rm -rf ${KEEPER_ARTIFACTS_FOLDER}
fi
;;
--) # End of all options.
@ -91,7 +131,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