🇺🇸
Laika Documentation
Docs - EN
Docs - EN
  • 🐶What is Laika
  • Guides
    • Quickstart Guide
  • Fundamentals
    • Create a New Request
    • Sharing Imports
    • Laika Utilities
      • Create a Note
      • Code Snippets
      • Converters
    • Laika Scenarios
    • Laika Environments
  • Advanced
    • Use hardhat-laika
    • Using Laika with Web3 Node Providers
  • Use Cases
    • Laika for Lens
    • Use Laika with Hardhat
      • What is Hardhat
      • Why do we use Hardhat
      • Setup Project
      • Toy Example
Powered by GitBook
On this page
  • Create Scenario Request
  • Using a Request Node
  • Using a Condition Node
  • Using a Connector Node
  1. Fundamentals

Laika Scenarios

The Multi-call Powerhouse Tool

PreviousConvertersNextLaika Environments

Last updated 2 years ago

Create Scenario Request

Laika gives you a powerful toolkit for your life as a Web3 Developer. One of these power tools is the ability to create nodegraphs for your Smart Contract Scenarios! You can hook up as many calls and conditions as you like, creating the dapp flow right in the workspace, to test and develop multi-call events using your Collections. Here, we take you through a small example on how to use this feature. Get Ready. Create all the requests you need and paste the address of the contract you want to interact with. To know more about creating Requests, check out Create a New Request.

Let's Dive In! Select [Scenario Request (beta)] on the left pane.

Select [ New ] to build a Scenario

Name the Scenario and then press [ Create ]

For Scenario Request Nodegraphs, there are 3 types of nodes that you can use.

To create a Node, there are two ways:

  • Drag the Node you want from the Toolbox(present at the bottom of the Scenario pane)

  • Right-click anywhere on the Scenario pane and choose the Node you want to create.

Using a Request Node

After creating a Request Node, a block will pop up on the interface.

Choose the prepared request by selecting the [ Select a method ]

For the Write/Read Method requests, adjust parameters as needed by selecting the [ Edit Parameters ]. If you want to check the status of the current parameters, hover the mouse on the vision icon.

For the Read Method requests, you can state a variable to store the response from the request by clicking on [Assign return to Context ]. Again, if you want to check the status of the current Assign Context, hover the mouse on the vision icon.

Using a Condition Node

After creating a Condition Node, a block will pop up on the interface.

State the value in the LHS (Left Hand Side) box, and the RHS (Right Hand Side) box, then, then select the condition. Stating the value in LHS and RHS boxes can be done in 3 ways:

  1. {{var_name}} : value from the set Environment

  2. Context.context_name : value from Context (Assign in the process of creating a Request Node, Read Request Node)

  3. value : a constant value

Next, to connect the Flow for Condition Node, connect the upper-right dot of the Condition Node to the Node you want to run if the result is “True”. In reverse, connect the lower-right dot of the Condition Node to the Node you want to run if the result is “False”.

Using a Connector Node

After creating a Connector Node, a block will pop up on the interface.

To combine 2 Flows into 1, connect the dots as shown in the picture below.

Need more help? Here's a Video on how to use Scenario Requests!

: for passing Requests as per your defined parameters

: for setting conditions (i.e., if function)

: for combining flows of the scenario from 2 flows to 1 flow

Request Node
Condition Node
Connector Node
Using Scenario Request Example
The Laika Workspace with created Requests in a Collection