Interact with CLI

In this tutorial, initiad and minitiad both can be used

The both initia and minitia have a command line interface (CLI) for developing on the Initia ecosystem. This document describes how to use the initia CLI tool. To download or build the CLI , follow Download Initiad.

Building Move

The initia CLI can be used to build a Move package. The below example uses the managed_coin in initia-tutorials.

$ initiad move build --path ./move/managed_coin --dev

Unit Test

The initiad CLI can also be used to run uint tests locally.

$ initiad move test --path ./move/managed_coin --dev

The above command will generate the following terminal output:

INCLUDING DEPENDENCY InitiaStdlib
INCLUDING DEPENDENCY MoveNursery
INCLUDING DEPENDENCY MoveStdlib
BUILDING basic_coin
Running Move unit tests
[ PASS    ] 0x2::managed_coin::test_create_and_mint
Test result: OK. Total tests: 1; passed: 1; failed: 0

In Move.toml there are two types of address lists which are addresses and dev-addresses. If a value exists on addresses the same value cannot exist on dev-addresses simutaneously. If you want to enter the same values for both locations, addresses must have "_" for the move CLI to work.

[addresses]
initia_std = "0x1"
std = "0x1"
your_address = "_"

[dev-addresses]
your_address = "0x2"

Test Coverage

The initiad can be used to generate test coverage report.

The output contains the result for each test case followed by a basic coverage summary resembling.

Deploying a Move Package

Create account and get a faucet fund to do on-chain operations.

After you create the account, you can run deploy command to deploy a package to the network.

Executing an Entry Function

The following command will try to mint managed coin to the acc0 account.

Executing a View Function

Retrieve the coin Metadata address.

Query minted coin balance with the Metadata.

Last updated