Skip to content

Commit ffb49b6

Browse files
authored
Update README.md
1 parent 943f502 commit ffb49b6

File tree

1 file changed

+69
-45
lines changed
  • BusinessNetwork-Extension/insurancebusinessnetwork

1 file changed

+69
-45
lines changed
Lines changed: 69 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,93 @@
1-
# Membership Attestation
1+
# Insurance Business Network
22

33

44
In this sample, we will showcase the use of business network extension in a mock insurance constorsium cordapp
55

6-
Concept:
6+
### Concept:
77
In this app, we will have a global insurance network, where participants are either insurance companies or different kind of health care providers.
88
With the help of business network extension, we can further breakdown the global network into smaller pieces as groups, such as APAC_Insurance_Alliance.
99

1010
In our sample, we will have three nodes, named as:
11-
NetworkProvider
12-
Insurer
13-
CarePro
11+
* NetworkOperator <- Business Network Operator
12+
* Insurance <- Insurance Company that is in the network
13+
* CarePro <- Care Provider of the network
1414

15-
The NetworkProvider will be create and primarily manage the network. As introduced in the SDK docs, NetworkManager will be the default authorized user of this global network. And the other two nodes will fill the roles which can be easily tell by its name.
15+
The NetworkOperator will be create and primarily manage the network. As introduced in the SDK docs, NetworkOperator will be the default authorized user of this global network. And the other two nodes will fill the roles which can be easily tell by its name.
1616

17-
The corDapp will run with the following steps:
18-
1. Network creations by NetworkProvider
17+
#### The corDapp will run with the following steps:
18+
1. Network creations by NetworkOperator
1919
2. The rest of the nodes request join the network
20-
3. The network provider will query all the request and active the membership status for the other nodes.
21-
4. The NetworkProvider will then create a sub group out of the global insurance network called APAC_Insurance_Alliance, and include the two other nodes in the network.
22-
5. The networkmanager will then assign custom network identity to the nodes. The insurer node will get an insurance identity, the carePro node will get a health care provider identity.
20+
3. The NetworkOperator will query all the request and active the membership status for the other nodes.
21+
4. The NetworkOperator will then create a sub group out of the global insurance network called APAC_Insurance_Alliance, and include the two other nodes in the network.
22+
5. The NetworkOperator will then assign custom network identity to the nodes. The insurer node will get an insurance identity, the carePro node will get a health care provider identity.
2323
6. Custom network identity comes with custom roles. We will give the insurer node a policy.
2424
As of now, the network setup is done. The very last step is to run a transaction between the insurer and the carePro node
2525

26+
### Usage
2627

28+
#### Running the CorDapp
2729

30+
Open a terminal and go to the project root directory and type: (to deploy the nodes using bootstrapper)
31+
```
32+
./gradlew clean deployNodes
33+
```
34+
Then type: (to run the nodes)
35+
```
36+
./build/nodes/runnodes
37+
```
38+
#### Interacting with the CorDapp
2839

29-
//Step1: Create the network
40+
Step1: Create the network in NetwprkOperator's terminal
41+
```
3042
flow start CreateNetwork
31-
32-
//Step2: 2 non-member makes the request to join the network.
33-
flow start RequestMembership authorisedParty: NetworkOperator, networkId: 603ec1c1-8b4f-4d4a-968a-8893ba9fdc00
34-
35-
//Step3: go back to the admin node, and query all the membership requests.
36-
flow start QueryAllMembers
37-
38-
//Step4: Admin active membership, two times, ONLY the membership activation
39-
Insurance:
40-
flow start ActiveMembers membershipId: c80bfa2c-d6c4-4376-8244-56d5cd27f050
41-
42-
CarePro:
43-
flow start ActiveMembers membershipId: 54e6d7af-2c9e-4267-adf0-872f70b7c800
44-
45-
---------------------
46-
flow start CreateNetworkSubGroup networkId: 603ec1c1-8b4f-4d4a-968a-8893ba9fdc00, groupName: APAC_Insurance_Alliance, groupParticipants: [baefb1ed-250a-4d27-b3db-6b8914151a45, c80bfa2c-d6c4-4376-8244-56d5cd27f050, 54e6d7af-2c9e-4267-adf0-872f70b7c800]
47-
48-
flow start AssignBNIdentity firmType: InsuranceFirm, membershipId: c80bfa2c-d6c4-4376-8244-56d5cd27f050, bnIdentity: APACIN76CZX
49-
50-
flow start AssignPolicyIssuerRole membershipId: c80bfa2c-d6c4-4376-8244-56d5cd27f050, networkId: 603ec1c1-8b4f-4d4a-968a-8893ba9fdc00
51-
52-
flow start AssignBNIdentity firmType: CareProvider, membershipId: 54e6d7af-2c9e-4267-adf0-872f70b7c800, bnIdentity: APACCP44OJS
53-
54-
55-
//Query to check
43+
```
44+
45+
Step2: 2 non-member makes the request to join the network. Fill in the networkId with what was return from Step1
46+
```
47+
flow start RequestMembership authorisedParty: NetworkOperator, networkId: <xxxx-xxxx-xxxx-xxxx-xxxxx>
48+
```
49+
Step3: go back to the admin node, and query all the membership requests.
50+
```flow start QueryAllMembers
51+
```
52+
Step4: Admin active membership, two times, ONLY the membership activation
53+
Insurance: fill in the Insurance node MembershipId that is display in the previous query
54+
```
55+
flow start ActiveMembers membershipId: <xxxx-xxxx-xxxx-xxxx-xxxxx>
56+
```
57+
CarePro: fill in the CarePro node MembershipId that is display in the previous query
58+
```
59+
flow start ActiveMembers membershipId: <xxxx-xxxx-xxxx-xxxx-xxxxx>
60+
```
61+
62+
Step5: Admin create subgroup and add group members.
63+
```
64+
flow start CreateNetworkSubGroup networkId: <xxxx-FROM-STEP-ONE-xxxxx>, groupName: APAC_Insurance_Alliance, groupParticipants: [<xxxx-NETWORKOPERATOR-ID-xxxxx>, <xxxx-xxxx-INSURANCE-ID-xxxxx>, <xxxx-xxxx-CAREPRO-ID-xxxxx>]
65+
```
66+
Step6: Admin assign business identity to a member.
67+
```
68+
flow start AssignBNIdentity firmType: InsuranceFirm, membershipId: <xxxx-xxxx-INSURANCE-ID-xxxxx>, bnIdentity: APACIN76CZX
69+
```
70+
Step7: Admin assign business identity to the second member
71+
```
72+
flow start AssignBNIdentity firmType: CareProvider, membershipId: <xxxx-xxxx-CAREPRO-ID-xxxxx>, bnIdentity: APACCP44OJS
73+
```
74+
Step8: Admin assign business identity related ROLE to the member.
75+
```
76+
flow start AssignPolicyIssuerRole membershipId: <xxxx-xxxx-INSURANCE-ID-xxxxx>, networkId: <xxxx-xxxx-NETWORK-ID-xxxxx>
77+
```
78+
Sanity Check: Query to check, we should be able to see multiple MembershipStates and GroupStates
79+
```
5680
run vaultQuery contractStateType: net.corda.core.contracts.ContractState
81+
run vaultQuery contractStateType: net.corda.bn.states.MembershipState
5782
83+
```
5884
-------------------Network setup is done, and business flow begins--------------------------
5985

60-
/* Step9: The insurance Company will issue a policy to insuree.
61-
* The flow initiator (the insurance company) has to be a member of the Business network, has to have a insuranceIdentity, and has to have issuer Role, and has to have issuance permission.
62-
*/
86+
Step9: The insurance Company will issue a policy to insuree. The flow initiator (the insurance company) has to be a member of the Business network, has to have a insuranceIdentity, and has to have issuer Role, and has to have issuance permission.
87+
```
6388
flow start IssuePolicyInitiator networkId: 603ec1c1-8b4f-4d4a-968a-8893ba9fdc00, careProvider: CarePro, insuree: PeterLi
64-
//Step10: Query the state in the CarePro node.
89+
```
90+
Step10: Query the state in the CarePro node.
91+
```
6592
run vaultQuery contractStateType: net.corda.samples.businessmembership.states.InsuranceState
66-
run vaultQuery contractStateType: net.corda.bn.states.MembershipState
67-
68-
69-
//flow start AssignBNIdentity firmType: CareProvider, membershipId: 9cc6abf7-e20e-4404-be8c-4bcec1a668e0, bnIdentity: APACCP44OJS
93+
```

0 commit comments

Comments
 (0)