epi-workspace bundles all the necessary dependencies for building and running EPI SSApps in a single package.
For more details about what a workspace is check out the template-workspace.
In order to use the workspace, we need to follow a list of steps presented below.
If you have trouble installing the epi-workspace, please try to follow the guide provided on PrivateSky.xyz
$ git clone https://github.com/PharmaLedger-IMI/epi-workspace.git
After the repository was cloned, you must install all the dependencies.
$ cd epi-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 epi-workspace folder run:
$ npm run server
At the end of this command you get something similar to:
Open a new console inside epi-workspace folder and run:
# Note: Run this in a new console inside "epi-workspace" folder
$ npm run build-all
To run the application launch your browser (preferably Chrome) in Incognito mode and access the http://localhost:8080 link.
Enterprise wallet allows creation of Products and Batches.
Username: test1234
Email: test@test.test
Password: test1234567890
1. Go to Issuer page
2. Put "epi" in application domain field and press "Generate Identity"
3. Copy the the generated issuer identity
4. Paste and save it into /apihub-root/external-volume/issuers-public-identities file. The entry should be on a single line.
1. Go to Holder
2. Put "epi" in application domain field and press "Generate Identity"
3. Copy the generated User Identity
4. Paste it into Issuer's field named "Identity of a new user in domain [epi]" and press "Generate Credentials"
5. Copy the generated credentials (from Issuer's page) and paste it into credential field inside the Holder page and press "Save Credentials"
Now you will act as a Holder thus will be able to add Products (and leaflets for it) and create Batches of products.
This is the part a normal user will see. The part that will be used to scan barcodes on drug's packages.
Steps:
- start from a fresh install of the workspace.
git clone https://github.com/PharmaLedger-IMI/epi-workspace
cd epi-workspace
- ensure that env variable called DEV is set to true in env.json file
{ "PSK_TMP_WORKING_DIR": "tmp", "PSK_CONFIG_LOCATION": "../apihub-root/external-volume/config", "DEV": true }
- run the installation process of the workspace
npm install
- run the server and build the ssapps and wallets
npm run server
npm run build-all
- verify that the builds are successfully and the ssapps are functioning properly
- execute the freeze command
npm run freeze
- verify the output of freeze command and check for errors. If any, correct them and run again the freeze command.
- commit the new version of the octopus.json file obtained with the freeze command.
Steps
- Install all dependencies (as develoment) for this workspace
npm run dev-install
- Bind Android repository into workspace
npm run install-mobile
- Launch API HUB
npm run server
- Prepare the Node files that will be packed into the Android app
#In another tab / console
npm build-mobile
- Have /mobile/scan-app/android/local.properties file with the following content
# Change the value to your SDK path
sdk.dir=/home/alex/Android/Sdk
- Build the APK
npm build-android-apk
This concludes the steps to build the APK file.
Note: The .apk file should be in folder
mobile/scan-app/android/app/build/outputs/apk/release