Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add agent #204

Merged
merged 3 commits into from
Dec 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.

Expand All @@ -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:

Expand All @@ -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. |
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
22 changes: 22 additions & 0 deletions compose-files/agent.yml
Original file line number Diff line number Diff line change
@@ -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


17 changes: 14 additions & 3 deletions start_ocean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
#################################################
Expand Down