How did Hyperledger Fabric blockchain development improve in 2019?

Ed Moffatt
Coinmonks

--

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.

Shame everything I’ve done in 2019 wasn’t recorded on an immutable ledger for convenient recall…

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).

One of the best jokes I have ever written.

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.

The free “IBM Blockchain Platform” extension for VS Code is suitable for any Hyperledger Fabric developer

Releases varied greatly in terms of how much “new stuff” they brought to users. One release fixed the fonts on the homepage:

Big changes on Jan 30th

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!

Unless you’re a green congablock, you’re probably wondering why they’re just staring at nothing.

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!

Before 2019, Fabric smart contract dev had some room for improvement!

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.

New programming model (left) vs. old (right) for submitting a transaction using the Javascript SDK (apologies, the old one can’t even fit on the page!) — New = 53 lines, Old = 163 lines (same functionality & level of commenting)

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.

Smart Contracts can now extend the “Contract” class to cut out a bunch of boilerplate code. New = 143 lines, Old = 193 lines (same functionality & level of commenting)

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 ;)

“…with mature dev tools and a stable, unified programming model… it’s the perfect time to JUMP IN!”

In conclusion…

Get Best Software Deals Directly In Your Inbox

--

--

Ed Moffatt
Coinmonks

Blockchain UX Designer @ IBM |Video game artist @ XMPT Games | Alt Metal singer + guitarist @ Prion Son