To run the project you will need to open two terminals:
-
one terminal in the ngrok folder: run the start-ngrok.sh script, this will initialize an ngrok tunnel that will be used to forward requests to your agent.
-
one terminal in the docker folder: run
./manage build
command to compile the image pre-requisites to run the services, then./manage start
. This will start all of the services defined in docker-compose.yml.
Once started the services will be listening on localhost as follows:
-
immunization-api-dev
: http://localhost:5001 - running in dev mode with hot-reloading. -
issuer-api-dev
: http://localhost:5000 - running in dev mode with hot-reloading. -
frontend
: http://localhost:4200 - running in dev mode with hot reloading. -
agent
: http://localhost:8024 (admin API) and http://localhost:8021 (public endpoint, also exposed on the ngrok URL). -
db
andwallet
postgres databases will respectively be listening on ports5432
and5434
. -
verifier-api-dev
: http://localhost:10000 .
You can always run ./manage -h
to get more information about the usage of the script, and refer to it to find values for environment variables being set and consumed by docker-compose
.
Please Note: when starting the project, a .env
file containing the agent wallet seed will be generated in the docker folder. Do not edit this file manually, as its contents are used by the services to persist the agent's information and will be handled automatically by the manage
script.
When starting the project, the services will use reasonable defaults (see previous section) to bind ports and expose them to the host. In rare situations, the ports might already be in use and cause issues when starting up.
In this case, each port binding can be individually overridden by using an environment variable:
-
immunization-api-dev
: use environment variableIMMUNIZATION_API_PORT
. -
issuer-api-dev
: use environment variableISSUER_API_PORT
. -
frontend
: use environment variableFRONTEND_WEB_PORT
. -
agent
: useAGENT_ADMIN_PORT
for the admin API andAGENT_HTTP_IN_PORT
for the public endpoint. Additionally,AGENT_WS_IN_PORT
can be used for the websocket endpoint. -
db
: useEXPOSED_DATABASE_PORT
. -
wallet
useEXPOSED_WALLET_PORT
. -
verifier-api-dev
: useVERIFIER_API_PORT
.
An example for the project started with custom agent ports for admin API and public endpoints:
AGENT_ADMIN_PORT=8088 AGENT_HTTP_IN_PORT=8089 ./manage start
Environment variables can also be exported in the current shell session: this can be used to set them once and then only execute ./manage start
to run or restart the services.