Skip to content
Snippets Groups Projects
Commit 48c39113 authored by Lyuben Penkovski's avatar Lyuben Penkovski
Browse files

Policy service definition

parent ddbcb278
No related branches found
No related tags found
No related merge requests found
...@@ -12,44 +12,74 @@ with environment variables which will be injected in its container. ...@@ -12,44 +12,74 @@ with environment variables which will be injected in its container.
* [Install Go](https://golang.org/doc/install) and set the * [Install Go](https://golang.org/doc/install) and set the
[`$GOPATH` variable](https://github.com/golang/go/wiki/SettingGOPATH). [`$GOPATH` variable](https://github.com/golang/go/wiki/SettingGOPATH).
## Setup Workspace ## Setup
* create directory: Clone the workspace repository into `$GOPATH/src/code.vereign.com/gaiax/tsa/workspace`. Using GOPATH is important
``` because it's the way the workspace will know where to find you Go source code.
mkdir -p $GOPATH/src/code.vereign.com/gaiax/tsa/
``` ```sh
* move in the previously created directory: # create the backend directory where the workspace will be checked out
``` mkdir -p $GOPATH/src/code.vereign.com/gaiax/tsa/workspace
cd $GOPATH/src/code.vereign.com/gaiax/tsa/
``` # change to the created directory
* clone the repository: cd $GOPATH/src/code.vereign.com/gaiax/tsa/workspace
```
git clone git@code.vereign.com:gaiax/tsa/workspace.git # clone the workspace repo
``` git clone git@code.vereign.com:gaiax/tsa/workspace.git .
* run the setup.sh script: ```
```
./setup.sh ### Checkout services repos
```
* set the services you would like to use in the docker-compose.yml file, defaults is **infohub** This step is optional because you may already have the repos checked out
or you may want to do this step manually. But the workspace provides you
* run docker compose: with a `setup.sh` script which will go and checkout the TSA backend
``` services at their correct locations, ready for use with `docker-compose`.
docker-compose up
``` ```shell
./setup.sh
```
> Note: If you have already checked out a repository, and it's not on the main branch or
> is not in a clean state, the script will give you a warning and won't override the
> state of your repo. You will have to checkout/update it manually.
### Usage
Now you're ready to start using the workspace environment.
```shell
# start all services
docker-compose up -d
# see the state of the containers and their exposed ports
docker-compose ps
# follow the logs of all services in the workspace
docker-compose logs -f
# follow the logs of specified services only
docker-compose logs -f gateway infohub
# restart a service
docker-compose restart gateway
# restart a service and reload its environment variables
docker-compose up -d gateway
# rebuild the docker image of a service
docker-compose build gateway
```
## 3rd Party Services ## 3rd Party Services
### DID Resolver service #### DID Resolver
The DID Resolver service can be reached at `localhost:9090` from your The DID Resolver service can be reached at `localhost:9090` from your local machine.
local machine.
Example usage: 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: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: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: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: In order to support more DID methods refer to currently supported ones here:
``` ```
......
version: '3.4' version: '3.4'
services: services:
infohub: policy:
container_name: infohub container_name: policy
build: build:
context: $GOPATH/src/code.vereign.com/gaiax/tsa/infohub context: $GOPATH/src/code.vereign.com/gaiax/tsa/policy
dockerfile: deployment/compose/Dockerfile dockerfile: deployment/compose/Dockerfile
volumes: volumes:
- "$GOPATH/src/code.vereign.com/gaiax/tsa/infohub:/go/src/code.vereign.com/gaiax/tsa/infohub" - "$GOPATH/src/code.vereign.com/gaiax/tsa/policy:/go/src/code.vereign.com/gaiax/tsa/policy"
env_file: env_file:
./env/infohub.env - ./env/policy.env
ports: ports:
- "8080:8080" - "8081:8080"
redis: didresolver:
image: "redis:alpine"
container_name: redis
ports:
- "6379:6379"
uni-resolver-web:
image: universalresolver/uni-resolver-web:latest image: universalresolver/uni-resolver-web:latest
ports: ports:
- "9090:8080" - "9090:8080"
uni-resolver-driver-did-uport: didresolver-driver-did-key:
image: uport/uni-resolver-driver-did-uport:2.3.0
ports:
- "9091:8081"
driver-did-sov:
image: universalresolver/driver-did-sov:latest
env_file:
./env/resolver.env
ports:
- "9092:8080"
driver-did-key:
image: universalresolver/driver-did-key:latest image: universalresolver/driver-did-key:latest
ports: ports:
- "9093:8080" - "9091:8080"
schema-registry-did-resolver:
image: 51nodes/schema-registry-did-resolver:0.1.1
ports:
- "9094:8080"
indy-did-driver: indy-did-driver:
image: ghcr.io/idunion/indy-did-resolver/indy-did-driver:latest image: ghcr.io/idunion/indy-did-resolver/indy-did-driver:latest
ports: ports:
- "9095:8080" - "9092:8080"
\ No newline at end of file
redis:
image: "redis:alpine"
container_name: redis
ports:
- "6379:6379"
HTTP_HOST="" HTTP_HOST=""
HTTP_PORT="8080" HTTP_PORT="8080"
HTTP_IDLE_TIMEOUT="60s" HTTP_IDLE_TIMEOUT="120s"
HTTP_READ_TIMEOUT="10s" HTTP_READ_TIMEOUT="10s"
HTTP_WRITE_TIMEOUT="10s" HTTP_WRITE_TIMEOUT="10s"
HTTP_MAX_REQUEST_SIZE="1000000" REDIS_ADDR="redis:6379"
REDIS_HOST="redis" REDIS_USER=""
\ No newline at end of file REDIS_PASS=""
REDIS_DB=1
REDIS_EXPIRATION="1h"
\ No newline at end of file
uniresolver_driver_did_sov_libIndyPath=
uniresolver_driver_did_sov_poolConfigs=_;./sovrin/_.txn;staging;./sovrin/staging.txn;builder;./sovrin/builder.txn;danube;./sovrin/danube.txn;idu;./sovrin/idu.txn;eesdi;./sovrin/eesdi.txn;indicio;./sovrin/indicio.txn;indicio:test;./sovrin/indicio-test.txn;indicio:demo;./sovrin/indicio-demo.txn;bbu;./sovrin/bbu.txn
uniresolver_driver_did_sov_poolVersions=_;2;staging;2;builder;2;danube;2;idu;2;eesdi;2;indicio;2;indicio:test;2;indicio:demo;2;bbu;2
uniresolver_driver_did_sov_walletName=default
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# export email="lyuben.penkovski@vereign.com" # export email="lyuben.penkovski@vereign.com"
# ------------ # ------------
# pull the master branch of a given git repository. # pull the main branch of a given git repository.
# User will be prompted for manual action if another branch is checked out or a problem occurs. # User will be prompted for manual action if another branch is checked out or a problem occurs.
# $1 - name of the repo to pull. # $1 - name of the repo to pull.
function pull() { function pull() {
...@@ -20,9 +20,9 @@ function pull() { ...@@ -20,9 +20,9 @@ function pull() {
pushd "${repo}" pushd "${repo}"
local branch=`git rev-parse --abbrev-ref HEAD` local branch=`git rev-parse --abbrev-ref HEAD`
if [ $branch == "master" ]; then if [ $branch == "main" ]; then
echo "Pulling ${repo}/master..." echo "Pulling ${repo}/main..."
git pull origin master || read -p "Could not pull ${repo}/master. Fix the issue and press ENTER to continue:" git pull origin main || read -p "Could not pull ${repo}/main. Fix the issue and press ENTER to continue:"
else else
echo "${repo}/${branch} is checked out" echo "${repo}/${branch} is checked out"
read -p "Pull ${repo} manually now or press ENTER to skip:" read -p "Pull ${repo} manually now or press ENTER to skip:"
...@@ -38,7 +38,8 @@ function getServices() { ...@@ -38,7 +38,8 @@ function getServices() {
mkdir -p "${GAIAX_TSA_DIR}" && cd "$_" mkdir -p "${GAIAX_TSA_DIR}" && cd "$_"
local services=( local services=(
"infohub" "policy"
"task"
) )
for repo in ${services[@]}; do for repo in ${services[@]}; do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment