Getting Started with Blockchain

In an earlier post I discussed the UK government report on distributed ledger technology (AKA ‘blockchain‘) and how the government’s Chief Scientific Advisor, Sir Mark Walport, was doing the rounds advocating the use of blockchain for a variety of (government) services.

Blockchain is a shared, trusted, public ledger that everyone can inspect, but which no single user controls. The participants in a blockchain system collectively keep the ledger up to date: it can be amended only according to strict rules and by general agreement. For a quick introduction to blockchain this article in the Economist is a pretty good place to start.

Blockchains are going to be useful wherever there is a need for a trustworthy record, something which is pretty vital for transactions of all sorts whether it be in banking, for legal documents or for registries of things like land or high value art works etc. Startups such as Stampery are looking to use blockchain technology to provide low cost certification services. Blockchain is not just for pure startups however. Twenty-five banks are part of the blockchain company, called R3 CEV, which aims to develop common standards around this technology. R3 CEV’s Head of Technology is Richard Gendal Brown an ex-colleague from IBM.

IBM recently announced that, together with Intel, J.P. Morgan and several large banks, it was joining forces to create the Open Ledger Project with the Linux Foundation, with the goal of re-imagining supply chains, contracts and other ways information about ownership and value are exchanged in a digital economy.

As part of this IBM is creating some great tools, using its Bluemix platform, to get developers up and running on the use of blockchain technology. If you have a Bluemix account you can quickly deploy some applications and study the source code on GitHub to see how to start making use of blockchain APIs.

This service is intended for developers who consider themselves early adopters and want to get involved with IBM’s approach to business networks that maintain, secure and share a replicated ledger using blockchain technology. It shows how you can:

  • Deploy and invoke simple transactions to test out IBM’s approach to blockchain technology.
  • Learn and test out IBM’s novel contributions to the blockchain open source community, including the concept of confidential transactions, containerized code execution etc.

It provides some simple demo applications you can quickly deploy into Bluemix to play around with this technology.

Marbles
Marbles Running in IBM Bluemix

This service is not production ready. It is pre-alpha and intended for testing and experimentation only. There are additional security measures that still must be implemented before the service can be used to store any confidential data. That said it’s still a great way to learn about the use and potential for this technology.

 

Advertisements

Back to the Future Day

So, the future has finally arrived and today is ‘Back to the Future Day‘. Just in case you have missed any of the newspaper, internet and television reports that have been ‘flying’ around this week, today is the day that Marty McFly and Doc Brown travel to in the 1980s movie Back To The Future II as dialled into the very high-tech (I love the Dymo labels) console of the modified (i.e. to make it fly) Delorean DMC-12 motor car. As you can see the official time we can expect Marty and Doc Brown to arrive is (or was) 04:29 (presumably that’s Pacific Time).

Back to the Future Delorean Display
Back to the Future Delorean Display

Depending on when you read this therefore you might still get a chance to watch one of the numerous Marty McFly countdown clocks hitting zero.

Most of the articles have focussed on how its creators did or didn’t get the technology right. Whilst things like electric cars, wearable tech, drones and smart glasses have come to fruition what’s more interesting is what the film completely missed i.e. the Internet,  smartphones and all the gadgets which we now take for granted thanks to a further 30 years (i.e. since 1985, when the first film came out) of Moore’s Law.

Coincidentally one day before ‘Back to the Future’ day I gave a talk to a group of university students which was focussed on how technology has changed in the last 30 years due to the effects of Moore’s Law. It’s hard to believe that back in 1985, when the first Back to the Future film was released, a gigabyte of hard disk storage cost $71,000 and a megabyte of RAM cost $880. Today those costs are 5 cents and a lot less than 1 cent respectively. This is why it’s now possible for all of us to be walking around carrying smart devices which have more compute power and storage than even the largest and fastest super computers of a decade or so ago.

It’s also why the statement made by Jim Deters, founder of the education community Galvanise, is so true, namely that today:

“Two guys in a Starbucks can have access to the same computing power as a Fortune 500 company.”

Today anyone with a laptop, a good internet connection and the right tools can set themselves up to disrupt whole industries that once seemed secure and impeneterable to newcomers. These are the disruptors who are building new business models that are driving new revenue streams and providing great, differentiated client experiences (I’m talking the likes of Uber, Netflix and further back Amazon and Google). People use the term ‘digital Darwinism’, meaning the phenomenon of technology and society evolving faster than an organization can adapt, to try and describe what is happening here. As Charles Darwin said:

“It’s not the strongest of the species that survive, nor the most intelligent, but the one most responsive to change.”

Interestingly IBM is working with Galvanise in San Francisco at its Bluemix Garage where it brings together entrepreneurs and start ups, as well as established enterprises, to work with new platform as a service (PaaS) tools like IBM Bluemix, Cloudant and Watson to help them create and build new and disruptive applications. IBM also recently announced its Bluemix Garage Method which aims to combine industry best practices on Design Thinking, Lean Startup, Agile Development, DevOps, and Cloud to build and deliver innovative and disruptive solutions.

There are a number of Bluemix Garages opening around the world (currently they are in London, Toronto, Nice and Melbourne) as well as local pop-up garages. If you can’t get to a garage and want to have a play with Bluemix yourself you can sign up for a free registration here.

It’s not clear how long Moore’s Law has left to run and whether non-silicon based technologies, that overcome some of the laws of physics that are threatening the ongoing exponential growth of transistors in chips, will ever be viable. It’s also not clear how relevant Moore’s Law actually is in the age of Cloud computing. One thing that is certain however is that we already have access to enough technology and tools that mean we are only limited by our ideas and imaginations in creating new and disruptive business models.

Now, where did I leave my hoverboard so I can get off to my next meeting.

Hello, World (from IBM Bluemix)

“The only way to learn a new programming language is by writing programs in it. The first program to write is the same for all languages: Print the words ‘hello, world’.”

So started the introduction to the book The C Programming Language by Brian Kernighan and Dennis Ritchie back in 1978. Since then many a programmer learning a new language has heeded those words of wisdom by trying to write their first program to put up those immortal words on their computer screens. Even the Whitehouse is now in on the game.

You can find a list of how to write “hello, world” in pretty much any language you have ever heard of (as well as some you probably haven’t) here. The idea of writing such a simple program is not so much that it will teach you anything about the language syntax but it will teach you how to get to grips with the environment that the code (whether compiled or interpreted) runs in. Back in 1978 when C ran under Unix on hardware like Digital Equipment Corporation’s PDP-11 the environment was a relatively simple affair consisting of a processor, some storage and rudimentary cathode ray terminal (CRT). Then the ‘environment’ amounted to locating the compiler, making sure the right library was provided to the program and figuring out the options to run the compiler and the binary files output. Today things are a bit more complicated which is why the basic premise of getting the most simple program possible (i.e. writing ‘hello, world’ to a screen) is still very relevant as a way of learning the environment.

All of this is by way of an introduction to how to get ‘hello, world’ to work in the IBM Bluemix Platform as a Service (PaaS) environment.  In case you haven’t heard, IBM Bluemix is an open source platform based on Cloud Foundry that provides developers with a complete set of DevOps tools to develop, deploy and maintain web and mobile applications in the cloud with minimal hassle. Bluemix-hosted applications have access to the capabilities of the underlying cloud infrastructure to support the type of non-functional requirements (performance, availability, security etc) that are needed to support enterprise applications. Bluemix also provides a rich set of services to extend your applications with capabilities like analytics, social, internet of things and even IBM Watson cognitive services. The Bluemix platform frees developers and organizations from worrying about infrastructure-related plumbing details and focus on what matters to their organizations – business scenarios that drive better value for their customers.

IBM Bluemix
IBM Bluemix

Because Bluemix supports a whole range of programming languages and services the options for creating ‘hello, world’ are many and varied. Here though are the basic instructions for creating this simplest of programs using the JavaScript language Node.js.  Follow these steps for getting up and running on Bluemix.

Step 1: Sign Up for a Free Bluemix Trial

You can sign up for a free Bluemix trial (and get an an IBM ID if you don’t have one) here. You’ll need to do this before you do anything else. The remainder of this tutorial assumes you have Bluemix running and you are logged into your account.

Step 2: Download the Cloud Foundry Command Line Interface

You can write code and get it up and running in numerous ways in Bluemix including within Bluemix itself, using Eclipse tools or with the Cloud Foundry command line interface (CLI). As this example uses the latter you’ll need to ensure you have the CLI downloaded on your computer. To do that follow the instructions here.

Step 3: Download the Example Code

You can download the code for this example from my GitHub here. Thanks to Carl Osipov over at Clouds with Carl for this code. Once you have downloaded the zip file unpack it into a convenient folder. You will see there are three files (plus a readme).

  • main.js – the Javascript source code. The code returns a ‘hello, world’ message to any HTTP request sent to the web server running the code.
  • package.json – which tells Bluemix it needs a Node.js runtime.
  • manifest.yml – this file is used when you deploy your code to Bluemix using the command line interface.  It contains the values that you would otherwise have to type on the command line when you ‘push’ your code to Bluemix. I suggest you edit this and change the ‘host’ parameter to something unique to you (e.g. change my name to yours).

Step 4: Deploy and Run the Code

Because all your code and the instructions for deploying it are contained in the three files just downloaded deploying into Bluemix is simplicity itself. Do the following:

  1. Open a command a Command Prompt window.
  2. Change to the directory that you unpacked the source code into by typing: cd your_directory.
  3. Connect to Bluemix by typing: cf api https://api.ng.bluemix.net.
  4. Login to Bluemix with your IBM ID credentials: cf login -u user-id -o password -s devHere dev is the Bluemix space you want to use (‘dev’ by default).
  5. Deploy your app to Bluemix by typing: cf push.

That’s it! It will take a while to upload, install and start the code and you will receive a notification when it’s done.  Once you get that response back on the command line you can switch to your Bluemix console and should see this.

IBM Bluemix Dashboard
IBM Bluemix Dashboard

To show the program is working you can either click on the ‘Open URL’ widget (the square with the right pointing arrow in the hello-world-node-js application) or type the URL: ‘hello-world-node-js-your-name.mybluemix.net’ into a browser window (your-name is whatever you set ‘host’ to in the manifest file). The words ‘hello, world’ will magically appear in the browser. Congratulations you have written and deployed your first Bluemix app. Pour yourself a fresh cup of coffee and bask in your new found glory.

If you live in the UK and would like to learn more about the IBM Bluemix innovation platform then sign up for this free event in London at the Rainmaking Loft on Thursday 25th June 2015 here.