ClientSide library for dapp on Tezos

ClientSide library for dapp on Tezos

By Siham lamssaoui | blockchain_news | 30 Nov 2020


 

 


ConseilJs is a library for decentralized applications, it allows connection to tezos node for live chain data and operations. Cryptonomic offers Nautilus cloud an infrastructure service that makes the access to tezos platform easier.

It can be used on javascript or typscript, in our demonstration we are going to use javascript.


First of all we declare our variables like contract address, Tezos node, parameters format and conseil server from nautilus cloud, then add our contract secret key and faucet account as follows:

                         a7e72f3158daf2862c29f6e44b26b47b77decf838aa0cacfb7675ac37f75ab6a.png

An application needs to sign transactions submitted by some accounts, which funds the execution of the transaction, therefore conseilJs offers mean of signing operations based on user's private key.

 

                           a3a4a4523af162468ee28cd7ac9b6642ae11a71c772a0f2a7d29823200e0d11e.png

To make sure the operation was succeed we use await OperationConfirmation(groupId) with the keyword await that wait until the transaction is sent successfully.

 704b17b253f954ab44114bc8c15a0ce308bcb866da03f8d2348cec53231f53da.png


Then we encode the user inputs to the appropriate format and then submit the transaction like shown below:

                            4105c3de1786ed1b9f683465114ba7caf8681448a186d33dbaa59908f124fef3.png

At this stage, the operation is normally succeed and broadcasted into the blockchain, from which a tezos baker will pull operations for inclusion in a block.

With this we are able to interact with our deployed smart contract in previous article with conseilJs and blockchain infrastructure with Nautilus Cloud. This is certainly an highlight to main useful functions but many other details are not covered here please refer to https://developers.tezos.com/ for more other details.

 

 

How do you rate this article?


4

0

Siham lamssaoui
Siham lamssaoui

Blockchain Developer/ PhD student blockchain security and interoperability


blockchain_news
blockchain_news

Blockchain news

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.