diff --git a/README.md b/README.md index e9d4c4f3..9eee26a3 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,9 @@ $ pip install -e . ```sh $ pip install -e .[indy] ``` +Note: If you are using the `indy` feature, you will need to have the indy-sdk +library installed. If it's not installed, please see +[Installing the SDK](https://github.com/hyperledger/indy-sdk/blob/master/README.md#installing-the-sdk) ### Plugin Installation @@ -77,6 +80,15 @@ $ aca-py start \ --plugin acapy_plugin_toolbox ``` +Alternatively, you may use the demo configs in `demo/configs` to startup ACA-Py +similarly to the demos. These demos automatically set many options, such as +ports, config options, plugins to load, etc. To do so, copy one of the config +files to the current directory and run the following command, substituting +`./{config}.yml` with the config file you have chosen: +``` +aca-py start --arg-file ./{config}.yml +``` + ### Generating an invitation for use with the Toolbox By default, ACA-Py has no preexisting connections. To have our agent interact with other agents, we use the Aries Toolbox which is itself a simplified kind of diff --git a/demo/Dockerfile.demo b/demo/Dockerfile.demo index b02d9489..42ca2993 100644 --- a/demo/Dockerfile.demo +++ b/demo/Dockerfile.demo @@ -2,11 +2,9 @@ FROM bcgovimages/von-image:py36-1.16-0 RUN pip3 install --no-cache-dir poetry -ADD --chown=indy https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 ./jq -RUN chmod +x ./jq - -COPY --chown=indy demo/agent-tunnel-wait.sh ./agent-tunnel-wait.sh -RUN chmod +x agent-tunnel-wait.sh +ADD --chown=indy https://raw.githubusercontent.com/Indicio-tech/agent-tunnel/02351dd87e105a7522a2d752ddd174a52a6755a1/wait-curl.sh ./wait.sh +RUN chmod +x ./wait.sh +COPY ./demo/acapy-endpoint.sh ./acapy-endpoint.sh RUN mkdir acapy_plugin_toolbox && touch acapy_plugin_toolbox/__init__.py COPY pyproject.toml . @@ -25,5 +23,5 @@ COPY demo/configs ./configs/ COPY acapy_plugin_toolbox acapy_plugin_toolbox -ENTRYPOINT ["/bin/bash", "-c", "./agent-tunnel-wait.sh \"$@\"", "--"] -CMD ["poetry", "run", "aca-py", "start", "--plugin", "acapy_plugin_toolbox", "--arg-file", "configs/default.yml"] +ENTRYPOINT ["/bin/bash", "-c", "./acapy-endpoint.sh poetry run aca-py \"$@\"", "--"] +CMD ["start", "--arg-file", "configs/default.yml"] diff --git a/demo/acapy-endpoint.sh b/demo/acapy-endpoint.sh new file mode 100755 index 00000000..c2381f7b --- /dev/null +++ b/demo/acapy-endpoint.sh @@ -0,0 +1,4 @@ +#!/bin/bash +ACAPY_ENDPOINT="$(./wait.sh)" +export ACAPY_ENDPOINT="[$ACAPY_ENDPOINT, ${ACAPY_ENDPOINT/http/ws}]" +exec "$@" diff --git a/demo/agent-tunnel-wait.sh b/demo/agent-tunnel-wait.sh deleted file mode 100644 index 51d1b1c4..00000000 --- a/demo/agent-tunnel-wait.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -TUNNEL_HOST=${TUNNEL_HOST:-tunnel} -TUNNEL_PORT=${TUNNEL_PORT:-4040} - -echo "tunnel end point [$TUNNEL_HOST:$TUNNEL_PORT]" - -while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' "${TUNNEL_HOST}:${TUNNEL_PORT}/status")" != "200" ]]; do - echo "Waiting for tunnel..." - sleep 1 -done -ACAPY_ENDPOINT=$(curl --silent "${TUNNEL_HOST}:${TUNNEL_PORT}/start" | ./jq -r '.url') -echo "fetched end point [$ACAPY_ENDPOINT]" - -export ACAPY_ENDPOINT="[$ACAPY_ENDPOINT, ${ACAPY_ENDPOINT/http/ws}]" -#export ACAPY_ENDPOINT="$ACAPY_ENDPOINT" -exec "$@" diff --git a/demo/docker-compose.alice-bob.yml b/demo/docker-compose.alice-bob.yml index 83001fac..f4e56998 100644 --- a/demo/docker-compose.alice-bob.yml +++ b/demo/docker-compose.alice-bob.yml @@ -1,38 +1,36 @@ version: "3" services: tunnel-alice: - image: reflectivedevelopment/agent-tunnel - command: agent-alice:3000 -p 4040 --host ${AGENT_TUNNEL_HOST} + image: dbluhm/agent-tunnel + command: -s agent-alice:3000 -p 4040 -h ${AGENT_TUNNEL_HOST} agent-alice: image: acapy-toolbox-tunnel build: context: ../ dockerfile: ./demo/Dockerfile.demo environment: - TUNNEL_HOST: tunnel-alice - TUNNEL_PORT: 4040 + TUNNEL_ENDPOINT: http://tunnel-alice:4040 # Modify for more log output ACAPY_TOOLBOX_LOG_LEVEL: WARNING ports: - "3001:3001" - command: poetry run aca-py start --arg-file ./configs/alice.yml + command: start --arg-file ./configs/alice.yml tunnel-bob: - image: reflectivedevelopment/agent-tunnel - command: agent-bob:3002 -p 4040 --host ${AGENT_TUNNEL_HOST} + image: dbluhm/agent-tunnel + command: -s agent-bob:3002 -p 4040 -h ${AGENT_TUNNEL_HOST} agent-bob: image: acapy-toolbox-tunnel build: context: ../ dockerfile: ./demo/Dockerfile.demo environment: - TUNNEL_HOST: tunnel-bob - TUNNEL_PORT: 4040 + TUNNEL_ENDPOINT: http://tunnel-bob:4040 # Modify for more log output ACAPY_TOOLBOX_LOG_LEVEL: WARNING ports: - "3003:3003" - command: poetry run aca-py start --arg-file ./configs/bob.yml + command: start --arg-file ./configs/bob.yml tails-server: image: dbluhm/indy-tails-server:latest diff --git a/demo/docker-compose.mediator.yml b/demo/docker-compose.mediator.yml index 8fd2eff3..fe824ed1 100644 --- a/demo/docker-compose.mediator.yml +++ b/demo/docker-compose.mediator.yml @@ -1,16 +1,15 @@ version: "3" services: tunnel-mediator: - image: reflectivedevelopment/agent-tunnel - command: agent-mediator:3004 -p 4040 --host ${AGENT_TUNNEL_HOST} + image: dbluhm/agent-tunnel + command: -s agent-mediator:3004 -p 4040 -h ${AGENT_TUNNEL_HOST} agent-mediator: image: acapy-toolbox-tunnel build: context: ../ dockerfile: ./demo/Dockerfile.demo environment: - TUNNEL_HOST: tunnel-mediator - TUNNEL_PORT: 4040 + TUNNEL_ENDPOINT: http://tunnel-mediator:4040 ports: - "3005:3005" - command: poetry run aca-py start --arg-file ./configs/mediator.yml + command: start --arg-file ./configs/mediator.yml diff --git a/demo/docker-compose.yml b/demo/docker-compose.yml index 2c001813..10cb1ea7 100644 --- a/demo/docker-compose.yml +++ b/demo/docker-compose.yml @@ -1,8 +1,8 @@ version: "3" services: tunnel: - image: reflectivedevelopment/agent-tunnel - command: agent:3000 -p 4040 --host ${AGENT_TUNNEL_HOST} + image: dbluhm/agent-tunnel + command: -s agent:3000 -p 4040 -h ${AGENT_TUNNEL_HOST} ports: - 4040:4040 agent: @@ -11,7 +11,4 @@ services: context: ../ dockerfile: ./demo/Dockerfile.demo environment: - TUNNEL_HOST: tunnel - TUNNEL_PORT: 4040 - ports: - - "3001:3001" + TUNNEL_ENDPOINT: http://tunnel:4040