1
0
mirror of https://github.com/oceanprotocol/barge.git synced 2024-11-22 09:47:04 +01:00

Merge pull request #204 from oceanprotocol/feature/withagent

add agent
This commit is contained in:
Alex Coseru 2019-12-12 21:56:08 +02:00 committed by GitHub
commit 7c5deed075
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 51 additions and 6 deletions

View File

@ -19,6 +19,7 @@
- [Keeper Node](#keeper-node)
- [Secret Store](#secret-store)
- [Faucet](#faucet)
- [Agent](#agent)
- [Dashboard](#dashboard)
- [Spree Network](#spree-network)
- [Spree Mnemonic](#spree-mnemonic)
@ -65,9 +66,9 @@ The startup script comes with a set of options for customizing various things.
The default versions are always a combination of component versions which are considered stable.
| Aquarius | Brizo | Events Handler | Keeper | Commons | Faucet |
| -------- | -------- | -------------- | --------- | -------- | -------- |
| `v1.0.5` | `v0.7.2` | `v0.3.4` | `v0.12.7` | `v2.0.0` | `v0.3.2` |
| Aquarius | Brizo | Events Handler | Keeper | Commons | Faucet | Agent |
| -------- | -------- | -------------- | --------- | -------- | -------- | ------ |
| `v1.0.5` | `v0.7.2` | `v0.3.4` | `v0.12.7` | `v2.0.0` | `v0.3.2` | latest |
You can use the `--latest` option to pull the most recent Docker images for all components, which are always tagged as `latest` in Docker. The `latest` Docker image tag derives from the default main branch of the component's Git repo.
@ -80,6 +81,7 @@ You can override the Docker image tag used for a particular component by setting
- `COMMONS_CLIENT_VERSION`
- `COMMONS_SERVER_VERSION`
- `FAUCET_VERSION`
- `AGENT_VERSION`
For example:
@ -105,6 +107,7 @@ will use the default Docker image tags for Aquarius, Keeper Contracts and Common
| `--no-faucet` | Start up Ocean without the `faucet` Building Block. |
| `--no-acl-contract` | Disables the configuration of secret store's ACL contract address |
| `--no-dashboard` | Start up Ocean without the `dashboard` Building Block. |
| `--no-agent` | Start up Ocean without the `agent` Building Block. |
| `--mongodb` | Start up Ocean with MongoDB as DB engine for Aquarius instead of Elasticsearch. |
| `--local-ganache-node` | Runs a local `ganache` node. |
| `--local-spree-node` | Runs a node of the local `spree` network. This is the default. |
@ -117,6 +120,7 @@ will use the default Docker image tags for Aquarius, Keeper Contracts and Common
| `--purge` | Removes the Docker containers, volumes, artifact folder and networks used by the script. |
| `--exposeip` | Binds the components to that specific ip. Exemple: ./start_ocean.sh --exposeip 192.168.0.1 |
## Docker Building Blocks
Barge consists of a set of building blocks that can be combined to form a local test environment. By default all building blocks will be started by the `start_ocean.sh` script.
@ -201,6 +205,14 @@ By default it will start two containers, one for Faucet server and one for its d
By default the Faucet allows requests every 24hrs. To disable the timespan check you can pass `FAUCET_TIMESPAN=0` as environment variable before starting the script.
### Agent
By default it will start one container. This Building Block can be disabled by setting the `--no-agent` flag.
| Hostname | External Port | Internal URL | Local URL | Description |
| -------- | ------------- | ----------------- | --------------------- | ----------------------------------------------- |
| `agent` | `4040` | http://agent:4040 | http://agent:4040 | [Agent](https://github.com/oceanprotocol/agent) |
### Dashboard
This will start a `portainer` dashboard with the following admin credentials and connects to the local docker host. This Building Block can be disabled by setting the `--no-dashboard` flag.

22
compose-files/agent.yml Normal file
View File

@ -0,0 +1,22 @@
version: '3'
services:
agent:
image: oceanprotocol/agent:$AGENT_VERSION
networks:
backend:
ipv4_address: 172.15.0.26
ports:
- 4040:4040
environment:
LOCAL_CONTRACTS: ${KEEPER_DEPLOY_CONTRACTS}
aquariusUri: ${COMMONS_AQUARIUS_URI}
brizoAddress: ${PROVIDER_ADDRESS}
nodeUri: ${COMMONS_KEEPER_RPC_HOST}
brizoUri: ${COMMONS_BRIZO_URL}
secretstoreUri: ${COMMONS_SECRET_STORE_URL}
faucetUri: ${COMMONS_FAUCET_URL}
PRIVATE_KEY: ${AGENT_PRIVATE_KEY}
volumes:
- ${KEEPER_ARTIFACTS_FOLDER}:/usr/src/app/node_modules/@oceanprotocol/keeper-contracts/artifacts/:ro

View File

@ -32,6 +32,7 @@ export KEEPER_VERSION=${KEEPER_VERSION:-v0.12.7}
export FAUCET_VERSION=${FAUCET_VERSION:-v0.3.2}
export COMMONS_SERVER_VERSION=${COMMONS_SERVER_VERSION:-v2.0.0}
export COMMONS_CLIENT_VERSION=${COMMONS_CLIENT_VERSION:-v2.0.0}
export AGENT_VERSION=${AGENT_VERSION:-latest}
export PARITY_IMAGE="parity/parity:v2.5.7-stable"
@ -126,6 +127,11 @@ export COMMONS_IPFS_NODE_URI=https://ipfs.oceanprotocol.com:443
export OPERATOR_SERVICE_URL=http://127.0.0.1:8050
#agent
# private key for agent, public address: 0x6f2b82bB771687b69d0932c7386742804144ae7D
# NEVER USE this address in production !
export AGENT_PRIVATE_KEY='axis talent grab cushion figure couple plug ostrich file false jealous nest'
# Export User UID and GID
export LOCAL_USER_ID=$(id -u)
export LOCAL_GROUP_ID=$(id -g)
@ -232,7 +238,7 @@ COMPOSE_FILES+=" -f ${COMPOSE_DIR}/events_handler.yml"
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/secret_store.yml"
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/secret_store_signing_node.yml"
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/faucet.yml"
COMPOSE_FILES+=" -f ${COMPOSE_DIR}/agent.yml"
DOCKER_COMPOSE_EXTRA_OPTS="${DOCKER_COMPOSE_EXTRA_OPTS:-}"
while :; do
@ -263,8 +269,9 @@ while :; do
export KEEPER_VERSION="latest"
# TODO: Change label on Docker to refer `latest` to `master`
export FAUCET_VERSION="latest"
export COMMONS_SERVER_VERSION="latest"
export COMMONS_CLIENT_VERSION="latest"
export AGENT_VERSION="latest"
export COMMONS_SERVER_VERSION="latest"
export COMMONS_CLIENT_VERSION="latest"
printf $COLOR_Y'Switched to latest components...\n\n'$COLOR_RESET
;;
--force-pull)
@ -310,6 +317,10 @@ while :; do
export CONFIGURE_ACL="false"
printf $COLOR_Y'Disabling acl validation in secret-store...\n\n'$COLOR_RESET
;;
--no-agent)
COMPOSE_FILES="${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/agent.yml/}"
printf $COLOR_Y'Starting without Agent ...\n\n'$COLOR_RESET
;;
#################################################
# Only Secret Store
#################################################