Jump into Azure

In this post you will learn how to setup a Azure Blockchain platform and how to deploy our locally created "HelloWorld" project to Azure.

What is Azure?

Simply Azure is the Microsoft cloud platform and it provides many Environments for your business applications. You can build, manage and deploy your applications very easily on Azure. In this post you will learn how to use Azure cloud platform for Blockchain.
sample dashboard for Azure:

As you know there is a common Ethereum Network. But some times you may have a requirement like having your own enterprise level Blockchain Environment. Then this is the solution for you.

What you should know about Azure Blockchain?

Basically Azure provides following features for your Blockchain,
  1. Hosting 
  2. Storage 
  3. Identity Management
  4. Security 
Besides that you should know on Azure Blockchain Consortium,
  • What is Blockchain Consortium - It is a privately shared Blockchain network (In Ethereum context it is 14 Members). It includes Consortium Leader who control the Blockchain, setup relevant configurations to Blockchain, initial allocation of Ether and creation of Genesis Block. (Actually this is a private network. So Ether in this network can not be directly exchanged with public Ethereum Blockchain)
  • What Genesis Block - The initial block of the Blockchain.
  •  How to transfer Ether between accounts

Azure will provide following setup automatically for your Blockchain. Each an individual Consortium Member has following setup. In Consortium network members' VPNs are tunneled. So you can host your applications in members' VPNs as well. But you should keep in your mind this is a private network and this network is isolated from public Ethereum Network.

re-correction : Transnational Node should be Transaction Node 
Idea of the above Diagram : User / Application contact to a VPN. Then first it hit the Load Balance. Then Load Balance will contact one of the Transaction Node. The major purpose of the Transaction Nodes is hiding the Miner Nodes and remove the competition to take transactions receiving from the client. So Miner Nodes are isolated from the outside. You can join another owner's VPN to your VPN and then both the VPN owners will become Same Network Consortium Members. This is called VPN Tunneling. Doing so you can host your application on members' VPNs as well.

Setup Azure Blockchain platform

In this video tutorial you will learn how to setup a Blockchain platform in Azure.
For this tutorial i use free trial version of Azure Account.
 

Access newly created Default Account and send Ether to the new Account using Admin Page (Usage of Ethereum Wallet called Metamask).

Here I'm going to demonstrate you how to access newly created Consortium Blockchain and how to use Admin Page to Transfer Ether from Default account to another account. Besides that here i introduce you what is Ethereum Wallet.

Deploy Local Smart Contract to Azure Consortium Blockchain.

Before we deploy our Contract to Azure Consortium, we have to unlock our account to enable supporting deployments because by default our Blockchain is protected by unauthorized changes. So this video is all about unlocking Consortium Transaction node for outside deployments.

 

Okay now we have successfully enabled the outside deployments. Now i am going to teach you how to upload a Contract from your local machine to Azure Consortium Blockchain.

In order to do that your truffle.js file should be edited like this:

As you can see in this diagram you have to take the address from ETHEREUM-RPC-ENDPOINT and put it against the host. Then provide your Consortium Network ID : 10101010 (i think you remember this was on our Ethereum specific settings when we creating the Blockchain). Finally put the port number specified at the end of the ETHEREUM-RPC-ENDPOINT value. So this is all about truffle network configuration file.

Then compile you solution using the command :  truffle compile

Then follow the following commands on terminal,
  1. truffle migrate --network value - (for network parameter just provide the value how you specified your network configuration on truffle.js file. For me it is myAzureNetwork. This command will deploy your Contract to Azure Blockchain.) 
  2. truffle console --network value - (this command will helpful you to run your Contract Methods on console. I demonstrated in one of my previous tutorial how to call Contract Methods on console.) 
Congratulations !!! now you know how to create your own Contracts and upload them to your Azure Consortium Blockchain Network 😊.

Cheers !!!

My Next Post : Learn Solidity Programming A-Z in short and sweet way

Comments

Most Popular

Introduction to Blockchain