Submitting a new transaction to the network

There's a lot more we can do with the Playground; we're now going to interact with the business network dynamically!

Ensure that you've selected the LetterOfCredit asset type in the Test view. Notice the Submit Transaction button on the left-hand pane:

We're going to interact with the business network by submitting a new LetterOfCredit application. If you press Submit Transaction, you'll be presented with the following entry box:

In the Transaction Type dropdown, you'll see all the possible transactions listed. Select InitialApplication and replace the JSON Data Preview with the following data:

{
"$class": "org.example.loc.InitialApplication",
"letterId": "LPLAYGROUND",
"applicant": "resource:org.example.loc.Customer#alice",
"beneficiary": "resource:org.example.loc.Customer#bob",
"rules": [
{
"$class": "org.example.loc.Rule",
"ruleId": "rule1",
"ruleText": "This is a test rule."
}
],
"productDetails": {
"$class": "org.example.loc.ProductDetails",
"productType": "Monitor",
"quantity": 42,
"pricePerUnit": 500
}
}

Can you see what this transaction describes? Can you see the new LetterId between Alice and Bob as Customer and Beneficiary? Can you see the ProductDetails, Quantity, and Price?

If you press Submit, you'll see that you're returned to the main view, and that a new letter has been created:

Congratulations, you've just submitted a new application for a letter of credit!
But wait! If we've interacted with the live network, then what happens if we return to our application view. If you got back to Alice's view, you'll notice that she has a new letter:

The Hyperledger Composer Playground has allowed us to interact with the live business network! Moreover, if we select Matias's page, we can see the letter is waiting for approval:

Notice all the attributes are those that you entered in the sample transaction! You can now use the Playground to move this letter through its full life cycle. We recommend that you spend some time doing thisit will help you solidify your knowledge.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.252.227