Tuesday, June 2, 2020

How to Deploy Smart Contract on Ant Blockchain?

Do you know Alibaba Cloud Blockchain as a Service allow you to quickly deploy Solidity smart contract on Ant Blockchain? There are cloud IDE and block explorer available for you to play. The platform give me the very best user experience in understanding and using it. It saves me a lot of hassle from setting up and maintaining the blockchain nodes.

Let me show you how to deploy a Solidity smart contract with just a few button clicks.

First, login to Alibaba Cloud, go to the Blockchain as a Service product page. For the first use, you need to create an account first which is represented by a SSL certificate, click the Try for Free and it will prompt you to enter your certificate details.


After creating the certificate, you will be prompted to download the certificate private key. You need to download the private key and keep it safe. This private key is used to determine the certificate ownership and it is required to sign blockchain transaction.


After that, you can either go to View Details that will bring you to the block explorer which allow you to search for transaction or data from the block. Or, you can click the Deploy Contract that bring you to the cloud IDE page.


This is where you write and compile your Solidity smart contract code. The platform provided a sample voting contract which allow you to setup vote and track vote count.


You may remove the source code and replace them with your smart contract code. Then, click the Compile button at the top right of the screen.


After successful compilation without error, you will see the Deploy button available. Hit the Deploy button to publish the smart contract to the blockchain.


Now, give a name for your contract, then enter the parameters while deploying smart contract. These parameters required base on the constructor setup in your smart contract. So, if you have replaced the sample contract with your own contract, this screen will look different.


After deploying the smart contract, in case you accidentally close the IDE, you can actually retrieved back you deployed contract by clicking the Deployed Contract button and enter the contract name that you have previously set.

Let's test our contract by calling the contract function. Simply hit the Call Contract button right beside the function name. You will be prompted to enter the parameter of the function:


Upon successful function call, you will receive the transaction hash. Transaction hash is the ID that represent that particular transaction.



You can copy the transaction hash, then go back to the Ant Blockchain page, click the View Details button to bring you to the block explorer. You can expect to see your Deploy Contract and Call Contract transaction in the block explorer.


Alternatively, you can search the particular transaction hash using the search function above. It will show you to the transaction details.


Now, you may go back to the cloud IDE to try calling other contract function.

Summary

I personally find Ant Blockchain is a great platform for the newbie who wants to learn blockchain. Though mind you that Ant Blockchain is not open source, to me I find that it is okay and acceptable as Alibaba Cloud have invested so much in building this technology, and also from the business perspective, they need to monetize it to get return of investment. The business nature is different from public chain which actually rely on the public contribute gas fee to the technology.

I think Ant Blockchain is more towards business oriented design. They need to maintain the data tamper-resistant, decentralized and distributed blockchain characteristic that fit the business requirement. There should not be having all businesses cramp their data into one chain and disclosing everything to the public. So, we need to juggle the balance between protecting business interest and data governance that sufficient to prove and gain public trust.

Send Transactional SMS with API

This post cover how to send transactional SMS using the Alibaba Cloud Short Message Service API. Transactional SMS usually come with One Tim...