Newer
Older
# workspace
This is a local development workspace for Trust Services API backend.
It uses docker-compose to bootstrap the services and their dependencies.
Each service has its own `.env` file in the [env](./env) directory
with environment variables which will be injected in its container.
## Prerequisites
* Install [docker](https://docs.docker.com/engine/install/) and [docker-compose](https://docs.docker.com/compose/install/).
* [Install Go](https://golang.org/doc/install) and set the
[`$GOPATH` variable](https://github.com/golang/go/wiki/SettingGOPATH).
## Setup Workspace
* create directory:
```
mkdir -p $GOPATH/src/code.vereign.com/gaiax/tsa/
```
* move in the previously created directory:
```
cd $GOPATH/src/code.vereign.com/gaiax/tsa/
```
* clone the repository:
```
git clone git@code.vereign.com:gaiax/tsa/workspace.git
```
* run the setup.sh script:
```
./setup.sh
```
* set the services you would like to use in the docker-compose.yml file, defaults is **infohub**
* set needed environment variables in an `.env` file and add the file path in `export-env.sh` script
* export environment variables:
```
. ./export-env.sh
```
* run docker compose:
```
docker-compose up
```
### DID Resolver service
The DID Resolver service can be reached at `localhost:9090` from your
local machine.
Example usage:
```
curl -X GET http://localhost:9090/1.0/identifiers/did:indy:idunion:BDrEcHc8Tb4Lb2VyQZWEDE
curl -X GET http://localhost:9090/1.0/identifiers/did:key:z6Mkfriq1MqLBoPWecGoDLjguo1sB9brj6wT3qZ5BxkKpuP6
curl -X GET http://localhost:9090/1.0/identifiers/did:schema:public-ipfs:json-schema:Qma2beXKwZeiUXcaRaQKwbBV1TqyiJnsMTYExUTdQue43J
curl -X GET http://localhost:9090/1.0/identifiers/did:web:did.actor:alice
curl -X GET http://localhost:9090/1.0/identifiers/did:sov:WRfXPg8dantKVubE3HX8pw
```
In order to support more DID methods refer to currently supported ones here:
```
https://github.com/decentralized-identity/universal-resolver/blob/main/docker-compose.yml
```
Needed env variables are here:
```
https://github.com/decentralized-identity/universal-resolver/blob/main/.env
```
The services access DID resolver from their containers as `uni-resolver-web:8080`
### Redis
The Redis server can be reached at `localhost:6397` from your
local machine.
The services access Redis from their containers as `redis:6397`