You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was produced by copying over the files/folders recursively
from the private Accenture repository which was on the commit:
------------------------------------------------------------------------
Commit: fce7bfb281d719fe41b15f90fb721ed525a9dba6
Parents: 80e17819bd280d48867dc1efc53c5ef57293c346
Author: hugo.borne-pons <[email protected]>
Date: Thu Oct 24 2019 05:21:20 GMT-0700 (Pacific Daylight Time)
Committer: hugo.borne-pons
------------------------------------------------------------------------
@@ -17,8 +18,13 @@ The scripts and following commands have only been tested on Ubuntu 18.04
17
18
18
19
Since the example runs on Hyperledger Fabric and Quorum, we'll first need to install and run local networks for both. Considering that we need to run 2 or more DLTs, the preferred setup for the demo is in Docker containers and we don't provide support for manual install just yet. We are gonna deploy 2 dockerised Blockchains with 4 nodes each plus the federations, it can prove power intensive for a single machine, we recommend deploying the environments in different machines: e.g. Fabric Blockchain and federation on one machine and Quorum Blockchain and federation in another one.
19
20
20
-
Navigate to the example folder: ``cd example/simple-asset-transfer``
21
+
Navigate to the example folder: ``cd examples/simple-asset-transfer``
21
22
Install npm dependencies: ``npm i``
23
+
Navigate to the example Fabric API folder: ``cd example/simple-asset-transfer/fabric/api``
24
+
Install npm dependencies: ``npm i``
25
+
Navigate to the example Quorum API folder: ``cd example/simple-asset-transfer/quorum/api``
26
+
Install npm dependencies: ``npm i``
27
+
22
28
Check example package.json for available commands. In simple-asset-transfer folder: ``cat package.json``
23
29
24
30
#### Fabric Blockchain
@@ -66,40 +72,61 @@ Then, you can run a federation of 4 validators:
66
72
``npm run fed:quorum``
67
73
Federation validators are relying on Fabric nodes and connectors to perform Blockchain actions and verifications, the default config is set to look for a running instance of the Fabric SDK locally on port 5050. If you are running the Fabric SDK on a different port or another machine you want to modify the ``federations/docker-compose-fabric.yml`` accordingly, look for ``URL: "http://172.20.0.1:5050"`` for each of the services and modify the string to point to the correct endpoint.
68
74
75
+
#### Corda Blockchain
76
+
77
+
First you need to build and deploy a Corda network. For this you need to run the following script:
78
+
``npm run corda:build``
79
+
80
+
This process can take several minutes to load the necessary components and assemble the Corda nodes. After successfully deploying the Corda nodes and web servers, you can run the Corda network.
81
+
82
+
To run the Corda Blockchain, you can use the following script:
83
+
``npm run corda``
84
+
85
+
This will run a Corda network of 5 nodes and 4 web servers. The launch will take you a couple of minutes.
86
+
87
+
#### Corda Federation
88
+
89
+
As mentioned above, you do not need to rebuild the docker image if you have already done it. Otherwise run next script:
90
+
``npm run fed:build``
91
+
92
+
Then, you can run a federation of 4 validators:
93
+
``npm run fed:corda``
94
+
Federation validators are relying on connectors to trigger Corda flows and verifications.
95
+
96
+
The federation will start in the background, you can use ``npm run fed:corda:log`` to show the Corda federation validator outputs.
97
+
69
98
### Scenarios
70
99
71
-
All scenarios are connecting to both Fabric, Quorum Blockchains and their respective federations. If you run everything locally with the default port you can go forward and launch one of the scenarios with the following commands. Otherwise, you will have to modify the config file located in the scenarios folder under simple-asset-transfer folder, to match the proper url for each of the networks.
72
-
73
-
- Share-pub-key
74
-
``npm run scenario:share``
75
-
Fetch all Quorum Validators' public keys and store them into Fabric smart contract then fetch all Fabric Validators' public key and store them into Quorum smart contract
76
-
77
-
Step1. Call ``askForPubKey`` for each of the alive Quorum validators and gather the public keys
78
-
Step2. Call ``addForeignValidator`` using one Fabric Node for each of the gathered public key
79
-
Step3. Call ``askForPubKey`` for each of the alive Fabric validators and gather the public keys
80
-
Step4. Call ``addForeignValidator`` using one Quorum Node for each of the gathered public key
81
-
Note: Step4. will be rejected by the EVM and fail if the public keys have already been stored in the smart contract. Launching the scripts multiple times will automatically cause this problem
82
-
83
-
- fabric-to-quorum
84
-
``npm run scenario:FtQ``
85
-
Create an asset on Fabric Blockchain and retire it, then ask a proof of retirement from the validators and send the proof on the Quorum Blockchain for on-chain verifications of the signature
86
-
87
-
Step1. Call ``createAsset`` to generate a standard asset with a pseudo-random ID on Fabric chain
88
-
Step2. Call ``lockAsset`` to retire the asset specifying a target public key (optional) on Fabric chain
89
-
Step2'. Call ``getAsset`` to verify the state of the asset on Fabric chain
90
-
Step3. Call ``askForSignature`` for the retirement of the asset and gather the signatures of the validators (should be 4 of them)
91
-
Step4. Call ``verifySignature`` to check the generated proof on Quorum chain
92
-
93
-
- quorum-to-fabric
94
-
``npm run scenario:QtF``
95
-
96
-
Create an asset on Quorum Blockchain and retire it, then ask a proof of retirement from the validators and send the proof on the Quorum Blockchain for on-chain verifications of the signature
97
-
98
-
Step1. Call ``createAsset`` to generate a standard asset with a pseudo-random ID on Quorum chain
99
-
Step2. Call ``lockAsset`` to retire the asset specifying a target public key (optional) on Quorum chain
100
-
Step2'. Call ``getAsset`` to verify the state of the asset on Quorum chain
101
-
Step3. Call ``askForSignature`` for the retirement of the asset and gather the signatures of the validators (should be 4 of them)
102
-
Step4. Call ``verifySignature`` to check the generated proof on Fabric chain
100
+
All scenarios are connected to all three Blockchains and their federations. If you run everything locally with the default port you can go forward and launch one of the scenarios with the following commands. Otherwise, you will have to modify the config file located in the scenarios folder under simple-asset-transfer folder, to match the proper url for each of the networks.
101
+
102
+
***share-pub-key**``npm run scenario:share``
103
+
104
+
Fetch all Validators' public keys from Corda, Quorum and Fabric Blockchains and share them between participating Blockchains.
105
+
106
+
- Step 1 Call ``askForPubKey`` for each of the alive Corda validators and gather them
107
+
- Step 2 Call ``askForPubKey`` for each of the alive Quorum validators and gather them
108
+
- Step 3 Call ``askForPubKey`` for each of the alive Fabric validators and gather them
109
+
- Step 4 Call ``addForeignValidator`` to store Corda + Quorum public keys to Fabric smart contract
110
+
- Step 5 Call ``addForeignValidator`` to store Corda + Fabric pubic keys into and Quorum smart contract
111
+
- Step 6 Call ``addForeignValidator`` to store Fabric + Quorum public keys to Corda ledger
112
+
113
+
Note: Last steps be fail if the public keys have already been stored. Launching the scripts multiple times will automatically cause this problem
114
+
115
+
***fabric-to-quorum**``npm run scenario:FtQ``
116
+
***quorum-to-fabric**``npm run scenario:QtF``
117
+
***corda-to-quorum**``npm run scenario:CtQ``
118
+
***corda-to-fabric**``npm run scenario:CtF``
119
+
***fabric-to-corda**``npm run scenario:FtC``
120
+
***quorum-to-corda**``npm run scenario:QtC``
121
+
122
+
This list of scenarios that create an asset on one of Blockchains ('export chain') and retire it, then ask a proof of retirement from the validators and send the proof in another Blockchain ('import chain') for on-chain verifications of the signature
123
+
124
+
- Step 1 Call ``createAsset`` to generate a standard asset with a pseudo-random ID on 'export chain'
125
+
- Step 2 Call ``lockAsset`` to retire the asset specifying a target public key (optional) on 'export chain'
126
+
- Step 2.5 (optional) Call ``getAsset`` to verify the state of the asset on 'export chain'
127
+
- Step 3 Call ``askForSignature`` for the retirement of the asset and gather the signatures of the validators (should be 4 of them)
128
+
- Step 4 Call ``verifySignature`` to check the generated proof on 'import chain'
129
+
- Step 5 Call ``copyAsset`` to creating a copy of the exported asset on 'import chain'
Installing Node.js will also install NPM, however it is recommended that you confirm the version of NPM installed. You can upgrade/downgrade the npm tool with the following command:
0 commit comments