Skip to content

Commit f88845b

Browse files
committed
chore: updating from private repo
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 ------------------------------------------------------------------------
1 parent 9ead7e8 commit f88845b

File tree

232 files changed

+32931
-2294
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

232 files changed

+32931
-2294
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,4 +305,4 @@ We want to implement plugins and on-chain logic for more platforms (e.g. Digital
305305
3 mihails gulajevs
306306
2 dimitrijs rulovs
307307
2 unknown
308-
1 peter somogyvari
308+
1 peter somogyvari

docs/tutorials/simple-asset-transfer.md

+60-33
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ We implemented an example using our Fabric and Quorum plugins to showcase a simp
88
- [Docker-compose](https://docs.docker.com/compose/install/)
99
- [Node.js](https://nodejs.org/en/download/) npm >= 5.6 & node >= 8.9
1010
- [Fabric1.4](https://hyperledger-fabric.readthedocs.io/en/release-1.4/)
11+
- [JDK 8](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
1112

1213
Note: Fabric SDK has stricter engine requirements (npm < 6.0 & node < 9.0)
1314

@@ -17,8 +18,13 @@ The scripts and following commands have only been tested on Ubuntu 18.04
1718

1819
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.
1920

20-
Navigate to the example folder: ``cd example/simple-asset-transfer``
21+
Navigate to the example folder: ``cd examples/simple-asset-transfer``
2122
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+
2228
Check example package.json for available commands. In simple-asset-transfer folder: ``cat package.json``
2329

2430
#### Fabric Blockchain
@@ -66,40 +72,61 @@ Then, you can run a federation of 4 validators:
6672
``npm run fed:quorum``
6773
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.
6874

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+
6998
### Scenarios
7099

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'
103130

104131
### Tests
105132

docs/tutorials/troubleshooting.md

+6
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,9 @@ When running the Fabric client from the Fabric SDK against your Fabric ledger, y
3030
nano node-module/fabric-client/config/default.json
3131
```
3232
increase ``"request-timeout" : 45000,`` l.2
33+
34+
### Installing non-default npm version
35+
36+
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:
37+
38+
npm install [email protected] -g

examples/simple-asset-transfer/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:8
1+
FROM node:8-slim
22

33
ADD . /federation
44
WORKDIR /federation

examples/simple-asset-transfer/app.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const Validator = require(`@hyperledger/blockchain-integration-framework`).Valid
22
const { genKeyFile } = require(`@hyperledger/blockchain-integration-framework`).cryptoUtils;
33
const ConnectorFabric = require(`./fabric/connector`);
44
const ConnectorQuorum = require(`./quorum/connector`);
5+
const ConnectorCorda = require(`./corda/connector`);
56

67
(async () => {
78
const keypair = await genKeyFile(`/federation/keypair`);
@@ -24,16 +25,19 @@ const ConnectorQuorum = require(`./quorum/connector`);
2425
password: process.env.PASSWORD,
2526
url: process.env.URL,
2627
port: process.env.PORT,
27-
}
28+
};
2829

2930
let connector;
30-
switch(validatorOptions.dlType) {
31+
switch (validatorOptions.dlType) {
3132
case `FABRIC`:
3233
connector = new ConnectorFabric(connectorOptions);
3334
break;
3435
case `QUORUM`:
3536
connector = new ConnectorQuorum(connectorOptions);
3637
break;
38+
case `CORDA`:
39+
connector = new ConnectorCorda(connectorOptions);
40+
break;
3741
default:
3842
throw new Error(`undefined dlType`);
3943
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Eclipse, ctags, Mac metadata, log files
2+
.classpath
3+
.project
4+
.settings
5+
tags
6+
.DS_Store
7+
*.log
8+
*.log.gz
9+
*.orig
10+
11+
.gradle
12+
13+
# General build files
14+
**/build/*
15+
!docs/build/*
16+
17+
lib/dokka.jar
18+
19+
### JetBrains template
20+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
21+
22+
*.iml
23+
24+
## Directory-based project format:
25+
#.idea
26+
27+
# if you remove the above rule, at least ignore the following:
28+
29+
# Specific files to avoid churn
30+
.idea/*.xml
31+
.idea/copyright
32+
.idea/jsLibraryMappings.xml
33+
34+
# User-specific stuff:
35+
.idea/tasks.xml
36+
.idea/dictionaries
37+
38+
# Sensitive or high-churn files:
39+
.idea/dataSources.ids
40+
.idea/dataSources.xml
41+
.idea/sqlDataSources.xml
42+
.idea/dynamic.xml
43+
.idea/uiDesigner.xml
44+
45+
# Gradle:
46+
.idea/libraries
47+
48+
# Mongo Explorer plugin:
49+
.idea/mongoSettings.xml
50+
51+
## File-based project format:
52+
*.ipr
53+
*.iws
54+
55+
## Plugin-specific files:
56+
57+
# IntelliJ
58+
/out/
59+
workflows/out/
60+
contracts/out/
61+
clients/out/
62+
testing/out/
63+
64+
# mpeltonen/sbt-idea plugin
65+
.idea_modules/
66+
67+
# JIRA plugin
68+
atlassian-ide-plugin.xml
69+
70+
# Crashlytics plugin (for Android Studio and IntelliJ)
71+
com_crashlytics_export_strings.xml
72+
crashlytics.properties
73+
crashlytics-build.properties
74+
75+
# docs related
76+
docs/virtualenv/
77+
78+
# if you use the installQuasar task
79+
lib

examples/simple-asset-transfer/corda/.idea/runConfigurations/Main_program.xml

+15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/simple-asset-transfer/corda/.idea/runConfigurations/PartyA_WEB.xml

+18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/simple-asset-transfer/corda/.idea/runConfigurations/PartyB_WEB.xml

+18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/simple-asset-transfer/corda/.idea/runConfigurations/PartyC_WEB.xml

+18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/simple-asset-transfer/corda/.idea/runConfigurations/PartyD_WEB.xml

+18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/simple-asset-transfer/corda/.idea/runConfigurations/Run_Flow_Tests.xml

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/simple-asset-transfer/corda/.idea/runConfigurations/Run_Integration_Tests.xml

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)