Visual Studio Code for Hyperledger Fabric, looking into the future.

--

Learning to write Smart Contracts for Hyperledger Fabric means quickly learning the excellent Visual Studio Code. with the IBM Blockchain Platform Extension. Visual Studio Code is a full-feature source-code editor developed by Microsoft for Windows, Linux and macOS.

Since I teach workshops in Hyperledger Fabric to developers, I really like Visual Studio Code and expect that most of my students will pick it up in no time.

So it always come as a surprise that so many of them get really confused trying to create their first Smart Contract. Some ask if they can use Atom instead, while others simply don’t understand the underlying design principles of Visual Studio Code. This is a real problem and it seems to have do with the fact that the Visual Studio Code uses extensions or plugins that makes the GUI appear to be quite different if you don’t click on the right button.

You have the IBM Blockchain extension with its pane on the left, you have the Explorer on the upper left followed. by the Search, the Source Control, the Debugger, Source Control, Debugger, Extensions, and finally the IBM Blockchain Platform.

And to make things really counterintuitive we have three really small dots to the right of the Local Fabric Ops, and clicking on these will bring up the popup shown above. I am sorry but this is not obvious.

Now the good news is that as with many if not all the things we have to learn in life, from biking to cooking, once someone has pointed out how to do things it is if not ecessarily obvious, so least something that we quickly learn.

And if was asked how I would design the layout in Visual Studio Code I am not certain that I could do a better job. Still people do struggle and without someone present who quickly can step them thru the various paths thru the editor, many developers find the learning path unnecessarily frustrating.

Compared to the generally loved and easy-to-use modeling tool Hyperledger Composer, which has now been discontinued, Visual Studio Code takes a little while to get used to.

Which is why I spend some extra time at the beginning of each workshop to explain how the VSC works.

For the person who wants to look into the future I am a firm believer in the Hyperledger GRID .

“Hyperledger Grid initially intends to provide reference implementations of supply chain-centric data types, data models, and smart contract based business logic — all anchored on existing, open standards and industry best practices. Second it will showcase in authentic and practical ways how to combine components from the Hyperledger stack into a single, effective business solution.”

When we develop Smart Contracts for Hyperledger Fabric we dont start at the code level but at the business level.

And the development methodology for new Hyperledger Fabric apps starts with determining what existing Use Case can may fit our app: https://www.ibm.com/blockchain/use-cases. And although this step is not (yet) part of the the Visual Studio Code, It easily can be, as the picture below illustrates.

We select Industry, and if we are interested in Supply Chain we go directly to the Supply Chain framework, where we select best-practice architectures and Smart Contracts. Which we tweak until we get what we want. We can then integrate our Hyperledger projects into the development methodology, such as Hyperledger URSA.

Ursa is a modular, flexible cryptography library that is intended for — but not limited to — use by other projects in Hyperledger. Ursa’s objective is to make it much safer and easier for our distributed ledger projects to use existing, time tested, and trusted cryptographic libraries but also new cryptographic library implementations being developed.

If we have special requirements on cryptography we pick and chose from https://www.hyperledger.org/blog/2018/12/04/welcome-hyperledger-ursa

“ Ursa’s objective is to make it much safer and easier for our distributed ledger projects to use existing, time tested, and trusted cryptographic libraries but also new cryptographic library implementations being developed.”

The days when we create Hyperledger Fabric apps from scratch will hopefully soon be gone. Instead we pick and chose from existing use cases, frameworks and libraries, just like when we play with Lego blocks.

An example of this is the superb framework IBM Food Trust. If we are interested in creating a Food Trust application we surely won’t want to start from scratch. but simply re-use the IBM Food Trust, or the similarly architected TradeLens shipping solution.

Visual Studio Code for IBM Blockchain will almost certainly grow and evolve to emphasize re-use of Use Cases, code libraries and frameworks. Which will make the development process really easy to understand and allow small development teams to quickly create major products.

And rather than including the new features into the Visual Studio Code itself, my suggestion is to include them into the IBM Blockchain Platform, where they will be easily available. And where they can leverage other Clo

ud Services like AI and Machine Learning just to name a few.

Which is surely an exciting vision.

--

--

IBM Developer Advocate in Silicon Valley

Developers, startups and hackathons, Cloud, AI and Blockchain, up and down Silicon Valley. The opinions in this blog are my own.