Delen via


Using Microsoft Azure to setup ARK Blockchain for Hacks and Blockchain Challenges

Guest blog by Kristjan Košič Technical Evangelist at Ark.io technology/Blockchain

About ARK

ARK provides users, developers, and start-ups with innovative Blockchain technologies. We aim to create an entire ecosystem of linked chains and a virtual spiderweb of endless use-cases that make ARK highly flexible, adaptable, and scalable. ARK is a secure platform designed for mass adoption and will deliver the services that consumers want and developers need.

Kristjan is always hacking and tinkering with state-of-the art technology and has an impressive collection of experiences. Kristjan speaks engineering language, but he feels most comfortable with:

  • GOLang (he loves it)
  • Java
  • C# and .NET Framework
  • C/C++
  • JavaScript

Kristjan fell in love with ARK and Blockchain technology when he cloned his first ARK-node. He immediately started hacking on various projects while learning about Blockchain and the ARK Ecosystem overall. As a community developer he contributes greatly to the ARK Ecosystem developing various client APIs, delegate helping scripts, and a listening relay node that can also be run on IoT devices.

Checkout his Github page to learn more about his contributions and skills (https://github.com/kristjank).

I met Kristjan and the Ark.io team a few month ago at Cambridge Hack where ARK.io were sponsoring the event and had a dedicated challenge at the event we saw the opportunity of working more closely together around challenges based on hosting Ark on Microsoft Azure,

So here is quick guide on using ARK on Azure and get you building solution on you own BridgeChain. Don't forget to check out the Ark Developer resources outlined here (ARK Deployer)

Pre-Requisites: Active Microsoft Azure account (Azure Imagine Student $100 is perfect) and basic knowledge on how to connect via SSH (E.g. PuTTY for Windows).

End result:
- Ubuntu VM in Azure
- Azure PublicIP and Firewall configurations pre-built
- Your own BridgeChain node and ARK Explorer running in < 20 minutes
- Re-usable and customizable deployment script

Script available at : ARK Azure on GitHub

1. Virtual Machine Quick Deployment

Navigate to: https://github.com/ArkEcosystem/ark-azure
Click on the big blue “Deploy to Azure” button to be taken to Portal.Azure.com. Login with your account (Trial or not, either work).

README.md of the Github page

You should only need to input data for 3 empty fields (Resource Group, Admin Password, and DNS Label), but full details for this section:

Subscription — If not already on your current one.
Resource Group — ‘Create New’ only option that will work unless you wish to edit the template yourself. We will use My-Ark-RG for this guide.
Location — Choose your desired region, ensuring it allows the subscription you chose above. If in doubt, use the default region when using a Free Trial.
Admin Username — This is the account you will sign into the server with.
Admin Password — Secure string and has high complexity requirements.
Dns Label Prefix — This is the unique DNS name that you are giving to this VM. It is mandatory that this name be unique in the Location Datacenter as a whole (It will self-check after input) **Remember this for easy SSH
Ubuntu OS Version — Only option is 16.04-LTS at this time.
ARKNSG Name — This is the name for the firewall group to permit SSH as well as Ark Node/Explorer port access to this VM.

A typical fully filled out template

Currently, the VM produced is a Standard_A1 size VM. This is a very low-cost resource VM for tutorial purposes (can be scaled-up after deployment if desired or via template adjustment).

Click ‘Agree’, and ‘Purchase’ to begin deployment. Should take 5–10 minutes.

2. Connecting to VM + ARK Deployer

You are welcome to explore your new VM’s Overview, etc, by clicking on ‘Resource Groups’ and finding your new group, and the VM inside. There are lots of configuration items here.

If you do not remember your Public DNS name or IP address (for SSH), go to: Resource Groups > My-Ark-RG > MyUbuntuVM > Overview. This has all the general information you will need.

View of the VM Overview panel — Public IP and DNS Name on right-hand side

Connecting via SSH

The Public DNS Name for all VMs follows this pattern:
PublicDNSname.locationid.cloudapp.azure.com

So in our instance it would be here: firstarksidechain.southcentralus.cloudapp.azure.com

SSH into your new VM using the Public DNS Name and login with the credentials used during the VM Template deployment page.

Login using the admin username and admin password that you input earlier in this tutorial.

Starting here, is the default quick-installation method with the chain being named “MyTest”. If you wish to customize it, please see the bottom-most section of this article.

Run the following command (It’s a one-liner, copy and paste the full contents from here or from the ARK AZure Github page):

curl -o- https://raw.githubusercontent.com/ArkEcosystem/ark-azure/master/script/arkdefaultinstall.sh | bash

This script will complete all of the installation steps to get both the node and explorer running for your BridgeChain, with all the default values. Total installation time is about 10 minutes.

There is 1 important item to locate in the stream of data being output to the console (for wallet control, etc). Your Genesis Passphrase details!

Just after the node gets installed, there will be 3 lines of text to record. Copy these lines outlined in red below.

Test deploy node example

This information will be used later on, as you explore ARK past the deployment phase with ARK Deployer. Copy and paste it right out of the console window for safe keeping.

3. Final result — see explorer in action

This is the Public IP of your server, and the port required to view the ARK Explorer for your BridgeChain (4200). The API should be available on port 4100.

You can highlight the URL straight from the SSH window, such as: https://13.65.29.3:4200 and hit CTRL+C to copy it. Paste into a browser, and voila!

4. Customizing Your Deployment

If you wish to customize your deployment of ARK within the bounds of ARK-Deployer, download a copy of:

https://raw.githubusercontent.com/ArkEcosystem/ark-azure/master/script/arkdefaultinstall.sh

Within this file, you’re welcome to edit the list of variables on lines 21–31 and personalize them. These variables all align with an optional parameter of ARK Deployer (See GitHub: https://github.com/ArkEcosystem/ark-deployer#optional-parameters)

You can then run this new version of your script against a new VM, or, you can uninstall the original node/explorer and re-install using the script again. We would recommend just rolling out a new server for ease of use, but that’s your call.

To quickly make a personalized copy of the script (GitHub account)

  • Click on “Raw” on the same line as your file name and copy the URL
  • You can now, on a prepared VM, run via SSH:
  • curl -o- paste-raw-gist-URL-here-ending-in.sh | bash

For more in-depth and customizable BridgeChain enjoy following along with the ARK Deployer guide going forward in your ARK journey. Welcome aboard ARK.

.Please share your adventures into Blockchain.

Comments

  • Anonymous
    March 19, 2018
    Very useful @Lee, thanks for sharing!