Azure offers cloud solutions to deploy and configure Ethereum consortiums with a simple single-click deployment through the Azure portal. In this recipe, you will learn how to deploy a flexible Ethereum network, consisting of a set of load-balanced transaction nodes, with which an application or user can interact to submit transactions, and a set of mining nodes to record transactions.
Using Azure Ethereum as a service
Getting ready
You will need an Azure subscription to create an Ethereum consortium. Other dependencies will be configured by the provider itself.
How to do it...
Follow these steps to create an Ethereum POW blockchain in Azure:
- Log in to the Azure portal and click on Create a resource from the left navigation bar.
- Select Create Ethereum Proof-of-Work Consortium under Blockchain.
Once you click Create, you can see a five-step wizard that will guide you through the setup process. The first step will ask you to choose a username, password, subscription, location, and so on. Provide the appropriate values and click OK:
- Step 2 will ask you to configure the regions in which the nodes should be deployed. For a simple network, one region should be enough.
- Step 3 is all about configuring the number of nodes that should be dedicated to mining and transactions. Mining nodes do all the heavy lifting of creating blocks, and transaction nodes take care of broadcasting the transaction from your application. Choose the number of nodes for each category and their respective configuration to meet your needs.
- Step 4 focuses more on the parameters of blockchain that you are about to create. You can compare it with the genesis file you will create during private network configuration.
- Once you are finished on the Ethereum settings tab, you can choose the Operations Management Suite for your Azure resource. Create a new one if you are new to Azure and creating resources for the first time.
- If everything goes well, then the verification process in the Summary tab will be successful and you can proceed to purchase the service.
- Read through the Terms and Conditions and click Create. This will start deploying your resources and can take a few minutes to finish.
- Once the deployment is finished, you can see your resources in the resource group that you created/selected. Select your resource group from the Resource groups tab in the left navigation bar and Deployments.
- This will display the set of deployments that has been created as part of Ethereum consortium's deployment. Select the deployment name that starts with microsoft-azure-blockchain-ethereum:
- Select output from the window, and now you can see the access credentials for the resources that you created:
These are some of the credentials you can use in the Azure blockchain service:
- ADMIN-SITE: Admin portal that you can use to view the current node status and send Ether to newly created accounts
- OMS-PORTAL-URL: Azure Operations Management Portal for your resources
- ETHEREUM-RPC-ENDPOINT: Ethereum RPC port for you to interact with the blockchain you created
- SSH-TO-FIRST-TX-NODE-REGION1: Credentials for connecting to a transaction node that is in the first region
How it works...
Steps 1 to 9 guide you through the process of creating a private Ethereum consortium using services offered by Azure. This will create and deploy multiple peers across various regions behind a load balancer for you to interact with. Steps 10 to 12 describe the process of using these services. This helps you understand various services and where to use them.