The best managed blockchain platform: Azure or AWS? - Part 1

Recently I started researching blockchain and distributed ledger technologies for a project I’m working on. During the formal definition of the application’s architecture, I concluded that using a permissioned blockchain that supports the execution of smart contracts was the best approach. Due to the high regards I hold for The Linux Foundation, my first instinct was to go for a Hyperledger Fabric deployment in a compute service from either one of the three main cloud platforms: Azure, AWS or GCP.

Quickly I realized that the hassle of maintaining all the required infrastructure, even in a modern cloud platform setup, would require a greater effort than building the application itself that would put this blockchain network to use. As the project is in an experimental phase, reducing the costs and efforts to produce a valid Proof-of-Concept would be ideal. That’s when I opted for a fully managed blockchain service provided by a cloud platform, at least to implement the Proof-of-Concept.

The two services that I deem worth considering are the Azure Blockchain Service and the Amazon Managed Blockchain. Even though both services are intended for the same purpose and possibly for the same use cases, whenever using a blockchain is being considered for an application, you can be certain that there is no “one size fits all” solution, analyzing the exact offerings of each platform is key for a successful implementation, and that’s exactly what I will be doing here!

In this first blog post I will be addressing the Azure Blockchain Service and all it’s offerings. The Amazon Managed Blockchain will be addressed in a subsequent post (stay tuned!).

Azure Blockchain Service

Disclaimer: If you are not completely familiar with Azure’s architecture and concepts, don’t worry, I will try to explain everything that matters in detail, and provide links for those who want to go further.

Azure provides 3 main components that are necessary for creating, maintaining and deploying a blockchain network, they are:

1. Creating and deploying a managed blockchain network

The Azure Blockchain Service is responsible for building, deploying and managing a blockchain network in Azure, we can think of it being the service related to the infrastructure aspects of your blockchain. The service can be accessed through Azure’s Portal and one is able to create and deploy a test blockchain network in less than 10 minutes.

 

 

In the example above I’m creating and deploying a blockchain network in a Resource Group called “blockchain-test”, currently the only protocol supported is Quorum (an Ethereum-based distributed ledger protocol), however Microsoft plans to support multiple protocols in the future. It’s also required to define a Consortium for the blockchain, it can be an existing Consortium or a new one, for this example I’ve created a new one. A Consortium is a concept used to define a logical relationship between private blockchain networks, where members of a private blockchain are permitted to interact with selected members of another private blockchain.

 

 

Once your deployment is complete you will be able to access it’s details and more importantly the member details. In this example I’ve created a member called “filipe01”, in the screenshot below you can see that during deployment Azure created a RootContact Address and a Member Account, let’s dive into these important concepts:

 

2. Developing a Smart Contract and deploying it to Azure Blockchain Service

Visual Studio Code (VS Code) is tightly integrated into Azure’s blockchain ecosystem, and it’s remarkable what Microsoft was able to achieve in terms of features for VS Code. In this blog post I will be covering mainly how to use VS Code to develop a Smart Contract and how to deploy it to our blockchain network, however VS Code can also be used to create the blockchain network, removing the need to access Azure Portal. The reasoning behind this strategy is to leverage developer productivity, delivering all Azure’s blockchain tools in one application (VS Code).

I will omit some steps from the process that are already quite well documented by Microsoft, so instead of jumping right into developing the Smart Contract, the following configuration steps must be performed:

2.1. Connect Visual Studio to the Azure Blockchain Service network

Once VS Code is properly configured and connected to a blockchain network, the resources can be accessed directly via the Azure Blockchain Service extension:

 

Another great tool integrated into VS Code are the project templates. Directly from the command palette (Cmd+Shift+p), one can execute many actions, including the creation of a “New Solidity Project":

 

The template “New Solidity Project” will create the necessary configuration and deployment files, folder structure, and a sample Solidity contract. The sample smart contract is enough to get a grasp of the process:

 

2.2 Building and Deploying smart contracts to an Azure Blockchain Service consortium network is such a trivial task that you will be just fine with links to the official documentation.

2.3 Interacting with the Smart Contract

After deploying the smart contract successfully to the consortium network in Azure Blockchain Service, there are different approaches that can be taken to interact with the smart contract’s functions. It’s out of the scope of this blog to explain in detail Azure concepts such as Logic Apps and APIs, however the resources below are a great starting point (specially the BlockTalk series). I will probably address this topic in a future blog post:

There is a very cool feature within VS Code that lets you interact with the smart contract without any additional configuration or coding, however it only works for smart contracts deployed locally to the Ganache development environment, and this is not well documented. According to this GitHub issue raised by me, Microsoft is looking into integrating this feature on Smart Contracts deployed in the blockchain, this would be excellent for those (life myself) that are looking to quickly test simple contracts.

Where do we go from here?

Once one understood the core concepts of the Azure Blockchain Service, the logical next step would be to create a distributed app using the Azure Blockchain Workbench. In the next blog post I will deep-dive into the Workbench features, detailing how one can easily create a distributed app using many Azure services quite easily.