The current mono-repo is a simple project to showcase the ease and power of Convector by creating a basic Drug Supply Chain fullstack application example.
Some of the challenges on the field are:
A somewhat typical value chain in this industry looks like:
Took from: http://www.rmtminc.com/page/product-solutions/supply-chain-integrity.html
A few high level reasons on why Blockchain may help here, are the following (for a real application, further analysis is required):
The end result:
npm i
node ./update-paths.js
Wake up the environment and install the components.
# Start the development blockchain and install chaincodes
# *An expected error will be shown* since the script will try to make a first call
# to start the chaincode containers.
npm run start
# Seed some participants in the Blockchain
npm run seed
Run the project (Servers will auto-enroll with the participant chaincode).
# Start the server
npx lerna run start:dev --scope @worldsibu/convector-example-dsc-server --stream
# Start the ui project
npx lerna run start --scope @worldsibu/convector-example-dsc-ui --stream
Go to localhost:4200
and use the application!
Access the CouchDB here: http://localhost:5084/_utils/#database/ch1_drug/_all_docs
To have multiple users registered in the network you need to start the server with each user (certificate/wallet) that will be available with these example scripts 👇
A new server will start but it will use a different identity to communicate with the blockchain network. Beware that the server always talks with 10010 port therefore the same front end will be used but it will call a different instance of the server source code.
The options available are:
[
{
"certId": "user1",
"certOrg": "org1",
"id": "aa001"
},
{
"certId": "user2",
"certOrg": "org1",
"id": "aa002"
},
{
"certId": "user3",
"certOrg": "org1",
"id": "aa003"
},
{
"certId": "user1",
"certOrg": "org2",
"id": "aa004"
},
{
"certId": "user2",
"certOrg": "org2",
"id": "aa005"
},
{
"certId": "user3",
"certOrg": "org2",
"id": "aa006"
},
]
Run the server:
# Stop the current server and run
# Start the server as the second user "aa002"
IDENTITY=aa002 npx lerna run start:dev --scope @worldsibu/convector-example-dsc-server --stream
# Stop the current server and run
# Start the server as the second user "aa003"
IDENTITY=aa003 npx lerna run start:dev --scope @worldsibu/convector-example-dsc-server --stream
docker ps
in your terminal.docker logs -f dev-peer0.org2.hurley.lab-drug-1.0
(or if you upgraded the version at the end may vary).