How did Hyperledger Fabric blockchain development improve in 2019?
It’s time for Hyperledger Fabric’s annual performance review. What has it achieved in the past year?
Due to the fact I can’t remember whether something happened last month or 2 years ago (my brain files it all under “the past”), this sort of task always leads me to search back through presentations, documents, emails, etc. and try to reconstruct the events of the last year into a timeline like some sort of cheesy-tv-thriller detective.
In my quest to uncover the truth, I started reading back over the release notes for the IBM Blockchain Platform extension for VS Code. This is the main thing I work on: it allows you to add functionality into your IDE that makes it easier to develop and test blockchain contracts and applications. It’s got “IBM Blockchain Platform” as its name, because of the team that work on it, but it’s useful for any Hyperledger Fabric developer. (Hyperledger Fabric is an open source blockchain technology — see my previous blogs or Hyperledger’s website for more details).
Better Developer Tooling
We’ve done 28 releases of our VS Code extension in 2019. That’s taken us from v0.1.1 up to v1.0.17. So, we celebrated our v1 release, a big milestone, and we maintained our intended pace of a release every 2 weeks.
Releases varied greatly in terms of how much “new stuff” they brought to users. One release fixed the fonts on the homepage:
Meanwhile, one of the more big-hitting releases added support for generating Java and Go smart contracts, the ability to issue new identities from your local test network (allowing devs to start testing attribute-based access control for transactions in their contracts) and the ability to debug a transaction submission.
So, yeah, some were bigger releases than others.
Every release that wasn’t a “that one got stuck in the build pipeline, we need to bump the version number and try again” came with its own Conga Comic. I continue to be amazed by the fact I haven’t run out of cringe blockchain jokes yet (I draw these comics, and the team helps me come up with ideas!). Littered throughout this article are a few of my favorite comics from 2019!
Better Programming Model
Tools are only part of the developer experience. Allow me to construct an awful analogy… If you’ve got an absolutely brilliant cake tin, but the only ingredients you have in your cupboard are mince beef, cement and bees, you’re still not gonna enjoy making that cake. And nobody is going to enjoy eating it.
Replacing that beef, cement and bees with sugar, flour and eggs is sort of like what the Fabric “chaincode” and “client SDK” teams have done over the course of 2019. Ok, so it’s not like Fabric was terrible to work with before, but there was room for improvement…
One of the biggest issues was that client applications wanting to interact with a blockchain network (e.g. to submit a transaction that would update the shared, distributed ledger) needed to know far too much about that network. They needed to explain how the transaction proposal should be endorsed, specifying how to reach each of the peers involved. It’s really weird for the application (outside the network) to have that much detail about the internals of the runtime coded into it — and it didn’t help with maintenance of your apps if something changed in the network!
As for smart contracts (“chaincode”), they only had 2 functions: init( ) and invoke( ). What if you didn’t want to do the same thing every single time a contract was invoked? Why, you’d be using the same boilerplate code to have invoke( ) handle routing into your code every single time, of course!
The team came up with a new higher-level programming model concept, and have been steadily rolling it out across the programming languages used by Fabric.
Client apps now benefit from the concept of a “Gateway” — basically, a single peer can act as an app’s entry point to the network, and deal with all the details of how to get a given transaction endorsed and committed on behalf of the client. It’s so much easier, more sensible, and involves much less code.
TypeScript, JavaScript and Java smart contracts (Go is still in the works!) can now define named functions for transactions at the top level. This cuts out a ton of boilerplate code, and makes a contract far more readable for a new developer. Again, easier, more sensible, less code.
In Summary
2019 has seen Fabric embrace a new Programming Model. Meanwhile we’ve been pushing new releases of the developer tooling every 2 weeks. The result is that developers have a better set of tools to build things out of better raw materials. We’ve got some cool new stuff coming in 2020 too, but with mature dev tools and a stable, unified programming model no matter what programming language you choose, it’s the perfect time to jump in and try Fabric to develop your blockchain use case! And if you ask me, I’d say installing the IBM Blockchain Platform extension for VS Code and following the built-in beginner tutorials is the best way to get started ;)
In conclusion…