ACDC means Anti-Counterfeiting Data Collaboration - Use-Case 4 of PharmaLedger
Aims to set up a separate environment, connected to Acdc for Authentication providers to develop and deploy their own authentication features in their own domain
In order to use the workspace, we need to follow a list of steps presented below.
$ git clone https://github.com/PharmaLedger-IMI/acdc-auth-feature-workspace.git
After the repository was cloned, you must install all the dependencies.
$ cd acdc-auth-feature-workspace
#Important: If you plan to contribute to the project and/or dependecies please set DEV:true
#in the file env.json before you run the installation!
$ npm install
Note: this command might take quite some time depending on your internet connection and you machine processing power.
While in the acdc-auth-feature-workspace folder run: (optional)
npm run integrate-acdc
this will run the following octopus script:
"configure-acdc-integration": [
{
"name": "configure server integration",
"src": "",
"actions": [
{
"type": "execute",
"cmd": "npm run set-up-acdc-integration -- --port=8080 --domainName=epi-auth-template --epi=http://192.168.1.89:8080 --env=dev"
},
{
"type": "execute",
"cmd": "npm run patch-server"
},
{
"type": "execute",
"cmd": "npx rimraf ./apihub-root/external-volume/config/domains/epi.json"
}
]
}
],
notice the use of npm run set-up-acdc-integration
with arguments to configure the domain
the possible arguments are:
- --port : the port where to run the ApiHub (defaults to 8080);
- --domainName: the name for the domain (defaults to 'template');
- --epi: the url to the epi (acdc for the time being) apihub:
acdc-dev.pharmaledger.pdmfc.com:80
oracdc.pharmaledger.pdmfc.com:80
for the dev and tst environments. local address for tests. (no outgoing communication is required so far for this repo, so this parameter is mute); - --env: (not supported currently);
Each user should tailor this to fit his needs.
$ npm run server
At the end of this command you get something similar to:
Open a new console inside acdc-auth-feature-workspace folder and run:
# Note: Run this in a new console inside "epi-workspace" folder
$ npm run build-all
To properly test the deployment locally, the best way is to deploy this workspace to a docker file ./docker/build.sh
and
then run it ./docker/run.sh
.
this latest script will map the 8080 port of the container to 8081 so it can run simultaneous to acdc.
then, in acdc, when all the workspace is set up stop the server and run npm run onboard-domain -- --domainName=$DOMAIN_NAME --anchoring=http://localhost:8081 --bricking=http://localhost:8081 --notifications=http://localhost:8081
restart the server npm run server
and now the KeySSI generated in this workspace can be used in the acdc workspace (easy test via Dossier Explorer or by using it in the EPI app)
If you think you can contribute, please check with the team, if it is ok to submit a pull-request.
Follow the "10 commandments" at https://jaxenter.com/10-commandments-committing-pull-requests-115707.html
- Thou Shalt not reformat
- Thou shalt absolutely not fix whitespace
- Thou Shalt not refactor
- Thou Shalt not rename
- Thou shalt document
- Thou shalt not implement more than one thing in a single commit
- Thou shalt ask the vendor / community first
- Thou shalt not demand
- Thou shalt accept the license terms