Run How-Tos
You can find many examples related to managing identities and channels in the Github repo:).
The next sections will describe each example in detail.
Running Examples
- Java
- Node.js
- Get Integration Service API's endpoint by setting the
api-key
andapi-url
inenv.properties
file. - Make sure you have an
adminIdentity.json
file which is actually an Admin Identity. If this is not the case, please run example-0 (details below) to make the identity anAdminIdentity
- Make sure that the aforementioned file is located in the same directory from which the code is run (recommended:
examples/
). This folder will be known as the "examples folder" throughout this section of the docs. - Run
mvn compile
to install the dependencies from the example folder'spom.xml
. - Run each example in turn either via the console or your favourite IDE.
Alternatively, a basic Dockerfile has been provided that will allow you to run all the examples in one go.
In order to run examples, you will need to:
- Get Integration Service API's endpoint by setting the
API_KEY
andAPI_URL
in.env
file. - Get the MongoDB endpoint for the API by setting
MONGO_URL
,DB_NAME
andSECRET_KEY
in.env
file. - Execute
npm run example-0
.
Install the Examples
You can install the examples by going into your local clients/client-sdk/examples
directory and running npm install
.
cd clients/client-sdk/examples
npm install
Configure the Examples
- Java
- Node.js
In Java, you will need to set up a env.properties
file with the following properties:
api-key=XXXXXXX
api-version=vX.X
api-url=XXXXXXX
identity-file=adminIdentity.json
Please note the Java SDK assumes that an instance of the API, including its MongoDB connection, is already running elsewhere.
- Set Integration Service API's endpoint by setting the
API_KEY
andAPI_URL
in.env
file. - Set the MongoDB endpoint for the API by setting
MONGO_URL
,DB_NAME
andSECRET_KEY
in.env
file.
If you started the API locally using kubernetes, you can write
the following .env
file:
#-----------------------
# For management purpose
#-----------------------
MONGO_URL=mongodb://root:rootpassword@0.0.0.0:27017
DB_NAME=integration-service
SECRET_KEY=7w9gfhb123jngh4gd53z465fewcs569e
#---------------------
# Client configuration
#---------------------
# You can either choose a IS_GATEWAY_URL (used in production)
# or the SSI_BRIDGE_URL AND AUDIT_TRAIL_URL (for local development)
API_KEY=4ed59704-9a26-11ec-a749-3f57454709b9
USE_GATEWAY_URL=false
SSI_BRIDGE_URL=http://localhost:3001
AUDIT_TRAIL_URL=http://localhost:3002
Run Example 0
- Java
- Node.js
Once you have completed the previous steps, if you do not have an identity stored in adminIdentity.json
which is actually an Admin Identity
you can run example-0
mvn exec:_java -Dexec.mainClass=net.gradbase.how_tos.AddAsRootIdentity
Once you have completed the previous steps, you can run example-0 to create a decentralized identity with Admin
role
that will be used in the other examples using the following command:
npm run example-0
The admin identity will be saved in adminIdentity.json
.