<?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 Adam Dry on Medium]]></title>
        <description><![CDATA[Stories by Adam Dry on Medium]]></description>
        <link>https://medium.com/@adit23?source=rss-d585afc19d38------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*2zVeMiHGUEd_VZj1.jpg</url>
            <title>Stories by Adam Dry on Medium</title>
            <link>https://medium.com/@adit23?source=rss-d585afc19d38------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 16:04:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@adit23/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[Ethers.js CheatSheet — Skip the learning curve!]]></title>
            <link>https://blog.thallo.io/ethers-js-cheatsheet-skip-the-learning-curve-4abc11729d98?source=rss-d585afc19d38------2</link>
            <guid isPermaLink="false">https://medium.com/p/4abc11729d98</guid>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[ethersjs]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[climatetech]]></category>
            <dc:creator><![CDATA[Adam Dry]]></dc:creator>
            <pubDate>Fri, 27 May 2022 13:10:43 GMT</pubDate>
            <atom:updated>2022-05-27T13:23:21.263Z</atom:updated>
            <content:encoded><![CDATA[<h3>Ethers.js CheatSheet — Skip the learning curve!</h3><figure><img alt="Screenshot of the ethers JS CheatSheet" src="https://cdn-images-1.medium.com/max/905/1*xIW_CwjCtGUOiRk0xxFqLw.png" /><figcaption>Screenshot of the ethers.js CheatSheet</figcaption></figure><h3>Open Source Rocks</h3><p>At thallo we utilise a number of open source libraries to build our product suite. We believe that the open source community is incredibly valuable and that anyone that takes from it should try and give something back.</p><h3>Hiring</h3><p>8 weeks ago we started our search for a Web3 developer to lead our smart contract and blockchain integration goals. We decided on an unusual recruitment process which involved a smart contract challenge in order to discover the email address to apply to. We had some great feedback from candidates who really enjoyed the puzzle. There’s even been some chatter on <a href="https://stackoverflow.com/questions/71669119/how-to-directly-interact-with-already-deployed-smart-contracts">Stack Overflow</a> about it. Although we’ve filled the position, if you fancy having a go for fun, the challenge starts <a href="https://1adb4708-5bdd-43de-8602-12589769d52d.s3.eu-west-1.amazonaws.com/ropsten.txt">here</a>.</p><p>Anyway, off the back of that process, 6 weeks ago we hired our Senior Solidity Developer — <a href="https://twitter.com/derked_eth">Brandon</a>. Brandon’s been absolutely smashing through the design and delivery of our blockchain powered carbon bridge. Another part of his role at thallo is to educate others in the <a href="https://www.thallo.io/team">team</a> on the deep technicals of the Web3 world.</p><h3>Giving Back to the OS Community</h3><p>To that end, Brandon has put together this <strong>awesome ethers.js CheatSheet</strong>: <a href="https://github.com/thallo-io/ethers-js-cheatsheet">https://github.com/thallo-io/ethers-js-cheatsheet</a> which we’ve decided to make open source so everyone in the Web3 community can make use of it and contribute if they wish.</p><p>It’s super pragmatic and to-the-point. It’ll be a great initial read, as well as useful reference material for any developer who isn’t already well versed in the nuances of communicating with a blockchain through ethers.js.</p><p><strong>Skip the painful learning curve</strong> that many of us have gone through and give it a read!</p><p>Being open source, if you have any feedback, please feel free to fork the repo and raise a PR, or create an issue and we’ll get back to you!</p><h3>About thallo</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/146/1*6yOCzdciR4Op1cVNASDIxQ.png" /></figure><p><strong>thallo</strong> will supercharge global decarbonisation efforts with our flagship product: an efficient and transparent carbon offset marketplace. We’re using the power of blockchain technology to completely transform and improve the transparency, liquidity and efficiency of today’s carbon offset market.</p><ul><li><a href="http://www.thallo.io/">www.thallo.io</a></li><li><a href="https://twitter.com/thallo_io">twitter.com/thallo_io</a></li><li><a href="https://t.me/+CrIV0hQ2jPI3ZjBh">t.me/+CrIV0hQ2jPI3ZjBh</a></li><li><a href="https://www.linkedin.com/company/thallo-io/">www.linkedin.com/company/thallo-io/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4abc11729d98" width="1" height="1" alt=""><hr><p><a href="https://blog.thallo.io/ethers-js-cheatsheet-skip-the-learning-curve-4abc11729d98">Ethers.js CheatSheet — Skip the learning curve!</a> was originally published in <a href="https://blog.thallo.io/">Thallo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blockchain Explained for Developers]]></title>
            <link>https://blog.thallo.io/blockchain-explained-for-regular-developers-ac26722b8d03?source=rss-d585afc19d38------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac26722b8d03</guid>
            <category><![CDATA[climate-technology]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[web2]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Adam Dry]]></dc:creator>
            <pubDate>Mon, 21 Mar 2022 14:40:58 GMT</pubDate>
            <atom:updated>2024-11-09T09:40:30.180Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*7_lw7LkgizsZa1XkWpWVTQ.jpeg" /><figcaption>Blockchain technology is weird and confusing — let’s resolve that</figcaption></figure><p>Maybe you build software products, maybe you’re a consultant or perhaps you work on internal corporate IT estates. I’ve worked in all three environments and for many years I didn’t fully appreciate what Blockchain tech could bring to the table. My opinion at the time was that I had the tools to solve the problems. What I didn’t have enough of, was time and money to build a bigger team and get things over the line faster.</p><p>Let me lay out how the Web3 world works through the eyes of a Web2 developer and why I changed my mind. Then you can decide how this tool fits into your solutions and when to use — and when not to.</p><h3>Let’s Execute Some Code</h3><p>Let’s jump right in and execute some code, we’ll go back and explain what is going on later.</p><ol><li>Clone the example repo: <a href="https://github.com/thallo-io/blockchain-example">https://github.com/thallo-io/blockchain-example</a></li><li>Open it in VSCode and ensure you open it in the DevContainer (use the green icon in the bottom left of VSCode -&gt; Open In Container)</li><li>npm i</li><li>Run the code via the tests:hh test</li></ol><p>You should see a similar output to this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*3jX4iYBZEj88u7LjpflSrw.png" /><figcaption>We executed a Smart Contract! 🎉 (+ shameless ASCII art plug for thallo)</figcaption></figure><h3>What Just Happened?</h3><p><a href="https://hardhat.org/getting-started/">Hardhat</a> 👷‍♀️ is an outstanding modern development environment to compile, deploy, test, and debug your Ethereum software. We have it installed as part of the example repo.</p><p>You can find the test code we executed at test/greeter.spec.ts and the Smart Contract code at contracts/Greeter.sol</p><p>Here’s an overview of what just happened in our test:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GyWcU4h5eEW99j32K7ks9w.png" /><figcaption>Our test process</figcaption></figure><h3>Take a Step Back</h3><p>Let’s take a step back and talk about the blockchain landscape.</p><p>Our code executed inside Hardhat’s EVM compatible implementation. EVM stands for Ethereum Virtual Machine. It’s the runtime in which our Solidity code can execute. Actually solidity compiles down into Ethereum bytecode but we can ignore this technicality for now.</p><p>Other blockchains utilise their own runtime, for example <a href="https://cardano.org/">Cardano</a> has its own VM and smart contracts are written in Haskell instead of Solidity. <a href="https://offchainlabs.com/">Arbitrum</a> uses its own AVM however it is EVM-compatible which means we can continue to write Solidity and have it execute correctly on the AVM. There are many other implementations which I may cover in future articles.</p><p>On top of these different runtime implementations we also have running instances of each blockchain. Ethereum has several testnets including Ropsten, Rinkeby and Kovan. Most other blockchains follow a similar convention. The Production environment is called “mainnet” and only <a href="https://www.coinbase.com/price/ethereum">ETH</a> (that is, Ether — the base cryptocurrency on Ethereum) on mainnet is worth any actual $$. We just ran our blockchain instance locally using Hardhat’s EVM compatible implementation.</p><h4>Miners and Validators</h4><p>I’m not going to go into the nitty gritty here. As developers, our code gets magically executed. That’s all we really care about. Of course if you’re going to actually start using a blockchain for real projects you will need to do your due diligence.</p><p>I will however briefly touch on consensus mechanisms. Ethereum currently uses Proof-of-Work (PoW). Super high level explanation: for each block (which contains multiple txs) a miner tries to guess the magic password, it tries many millions of passwords for each block and whoever finds it first gets some ETH that is minted out of thin air.</p><p>This is not very environmentally friendly 😔 It uses a lot of electricity just on mindless guessing. Fortunately a new consensus method has been developed called Proof-of-Stake (PoS) which basically involves people locking up a large amount of ETH, then they just run simple validation against the txs and say to the network “this all looks good”. If they fiddle with the data but emit the “all good” to the network, and they get caught (which they almost certainly will do by other validators) they will lose a large chunk of their locked up ETH — this process is called “slashing”. So it is in their interest to be honest.</p><p>PoS is awesome because it reduces the energy required by a blockchain network to something like <a href="https://blog.ethereum.org/2021/05/18/country-power-no-more/">0.05%</a> of its needs when using PoW. 🌎 <a href="https://www.thallo.io/about">thallo</a> is working hard to help allow blockchains and other protocols reduce their carbon footprint to zero, or even be climate positive — <a href="https://blog.thallo.io/thallo-climate-tech-3-0-45677b793680">read more here</a>!</p><p>Ethereum will be moving to PoS in the near future — known as “<a href="https://ethereum.org/en/upgrades/merge/">The Merge</a>”.</p><h3>Wallets &amp; Accounts</h3><h4>MetaMask</h4><p>MetaMask is an example of an Ethereum wallet. It’s a Chrome extension that looks after your accounts (explained below).</p><p>It also allows JavaScript on webpages you visit in Chrome talk to the blockchain. At a high level this works like this:</p><p>JS -&gt; MetaMask -&gt; an Ethereum node</p><p>This means you don’t have to run a full Ethereum node which is a heavy task and not in scope for this article. Again, for now, it magically reads from the blockchain and fires txs into it. 🙌</p><h4>Accounts</h4><p>In order to execute a tx you need an Ethereum account. This is a public/private key pair. You can generate a new one using MetaMask. Note that this doesn’t communicate with the blockchain, it’s generated locally. The number of available addresses is 2¹⁶⁰ or 1461501637330902918203684832716283019655932542976. So a lot! So the chances of a collision with an existing account is reduced to virtually zero.</p><h3>What is a Smart Contract</h3><p>Firstly it isn’t a contract in the legal sense. It’s not an agreement between 2 or more parties or anything like that.</p><p>It’s a lump of code (similar to a “class”) which does two things:</p><ol><li>Stores data on the blockchain through declaring module level variables.</li><li>Contains logic. Typically the logic will focus on the management of the data — who can update it and who can’t. How can the data evolve etc. Contracts can call other contracts — the calling contract will need to know the address of the contract it is trying to talk to.</li></ol><p>As a developer you can write Solidity code and exercise it through writing tests in TypeScript (or JS) and using Hardhat to execute those tests.</p><h4>Deployment</h4><p>When you’re ready you can deploy your smart contracts to a testnet such as Ropsten. You’ll need some ETH on the Ropsten network which can be obtained through a “faucet” or by asking the internet kindly via reddit/twitter etc.. You’ll need to setup Ropsten in your Hardhat config and have a key for an API that will allow you to talk to the blockchain easily — <a href="https://www.alchemy.com/">Alchemy</a> and <a href="https://infura.io/">Infura</a> are the two most popular ones. Both have free tiers which are good enough for most personal projects.</p><p>When you deploy a Smart Contract it will be given an address, which looks something like this: 0x006eCb9efFA194df5ce192AF1e15eFBaa8a3c87b</p><p>Anyone can then submit txs and attempt to execute the various methods available on the Smart Contract.</p><p>Once ready you can now deploy to mainnet. You will get a new contract address as you’re deploying to a completely different blockchain instance — they aren’t linked in any way.</p><h4>Updating Code</h4><p>By default Smart Contracts are immutable — that is, once they are deployed you cannot change their contents. This is <strong><em>very</em></strong><em> </em>different to what we’re used to in the Web2 world. DevOps processes, coupled with test automation have transformed the way in which we can deliver change into systems. Instead of having monthly, quarterly or even longer delivery cycles, we’re able to deploy to production multiple times a day with a high level of confidence that we haven’t broken stuff, and with zero downtime.</p><p>There are patterns you can follow to allow your Smart Contracts to be upgradeable. The details of this are out of scope for this article but you can take a look at the <a href="https://docs.openzeppelin.com/contracts/4.x/upgradeable">OpenZepplin upgradeable contracts</a>. OpenZepplin produce tonnes of awesome Smart Contracts to inherit from so if you want to create your own fungible token for example, you can simply inherit from the OZ ERC20 contract which will handle most of the logic for you.</p><h4>Security Considerations</h4><p>Given that any Smart Contracts you deploy are effectively an API available for the world to execute against you need to be careful that your code doesn’t have any logic issues which would allow a user to do something nefarious, like steal tokens or otherwise corrupt the data.</p><p>You will have to be extra cautious if you don’t make your contracts upgradeable!</p><p>There are several pit falls new blockchain devs fall into. I won’t go through all of them here — I highly recommend working your way through these CTF style challenges: <a href="https://ethernaut.openzeppelin.com/">https://ethernaut.openzeppelin.com/</a></p><p>Remember that all data on public blockchains (e.g. Ethereum) is visible to the world. Even privatevariable’s data is visible — private simply means that one contract cannot access the data directly from another contract.</p><p>Typically companies use 3rd parties to audit their Smart Contracts before they get deployed. <a href="https://consensys.net/diligence/">Consensys Diligence</a> and <a href="https://quantstamp.com/audits">Quantstamp</a> are well known providers for this service. Because it is a highly skilled and unique task for each customer, its very expensive — do not underestimate this cost when budgeting.</p><h4>Example Smart Contracts</h4><p>We already have one example in the GitHub repo, <a href="https://github.com/thallo-io/tssc2/blob/main/ThalloHire1.sol">here</a> is another example which is a little tech challenge as part of our hiring process at thallo. Take a look at our <a href="https://www.thallo.io/join-us">open positions</a>! 🧐</p><h3>Serverless and Gas Fees</h3><p>Because our code is executed by someone else and the data is stored by the people running a “node” on the network, we don’t have any server costs or maintenance overheads! Pretty awesome!</p><p>However, everyone that executes a tx has to pay to have their tx executed and their data stored on the blockchain. In Ethereum this is paid in Ether.</p><p>The details of how much a tx costs is a large topic in its own right but at a high level, the more code is executed and the more data is stored the higher the gas fees. So code performance has a direct $ cost to all those who are going to interact with it — you can’t just chuck hardware at it, which is sometimes a viable solution in the Web2 world.</p><h3>Applications</h3><h4>DeFi</h4><p>DeFi which is short for Decentralised Finance — is the opposite of TradFi which is short for Traditional Finance. There are a huge number of protocols which range from lending to staking to futures and options contracts and a million other things.</p><p>This is the obvious and most utilised function of blockchain tech but there are other problems it can solve too.</p><h4>Prove Your Data Hasn’t Changed</h4><p>As a business you may have private data that you wish to prove to your customers hasn’t changed. Imagine you’re an electricity supplier and as you take people’s readings, check their agreed rate and calculate their bill, you store all of this information in a regular database.</p><p>It would be feasible for a nefarious actor internally, or a bug in the code to alter old readings and land the customer with a large bill. There would then be a costly dispute process and you’ll probably incur some reputational damage. However if you take a snapshot of all the data each time you take a reading and put it on the blockchain, where it would then be <strong>immutable</strong>, the dispute is easily resolved.</p><p>The issue here is that we’ve just published <strong>private</strong> customer data on to a <strong>public</strong> blockchain! What we can do instead is take a hash of this data and store that on the blockchain. This will allow the customer (through an easy to use tool) to compare the hashes and know if the data has changed since it was originally created.</p><h4>Cross-Organisation Data</h4><p>Because of the <strong>immutability</strong> and <strong>trust-less</strong> ownership of data, blockchain opens opportunities for businesses to share information between each other without duplicating the data in their own infrastructure and setting up costly reconciliation processes.</p><p>There are complications here as the Smart Contract code would have to be developed in tandem to ensure that the logic serves both parties. <strong>Privacy</strong> may also be a concern as transactions between businesses are generally not something the parties want publicly visible.</p><h3>Conclusion</h3><p>Blockchain doesn’t solve everything — it’s a tool to be used to <strong>complement </strong>existing technologies.</p><p>I’ve massively glossed over many details and considerations here but I wanted to give you enough to at least write some code and execute it, and have an idea of where this tech sits in the grand scheme of things.</p><p>It’s a powerful addition to your arsenal as an architect. Use it wisely!</p><h3>About thallo</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/239/1*dTaYntr2sd0GzHU7-e0Deg.png" /><figcaption>thallo.io — Tomorrow’s carbon market. Powered by blockchain.</figcaption></figure><p><a href="https://www.thallo.io/">thallo</a> will supercharge global decarbonisation efforts with our flagship product: an efficient and transparent carbon offset marketplace. We’re using the power of blockchain technology to completely transform and improve the transparency, liquidity and efficiency of today’s carbon offset market.</p><p>We’re hiring! <a href="https://www.thallo.io/join-us">Check out our current openings.</a></p><p>Read more about thallo <a href="https://blog.thallo.io/thallo-climate-tech-3-0-45677b793680">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac26722b8d03" width="1" height="1" alt=""><hr><p><a href="https://blog.thallo.io/blockchain-explained-for-regular-developers-ac26722b8d03">Blockchain Explained for Developers</a> was originally published in <a href="https://blog.thallo.io/">Thallo</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating Corda into Enterprise IT Estates]]></title>
            <link>https://medium.com/corda/integrating-corda-into-enterprise-it-estates-faeaa3be62fb?source=rss-d585afc19d38------2</link>
            <guid isPermaLink="false">https://medium.com/p/faeaa3be62fb</guid>
            <category><![CDATA[enterprise-technology]]></category>
            <category><![CDATA[corda]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[dlt]]></category>
            <dc:creator><![CDATA[Adam Dry]]></dc:creator>
            <pubDate>Mon, 07 Sep 2020 15:07:13 GMT</pubDate>
            <atom:updated>2020-12-01T11:45:35.785Z</atom:updated>
            <content:encoded><![CDATA[<h4>Be ready for the Enterprise!</h4><figure><img alt="Corda integrated into an enterprise IT estate" src="https://cdn-images-1.medium.com/max/1005/1*hjev0JxWYHhESKVksQNZcQ.png" /></figure><h3>Integration</h3><p>Integrating your CorDapp into an existing, complicated IT estate will be somewhat of a journey. Before we dive in, let’s consider what DLT can do, what it can’t (or at least shouldn’t) do and why integration is so important…</p><h3>Corda Can Supercharge a Business!</h3><h4>Over Simplified DLT Explanation</h4><p>DLT allows the same, synchronised data to exist in multiple places. To write to those databases (the ledger), one or more parties must agree on the data that is going to be written. Who needs to agree is controlled by business logic and hard constraints in the form of Flows and Contracts.</p><p>The data on the ledger is versioned and immutable — you can’t just overwrite the data like a regular database, you have to create a new “version” of the data and write that. You can always see previous versions and everything is secured using cryptographic techniques — you can’t claim that “I didn’t agree to that” or “I put 1,000 not 10,000”.</p><p><a href="https://www.corda.net/">Corda</a> is R3’s DLT implementation and, with its private and permissioned architecture, is best suited to large Enterprise business problems IMHO. The rest of this blog will refer to Corda as the DLT tech of choice.</p><h4>Problem</h4><p>Two or more distrusted parties need to keep a record of the same data. They don’t trust each other to do that so they keep their own copies. Mistakes are made and there is a large operational overhead in the form of reconciliation.</p><p>A classic example is two people who loan each other money. Alice isn’t going to trust Bob to write down the right amount and tell her how much she owes, and vice versa. If they make a mistake and Bob puts that Alice borrowed “$100” but Alice puts that she borrowed “$10”, when the money arrives it is not what Alice is expecting. She then has to resolve this with Bob, they both update their ledgers and she has to send the money back to Bob — scale this up to large Enterprises and this is a costly operational overhead.</p><h4>Solution — Use a Third Party?</h4><p>To solve this you could use a mutually trusted third party to keep one record of the data for both parties. Issues will be detected before the money moves. This greatly reduces the operational overhead of reconciling — no need to move any money back.</p><p>However, there are costs associated with the third party and you have the potential political nightmare of identifying a third party which both parties trust. Also, scale this up and it doesn’t really work as each party will have hundreds, thousands or tens of thousands of counterparties.</p><h4>Solution — Use Corda!</h4><p>As discussed above, Corda allows you to have multiple copies of the same data. Using Contracts each party can be sure that they are in control of the data and that all relevant parties see exactly the same data.</p><p>Much lower cost and no need to trust another party.</p><h3>Don’t Write Everything in Your CorDapp</h3><p>Running a production-grade Corda node is no small feat. Making the node highly available (HA) using techniques such as a <a href="https://docs.corda.net/docs/corda-enterprise/4.5/operations/deployment/hot-cold-deployment.html">hot/cold</a> deployment is significantly more difficult than regular non-DLT technologies.</p><p>In addition, the node itself is part of a wider network with other nodes that are outside of your control. Corda has excellent resiliency with this regard in the form of a back-off message retry mechanism built into its excellent <a href="https://docs.corda.net/docs/corda-os/4.5/key-concepts-flows.html">Flow Framework</a>. But still, it’s part of a complex messaging system and you want to minimise downtime.</p><p>Unfortunately, there’s no way (that I’m aware of) to perform zero-downtime upgrades on Corda. You have to initiate <a href="https://docs.corda.net/docs/corda-os/4.5/node-upgrade-notes.html#step-1-drain-the-node">flow draining mode</a> to allow the node to complete any in-flight flows and then stop the Corda process, perform the upgrade tasks (like deploying the new CorDapp) and then restart the node.</p><p>If you have non-ledger related logic in your application, move it into a non-DLT technology. Using well-known techniques you can upgrade these applications with zero downtime. There is a trade-off that more infrastructure and procedures need to be put in place but if you are using a well-known tech such as Java, .NET, Node JS etc., your customers will likely already have the capability to deploy and maintain these types of applications.</p><p>Now you can iterate on this logic with ease and no downtime!</p><h3>Why Is Integration So Important?</h3><p>Your CorDapp should mostly contain ledger related logic so it is likely to be a cog in the machine — rather than driving an entire business process. External systems such as <a href="https://en.wikipedia.org/wiki/Treasury_management_system">Treasury Management Systems</a>, Margin Management Systems and the like are going to need to instruct the node to do things and they are going to need feedback from your CorDapp.</p><p>This facilitates using existing GUIs or APIs reducing the barriers to adoption.</p><p>You will also need to allow data to be pulled from the node for reporting and auditing purposes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/0*vPvAGJwqUl87s8WS.jpg" /></figure><h3>Make Integrating as Easy as Possible</h3><p>Integration <em>will</em> be something you come up against and it will be a journey from business analysis through to design, build, deploy and maintain.</p><p>The default interface to integrate into a Corda node is RPC, which, in my experience, the majority of development teams are not familiar with. In addition, spinning up your CorDapp will require some<em> </em>Corda knowledge and, very probably, some internal knowledge of your application — perhaps there are some initial states that need creating or maybe there’s a <a href="https://solutions.corda.net/business-networks/business-network-operator-node.html">Business Network Operator</a> node that requires some config. These cause barriers to adoption and essentially increase the effort and cost required by the customer to integrate with your CorDapp. It also increases your cost to support these PoCs per customer as you are having to hand-hold the customer through the setup process — which is not interesting to either party.</p><p>You want to reduce this cost as much as possible so you can move along the sales process and demonstrate how your application can help their business.</p><p>There are two things you can do that will help significantly:</p><ul><li>implement an Http API</li><li>have the ability to spin up private networks for your customers to build against</li></ul><p>Let’s explore both of these things in more detail…</p><h3>Http API</h3><p>Use well-known technologies to deliver your API — which these days basically means an Http API. You could use Graph QL or REST to structure the endpoints — so long as you use something that’s popular amongst developers and is common in the enterprise world.</p><h4>Architecture</h4><p>You can either create a separate web server application to deliver your API or you can run the server inside the Corda process.</p><p>To run the server inside the Corda process you can use <a href="https://blog.b9lab.com/cordacon-2019-highlights-braid-server-and-openapi-generator-for-corda-flows-api-s-d24179ccb27c">BRAID</a>. I haven’t actually implemented this so I’ll leave you to do your own research. My “Solution Architect” spidey sense says that a separate web server which can be scaled and maintained independently is probably a better solution, so I’ll focus on that.</p><h4>Technology Choice</h4><p>You have to use a Java bytecode generating language such as Java or Kotlin (I recommend Kotlin) because you will need to consume your CorDapps as dependencies in order to integrate via the RPC interface in an efficient way.</p><p>I’ll do a very light-touch analysis of the web server technologies Ivno looked at (EDIT: Igor Lobanov from Bond 180 does a fantastic deep dive write up on the <a href="https://medium.com/b180tech/corda-integration-options-a8ba4339006b">options available for CorDapp integration</a>, as well a new promising, open source player on the scene — <a href="https://github.com/b180tech/cordaptor">Cordaptor</a>):</p><p><strong>Ktor</strong></p><p>This did well in performance tests and was easy to build against but, as a new technology, we were concerned customers may have additional due diligence to perform before adopting it — another barrier to engagement.</p><p><strong>Vertx</strong></p><p>This performed the best in performance tests although there were some concerns regarding the internal training required to build against this in a confident way.</p><p><strong>Spring Boot</strong></p><p>Ultimately Spring Boot was fast enough and extremely well known. We had the internal knowledge to build against this immediately and with confidence. So Spring Boot was our technology of choice!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/1*mr2S5lzsAETWx1oVqDtUlA.png" /></figure><h4>Authentication, Identification and Auditing</h4><p>In the enterprise world and particularly in the Fin Serv and DLT world, security is absolutely paramount. It should be considered in every design decision of your software. Enterprises will expect your web server to support <a href="https://en.wikipedia.org/wiki/Mutual_authentication">mutual TLS</a> so make sure you know how to set this up and that your web tech supports it.</p><p>Customers will also expect some method of identification. Each request that comes through the API must authenticate and identify itself. This way you can add roles and permissions to each “user” within the system and you can restrict which operations each user can perform within the system.</p><p>This is also imperative for auditing purposes. Every action should be recorded in a regular database, including the user that performed that action, to ensure a full audit trail. Again something enterprise customers will expect.</p><h3>Sandbox Networks</h3><p>OK, so you have an easy-to-use API that innovation teams can integrate with. But they need a running instance of your app in order to build against.</p><p>As discussed earlier, spinning up a Corda network or even running one through <a href="https://docs.corda.net/docs/corda-os/4.5/generating-a-node.html#tasks-using-the-cordform-plug-in">deployNodes</a> requires some Corda knowledge and expertise. On top of that your application will likely require some setup and orchestration. Just handing your CorDapps or even a docker image to a customer will cause both you and them a headache. And just getting a running instance is unlikely to be part of the scope of a PoC — it’s boring, costly and yet another barrier to revenue.</p><p>At Ivno we utilise Infrastructure as Code (IaC) technologies (namely Terraform) with a cloud provider (AWS) and a custom orchestration application to allow us to spin up private networks with one command, and in a matter of minutes.</p><p>We then give customers access to these instances to build their PoCs and integrate their test instances of their existing systems. We do the heavy lifting for them!</p><p>By using IaC and scripting the creation and destruction of these networks, we can get our software into the hands of customers at minimal cost to us. Not every PoC will result in a signed contract so this reduces our customer acquisition cost significantly.</p><h3>Create a Plugin System</h3><p>This is something for further down the line as it can be bolted on to your offering at later date.</p><p>I’ve recently covered this topic in a <a href="https://medium.com/corda/creating-a-cordapp-plugin-system-dc07d4b0ef8a">blog post</a>, however the high-level concept is to create libraries for languages your customer’s use to integrate with your API.</p><p>This means you can keep your Http API low level and flexible but also offer a way to very quickly integrate into your Http API from their language of choice.</p><p>At Ivno we currently write all of our plugins in Node JS, and our plugin library makes it extremely quick for us, and our customers, to build new functionality around the node.</p><p>Read my blog post for a deep-dive into the subject: <a href="https://medium.com/corda/creating-a-cordapp-plugin-system-dc07d4b0ef8a">Creating a CorDapp Plugin System</a></p><h3>TL;DR</h3><ul><li>Put an Http API over your CorDapp to make it easier for existing non-DLT savvy teams to integrate with your system</li><li>Make it easy for you to spin up mini private networks for customers to create PoCs against</li></ul><p>These 2 things mean development teams with zero Corda, Blockchain or DLT experience can integrate with your system in a matter of hours.</p><p>P.S. Listen to me discuss some of these topics in my <a href="https://www.youtube.com/watch?v=gjd0Cas1WfM">From The Basement</a> podcast interview with <a href="https://medium.com/@MartinJee">Martin Jee</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=faeaa3be62fb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/corda/integrating-corda-into-enterprise-it-estates-faeaa3be62fb">Integrating Corda into Enterprise IT Estates</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[Creating a CorDapp Plugin System]]></title>
            <link>https://medium.com/corda/creating-a-cordapp-plugin-system-dc07d4b0ef8a?source=rss-d585afc19d38------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc07d4b0ef8a</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[plugins]]></category>
            <category><![CDATA[cordapp]]></category>
            <category><![CDATA[corda]]></category>
            <category><![CDATA[dlt]]></category>
            <dc:creator><![CDATA[Adam Dry]]></dc:creator>
            <pubDate>Sun, 29 Mar 2020 19:31:37 GMT</pubDate>
            <atom:updated>2020-03-31T19:08:49.767Z</atom:updated>
            <content:encoded><![CDATA[<h4>Get to production faster</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*XqMkoFY8EE1PloPGfDf3Yg.png" /></figure><h3>The Plugin Paradigm</h3><p>Using a plugin pattern allows you, as a CorDapp product vendor, and your customers to build highly focused and unique business logic that bolts on to a specific running instance of your CorDapp.</p><p>Importantly it allows Development and Ops teams to use languages, protocols, deployment processes and infrastructure they are familiar with to integrate your CorDapp into their existing systems and make it work for them.</p><h3>RESTful API</h3><p>After <strong>Ivno’s highly successful </strong><a href="https://medium.com/ivno/ivnos-global-corda-trial-53016c85682"><strong>Global Corda Trial</strong></a>, we polled the participants and asked them if a RESTful API would likely be useful in a production setting— the answer was a resounding yes.</p><p>The default interface into a Corda node is RPC, which the majority of development teams are not familiar with. Http interfaces, on the other hand, are highly prevalent in modern day programming.</p><p>Ivno have built a <strong>rich RESTful API</strong> to allow the querying of the vault and instructing the node to perform actions, such as starting the token transfer process. We also provide a <strong>real-time API</strong> to allow a “push” model into other systems.</p><p>It’s this interface that our Plugins will utilise.</p><h3>The anatomy of an Ivno CorDapp Plugin</h3><p>At Ivno all our Plugins are written in TypeScript as that’s the language we prefer to write web-tech products in. We have created a Plugin Library that encapsulates communications into our RESTful API. This Library is used across all of our Plugins and significantly reduces the development and testing time for each Plugin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y1C12k6HaO4co696Hptuog.png" /><figcaption>Ivno’s CorDapp Plugin Architecture</figcaption></figure><h3>Where to Place Business Logic</h3><p>CorDapps themselves are conceptually split into two parts, the plugin paradigm adds a third:</p><ul><li><strong>States/Contracts </strong>— this is where your “absolute” rules go, things that must absolutely be true for your system to make sense. E.g. an IOU state cannot have the lender and the borrower be the same person.</li><li><strong>Flows</strong>— this is where the business processes that are core to your system are placed. They control the process flow by utilising Corda’s <a href="https://docs.corda.net/docs/corda-enterprise/4.0/key-concepts-flows.html#the-flow-framework">Flow Framework</a>. Generally speaking they are used to build up a transaction by asking different parties for data, signatures etc., ultimately leading to a finalised transaction and thus a change to the shared ledger.</li><li><strong>Plugins </strong>— this is where you place instance-specific business logic. E.g. when a new IOU state is set to requested and you are the lender, and it’s less than or equal to $500, check your external system to see if the borrower is “trusted”. If they are, then automatically start a Flow to set the IOU to Accepted.</li></ul><h3>Benefits of Writing Plugins</h3><p>You could create this logic inside of a separate, customer specific CorDapp. You could write custom Flows and utilise Corda Services to achieve the desired outcome. This is fine for a Corda shop, who already have the intimate Corda knowledge required to build a production grade CorDapp. They already have testing and deployment processes and test environments suitable for CorDapp development.</p><p>Most customers won’t have this and so giving them the option to use technologies they already know to interface into the Corda node greatly reduces friction to production.</p><p>Simply put, <strong>Plugins make your CorDapp immediately accessible by your customers.</strong></p><p>At Ivno we supply customers with our Plugin Library which reduces their development time and allows them to benefit from our products more quickly.</p><p>Customers can use languages, protocols, deployment processes and infrastructure they are familiar with. Empowering them like this has the following benefits:</p><ul><li>Customers can create Proof of Concepts easily and cheaply which they can use in their business case to get budget sign off for your CorDapp</li><li>Customers can move into production much more quickly</li><li>Customers will be able to maintain and improve their Plugins on their own, giving them freedom to iterate as and when they see fit</li></ul><h3>When not to use Plugins</h3><p>Anything that is core to your application should go in a Flow and be provided as part of your product.</p><p>Plugins are for custom logic/integration points that are node-instance specific.</p><h3>Example Use Cases</h3><p><strong>Creating connectors into existing systems</strong>: The Plugin can take events from the real-time API that triggers actions in another system. Equally the Plugin could listen for events in an external system that trigger an action on the node. It can keep the two systems in sync to create a seamless integration.</p><p><strong>Customer specific logic</strong>: The Plugin could automate an otherwise manual step in a Flow — for example, to approve a token transfer given some customer specific requirements.</p><p><strong>Slack notifications</strong>: The Plugin could fire messages to a Slack channel when certain events occur on the node.</p><p><strong>Automate certain node roles in a test environment</strong>: At Ivno we’ve created a Plugin that automatically approves token issuance and redemption on the Custodian’s node. This isn’t something that would be done in production (obviously) but is exceptionally helpful when testing and demoing the product. Using a Plugin model avoids us shipping test-only code in the production product.</p><p>Here is some sample code utilising our Plugin library:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/78febdbd36b6206994312b83a778da86/href">https://medium.com/media/78febdbd36b6206994312b83a778da86/href</a></iframe><p>When a new inbound token transfer request is sent to this node, the Plugin will automatically accept it and the tokens will be transferred to this node.</p><h3>What makes a Plugin System?</h3><p>By creating and supplying a Plugin Library we are standardising the way external systems communicate with the node. For example, authentication is handled by a module within the library.</p><p>We also promote certain patterns when writing Plugins. For example, how to handle state to keep track of which events have been processed by the Plugin and the way in which the Plugin is deployed.</p><h3>Infrastructure Architecture</h3><p>We follow the <a href="https://docs.microsoft.com/en-us/azure/architecture/patterns/sidecar">sidecar pattern</a> for the majority of our Plugins as we generally consider them an extension of the core product. As such they follow the same life cycle as the main CorDapps and are updated in lock step.</p><p>This isn’t always applicable so make sure you choose the correct architecture for your given situation.</p><p>In summary, adopting a Plugin system for your CorDapps will empower customers to get hands on with your app faster. They will be more comfortable with the technology, which can only be a good thing in such an emerging and complex world such as DLT.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc07d4b0ef8a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/corda/creating-a-cordapp-plugin-system-dc07d4b0ef8a">Creating a CorDapp Plugin System</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[Ivno’s approach to DevOps on Corda]]></title>
            <link>https://medium.com/@adit23/ivnos-approach-to-devops-on-corda-af095375fccd?source=rss-d585afc19d38------2</link>
            <guid isPermaLink="false">https://medium.com/p/af095375fccd</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[r3]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[corda]]></category>
            <category><![CDATA[dlt]]></category>
            <dc:creator><![CDATA[Adam Dry]]></dc:creator>
            <pubDate>Thu, 14 Nov 2019 10:38:08 GMT</pubDate>
            <atom:updated>2019-11-14T10:38:08.757Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Ivno’s projects and their build artifacts" src="https://cdn-images-1.medium.com/max/1024/1*3YIdSo4FOU0PO_HkMgOhtA.png" /><figcaption>Ivno’s projects and generated build artifacts</figcaption></figure><h3>What is DevOps?</h3><p>This is a controversial question. The die-hard will tell you it’s a mindset, the uninitiated will tell you it’s a job role and anyone else will shout “Docker!” and run off.</p><p>Creating a ubiquitous definition of DevOps is not in the scope of this article so I’ll simply outline what it means to me when I say “we utilise DevOps”:</p><blockquote>The ability to change quickly, with a high level of confidence.</blockquote><p>Meaning we can change the code base, test the product, be pretty damn certain that we haven’t broken any existing functionality and create a shippable build artifact — quickly.</p><p>This requires the use of various tools (yes, Docker included) as well as the right mentality to keep this mantra at front of mind throughout all technical decisions.</p><p>This also extends to deployment, for which I have an additional one liner:</p><blockquote>Deployment should be boring.</blockquote><p>Meaning it’s highly automated and the testing of the deployment process itself is a first-class citizen — not an afterthought. This gives you the confidence to push the “deploy” button <strong>without</strong> that surge of fear-induced adrenaline while you wait for the phones to light up — <em>boring</em>.</p><p>However this article will focus on the dev-&gt;test-&gt;build cycle. I’ll leave deployment for another time.</p><h3>The Product</h3><p><a href="http://ivno.io/">Ivno</a> uses <a href="https://www.corda.net/">Corda</a>’s enterprise grade DLT solution to bring cash &amp; collateral backed Tokens to institutions, banks and corporations to enable 24/7 instant settlement, real-time payment and immediate collateral mobility.</p><p>We include a web GUI and a RESTful http interface into the Corda node for systems integration.</p><p>This is achieved with the following technical components:</p><ul><li>Multiple CorDapps that contain our States, Contracts, Flows etc..</li><li>An Angular web Frontend</li><li>A web server (Spring Boot) that acts as a Backend for the Angular app and serves the REST API</li></ul><h3>Automated Testing</h3><p>Automated testing is an absolute must for any software team that wants to move quickly. It also enables an Agile approach — make lots of small changes instead of a few large ones. If your regression testing isn’t automated, the overhead of making a change is huge and so making lots of small changes will see your QA team completely snowed under and output will grind to a halt.</p><p>These are the types of automated tests we build alongside our code to assure quality:</p><h4>CorDapps</h4><ul><li>Unit and integration tests — these use the Node Driver that comes with Corda</li></ul><h4>Backend Server</h4><ul><li>Integration tests using JUnit 5</li></ul><h4>Frontend Angular app</h4><ul><li>End to end tests using <a href="https://devexpress.github.io/testcafe/">TestCafe</a></li></ul><h3>Build Artifacts</h3><p>Each of our projects need to ultimately produce a build artifact that can be shipped to a customer and deployed. These are our build artifacts for each project:</p><figure><img alt="Ivno’s projects and their build artifacts" src="https://cdn-images-1.medium.com/max/1024/1*3YIdSo4FOU0PO_HkMgOhtA.png" /><figcaption>Ivno’s projects and generated build artifacts</figcaption></figure><h4>CorDapps</h4><ul><li>A zip file containing all the JAR files plus some config files</li><li>A docker image including Corda that can be run to create a running node with our CorDapps pre-installed — tagged with the version</li></ul><h4>Backend Server</h4><ul><li>A JAR file</li><li>A docker image which can be run to create a running Ivno Backend server — tagged with the version</li></ul><h4>Frontend</h4><ul><li>A zip file containing the JavaScript which has been transpiled from TypeScript</li><li>A docker image which can be run to create a simple nginx server that serves our Frontend app — tagged with the version</li></ul><p>We produce both a core build artifact (e.g. the JARs) as well as a docker image as some customers may already have a Corda node on which they want to add our CorDapps. Our docker image wouldn’t be suitable in that situation. Equally on the Frontend, they may already have a webserver (IIS or Apache for example) from which they want to serve the Ivno Frontend. They can do this using the zip file build artifact.</p><p>If you spin up one of each of the docker containers you have a working node. Well sort of. A Corda network requires some network services, namely a doorman (to allow/disallow people to join the network), a network map (think DNS for nodes) and a notary. Cue our ephemeral environment…</p><h3>Ephemeral Environment</h3><p>By ephemeral I mean an environment that can be created and destroyed with relative ease. It isn’t long-lived and it doesn’t contain any sensitive or important data as it could be destroyed at any point.</p><p>When testing manually or running integration/end-to-end tests we want to be hitting an environment that is as close to production as possible.</p><p>As Ivno is moving towards production (expected early 2020) we have ensured the docker images we produce are production quality and ready to be shipped to our customers. It therefore makes sense that our test environments also make use of them.</p><h4>Environment Topology</h4><p>We use docker-compose to spin up the following services:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u2YXcYgVPg9tgiXuXwFDCg.png" /></figure><ul><li>Postgres db (for test env only)</li><li>Postgres db GUI (for test env only)</li><li>A Network Map Service (NMS) (<a href="https://gitlab.com/cordite/network-map-service">we use Cordite’s excellent NMS</a>) which also acts as the doorman</li><li>A notary (for test env only)</li><li>3x Nodes with our CorDapps installed (Ivno, Bank1, Bank2) (prod ready)</li><li>3x Backend Servers (Ivno, Bank1, Bank2) (prod ready)</li><li>3x Frontend Servers (Ivno, Bank1, Bank2) (prod ready)</li></ul><h4>Spin Up</h4><p>Spinning up a Corda network requires some orchestration. For example you don’t want to start the nodes until the NMS has booted up. You also have to register the notary with the NMS. We use a bash script to spin up the individual docker-compose services and then use loops inspecting the docker-compose logs to identify when a service has started. This approach is heavily inspired by <a href="https://gitlab.com/cordite/cordite/blob/master/test/build_env.sh">Cordite’s scripts</a>.</p><p>It’s just one command to spin up the environment: ./spin-up.sh</p><p>Once the environment has started up (which takes about two and half minutes on my machine) it outputs a summary of useful links and commands:</p><figure><img alt="Screenshot of the terminal with Ephemeral Environment summary" src="https://cdn-images-1.medium.com/max/1024/1*VZWnm6u9bS_gG5hHYS6m-g.png" /><figcaption>Ivno’s Ephemeral Environment summary</figcaption></figure><p>So hitting http://localhost:2301/ will serve up the Ivno Frontend for Bank1:</p><figure><img alt="Ivno’s Frontend for Bank1" src="https://cdn-images-1.medium.com/max/1024/1*MM0Q6ibavllNYUI2RbG6ow.png" /><figcaption>Ivno’s Dashboard for Bank1, served locally</figcaption></figure><h4>Flexibility</h4><p>Our docker-compose.yml file uses environment variables to specify the docker image names e.g.:</p><pre>ivno-notary:<br>  image: ${NOTARY_IMAGE}</pre><p>The images used for each of these is specified in a .env file which our docker-compose.yml file will pick up. This means a QA could edit the .env file to change the version of the Node for Bank2, re-spin that service and start testing to see what happens when different versions of our CorDapps are running in the same network.</p><p>We can also run our integration and end-to-end tests against this environment — <strong>both locally <em>and</em> on a CI/CD server</strong>. This is massively helpful — you can run almost the exact same setup locally as what the CI/CD server runs. Any build failures should be reproducible locally and therefore <strong>much easier and faster to debug.</strong></p><p>This means our developers, QA team and CI server are all running tests <strong>against production grade build artifacts</strong>!</p><p>There’s also no server costs to spin up an ephemeral environment as it runs locally rather than in a cloud provider like AWS.</p><h3>The Dev -&gt; Check -&gt; Repeat Cycle</h3><p>Developers do this a lot. Write some code, exercise the code, did it work? Possibly not, so change the code, exercise the code, did it work? And so on. Because of the high frequency of this cycle, any small efficiency gain will quickly add up, and is then multiplied by the number of developers in the team. So it’s an area worth putting some focus on.</p><p>Utilising the unit and integration tests, developers can exercise their code quickly. In addition, being able to run a prod-like environment locally means they don’t have to wait for their changes to be deployed to a UAT server to test them “in the wild” — they can do that even before pushing to git!</p><h3>Branching and Versioning Strategy</h3><p>This isn’t very Corda-ee so I won’t go into huge amounts of detail here.</p><p>Essentially we follow the <a href="https://about.gitlab.com/blog/2014/09/29/gitlab-flow/">GitLab Flow</a> method for branching. This allows us to manage multiple environments and have multiple release versions on the go at the same time — something that <a href="https://about.gitlab.com/images/git_flow/gitdashflow.png">Git Flow</a> doesn’t allow.</p><p>Our versions come from the branch name and then we add the build number on the end on our CI server (see below). So for example a branch called f-issuance-flow will generate build artifacts with a version f-issuance-flow+35 where 35 is the build number.</p><p>For branches that start with rc- we strip the rc- part from the front to create the version. For example rc-2.4.3 will generate build artifacts with a version of 2.4.3+35 .</p><p>These versions are stamped into the build artifacts using filenames for the zips and docker tags for the docker images.</p><h3>CI/CD</h3><p>We use <a href="https://circleci.com/">CircleCI</a> as our build server of choice. I’ve worked with Jenkins in the past and the server maintenance and cloud provider cost overheads were a burden our team didn’t need. CircleCI is cloud based and as such these overheads are handed off to their Ops team and we can just assume it magically works.</p><p>Our build pipelines tend to go something like this:</p><ul><li>Compile/Transpile</li><li>Run unit tests</li><li>Generate version number</li><li>Tag commit in git with version number</li><li>Create build artifacts (zips and docker images) tagged with version number</li><li>Push build artifacts (S3 and ECR)</li><li>Run integration tests</li><li>Run end-to-end tests</li></ul><p>If we change the CorDapp, the CI server will use that build we just created and run the end-to-end tests against the latest master version of the Backend and Frontend. Equally, if we change the Frontend we’ll run that latest build against the latest master versions of the CorDapps and Backend server.</p><p>This pipeline is triggered every time we push a commit. Build failures are posted to a Slack channel. This gives fast feedback to the developer so if they’ve broken something with their changes they can fix it while it’s still fresh in their heads. This is both more efficient and more comprehensive — the developer will remember all the little details of the changes they’ve just made and will do a better job of catching all the gremlins in the code. Ultimately this gives us a higher quality product.</p><p>CircleCI is integrated with our GitHub repos so you can’t merge a Pull Request unless all the steps in the pipeline have passed. This ensures we don’t get nasty code in master or a release branch.</p><h3>Can we change quickly, with a high level of confidence?</h3><p>Let’s summarise the things that help us with this goal:</p><ul><li>Developers can run the unit and integration tests locally to exercise their code</li><li>Developers and testers can test on a prod-like environment locally</li><li>Developers can run the end-to-end tests locally in a comparable way to how the CI server runs them</li><li>Integration and end-to-end tests are performed against the actual build artifacts that will be shipped</li><li>Tests are run automatically to give fast feedback, creating a higher quality code base with less effort</li><li>Checks avoid bad code from making it’s way into the wild</li></ul><p>Given the above I think it’s fair to say yes we can. But there’s always room for…</p><h3>Improvements</h3><p>Really we’re just getting started. There are lots of additional tests and procedures we’d like to add, for example automated performance testing and adding linters to the build process.</p><p>Our approach to DevOps is the same as our approach to Software Development — it is iterative, always improving and always driving forward in an innovative and smart fashion. The processes I’ve described above will continue to evolve, grow and deliver an even richer experience for our developers and testers — ultimately leading to a higher quality product for our customers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af095375fccd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>