Marketplace has launched, further enabling blockchain developers! Learn more

How to Use Laika with QuickNode

September 09, 2022

Overview

Developers spend most of their time writing code, testing, and fixing bugs. A lot of the time spent with these tasks can be simplified by using a tool like Laika. Laika is a Web3 development tool that aims to improve the developer experience when interacting with the blockchain. This guide will demonstrate how to interact with smart contracts in Laika using QuickNode.

Prerequisites

Why Laika?

Laika is similar to Postman but is geared towards Web3. There are many reasons why a developer may find Laika handy. Let us go through a couple of their main features:

  • Query and interact with smart contracts
  • Easily manage requests using Collections
  • Create environments of choice to be reused in any request in collections you like
  • Generate code snippets for multiple programming languages (including Ethers.js and Web3.js)
  • Scenario requests (beta; which allows for making requests based on conditions)

If the features above got your attention, great! Let us move on to using Laika to query balances from a smart contract.

Booting your Ethereum Node

While this goal could be accomplished by any node connection on the Kovan network, here at QuickNode, we make it quick and easy to set up a blockchain node. You can register for whatever plan best suits your needs and then make sure to launch a Kovan node. You can register for a free trial, as well as see pricing here.

You will need the HTTP Provider URL for this tutorial, so keep this URL handy. It should look something like this:

Screenshot of QuickNode endpoint

Setting up Laika

Now that we have our blockchain infrastructure ready to go, we can move on to querying blockchain data using Laika.

First, we will want to configure Laika with our QuickNode endpoint and mnemonic phrase. If you don't have a mnemonic handy, don't worry, Laika automatically generates a test wallet for you to use. Click the Connect button in the top right corner and then click Web3 Provider.

Screenshot of Laika Webapp

Input your QuickNode URL and click Connect:

Screenshot of Laika Connect Window

Once our wallet and node are connected, click the New button in the top left corner of the page.

Screenshot of connected Laika app

Then, depending on how you want to import your contract, you can click "Upload JSON ABI", or "Plain text ABI" to import a smart contract via ABI. Alternatively, if the smart contract is already verified on Etherscan, you can use the "Chain Explorer" option to input a smart contract address and Laika will automatically fetch the ABI for you.

Screenshot of Laika import ABI window

For this guide, we will use the "Chain Explorer" option and the following smart contract address: 0xd0A1E359811322d97991E03f863a0C30C2cF029C (WETH Address). Make sure to select "Ethereum Kovan" from the "Chain" dropdown. Then, click "import", and you should see the smart contract loaded on the collections panel under "New Imported ABIs from..".

Screenshot of Chain Explorer Laika window

Making Requests with Laika

We have our smart contract loaded. Now all that's left to do is start interacting with the blockchain!

Screenshot of Laika Imported Contract

Click the balanceOf function to see more details about the function such as the parameters required, response expected and etc. We see that this function has one required parameter which expects an address. Use the following address in the Value1 field: 0x2ED0fE9a8FbB3b7f0ffC45a18eff8f0c3A0ABE2C, then click Send.

Screenshot of BalanceOf Function - Laika

You'll get the following response:

making requests with laika

Copy
[
  {
    "name": "",
    "type": "uint256",
    "value": "100000000000000000"
  }
]

There you have it! We just made a request using Laika and QuickNode! In the next section, we will go over some tips and features I hope you find helpful.

Tips & Features

Code Snippets

You can click the Code Snippet icon (</>) to generate code from multiple different libraries (i.e., Ethers.js, Web3.js) and formats. This will help us save time compared to writing code from scratch. For example, we can easily generate javascript code that uses Ethers.js to query the balanceOf function:

Laika - Code Snippet Generator Screenshot


Scenario Requests

One interesting feature Laika has in development is the scenario requests tool. This allows you to set up a flow of requests based on conditional statements. For example, in the flow chart below, we make a balanceOf request and attach a conditional that states if the balance is greater than .1 ETH, run the next request (get symbol method):


Screenshot of Laika Scenario Requests


Laika also has a Notes and Converter tab you can use to write notes or convert arbitrary data to a readable format.

Conclusion

Congratulations on interacting with the blockchain using Laika! You are on your way to becoming an efficient web3 developer! Subscribe to our newsletter for more articles and guides on Ethereum. If you have any feedback, feel free to reach out to us via Twitter. You can always chat with us on our Discord community server, featuring some of the coolest developers you will ever meet :)

Related articles 11

Ethereum Full Node vs Archive Node
Published: Apr 8, 2021
Updated: Sep 20, 2022

Ethereum runs on a network of computers (also known as nodes) that verify transactions based on a consensus protocol and ledger, which make up the blockchain. In this guide, you will learn...

Continue reading
How to setup a Chainlink node
Published: Jul 6, 2020
Updated: Sep 21, 2022

Smart-contracts are the heart and soul of all the development happening on the Ethereum blockchain, and as more and more people develop on Ethereum, smart contracts are becoming more...

Continue reading
Introduction to Ethereum Rollups
Published: Dec 28, 2021
Updated: Sep 9, 2022

Ethereum, the most popular blockchain, has seen scaling issues for quite a long time now. With high gas fees due to congestion being the primary pain point. With the increasing cost to use the...

Continue reading
How to run a Hyperledger Besu node
Published: May 18, 2021
Updated: Sep 9, 2022

As the Ethereum network continues to grow, the need for an enterprise-ready Ethereum client arises. Hyperledger Besu is an enterprise-friendly Ethereum client that can implement both public...

Continue reading
How to Run a Binance Smart Chain Node
Published: Jul 2, 2021
Updated: Oct 11, 2022

Binance Smart Chain, BSC for short, is a blockchain that seeks to provide both an alternative and extension to the Ethereum Blockchain. It has done this through several clever implementations...

Continue reading
How to install and run a Geth node
Published: Apr 5, 2020
Updated: Sep 12, 2022

Ethereum nodes are computers participating in Ethereum blockchain network. These nodes are actual computers running software that verifies, stores, and sometimes creates blocks. The actual...

Continue reading
How to run Nethermind node
Published: May 18, 2021
Updated: Nov 18, 2022

To run an Ethereum node without any problems, it is essential to choose a good node client. Nethermind is one of the oldest and most trusted Ethereum node clients. In this guide, let’s see how...

Continue reading
How to Install and Run a Stacks Node
Published: Aug 26, 2022
Updated: Sep 9, 2022

Stacks 2.0 is an open-source layer-1 blockchain that allows developers to build smart contracts and decentralized blockchain applications. This guide will demonstrate how to install the Stacks...

Continue reading