|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# based on code developed by Sovrin: https://github.com/hyperledger/aries-acapy-plugin-toolbox |
| 4 | + |
| 5 | +echo "using ngrok end point [$NGROK_NAME]" |
| 6 | + |
| 7 | +NGROK_ENDPOINT=null |
| 8 | +while [ -z "$NGROK_ENDPOINT" ] || [ "$NGROK_ENDPOINT" = "null" ] |
| 9 | +do |
| 10 | + echo "Fetching end point from ngrok service" |
| 11 | + NGROK_ENDPOINT=$(curl --silent $NGROK_NAME:4040/api/tunnels | ./jq -r '.tunnels[] | select(.proto=="https") | .public_url') |
| 12 | + |
| 13 | + if [ -z "$NGROK_ENDPOINT" ] || [ "$NGROK_ENDPOINT" = "null" ]; then |
| 14 | + echo "ngrok not ready, sleeping 5 seconds...." |
| 15 | + sleep 5 |
| 16 | + fi |
| 17 | +done |
| 18 | + |
| 19 | +export ACAPY_ENDPOINT=$NGROK_ENDPOINT |
| 20 | + |
| 21 | +echo "Starting aca-py agent with endpoint [$ACAPY_ENDPOINT]" |
| 22 | + |
| 23 | +# ... if you want to echo the aca-py startup command ... |
| 24 | +set -x |
| 25 | + |
| 26 | +exec aca-py start \ |
| 27 | + --auto-provision \ |
| 28 | + --inbound-transport http '0.0.0.0' 8001 \ |
| 29 | + --outbound-transport http \ |
| 30 | + --genesis-url "http://test.bcovrin.vonx.io/genesis" \ |
| 31 | + --endpoint "${ACAPY_ENDPOINT}" \ |
| 32 | + --auto-ping-connection \ |
| 33 | + --monitor-ping \ |
| 34 | + --public-invites \ |
| 35 | + --wallet-type "askar" \ |
| 36 | + --wallet-name "test_multi" \ |
| 37 | + --wallet-key "secret_key" \ |
| 38 | + --wallet-storage-type "postgres_storage" \ |
| 39 | + --wallet-storage-config "{\"url\":\"wallet-db:5432\",\"max_connections\":5,\"scheme\":\"MultiWalletSingleTable\"}" \ |
| 40 | + --wallet-storage-creds "{\"account\":\"DB_USER\",\"password\":\"DB_PASSWORD\",\"admin_account\":\"postgres\",\"admin_password\":\"mysecretpassword\"}" \ |
| 41 | + --admin '0.0.0.0' 8010 \ |
| 42 | + --label "test_multi" \ |
| 43 | + --admin-insecure-mode \ |
| 44 | + --multitenant \ |
| 45 | + --multitenant-admin \ |
| 46 | + --jwt-secret "very_secret_secret" \ |
| 47 | + --log-level "error" |
0 commit comments