MoveVM
Overview
Initia's MoveVM serves as an innovative bridge, seamlessly integrating the Move Runtime with the CosmosSDK. This integration is achieved through a method inspired by CosmWasm's WasmVM, facilitating a connection between the MoveVM runtime, developed in Rust, and the Cosmos chain, implemented in Go. This approach extends beyond mere connectivity; it harmonizes the token standards within the platform by adapting the CosmosSDK's bank module to exclusively utilize the Move coin standard. Furthermore, to ensure Move users can fully leverage Cosmos' native staking capabilities, a Liquid Staking Module has been introduced. This feature allows for the utilization of Cosmos Staking features within the Move ecosystem. Additionally, Initia supports various CosmosSDK messages within Move, enhancing the functionality and interoperability of applications built on this platform.
Supported Cosmos Messages
Staking
delegate
Distribution
fund_community_pool
IBC
transfer
IBC
nft_transfer
IBC
pay_fee
OPinit
initiate_token_bridge
Interact with CLI
This tutorial walks you through the process of interacting with the command-line interface (CLI) for initiad
and minitiad
, demonstrating how to build a Move module, deploy a Move package, and execute entry and view functions on the Initia network.
Building Move
The initia
CLI can be used to build a Move package. To build a Move package, managed_coin
for example, use the command below.
Unit Test
To run a unit test locally, use the following command.
This is an example response:
Test Coverage
To generate a test coverage report, run the following command.
The output contains the result for each test case followed by a basic coverage summary:
Deploying a Move Package
To deploy a Move package to the network, follow these steps:
Create an Account:
Use
initiad keys add acc0
to create a new account.Parse the created account address:
initiad keys parse $(initiad keys show acc0 --address)
.Update
your_address
in./move/managed_coin/Move.toml
to the 0x address of the created account.Obtain tokens from the Initia faucet: https://faucet.initia.tech/.
A Full tutorial on creating an account can be found here.
Deploy the Package: Run the deployment command, replacing placeholders with actual values:
Executing a View Function
For example, to retrieve and query coin metadata and balance:
Retrieve Metadata Address
Query Minted Coin Balance
Executing an Entry Function
For example, to mint managed_coin
to the acc0
account, execute the following command, replacing ${RPC_URL}
and ${CHAIN_ID}
with your specific values:
Conclusion
This tutorial offers a concise overview of essential operations you can perform using the Initia CLI tools, providing a solid foundation for developing and deploying smart contracts and applications on the Initia network.
To learn examples of Move Modules, please visit the Move Module tutorials we have provided.
Last updated