Skip to content

Commit 79908ce

Browse files
authored
Merge branch 'corda:master' into master
2 parents e8d68b0 + 9651d36 commit 79908ce

63 files changed

Lines changed: 518 additions & 398 deletions

File tree

Some content is hidden

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

Accounts/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This folder features Corda Accounts sample projects. Learn more about [Accounts]
66

77
This CorDapp mimics a supply chain transaction, where the deal is incorporated among different teams in the companies on both side of the trade.
88
<p align="center">
9-
<img src="./supplychain/Business%20Flow.png" alt="Corda" width="700">
9+
<img src="./supplychain/Business_Flow.png" alt="Corda" width="700">
1010
</p>
1111

1212
### [Tic Tac Thor](./tictacthor):
@@ -15,3 +15,7 @@ This CorDapp recreates the game of Tic Tac Toe via Corda. It primarily demonstra
1515
<p align="center">
1616
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/32/Tic_tac_toe.svg/1024px-Tic_tac_toe.svg.png" alt="Corda" width="200">
1717
</p>
18+
19+
### [World Cup Ticket Booking](./worldcupticketbooking):
20+
21+
This sample shows you how to integrate accounts and tokens. This sample talks about a scenario where typically when the Cricket season starts, BCCI (Board of Control for Cricket) starts selling tickets. As of now there are multiple dealers whom the BCCI issues tickets and further these dealers sell tickets to their client. We are trying to simulate similar functionality maintaining the entire issuance and selling of the tickets on Corda Platform.

Accounts/supplychain/README.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Accounts_SupplyChain
22

3-
For More information regarding the Accounts Library, please read at: https://github.com/corda/accounts/blob/master/docs.md
3+
For more information regarding the Accounts Library, please read at: https://github.com/corda/accounts/blob/master/docs.md
44

55
This sample describes a mock/simple supply chain business flow.
66

@@ -10,18 +10,23 @@ This sample describes a mock/simple supply chain business flow.
1010

1111
From the above chart, you can see the flow is going back and forth between different parties' accounts. Please follow the instruction below to experience the [Accounts](https://training.corda.net/libraries/accounts-lib/) library.
1212

13-
# Setting up
13+
14+
## Pre-Requisites
15+
16+
For development environment setup, please refer to: [Setup Guide](https://docs.r3.com/en/platform/corda/4.9/community/getting-set-up.html).
17+
18+
## Runnning the nodes
1419
Go into the project directory and build the project
1520
```
16-
./gradlew clean deployNodes
21+
./gradlew clean build deployNodes
1722
```
1823
Run the project
1924
```
2025
./build/nodes/runnodes
2126
```
2227
Now, you should have four Corda terminals opened automatically.
2328

24-
# Shell Instructions (Part 1) - Creating & Sharing Accounts
29+
## Shell Instructions (Part 1) - Creating & Sharing Accounts
2530
Go to the Buyer's node terminal and paste in the following code: (You can select all 7 lines and copy to the terminal all at once)
2631
```
2732
flow start CreateNewAccount acctName: BuyerProcurement
@@ -33,7 +38,7 @@ flow start ShareAccountTo acctNameShared: BuyerFinance, shareTo: Seller
3338
flow start ShareAccountTo acctNameShared: BuyerWarehouse, shareTo: ShippingCo
3439
flow start ShareAccountTo acctNameShared: BuyerWarehouse, shareTo: Seller
3540
```
36-
This is creating 3 accounts under Buyer's node and sharing with their specific conterpartie's node or account.
41+
This is creating 3 accounts under Buyer's node and sharing with their specific counterparty's node or account.
3742

3843
Go to the Seller's node terminal and paste in the following code:
3944
```
@@ -45,14 +50,14 @@ flow start ShareAccountTo acctNameShared: SellerSales, shareTo: Buyer
4550
flow start ShareAccountTo acctNameShared: SellerFinance, shareTo: Buyer
4651
flow start ShareAccountTo acctNameShared: SellerInventory, shareTo: ShippingCo
4752
```
48-
This is creating 3 accounts under Seller's node and sharing with their specific conterparty's node or account.
53+
This is creating 3 accounts under Seller's node and sharing with their specific counterparty's node or account.
4954

5055
[Optional]: You can run a vaultQuery to see the [AccountInfo](https://training.corda.net/libraries/accounts-lib/#design) that been stored at each node by using:
5156
```
5257
run vaultQuery contractStateType: com.r3.corda.lib.accounts.contracts.states.AccountInfo
5358
```
54-
# Shell Instructions (Part 2) - Executing Business Flows
55-
## Step 1: Seller's sales team send inovice of $500 to Buyer's procurement team
59+
## Shell Instructions (Part 2) - Executing Business Flows
60+
### Step 1: Seller's sales team send invoice for $500 to Buyer's procurement team
5661
navigate to Seller's node terminal and run
5762
```
5863
flow start SendInvoice whoAmI: SellerSales, whereTo: BuyerProcurement, amount: 500
@@ -63,42 +68,42 @@ flow start ViewInboxByAccount acctname: BuyerProcurement
6368
```
6469
You see that the invoice state amount 500 is returned. You can also replace the BuyerProcurement with BuyerWarehouse to see that the non-relevant accounts has no visiblity about the invoice state.
6570

66-
## Step 2: Buyer's procurement team will send an internal message to Buyer's Buyer's finance team
71+
### Step 2: Buyer's procurement team will send an internal message to Buyer's Buyer's finance team
6772
Navigate to Buyer's node terminal and type in:
6873
```
6974
flow start InternalMessage fromWho: BuyerProcurement, whereTo: BuyerFinance, message: Send 500 to SellerFinance
7075
```
7176
[Optional verification]: run ```flow start ViewInboxByAccount acctname: BuyerFinance``` at Buyer' node terminal
7277

73-
## Step 3: Buyer's finance team send a payment to Seller's finance team
78+
### Step 3: Buyer's finance team send a payment to Seller's finance team
7479
Navigate to Buyer's node terminal and type in:
7580
```
7681
flow start SendPayment whoAmI: BuyerFinance, whereTo: SellerFinance, amount: 500
7782
```
7883
[Optional verification]: run ```flow start ViewInboxByAccount acctname: SellerFinance``` at Seller's node terminal
7984

80-
## Step 4: Seller's finance team send an internal message to Seller's inventory team to instruct them to send the cargo
85+
### Step 4: Seller's finance team send an internal message to Seller's inventory team to instruct them to send the cargo
8186
Navigate to Seller's node terminal and type in
8287
```
8388
flow start InternalMessage fromWho: SellerFinance, whereTo: SellerInventory, message: send Cargo to Buyer
8489
```
8590
[Optional verification]: run ```flow start ViewInboxByAccount acctname: SellerInventory``` at Seller's node terminal
8691

87-
## step 5: Seller's inventory team send a shipping work order for shipping company
92+
### step 5: Seller's inventory team send a shipping work order for shipping company
8893
Navigate to Seller's node terminal and type in
8994
```
9095
flow start SendShippingRequest whoAmI: SellerInventory, whereTo: BuyerWarehouse, shipper: ShippingCo, Cargo: 10 boxes of Books
9196
```
9297
[Optional verification]: run ```run vaultQuery contractStateType: ShippingRequestState``` at ShippingCo's node terminal
9398

94-
## Step 6: Shipping company sends the cargo to Buyer's warehouse
99+
### Step 6: Shipping company sends the cargo to Buyer's warehouse
95100
Navigate to ShippingCo's node terminal and type in
96101
```
97102
flow start SendCargo pickupFrom: SellerInventory, shipTo: BuyerWarehouse, cargo: Books
98103
```
99104
[Optional verification]: run ```flow start ViewInboxByAccount acctname: BuyerWarehouse``` at Buyer's node terminal
100105

101-
## Now, the entire business chain is completed.
106+
### Now, the entire business chain is completed.
102107

103108

104109

Accounts/tictacthor/README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,36 @@
11
# Tic Tac Thor
2-
This CorDapp recreates the game of Tic Tac Toe via Corda. It primarilly demonstrates how you can have [LinearState](https://docs.corda.net/docs/corda-os/api-states.html#linearstate) transactions between cross-node accounts.
2+
This CorDapp recreates the game of Tic Tac Toe via Corda. It primarily demonstrates how you can have [LinearState](https://docs.corda.net/docs/corda-os/api-states.html#linearstate) transactions between cross-node accounts.
33

44
<p align="center">
55
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/32/Tic_tac_toe.svg/1024px-Tic_tac_toe.svg.png" alt="Corda" width="200">
66
</p>
77

8+
9+
## Pre-Requisites
10+
11+
For development environment setup, please refer to: [Setup Guide](https://docs.r3.com/en/platform/corda/4.9/community/getting-set-up.html).
12+
813
## Running the sample
914
Deploy and run the nodes by:
1015
```
11-
./gradlew deployNodes
16+
./gradlew clean build deployNodes
1217
./build/nodes/runnodes
1318
```
14-
Then you will need to also start the spring server for the Cordapp by running the following commands seperately:
19+
Then you will need to also start the spring server for the CorDapp by running the following commands separately:
1520
`./gradlew bootRunDevRel`will have the DevRel server running on 8080 port
1621
, and `./gradlew bootRunSOE`will start the Solution Engineering server on 8090 port
1722

18-
## Operating the Cordapp
19-
Now go to postman and excute the following in order: (All of the API are POST request!)
23+
## Operating the CorDapp
24+
Now go to postman and execute the following in order: (All the APIs are POST requests!)
2025
1. Create an account on DevRel node: `http://localhost:8080/createAccount/PeterLi`
2126
2. Create an account on SoE node: `http://localhost:8090/createAccount/DavidWinner`
2227
3. Peter now requests game with David: `http://localhost:8080/requestGameWith/PeterLi/SolutionEng/DavidWinner`
23-
4. David has to accept the challenege: `http://localhost:8090/acceptGameInvite/DavidWinner/DevRel/PeterLi`
28+
4. David has to accept the challenge: `http://localhost:8090/acceptGameInvite/DavidWinner/DevRel/PeterLi`
2429
5. Game Starts, and Peter makes the first move: `http://localhost:8080/startGameAndFirstMove/PeterLi/DavidWinner/0`
2530
6. David's turn: `http://localhost:8090/submitMove/DavidWinner/PeterLi/4`
2631
API Syntax: `http://localhost:8080/submitMove/WHO-AM-I/MY-COUNTERPART/POSITION`
2732

28-
From here, you can start play the game by changing the very last number from the `submitMove`API call. The game board is representated by an 1-D array: What we just ran can transfer into a tic-tac-toe game board like the one we see on the right.
33+
From here, you can start play the game by changing the very last number from the `submitMove`API call. The game board is represented by an 1-D array: What we just ran can transfer into a tic-tac-toe game board like the one we see on the right.
2934
```
3035
│0│1│2│ │O│ │ │
3136
│3│4│5│ -> │ │X│ │
@@ -34,7 +39,7 @@ From here, you can start play the game by changing the very last number from the
3439
The Game will automatically end when one player wins the game.
3540
You can also run `run vaultQuery contractStateType: net.corda.samples.tictacthor.states.BoardState` at any given time to see the board games stored in vault.
3641

37-
now if you want to fast forward the game, Play the following moves in order:
42+
now if you want to fast-forward the game, Play the following moves in order:
3843
According to syntax: we should have `http://localhost:8080/submitMove/PeterLi/DavidWinner/3` for the first move below.
3944
```
4045
* Peter: 3 │O│ │ │
@@ -49,7 +54,7 @@ We can play a bit more about the accounts. Now let's create two accounts, a new
4954
* Create an account on SoE node: `http://localhost:8090/createAccount/ThorG`
5055
Now, try to have Anthony play a game with Thor while start a new game between Peter and David. It worked!
5156

52-
One key feature about account is that, each account's data is segregated, meaning that it can be enforced that each account will not be able to see other account's data. In this sample cordapp, the game is queried by account name. Therefore, we see that each account only knows about the game that he participated. Account Peter doesn't know anything about the game between Thor and Anthony.
57+
One key feature about account is that, each account's data is segregated, meaning that it can be enforced that each account will not be able to see other account's data. In this sample CorDapp, the game is queried by account name. Therefore, we see that each account only knows about the game that he participated. Account Peter doesn't know anything about the game between Thor and Anthony.
5358

5459
## Credit
5560
This project is inspired and evolved from a simple [tic-tac-toe](https://github.com/thorgilman/tictactoe) game on Corda by Thor Gilman.

0 commit comments

Comments
 (0)