Testing your application is critical before going to production, especially in Web3. Axelar Local Dev allows you to simulate interchain transactions on the Axelar Gateway right on your local machine. This provides a Ganache-like testing experience before officially migrating to testnet.
The following examples are configured for Hardhat based the axelar-examples
repo. Feel free to replicate some of these tests in your own interchain applications.
Axelar Local Dev contains tests for the Call Contract, Call Contract With Token, and NFT Linker examples. Make sure you are in the evm
directory before running the npx hardhat test
command for each example you want to test.
For example, to run the NFT Linker example:
npx hardhat test nft-linker/tests/NftLinker.test.js
There are a few things to keep in mind when testing contracts with cross-chain functionality:
createNetwork
command on Axelar Local Dev.relay()
function. The logic you are testing on the destination chain will not execute until the transaction is relayed.If you have any questions or concerns, open an issue in our support repository. We're here to help.