|
1 | | -# Membership Attestation |
| 1 | +# Insurance Business Network |
2 | 2 |
|
3 | 3 |
|
4 | 4 | In this sample, we will showcase the use of business network extension in a mock insurance constorsium cordapp |
5 | 5 |
|
6 | | -Concept: |
| 6 | +### Concept: |
7 | 7 | In this app, we will have a global insurance network, where participants are either insurance companies or different kind of health care providers. |
8 | 8 | With the help of business network extension, we can further breakdown the global network into smaller pieces as groups, such as APAC_Insurance_Alliance. |
9 | 9 |
|
10 | 10 | 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 |
14 | 14 |
|
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. |
16 | 16 |
|
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 |
19 | 19 | 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. |
23 | 23 | 6. Custom network identity comes with custom roles. We will give the insurer node a policy. |
24 | 24 | As of now, the network setup is done. The very last step is to run a transaction between the insurer and the carePro node |
25 | 25 |
|
| 26 | +### Usage |
26 | 27 |
|
| 28 | +#### Running the CorDapp |
27 | 29 |
|
| 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 |
28 | 39 |
|
29 | | -//Step1: Create the network |
| 40 | +Step1: Create the network in NetwprkOperator's terminal |
| 41 | +``` |
30 | 42 | 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 | +``` |
56 | 80 | run vaultQuery contractStateType: net.corda.core.contracts.ContractState |
| 81 | +run vaultQuery contractStateType: net.corda.bn.states.MembershipState |
57 | 82 |
|
| 83 | +``` |
58 | 84 | -------------------Network setup is done, and business flow begins-------------------------- |
59 | 85 |
|
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 | +``` |
63 | 88 | 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 | +``` |
65 | 92 | 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