<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Peter Li on Medium]]></title>
        <description><![CDATA[Stories by Peter Li on Medium]]></description>
        <link>https://medium.com/@lpeterduke?source=rss-15b8b151b74d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*h0vtGS8ncyU2O-j8.jpg</url>
            <title>Stories by Peter Li on Medium</title>
            <link>https://medium.com/@lpeterduke?source=rss-15b8b151b74d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 06:02:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lpeterduke/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[2020 CordaCon Dev Highlights — Day Two]]></title>
            <link>https://medium.com/corda/2020-cordacon-dev-highlights-day-two-e08d6165b4cc?source=rss-15b8b151b74d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e08d6165b4cc</guid>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[blog]]></category>
            <category><![CDATA[dlt]]></category>
            <category><![CDATA[corda]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Peter Li]]></dc:creator>
            <pubDate>Mon, 26 Oct 2020 16:21:37 GMT</pubDate>
            <atom:updated>2020-10-26T16:21:37.368Z</atom:updated>
            <content:encoded><![CDATA[<h3>CordaCon 2020 developer highlights — day two</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*vHyUsDLLX43vk0asTdwijw.jpeg" /></figure><p>Let’s pick up from where we left off with the previous article on <a href="https://medium.com/corda/2020-cordacon-dev-highlights-day-one-87fd8994613b">CordaCon 2020 developer highlights — day one</a>. Take your pick of these exciting talks from the second day of our annual flagship event <a href="https://www.cordacon.com/">CordaCon 2020</a>.</p><h4>Beyond Blockchain: <a href="https://www.cordacon.com/agenda/session/398816">How Confidential Computing is the Last Piece of the Market Transformation Jigsaw</a> — R3 CTO Richard Brown</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FUdSZy0kceO0XH59CaoS5Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6v4TiO0mUQJD_oacKFNoUQ.png" /></figure><p>Confidential Computing provides the missing piece of the puzzle:</p><ul><li>Conclave uses Confidential Computing and Intel SGX to provide assurance to users that data will be processed in a secure and tamper-proof way.</li><li>Conclave enables service providers to build new privacy-preserving solutions for market-level collaboration.</li></ul><h4>Conclave: <a href="https://www.cordacon.com/agenda/session/398828">Multi-party Computation Made Easy</a> — R3 Lead Platform Engineer Mike Hearn</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V-FI3BJbB9HVPlWshGffpg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-HCy8nF04eCLLjh3xoWK1A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Z2jJ7cwTuJmsehozoTL9A.png" /></figure><p>Imagine a sealed bid auction in which:</p><p>1. User 1 proposes a bid to the enclave (recorded on the ledger).</p><p>2. User 2 proposes a bid to the enclave (recorded on the ledger).</p><p>3. User 3 (auctioneer) receives the output from the enclave (the winner) and stores it on the ledger.</p><p>As a result, User 3 never sees the bids.</p><h4>Wallets Prototype — <a href="https://www.cordacon.com/agenda/session/398827">Deep Dive</a> — R3 Software Engineer Will Hester</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q1Y9WKd-JV07Da5tbIKuBA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BmS8mWTB4Ky8dM_sJ0YUZg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W494hkD4boM1hmGzgQmN8w.png" /></figure><h4>Performance — <a href="https://www.cordacon.com/agenda/session/398826">Now, Then and What’s to Come</a> — R3 Software Engineer Dimos Raptis</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p5OaJ43EndKkDi8SVKedTA.png" /></figure><p>Performance-related improvements:</p><ul><li>Tuning options for Artemis to control <em>flush/ack</em> frequencies.</li><li><em>p2p</em> message compression.</li><li>New <em>sendAll</em> API for sending messages to multiple counterparties.</li></ul><p>Thanks for watching the brief developer highlights from day two — stay tuned for more highlights from day three of <a href="https://go.r3.com/ubE9F">CordaCon 2020</a>.</p><p>Peter Li is a Developer Evangelist at <a href="https://www.r3.com/">R3</a>, an enterprise blockchain software firm working with a global ecosystem of more than 350 participants across multiple industries from both the private and public sectors to develop on Corda — its open-source blockchain platform, and Corda Enterprise — a commercial version of Corda for enterprise usage.</p><p>Follow us on Twitter <a href="https://twitter.com/cordablockchain">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e08d6165b4cc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/corda/2020-cordacon-dev-highlights-day-two-e08d6165b4cc">2020 CordaCon Dev Highlights — Day Two</a> was originally published in <a href="https://medium.com/corda">Corda</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2020 CordaCon Dev Highlights — Day One]]></title>
            <link>https://medium.com/corda/2020-cordacon-dev-highlights-day-one-87fd8994613b?source=rss-15b8b151b74d------2</link>
            <guid isPermaLink="false">https://medium.com/p/87fd8994613b</guid>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[dlt]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[blog]]></category>
            <category><![CDATA[corda]]></category>
            <dc:creator><![CDATA[Peter Li]]></dc:creator>
            <pubDate>Wed, 21 Oct 2020 20:20:03 GMT</pubDate>
            <atom:updated>2020-10-22T05:10:42.434Z</atom:updated>
            <content:encoded><![CDATA[<h3>2020 CordaCon developer highlights — day one</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TcbHNVlAbmeMwIGqtnQQhQ.jpeg" /></figure><p>On October 20th, we kickstarted our annual flagship event <a href="https://www.cordacon.com/">CordaCon 2020</a>, which runs for a 5th consecutive year. This year it is in a new digital format and we have a fantastic panel of <a href="https://www.cordacon.com/page/1514144/speakers">speakers</a>, an impressive list of <a href="https://www.cordacon.com/page/1514146/sponsors">sponsors</a>, and over 5000 registered attendees.</p><p><a href="https://www.cordacon.com/page/1518297/register">Join us</a> on the <a href="https://www.cordacon.com/agenda?dates=1603324800000">final day of the conference</a> — this is a great opportunity to learn and engage with the worldwide blockchain community.</p><p>Here are some of the developer highlights from <a href="https://www.cordacon.com/agenda?dates=1603152000000">day one</a>.</p><h4><strong>This year’s CordaCon themes are </strong><a href="https://www.cordacon.com/agenda/session/393797"><strong>Transact, Connect, and Simplify</strong></a><strong>.</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hF4nkDFfZ0iVdG8JVbPuwg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hDpRah4zRl6JcYAQ5CsIDg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r38UNClaVhBhr8K-nSNvAw.png" /></figure><h4><strong>Corda roadmap &amp; future plan: a quick peek at </strong><a href="https://www.cordacon.com/agenda/session/393798"><strong>Corda 5</strong></a></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rHc2q9AuYDR7QXHMRrJJRw.png" /></figure><p><strong>Corda 5 updates:</strong></p><ul><li>Support for <strong>Java 11</strong>.</li><li>Support for <strong>Kotlin 1.3</strong>.</li><li>Support for <strong>Gradle 6</strong>.</li><li>Support for <strong>TLS 1.3</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4OOZt_xwUPuWj4XclPu8Wg.png" /></figure><p><strong>Corda-aaS: Bring your CorDapp and we will host it for you</strong></p><ul><li>Focus on building your business and your CorDapp — not on operating Corda.</li><li>Go to market more quickly, with scale and enterprise-grade performance.</li><li>Leverage predictable cost models to reduce running costs and TCO.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VUxDdx6cgKQfrhrJUHL6PQ.png" /></figure><p><strong>Corda feature enhancements</strong></p><ul><li>Consensus states.</li><li>Out-of-node signing.</li><li>Data distribution groups.</li><li>CorDapp package management.</li><li>Vault subscription.</li><li>Standard REST endpoints - <strong>RESTful APIs</strong> in a layered API architecture.</li></ul><h4>Payments on Corda: <a href="https://www.cordacon.com/agenda/session/396730">The Roadmap to Universal Payments</a></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YZPH28dxxcdkJlYDfVqPFw.png" /></figure><p>Main points:</p><ul><li>All integrations go through ISO 20022.</li><li>Emerging global standard.</li><li>Enable DvP out of the box.</li></ul><p>Developer Challenge: <a href="https://www.cordacon.com/agenda/session/407969">Accelerate the Potential of 5G with Blockchain</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yw7QbfKQG340z3u8gwhHZQ.png" /></figure><p>How it works:</p><ul><li>Stage 1: value proposition.</li><li>Stage 2: solution design.</li><li>Stage 3: demonstrable prototype.</li><li>Finish line: support to go to production.</li></ul><p>Prizes:</p><ul><li>R3–1 year Corda Enterprise License &amp; $15K grant &amp; Marketing Opportunity.</li><li>Commercial Pilot.</li></ul><p>These were the brief developer highlights from day one - I hope to see you all on day three of <a href="https://go.r3.com/ubE9F">CordaCon 2020</a> tomorrow.</p><p>Peter Li is a Developer Evangelist at <a href="https://www.r3.com/">R3</a>, an enterprise blockchain software firm working with a global ecosystem of more than 350 participants across multiple industries from both the private and public sectors to develop on Corda — its open-source blockchain platform, and Corda Enterprise — a commercial version of Corda for enterprise usage.</p><p>Follow us on Twitter <a href="https://twitter.com/cordablockchain">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87fd8994613b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/corda/2020-cordacon-dev-highlights-day-one-87fd8994613b">2020 CordaCon Dev Highlights — Day One</a> was originally published in <a href="https://medium.com/corda">Corda</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to equip your existing CorDapp with Corda Accounts]]></title>
            <link>https://medium.com/corda/how-to-equip-your-existing-cordapp-with-corda-accounts-ac7e600c1c32?source=rss-15b8b151b74d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac7e600c1c32</guid>
            <category><![CDATA[dlt]]></category>
            <category><![CDATA[account]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[corda]]></category>
            <dc:creator><![CDATA[Peter Li]]></dc:creator>
            <pubDate>Tue, 15 Sep 2020 10:47:33 GMT</pubDate>
            <atom:updated>2020-09-15T10:47:33.562Z</atom:updated>
            <content:encoded><![CDATA[<p>If you have read our previous introductory articles on what is <a href="https://medium.com/corda/unlocking-new-opportunities-with-accounts-on-corda-ff69e21c198f">Corda Accounts library</a> and the <a href="https://medium.com/corda/scale-your-cordapp-with-cordas-account-library-2430960a5a58">technical break downs</a> of the package, now you might wonder how do you add the Accounts feature sets to your current existing CorDapp to benefit from the scalability that Corda Accounts brings. In this article, I will walk you through the necessary steps for you to do and consider when you are enhancing your CorDapp with Corda Accounts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*QcKBH5Qj31C68UWq.jpg" /></figure><p>We will go through the Account enhancement using the one of our signature CorDapp, the <a href="https://github.com/corda/samples-java/tree/master/Basic/yo-cordapp">Yo-CorDapp</a>. It is a simple single state CorDapp that send a transaction from one node to another node. Let’s begin!</p><h4>Pre-requisite</h4><p>Clone the project and make sure your development environment is properly set up for CorDapp development. We can easily test it by building the projects and test run it with a transaction.</p><ul><li>Build the project: ./gradlew clean deployNodes</li><li>Start the bootstrapped network: ./build/nodes/runnodes</li><li>Once you have started the nodes, go to PartyA and test the app by entering the command: flow start YoFlow target: PartyB</li></ul><h4>Modification Step 1: Add dependencies</h4><p>Whenever you are considering using any Corda SDK features, you will need to add corresponded dependencies. Go to the project level Build.gradle under the buildscript.ext add both dependencies:</p><pre>//account<br>accounts_release_group = &#39;com.r3.corda.lib.accounts&#39;<br>accounts_release_version = &#39;1.0&#39;<br>//CI<br>confidential_id_release_group = &quot;com.r3.corda.lib.ci&quot;<br>confidential_id_release_version = &quot;1.0&quot;</pre><p>Add the following maven path at the repository section:</p><pre>maven <strong>{ </strong>url &#39;http://ci-artifactory.corda.r3cev.com/artifactory/corda-lib&#39; <strong>}<br></strong>maven <strong>{ </strong>url &#39;https://ci-artifactory.corda.r3cev.com/artifactory/corda&#39; <strong>}</strong></pre><p>Move to the allprojects.repository add:</p><pre>//CI dependencies<br>maven <strong>{ </strong>url &#39;https://ci-artifactory.corda.r3cev.com/artifactory/corda&#39; <strong>}<br></strong>maven <strong>{ </strong>url &#39;https://ci-artifactory.corda.r3cev.com/artifactory/corda-lib&#39; <strong>}</strong></pre><p>continue to the dependencies section (the one in the outer level) add:</p><pre>//Account &amp; CI lib<br>cordapp &quot;$confidential_id_release_group:ci-workflows:$confidential_id_release_version&quot;<br>cordapp &quot;$accounts_release_group:accounts-contracts:$accounts_release_version&quot;<br>cordapp &quot;$accounts_release_group:accounts-workflows:$accounts_release_version&quot;</pre><p>At the deployNodes section, under the nodeDefaults add:</p><pre>cordapp(&quot;$confidential_id_release_group:ci-workflows:$confidential_id_release_version&quot;)<br>cordapp(&quot;$accounts_release_group:accounts-contracts:$accounts_release_version&quot;)<br>cordapp(&quot;$accounts_release_group:accounts-workflows:$accounts_release_version&quot;)</pre><p>Now navigate to a different build.gradle under the workflows folder, under the dependencies, add:</p><pre>//Account and CI dependencies<br>cordaCompile &quot;$confidential_id_release_group:ci-workflows:$confidential_id_release_version&quot;<br>cordaCompile &quot;$accounts_release_group:accounts-workflows:$accounts_release_version&quot;</pre><p>We will add the last required dependencies to the build.gradle in the Contracts folder. Again, in the dependencies section, add:</p><pre>//Account dependencies.<br>cordaCompile &quot;$accounts_release_group:accounts-contracts:$accounts_release_version&quot;</pre><h4>Modification Step 2: Modify the States</h4><p>The first thing we need to consider is the participants of the States. In our Corda Account overview article, we mentioned that Corda accounts are simply masked confidential identities that live in the nodes. Therefore, the first thing we need to reconsider is the involving parties of the App.</p><p>In the original Yo-CorDapp, each YoState consists of three attributes, an origin party (who sends the message) and a target party (who receives the message). In our accounts enhanced modification, we will change these parties to accounts.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1285a908aba3e09a5e8a44894ddcefa4/href">https://medium.com/media/1285a908aba3e09a5e8a44894ddcefa4/href</a></iframe><h4>Modification Step 3: Modify the Contracts</h4><p>What we need to look for to modify in our CorDapp are all the contract rules that relate to the node identities. We do not need to change the contract rules for the participants or signers because the accounts behave the same as the node (Both are operated via public/private key pair).</p><p>Regarding the original Yo-CorDapp, we do not need to change anything because there aren’t any contract rules regarding the node identities.</p><h4>Modification Step 4: Modify the flows and helper method.</h4><p>Before we modify the YoFlow, we would need to create a couple of helper methods to take care of the creation and sharing of the Accounts. You can simply mimic the code here:</p><ul><li>CreateNewAccount: <a href="https://github.com/corda/samples-java/blob/master/Accounts/tictacthor/workflows/src/main/java/com/tictacthor/accountUtilities/CreateNewAccount.java">link</a></li><li>ShareAccountTo: <a href="https://github.com/corda/samples-java/blob/master/Accounts/tictacthor/workflows/src/main/java/com/tictacthor/accountUtilities/ShareAccountTo.java">link</a></li><li>A helper method that Sync the keys with the counterparty (Very important step): (<a href="https://github.com/corda/samples-java/blob/master/Accounts/tictacthor/workflows/src/main/java/com/tictacthor/flows/SyncGame.java">sample code</a>) This step will sync all the keymaps that relates to the transaction state to the counterparty, so when the counterparty tries to use the state in a different transaction. The counterparty node knows whose signature was on the transaction. SyncYoStateFlow</li></ul><p>Next, we will start to modify our YoFlow. We will look at:</p><ol><li>Modifying the Constructor, so the YoFlow now take 2 different parameters (Which account am I, Which account is this YoFlow is sent to)</li><li>Querying both our accounts and counterparty’s accounts.</li><li>Remaking the YoState that take the accounts as parameters.</li><li>Changing the command’s requires signing keys to account keys.</li><li>Adding the account’s owning key when self-signing the transaction.</li><li>Collecting the counterParty signature.</li><li>After the FinalityFlow, syncing the state with the counterparty.</li><li>Signing the transaction in the responder flow.</li></ol><p>Full Code <a href="https://github.com/corda/samples-java/tree/yo-accounts/Basic/yo-cordapp">here</a></p><p>Now all the modification would be done. Let test it.</p><h4>Running the Accounts equipped YoCorDapp:</h4><p>Build the project and run it by:</p><pre>./gradlew clean deployNodes<br>./build/nodes/runnodes</pre><p>At PartyA, create and share the accounts:</p><pre>flow start CreateNewAccount acctName: PeterLi<br>flow start ShareAccountTo acctNameShared: PeterLi, shareTo: PartyB</pre><p>At PartyB, create and share the accounts:</p><pre>flow start CreateNewAccount acctName: DavidA<br>flow start ShareAccountTo acctNameShared: DavidA, shareTo: PartyA</pre><p>Back to PartyA to invoke a YoFlow:</p><pre>flow start YoFlow whoAmI: PeterLi, whereTo: DavidA</pre><p>Go to PartyB to check for the States:</p><pre>run vaultQuery contractStateType: net.corda.examples.yo.states.YoState</pre><p>With the successfully returned message, we can see that this is our modified YoStates. We can conclude that we just upgraded a base CorDapp to an Accounts equipped CorDapp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GUubf__nek9RxOFP8P_bhQ.png" /></figure><p>Peter Li is a Developer Evangelist at <a href="https://www.r3.com/">R3</a>, an enterprise blockchain software firm working with a global ecosystem of more than 350 participants across multiple industries from both the private and public sectors to develop on Corda, its open-source blockchain platform, and Corda Enterprise, a commercial version of Corda for enterprise usage.</p><p>Follow us on twitter <a href="https://twitter.com/cordablockchain">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac7e600c1c32" width="1" height="1" alt=""><hr><p><a href="https://medium.com/corda/how-to-equip-your-existing-cordapp-with-corda-accounts-ac7e600c1c32">How to equip your existing CorDapp with Corda Accounts</a> was originally published in <a href="https://medium.com/corda">Corda</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Equip Your Existing CorDapp with Tokens SDK]]></title>
            <link>https://medium.com/corda/how-to-equip-your-existing-cordapp-with-tokens-sdk-982250da69?source=rss-15b8b151b74d------2</link>
            <guid isPermaLink="false">https://medium.com/p/982250da69</guid>
            <category><![CDATA[token]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[corda]]></category>
            <category><![CDATA[dlt]]></category>
            <dc:creator><![CDATA[Peter Li]]></dc:creator>
            <pubDate>Wed, 09 Sep 2020 13:54:41 GMT</pubDate>
            <atom:updated>2020-09-09T13:54:41.220Z</atom:updated>
            <content:encoded><![CDATA[<p>As more and more industry incumbents are gearing up towards digitalization and tokenization, we, as Corda developers, should also prepare ourselves for the new breakthrough. In this article, I will guide you through the steps to upgrade your existing CorDapp to a Token app via Corda Tokens SDK. Some basic information if you have not heard about the Tokens SDK: <a href="https://medium.com/corda/introduction-to-token-sdk-in-corda-9b4dbcf71025">Introduction information on the Tokens SDK</a>, <a href="https://medium.com/corda/lets-create-some-tokens-5e7f94c39d13">SDK technical break down</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*ZSdQd6fL5er-BrMv-LzQxQ.png" /></figure><h4>Design &amp; Planning</h4><p>For simplicity purposes, we will walk through the steps with our signature Yo-CorDapp. which sends a single state to the counterparty. We will implement a couple of modifications:</p><ol><li>Add an evolvable non-fungible token to the App (as which normally represents non-fungible tokenized asset)</li><li>Add an evolvable fungible token to the App (as which normally represents fungible asset such as stock)</li></ol><h4>Step One: Add dependencies</h4><p>We will add the dependencies for Tokens SDK at each of the build.gradle at the project level, at the workflow folder, and the contract folder.</p><p>For project level build.gradle, under the buildscript.ext section add:</p><pre>//Tokens        <br>tokens_release_group = &#39;com.r3.corda.lib.tokens&#39;        tokens_release_version = &#39;1.2&#39;</pre><p>Under the allprojects.repositories section add:</p><pre>maven <strong>{ </strong>url &#39;https://ci-artifactory.corda.r3cev.com/artifactory/corda-lib&#39; <strong>}</strong></pre><p>Under both the dependencies section and the deployNodes nodeDefaults section add:</p><pre>// Token SDK dependencies.    <br>cordapp &quot;$tokens_release_group:tokens-contracts:$tokens_release_version&quot;    <br>cordapp &quot;$tokens_release_group:tokens-workflows:$tokens_release_version&quot;</pre><p>Navigate to the workflow build.gradle, under the dependencies section add:</p><pre>// Token SDK dependencies.<br>cordaCompile &quot;$tokens_release_group:tokens-workflows:$tokens_release_version&quot;</pre><p>Navigate to the Contract build.gradle, under the dependencies section add:</p><pre>// Token SDK dependencies.<br>cordaCompile &quot;$tokens_release_group:tokens-contracts:$tokens_release_version&quot;</pre><h4>Step Two: Define the TokenState</h4><p>In our previous Tokens SDK introductory article/videos, we explained that every token that carries evolvable attributes would have a Corda State as the underlying token classifier.</p><p>We will define two States:</p><ul><li>YoTokenFungibleState</li><li>YoTokenNonFungibleState</li></ul><p>They are virtually the same, the only difference is that each of them carries a different string to help us distinguish them when we query the tokens.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a4c4776f27f9d8f3100598c53bdcb612/href">https://medium.com/media/a4c4776f27f9d8f3100598c53bdcb612/href</a></iframe><h4>Step Three: Create a Token Contract.</h4><p>After defining the underlying token classifiers, the next step is to write the Contracts for these states. (As we recall, every Corda State is pegged with one Contract to verify any transaction that carries the state.) However, token Contracts are a bit different than normal contracts. We will not define any Commands for the state because all of the transaction regarding the Token State is pre-defined in the Tokens SDK, we will define two extra checks for creating and updating the token States. These two methods will behave just like the verify() method, which will be called during a transaction. These two methods will get called automatically when the State is created and updated.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1ebf91ca51c6a47c3ec6c4ec88b5c332/href">https://medium.com/media/1ebf91ca51c6a47c3ec6c4ec88b5c332/href</a></iframe><p>This is the code for the YoFungibleTokenContract file, the Contract for the nonfungibleToken would be almost identical. The reason we are not implementing the additional checks is that YoState carries very minimal information, which we do not have any field needs to be verified. An example of additional checks for the Token State would look like <a href="https://github.com/corda/TokenSDKDemo/blob/master/diamond-contracts/src/main/kotlin/com/r3/demo/tokens/contract/DiamondGradingReportContract.kt">this</a>.</p><h4>Step Four: Add Token Logic in the Flows</h4><p>We will create 2 new flows to demonstrate the creation and issuance of the two different tokens.</p><ul><li>CreateAndIssueFungibleYoToken</li><li>CreateAndIssueNonFungibleYoToken</li></ul><p>Token issuance flow is similar to any of the traditional flows in the way that it creates the state and send it via transaction. In a token flow, we will need to create the token classifier state and then issue the actual token with the classifier. For example in this CreateAndIssueFungibleYoToken flow here:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c4eeba9ea3e3dea597ccb25cffaae461/href">https://medium.com/media/c4eeba9ea3e3dea597ccb25cffaae461/href</a></iframe><p>The CreateAndIssueNonFungibleYo flow is similar to to the createAndIssueFungibleYo flow. The code can be found <a href="https://github.com/corda/samples-java/blob/yo-tokens/Basic/yo-cordapp/workflows/src/main/java/net/corda/examples/yo/flows/CreateAndIssueNonFungibleYo.java">here</a>.</p><p>We will continue to upgrade, implementing another flow that moves the Token around.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2e7e3f860689c2426087f285311475a4/href">https://medium.com/media/2e7e3f860689c2426087f285311475a4/href</a></iframe><p>As of now, we have complete the steps to upgrade a simple CorDapp to a Token capable CorDapp.</p><h4>Running the Token equipped YoCorDapp:</h4><p>For demo purposes, we will add another node to the bootstrapper network to distinguish the issuance of the two different tokens. Navigate to the project level build.gradle, under the deployNodes task, add another node attribute at the bottom:</p><pre>node <strong>{<br>    </strong>name &quot;O=PartyC,L=San Diego,C=US&quot;<br>    p2pPort 10011<br>    rpcSettings <strong>{<br>        </strong>address(&quot;localhost:10012&quot;)<br>        adminAddress(&quot;localhost:10052&quot;)<br>    <strong>}<br>    </strong>rpcUsers = [[ user: &quot;user1&quot;, &quot;password&quot;: &quot;test&quot;, &quot;permissions&quot;: [&quot;ALL&quot;]]]<br><strong>}</strong></pre><p>Build the project and run it by:</p><pre>./gradlew clean deployNodes<br>./build/nodes/runnodes</pre><p>At PartyA, issue the FungibleYo Token to PartyB, and issue the NonFungibleYo Token to PartyC.</p><pre>flow start CreateAndIssueFungibleYo target: PartyB, issueVol: 200<br>flow start CreateAndIssueNonFungibleYo target: PartyC</pre><p>At PartyB, query the Fungible Tokens:</p><pre>run vaultQuery contractStateType: com.r3.corda.lib.tokens.contracts.states.FungibleToken</pre><p>At PartyC, query the Non-Fungible Tokens:</p><pre>run vaultQuery contractStateType: com.r3.corda.lib.tokens.contracts.states.NonFungibleToken</pre><p>Move some of the Fungible tokens from PartyB to PartyC, run the following command at PartyB (The tokenId can be found in the previous Fungible Token query)</p><pre>flow start MoveFungibleInitiator tokenId: &lt;xxx-xxx-xxx-xxxx&gt;, quantity: 15, recipient: PartyC</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2lfQjaKLtfdhfhOzz6mlRw.png" /></figure><p>Now run the fungible token query at PartyC’s terminal we should see the 15 Fungible Yo Tokens were given by PartyB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*URZuuHaczF6buX4Hj1WBwg.png" /></figure><h4>Ending Notes:</h4><p>Tokens SDK, unlike the Account Library, does not necessarily require structural changes of the existing CorDapp. The token system is more like an add-on to the existing app. From the Token Classifier State to the Contracts and to flow modification, most of them are adding to the existing code, rather than changing it. As a result, Tokens SDK is very easy to implement.</p><p>Full implementation is <a href="https://github.com/corda/samples-java/tree/yo-tokens/Basic/yo-cordapp">here</a></p><p>Peter Li is a Developer Evangelist at <a href="https://www.r3.com/">R3</a>, an enterprise blockchain software firm working with a global ecosystem of more than 350 participants across multiple industries from both the private and public sectors to develop on Corda, its open-source blockchain platform, and Corda Enterprise, a commercial version of Corda for enterprise usage.</p><p>Follow us on twitter <a href="https://twitter.com/cordablockchain">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=982250da69" width="1" height="1" alt=""><hr><p><a href="https://medium.com/corda/how-to-equip-your-existing-cordapp-with-tokens-sdk-982250da69">How to Equip Your Existing CorDapp with Tokens SDK</a> was originally published in <a href="https://medium.com/corda">Corda</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to implement your well designed CorDapp]]></title>
            <link>https://medium.com/corda/how-to-implement-your-well-designed-cordapp-fdc4fa69b54d?source=rss-15b8b151b74d------2</link>
            <guid isPermaLink="false">https://medium.com/p/fdc4fa69b54d</guid>
            <category><![CDATA[dlt]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[corda]]></category>
            <dc:creator><![CDATA[Peter Li]]></dc:creator>
            <pubDate>Mon, 07 Sep 2020 10:54:18 GMT</pubDate>
            <atom:updated>2020-09-07T11:21:29.284Z</atom:updated>
            <content:encoded><![CDATA[<p>In my <a href="https://www.corda.net/blog/how-to-design-your-first-cordapp/">previous article</a>, we had designed a badge CorDapp. In this article, we will go through the implementation journey of the CorDapp. As a result, you will have a template for systematically implementing a CorDapp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*WzVj186hO77hRwJ3cGBehw.jpeg" /></figure><h4>Customize the Badge project from template CorDapp</h4><ol><li>Clone the template code from Corda’s Github home page (<a href="https://github.com/corda/cordapp-template-java">Java version</a>, <a href="https://github.com/corda/cordapp-template-kotlin">kotlin version</a>). Open the project in your choice of IDE. We will continue the tutorial using the Java template using IntelliJ.</li><li>Before we edit any code, we would need to do some housekeeping to customize the template project to customized setups, such as changing the package name (shown in the below screenshot) and some other dependencies to “badge”.</li></ol><p>TIPS: you can do a holistic search by holding Cmd+shft + f and look for any occurrence of the word template, and selectively change the related ones to the badge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*5m5kTVy2MMnn4TWfIGTUJg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*KbjxZVc4Rk7rJknzNMw-Vw.png" /></figure><p>Now, we are ready to implement the code for our badge CorDapp.</p><p>In the previous article, we divided our Badge CorDapp into these four modules. Along with these modules, we will also implement some tester as well. We will implement as the order of:</p><ol><li>Required Network Participants</li><li>Corda States &amp; Corda Contract</li><li>Unit test for States and Contract</li><li>Corda flows</li><li>Unit test for flows</li></ol><h4>Network Participants</h4><p>In the previous designing phase, we decide that we have three nodes to demonstrate our simple badge system. In the real production environment, the network will be handled by the network operators. However, during the development process, we will be running our application on a bootstrapped local network. Then we will progress to the remote server to test database integration and etc. So let’s configure the bootstrapper.</p><p>🛠 Navigate to the build.gradle in the project root level, and scroll to the task deployNodes function. You will see one nodeDefaults and 3 node instances named Notary, PartyA, and PartyB. Leave the Notary instance untouched and change the node name to IssuerNode, YourName, and add another node called ByStandar. (Remember to modify the RPC address to a different address). That is all we need to configure to bootstrap 3 nodes in a network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*_iVpdlDguUInHectW7BLVw.png" /></figure><h4>The State</h4><p>In our design, we decide that the build block of our Badge app will be a Badge State and we gave a set of attributes to our badge state, such as Name<br>, Badge ID , and etc.</p><p>🛠 Navigate to /contracts/main/java/com/badge/states and create a new state java file BadgeState.java that contains all the attributes.</p><p>Tips:</p><ul><li>BelongsToContract annotation defines which contract should this state follows. This annotation will create a bond between the state and the Contract.</li><li>There is great flexibility in what you can have in the state class, such as a private method that modifies the states.</li></ul><p>BadgeState Implementation:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5a26e227ed9218ecdfb1f18a321defa8/href">https://medium.com/media/5a26e227ed9218ecdfb1f18a321defa8/href</a></iframe><h4>The Contract</h4><p>In our design, we mentioned that Contracts are the checks that transactions would need to go through. Each State is linked to a contract. Inside of the contract, it consists of one verify method and Commands sub-interface, which describes different intends of the different transactions involving the pegged state.</p><p>🛠 Navigate to /contracts/main/java/com/badge/contracts and create a new contract java file BadgeContract.java .</p><p>Notes:</p><ul><li>The command interface indicates the intends of different transactions. We will also implement the verify methods accordingly.</li></ul><p>BadgeContract Implementation:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/060e2f37ed314bf583beda198761f42c/href">https://medium.com/media/060e2f37ed314bf583beda198761f42c/href</a></iframe><h4>Unit test for States &amp; Contract</h4><p>The reason we implement unit tests at this point is that States and contracts are strictly coupled. It is better we test them together.</p><p>🛠 Navigate to workflows/src/test/java/com/badge and create a StateTest.java file and modify the existing ContractTest.java</p><p>StateTest implementation:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/abaab8cddd37648d49875ce5fc150db1/href">https://medium.com/media/abaab8cddd37648d49875ce5fc150db1/href</a></iframe><p>ContractTest implementation:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/86efcba157ad00149ddcdeaaa8208de0/href">https://medium.com/media/86efcba157ad00149ddcdeaaa8208de0/href</a></iframe><h4>The Flows</h4><p>In our design article, we planned that we will have two flows.</p><pre> 1. Issue flow that issues the badge<br> 2. Show flow that display the badge while the badge still has available show counts.</pre><p>🛠 Navigate to workflows/src/main/java/com/badge/flows and create IssueFlow and ShowFlow java files.</p><p>Note:</p><ul><li>In our design, only the receiver cares about the badge state. Therefore, only the receiver will store the BadgeState in their database.</li><li>The issuing process involves the issuer and receiver, so it will have two signatures on the transaction. Whereas, the showbadge flow only matters to the receiver, so we only ask for the receiver’s signature.</li></ul><p>IssueFlow implementation:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/209f16c906fc531569f92b8892f17c77/href">https://medium.com/media/209f16c906fc531569f92b8892f17c77/href</a></iframe><p>ShowFlow implementation:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/18508c4617ba2923b4e1745c2a3368b9/href">https://medium.com/media/18508c4617ba2923b4e1745c2a3368b9/href</a></iframe><h4>Unit test for the Flows</h4><p>We need to customize the flow a little bit before we implement the flow test. we would need to change the String return type to signedTransaction in order to use the unit tests. If you go to Line #25, #53, and #91, you should see the return type is String for better information displaying. Change it to SignedTransaction in order to use the flow test.</p><p>🛠 Navigate to workflows/src/test/java/com/badge and create a FlowTests.java file</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a37f018c074288865aa4fc77dc7c771f/href">https://medium.com/media/a37f018c074288865aa4fc77dc7c771f/href</a></iframe><h4>Running the Badge CorDapp</h4><p>Step 1: Deploy and Run the nodes:</p><pre>./gradlew deployNodes<br>./build/nodes/runnodes</pre><p>Step 2: Test the flow</p><ol><li>Issue a badge from IssuerNode to PeterLi: flow start IssueInitiator badgeName: BestCoder, receiver: PeterLi, description: Best Software developer in town, showCounts: 2. This should output a message with the Badge ID which we will need to use in the next flow.</li><li>Show the badge: flow start ShowBadge badgeId: &lt;xxxx-xxxx-xxxxx-xxx&gt; (replace the badge ID with the one from the previous return message.)</li></ol><p>You can query the BadgeState at any time by run: run vaultQuery contractStateType: com.badge.states.BadgeState</p><p>Congratulations, you had completely implemented a simple CorDapp.</p><p>Peter Li is a Developer Evangelist at <a href="https://www.r3.com/">R3</a>, an enterprise blockchain software firm working with a global ecosystem of more than 350 participants across multiple industries from both the private and public sectors to develop on Corda, its open-source blockchain platform, and Corda Enterprise, a commercial version of Corda for enterprise usage.</p><p>Follow us on twitter <a href="https://twitter.com/cordablockchain">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fdc4fa69b54d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/corda/how-to-implement-your-well-designed-cordapp-fdc4fa69b54d">How to implement your well designed CorDapp</a> was originally published in <a href="https://medium.com/corda">Corda</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to design your first CorDapp]]></title>
            <link>https://medium.com/corda/how-to-design-your-first-cordapp-825e98fd15ae?source=rss-15b8b151b74d------2</link>
            <guid isPermaLink="false">https://medium.com/p/825e98fd15ae</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[corda]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[dlt]]></category>
            <dc:creator><![CDATA[Peter Li]]></dc:creator>
            <pubDate>Thu, 03 Sep 2020 13:18:32 GMT</pubDate>
            <atom:updated>2020-09-03T13:18:32.765Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, we will guide you through the steps of designing a CorDapp. We will do so by designing a simple badge CorDapp together. Note: If you are new to the Corda community, please watch the Corda Introduction <a href="https://www.youtube.com/watch?v=cKMz6sXya84&amp;t=3s">video</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*pnAYFgFQ0nyQTIuXw6FmgQ.gif" /></figure><p>In the badge CorDapp, you will be able to issue a “badge” from the issuer node to your node. Once you received the badge, you will have the option to trigger a show-off 😎 action. However, the number of available show-offs is limited, so when you run out of the show-off balance, you will no longer be able to do it. Sounds interesting? Let’s get to it!</p><h4>Designing the CorDapp</h4><p>A big part of software development is designing/planning. Nowadays, a large number of software companies will take the agile software development pattern, which adding new functions on the go. However, keep in mind, when you develop a smart contract running on a decentralized network. Each software update would need a network-level agreement. It is doable but it will create a much more ripple effect than it will on a centralized managed system. With that said, when we design the decentralized app, we should be as comprehensive as we can to avoid future major changes.</p><h4>First thing first — The Network Participants</h4><p>In our introduction video, we begin talking about Corda via a simple network of Alice, Bob, and Carl. That would be the same case when we design our CorDapp. That is, we need to think about the participants of the network. It doesn’t mean we will list out all of the participants and cannot onboard any new customer in the future, we just need to plan for the required participants in the network.</p><p>🛠 In our Badge CorDapp, we want to achieve the action of issue a badge from one node to another node (the me-node). Therefore, I would like to have 3 required nodes to start the network with:</p><ol><li>Issuer Node</li><li>PeterNode (Feel free to change it to your name 😁)</li><li>Bystander Node (We want this node to show Corda’s P2P private transaction scheme, where he is in the network but he doesn’t know anything about the transaction between IssuerNode and PeterNode)</li></ol><h4>How Blocks chain Up — Corda State</h4><p>In the Corda introduction video, we explained that “in a Corda system, Corda States are the blocks and it chains up via transactions.” After initial creation, States will be either consumed or updated in later transactions. You can include as much information as you want in a Corda State. It is the lego block of your system.</p><p>🛠 Now, let us design the Corda States for the Badge CorDapp. Since we are passing along the badge in our app, the Corda state will indeed be a badge! Let’s list some attributes of a badge:</p><pre>  1. Name<br>  2. Badge ID <br>  3. Badge Issue Date <br>  4. Issue agency<br>  5. Receiver<br>  6. Badge Description <br>  7. Show-off counts balance 😎</pre><h4>What do you want to do with the States — Corda Flows</h4><p>In the Corda system, the flows define the actions of the app. Whenever you want to initiate a transaction, your node will invoke the designed flow to execute. It is also the flow that gets triggered via RPC client from your existing infrastructure.</p><p>🛠 Back to our Badge CorDapp, in our brief description, we mentioned that we want to have two actions:</p><ul><li>Issuance flow takes parameters of recipient name, badge Description, and show-off counts balance.</li><li>Show-off 😎 flow takes parameters of Badge ID</li></ul><h4>Under what rules shall we execute a transaction — Corda Contracts</h4><p>In the Corda system, the contracts define the regime for different transactions. As we recall, transactions in Corda are only shared between the transaction participants, therefore, the transaction validation is in the hands of these participants. There needs to be a series set of rules to regulate transactions and reduce the risk of having bad transactions.</p><p>🛠 In our Badge CorDapp, we could come up with arbitrary rules such as:</p><ul><li>Any Issuance action, the issuing agency has to be the Issuer Node</li><li>Any show-off action, the show-off counts balance has to be more than one.</li></ul><p>So far, you went through the application architecting of a CorDapp. This is the very first step of CorDapp development. Once we have the architecture of our CorDapp, the second step is implementation. Stay tuned to continue learning about the implementation in our next article: How to implement a well designed CorDapp.</p><p>Peter Li is a Developer Evangelist at <a href="https://www.r3.com/">R3</a>, an enterprise blockchain software firm working with a global ecosystem of more than 350 participants across multiple industries from both the private and public sectors to develop on Corda, its open-source blockchain platform, and Corda Enterprise, a commercial version of Corda for enterprise usage.</p><p>Follow us on twitter <a href="https://twitter.com/cordablockchain">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=825e98fd15ae" width="1" height="1" alt=""><hr><p><a href="https://medium.com/corda/how-to-design-your-first-cordapp-825e98fd15ae">How to design your first CorDapp</a> was originally published in <a href="https://medium.com/corda">Corda</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flow Management Enhancement in Corda 4.5]]></title>
            <link>https://medium.com/corda/flow-management-enhancement-in-corda-4-5-aaced79ac373?source=rss-15b8b151b74d------2</link>
            <guid isPermaLink="false">https://medium.com/p/aaced79ac373</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[corda]]></category>
            <category><![CDATA[dlt]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Peter Li]]></dc:creator>
            <pubDate>Tue, 23 Jun 2020 19:36:51 GMT</pubDate>
            <atom:updated>2020-06-23T19:36:51.476Z</atom:updated>
            <content:encoded><![CDATA[<p>In our most recent Corda 4.5 release, we announced new enhancements to our flow management capabilities:</p><blockquote>If a node user terminates a flow, counter-parties are automatically notified and any soft-locked states in the vault are automatically released.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1Fq_gYO5p4v2IKgy.png" /></figure><p>Generally, operating a system requires multiple subsystems to function collectively and simultaneously. Occasionally, the systems do not work at the capacity they are supposed to which would require intervention by a system operator to recalibrate the system in order to restore optimal performance. In Corda, this process is referred to as flow management.</p><p>In Corda, a flow becomes problematic or unusable in situations where:</p><ul><li>It is blocked due to a long-running or infinite loop.</li><li>It is waiting indefinitely for another node to respond.</li><li>It is started accidentally.</li></ul><p>To resolve these issues, you can terminate a flow similar to how you would cancel a process.</p><p>In Corda 4.5, we have improved the existing killflow operation, so that:</p><ul><li>When a flow is terminated, any counter party that has an open flow session with the flow in question is notified that the flow has ended unexpectedly</li><li>Any vault soft-locks held by a flow are released when the flow is terminated</li><li>A flow can now check programmatically whether its termination has been requested. This allows a looping flow to use this API to ensure it doesn’t loop indefinitely when a termination has been requested. Previously, the flow would wait until it reached the next checkpoint to decide whether to terminate, allowing deadlocks to occur (e.g. if the flow was caught in an infinite loop)</li></ul><p>That is, the flow termination becomes less brute forced, and the consequence of the termination is well handled.</p><p>Find more information at out docs site at: <a href="https://docs.corda.net/docs/corda-os/4.4/api-flows.html">api-flows</a></p><p><strong>Want to learn more about building awesome blockchain applications on Corda? Be sure to visit </strong><a href="http://corda.net/"><strong>corda.net</strong></a><strong>, check out our </strong><a href="https://www.corda.net/community/"><strong>community page</strong></a><strong> to learn how to connect with other CorDapp developers, or </strong><a href="https://info.r3.com/email-preferences"><strong>sign up</strong></a><strong> for one of our newsletters for the latest updates.</strong></p><p>— Peter Li is a Developer Evangelist at <a href="https://www.r3.com/">R3</a>, an enterprise blockchain software firm working with a global ecosystem of more than 350 participants across multiple industries from both the private and public sectors to develop on Corda, its open-source blockchain platform, and Corda Enterprise, a commercial version of Corda for enterprise usage.</p><p>Follow us on twitter <a href="https://twitter.com/cordablockchain">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aaced79ac373" width="1" height="1" alt=""><hr><p><a href="https://medium.com/corda/flow-management-enhancement-in-corda-4-5-aaced79ac373">Flow Management Enhancement in Corda 4.5</a> was originally published in <a href="https://medium.com/corda">Corda</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to develop a blockchain application if I only know Java]]></title>
            <link>https://medium.com/corda/how-to-develop-a-blockchain-application-if-you-only-know-java-f93dcf52cb60?source=rss-15b8b151b74d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f93dcf52cb60</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[dlt]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Peter Li]]></dc:creator>
            <pubDate>Mon, 11 May 2020 14:57:31 GMT</pubDate>
            <atom:updated>2020-05-11T14:57:31.029Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to develop a blockchain application if you only know Java</h3><p>Welcome! You are one of the 7.1 million active Java developers around the world, and perhaps one of the 12 million developers who have learned the Java language in their life.</p><p>In this article, I will guide you in building your very first blockchain application using <a href="https://www.corda.net/blog/what-is-corda/">Corda</a>, a blockchain platform running inside a JVM, with only using Java. Get ready to stand out among your fellow Java peers!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iIXOmGDzrtTJmdwbn7cGMw.png" /></figure><h4>What you need…</h4><p>In this article, I will not go through the details on what a blockchain is and why people need blockchain. I will go directly into coding and explain the logic of decentralization as we go. So here is what you will need to follow along:</p><ol><li>Your choice of IDE or code editor.</li><li>A JVM environment with minimum of 2GB of RAM. (Most desktop/laptop/VMs are capable of running Corda. I challenge you to run your application on a Pi!).</li><li>Last, but not least, your Java knowledge!</li></ol><h4>What shall we build…</h4><p>Of course, we are going to start with a “Hello-World” app! We will build an app that sends a message of “Hello World” from one party on the blockchain to another.</p><p>In the Corda world, the blockchain application that you write is called a CorDapp. It only consists of three components:</p><ul><li><a href="https://docs.corda.net/docs/corda-os/4.4/key-concepts-states.html#states"><strong>State</strong></a>: The real-world assets/objects that get created, updated, stored, and spent. For example, a loanbook, a tokenized bicycle, or a game board.</li><li><a href="https://docs.corda.net/docs/corda-os/4.4/key-concepts-contracts.html#contracts"><strong>Contract</strong></a>: The rules that regulate/verify the state transaction, updating, and consumption.</li><li><a href="https://docs.corda.net/docs/corda-os/4.4/key-concepts-flows.html#flows"><strong>Flow</strong></a>: The instructions that tell how each transaction should be executed.</li></ul><p>Without further ado, Let’s start coding.</p><h4>Step 1: Corda State</h4><p>Clone the Cordapp-template-java at <a href="https://github.com/corda/cordapp-template-java">here</a>.</p><p>Open it using your choice of the code editor, and navigate to:</p><p>/contracts/src/main/java/com/template/states/TemplateState.java</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e53eb4305755be6b6b43824d6a9687c8/href">https://medium.com/media/e53eb4305755be6b6b43824d6a9687c8/href</a></iframe><p>In the Corda world, most of the data is transacted in an object called <strong>State</strong>. Each State will have an @BelongsToContract() annotation indicating which contract file will be used to verify this State in the transaction. State and contract are 1 to 1 pegged. Continue on our Hello-world CorDapp, we will simply add a few lines to make the above TemplateState carry a message. We will have 3 attributes for our State.</p><ul><li>A String message</li><li>A message sender</li><li>A message receiver</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fc0f5be4bd66422f16e9e6f7dbd5be65/href">https://medium.com/media/fc0f5be4bd66422f16e9e6f7dbd5be65/href</a></iframe><p>Create three variables, instantiate the variables, create the getters, fill out the participant&#39;s list, and there you have it, a Corda State. Step one of creating your blockchain application is done.</p><h4>Step 2: Corda Contract</h4><p>Navigate to /contracts/src/main/java/com/template/contracts/TemplateContract.java</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/44c93f2cd8c8fbb2e7c709832da24c5e/href">https://medium.com/media/44c93f2cd8c8fbb2e7c709832da24c5e/href</a></iframe><p>In the Corda world, every transaction that involves a State has to be verified by a contract. Each contract consists of three required components:</p><ul><li>A Contract Id for later reference</li><li>A verify() method to examine the transaction</li><li>A Commands interface to indicate the transaction’s intent regarding the State. Note that all standard contracts (excluding token contracts because they are pre-written) must utilize commands and we normally define them in an interface here for convenience.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3a95b57d12c1f8eb90bdc243e07ddafb/href">https://medium.com/media/3a95b57d12c1f8eb90bdc243e07ddafb/href</a></iframe><p>In the Commands interface, we create a command called send, which we will later use to indicate our transaction’s intent.</p><p>In the verify() method, we ask:</p><ul><li>The message string that is carried in the state inside the transaction must be “Hello-World”.</li></ul><p>By the end of this step, you will have written your contract.</p><h4>Step 3: Corda Flows</h4><p>Last step before you have an operational blockchain application! Navigate to /workflows/src/main/java/com/template/flows/Initiator.Java</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/99b22f5763aa212f2a19c171860d74df/href">https://medium.com/media/99b22f5763aa212f2a19c171860d74df/href</a></iframe><p>In the Corda world, initiator flows trigger the business actions in your application. Whether it is sending a transaction or delivering a message, there has to be an initiator to signal the action. Besides the private variables and the constructor, initiator flow consists of a signature method called call() .</p><p>This method will automatically run whenever the initiator is called. This is where the payload is added to the transaction, signing, and signature collections all take place. Now, let’s fill it out to suit our Hello-World case.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/569b96c10cce197d9a42a0d59dc04148/href">https://medium.com/media/569b96c10cce197d9a42a0d59dc04148/href</a></iframe><p>In this Hello-World initiator flow, we have to:</p><ol><li>Get a reference to the notary service. [To prevent double spend]</li><li>Compose the state that carries the Hello World message. [To produce the output]</li><li>Create a new TransactionBuilder object, and add the State with Hello-World message as an output state, as well as a command to the transaction builder. [To compose the transaction]</li><li>Verify and sign it with our KeyPair. [To self verify and sign]</li><li>Collect the other party’s signature using the SignTransactionFlow. [To reach consensus among counter parties]</li><li>Finalize the transaction and broadcast to all involved parties. [To store the transaction onto ledger]</li></ol><p>And this will be the initiator flow for sending our Hello-World to the counterparty. But, we are not done here. We have to take care the responding part of this initiator. Now, navigate to /workflows/src/main/java/com/template/flows/Responder.Java</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8955b8c1c348f5a87a497a4a642d5a2b/href">https://medium.com/media/8955b8c1c348f5a87a497a4a642d5a2b/href</a></iframe><p>The responder flow, as its name indicates, will respond to the corresponding initiator flow from the counter party’s side. The annotation@InitiatedBy shows which initiator does it correlated to.</p><p>Similarly, the responder also has an auto-run call() the method will re-examine and save the transaction locally (on the counterparty node’s end since the responder was triggered at the counterparty side).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/513ab54dd1c9903e9e44cf1b8b7bf3bd/href">https://medium.com/media/513ab54dd1c9903e9e44cf1b8b7bf3bd/href</a></iframe><p>As of now, you have completed the writing of your very first blockchain application. Shall we try to run them?</p><p><strong>Running the Hello-World Blockchain CorDapp…</strong></p><p>Go to the terminal, and navigate to the project folder /cordapp-template-java/ and run the following code to deploy your application.</p><ul><li>./gradlew clean deployNodes for Unix, andgradlew.bat clean deployNodes for Windows</li></ul><p>A successful bootstrapping will yield a message of:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*lCc_3bicTYvnxTQ5IKUByQ.png" /></figure><p>Now, run the following code to run the bootstrapped environment:</p><ul><li>./build/nodes/runnodes for Unix, and .\build\nodes\runnodes.bat for Windows.</li></ul><p>We should be expecting three nodes starting up and launching their shell in different tabs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vxGlcukc5XI1kOZtCLxPmw.png" /></figure><p>Now let’s send out “Hello-world” from PartyA to PartyB. <br>Go to PartyA’s shell and run:</p><pre>flow start Initiator sendTo: PartyB</pre><p>We should be expecting the following message:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9QOBlt-R97edGswCkY1xtw.png" /></figure><p>Thus far, we have sent a “Hello-World” message from one party to another party via a distributed system! But is it? Let’s check!</p><p>Navigate to PartyB’s node shell and run:</p><pre>run vaultQuery contractStateType: com.template.states.TemplateState</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W2-Zv0-SWHjG2SWLvhb0wA.png" /></figure><p>There it is! A Template State that carries the “Hello-World” and is sent from PartyA to PartyB.</p><h4>What is so ‘blockchain’ about this app?</h4><p>You might wonder, wait a minute, I only see an app that sends a message between parties, where is the block? and where is the chain? By deploying and running the app, you have successfully launched a local distributed ledger system commonly referred to as “blockchain&quot;.</p><p><strong>The state</strong> that carries the message string is the block. And you will connect the later states that are relevant to the previously generated states via transaction, which we can view them as “chains”.</p><p>And this State-Transaction chain is only shared on the need-to-know basis between participating parties. (Recall the participant list in Step 1). Hence, in the Corda world, the data is shared distributively. There will not be a centralized database that records every parties’ transactions.</p><p>Coming back to our Hello-World sample, transaction(txHash:736AA884909641571B56AD965d3B...94E4F457C) carries the genesis block(State), that can be used as an input of another transaction and the chain will go on and on. Similar as the concept with Blockchains:</p><ul><li>Corda States(Blocks) are linked by Corda Transactions(Chains)</li></ul><p><strong>Want to learn more about building awesome blockchain applications on Corda? Be sure to visit </strong><a href="http://corda.net/"><strong>corda.net</strong></a><strong>, check out our </strong><a href="https://www.corda.net/community/"><strong>community page</strong></a><strong> to learn how to connect with other CorDapp developers, or </strong><a href="https://info.r3.com/email-preferences"><strong>sign up</strong></a><strong> for one of our newsletters for the latest updates.</strong></p><p>— Peter Li is a Developer Evangelist at <a href="https://www.r3.com/">R3</a>, an enterprise blockchain software firm working with a global ecosystem of more than 350 participants across multiple industries from both the private and public sectors to develop on Corda, its open-source blockchain platform, and Corda Enterprise, a commercial version of Corda for enterprise usage.</p><p>Follow Peter on twitter <a href="http://www.twitter.com/lpeterduke">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f93dcf52cb60" width="1" height="1" alt=""><hr><p><a href="https://medium.com/corda/how-to-develop-a-blockchain-application-if-you-only-know-java-f93dcf52cb60">How to develop a blockchain application if I only know Java</a> was originally published in <a href="https://medium.com/corda">Corda</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lifecycle Observer for CordaService]]></title>
            <link>https://medium.com/corda/lifecycle-observer-for-cordaservice-9347a5e62f15?source=rss-15b8b151b74d------2</link>
            <guid isPermaLink="false">https://medium.com/p/9347a5e62f15</guid>
            <category><![CDATA[services]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[corda]]></category>
            <category><![CDATA[lifecycle-observer]]></category>
            <category><![CDATA[dlt]]></category>
            <dc:creator><![CDATA[Peter Li]]></dc:creator>
            <pubDate>Mon, 30 Mar 2020 13:29:59 GMT</pubDate>
            <atom:updated>2020-03-30T13:29:59.805Z</atom:updated>
            <content:encoded><![CDATA[<h3>Lifecycle Observer for Corda service</h3><p>In the latest release of Corda open source v4.4, we introduced a feature to monitor the lifecycle of <a href="https://docs.corda.net/api-service-classes.html">Corda service</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aB0wHC5N5npuTPWeJp8cIw.jpeg" /></figure><h4>Corda services are…</h4><blockquote>Corda services are long-lived instances that can trigger or be triggered by flows from within a node. A service class is limited to a single instance per node. They allow related, reusable, functions to be separated into their own class where their functionality is grouped together.</blockquote><p>To create a Corda service:</p><ul><li>Add the @CordaService annotation</li><li>Add a constructor with a single parameter of AppServiceHub</li><li>Extend SingletonSerializeAsToken</li></ul><p>You can find simple demo at this <a href="https://github.com/corda/samples/tree/release-V4/autopayroll-CordaService">autopayroll-CordaService</a> sample.</p><h4>We observed that…</h4><p>With the flexibilities of the Corda service, we are starting to see more and more use of it. However, we have also experienced some incidences, when the service is “upset”. For example:</p><ul><li>The service expects to find a state in the vault and, if not found, the service is unable to continue.</li><li>It starts a flow on node start-up which returns an error condition and service decided that it cannot continue.</li></ul><p>In these critical conditions, it makes it impossible for service to function going forward.</p><h4>Introducing Lifecycle Observer…</h4><p>Upon instantiation of the Corda service:</p><p>Kotlin Code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3159f8d2f2c9ead33faf6b4fca80779e/href">https://medium.com/media/3159f8d2f2c9ead33faf6b4fca80779e/href</a></iframe><p>Java Code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6045b1a23b27c1954dff5d1f9c6b1839/href">https://medium.com/media/6045b1a23b27c1954dff5d1f9c6b1839/href</a></iframe><p>This code will register to the node’s service hub and monitored by the life cycle observer. Now, when any service feels that it cannot continue, it may throw CordaServiceCriticalFailureException from lifecycle handler which will lead to node terminating JVM. This fail-fast approach will let the node operator spot the service failure explicitly, which will lead to minimizing the later operation cost.</p><p>More information can be found at <a href="https://github.com/corda/corda/blob/07eb2b6887d4833f899e4278dfbe7c810087becc/docs/source/api-service-classes.rst">docs</a>, <a href="https://github.com/corda/corda/blob/release/os/4.5/core/src/main/kotlin/net/corda/core/node/services/ServiceLifecycleObserver.kt">ServiceLifecycleObserver.kt</a></p><p><strong>Thank you for reading and being part of this journey!</strong></p><p>We’d love to hear about your experiences and answer any questions you have in our public slack channel: <a href="http://slack.corda.net/">http://slack.corda.net/</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9347a5e62f15" width="1" height="1" alt=""><hr><p><a href="https://medium.com/corda/lifecycle-observer-for-cordaservice-9347a5e62f15">Lifecycle Observer for CordaService</a> was originally published in <a href="https://medium.com/corda">Corda</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Road to Less Coding: Auto-Generate APILibrary]]></title>
            <link>https://medium.com/corda/a-road-to-less-coding-auto-generate-apilibrary-bcbe2def7b30?source=rss-15b8b151b74d------2</link>
            <guid isPermaLink="false">https://medium.com/p/bcbe2def7b30</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[dlt]]></category>
            <category><![CDATA[corda]]></category>
            <category><![CDATA[open-api]]></category>
            <dc:creator><![CDATA[Peter Li]]></dc:creator>
            <pubDate>Tue, 03 Dec 2019 17:35:13 GMT</pubDate>
            <atom:updated>2019-12-03T17:35:13.754Z</atom:updated>
            <content:encoded><![CDATA[<p>This blog is about streamlining the process of connecting your Corda node to an existing system or a front end application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*N5VhhealE0atM5aY4qT9uA.png" /></figure><p>With the recent launch of OpenAPI support, you can now automate the building of client libraries for your CorDapps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*10xzQqoEWq5f5SuJI_bV9Q.png" /></figure><p>Every Corda developer has had the experience of having to build an integration with their existing system. It might be a bank system, back-end business software, or a web application. The experience is tedious and complex.</p><p>Before today, in order to connect to a Corda node, you had to write a client in a JVM-compatible language using the <a href="https://docs.corda.net/clientrpc.html#connecting-to-a-node-via-rpc">CordaRPCClient</a> class because the Corda node is a secure box running inside an JVM.</p><p>The client normally looks like something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*chnfo-FMFE0DIqfsMzpmcA.png" /></figure><p>Writing the client is the little step that stops you from showing your brilliant CorDapp to your friends and your boss if they haven’t learned how to start flows using the node shell. (⚠️ Don’t get me wrong. Implementing a web server by yourself is very easy. Check out these two articles to find out more information: <a href="https://medium.com/corda/spring-cleaning-migrating-your-cordapp-away-from-the-deprecated-corda-jetty-web-server-9d618371fc92">Spring cleaning : Migrating your CorDapp away from the deprecated Corda Jetty web server</a> and <a href="https://medium.com/corda/streaming-data-out-of-a-corda-node-with-spring-webflux-1f01bcd20246">Streaming data out of a Corda node with Spring WebFlux</a> by our R3 employees)</p><p>Introducing project <a href="https://gitlab.com/bluebank/braid">Braid</a>. Braid is a standalone client server that can present your CorDapp (and the APIs of your node) as an <a href="https://swagger.io/docs/specification/about/">OpenAPI</a> end point (formally know to developers as a swagger-api) API templates.</p><p>Thanks to the OpenAPI client, having to write your own custom REST APIs is a thing of the past. Now, after you finish your CorDapp development, you start up the Braid server. It will give you an API template, use the <a href="https://github.com/OpenAPITools/openapi-generator">Openapi-generator</a> tool to generate the API libraries in your desired language. Then you can start using the APIs anyway you like!</p><p>Braid provides easy integration to Corda from any programming language, and secure connections with TLS/SSL. It’s fast — capable of handling 8–9K concurrent requests per second on a small Amazon instance; and it scales well.</p><p>Behind the scene, Braid uses Vert.x, a lightweight reactive java framework. According the <a href="https://www.techempower.com/">techempower.com</a>, Vert.x’s performance is significantly better than Spring-boot for multiple queries. That said, Braid will be the next best option to connect your node with your existing applications.</p><p>Note: Braid was developed by an established R3 partner, <a href="https://lab577.io/">LAB577</a>. The core developer team of LAB577 has many years of experience with Corda. LAB577 is also a member and maintainer of the <a href="https://cordite.foundation/">Cordite</a> Foundation.</p><h3>Conclusion:</h3><p>This new procedure will shorten the development cycle and decrease the learning curve of developing Cordapps. For developers, it will make the application experience easier. For business owners and entrepreneurs, it will all come back as cost-savings for the project. This is the ultimate goal as the main contributors of our Corda community: to provide a smoother development experience that better fosters the Corda ecosystem</p><h3>Try it out:</h3><p>Openapi-sample: <a href="https://github.com/corda/openapi-sample">https://github.com/corda/openapi-sample</a><br>Or, learn more about Corda at<a href="http://www.corda.net/"> corda.net</a>.</p><p>Contact: slack.corda.net | Peter.li@r3.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bcbe2def7b30" width="1" height="1" alt=""><hr><p><a href="https://medium.com/corda/a-road-to-less-coding-auto-generate-apilibrary-bcbe2def7b30">A Road to Less Coding: Auto-Generate APILibrary</a> was originally published in <a href="https://medium.com/corda">Corda</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>