This document provides a step-by-step guide to execute GMP flow on the SUI network.
Deploy the contracts with the following commands:
node sui/faucet
node sui/deploy-contract deploy Utils
node sui/deploy-contract deploy VersionControl
node sui/deploy-contract deploy AxelarGateway --signers wallet
node sui/deploy-contract deploy GasService
node sui/deploy-contract deploy Abi
node sui/deploy-contract deploy RelayerDiscovery
node sui/deploy-contract deploy ITS
node sui/deploy-contract deploy Example
To simplify the process of obtaining necessary parameters, run the following script:
sourceChain=avalanche-fuji
sourceAddress=0x95222290DD7278Aa3Ddd389Cc1E1d165CC4BAfe5
messageId=0x32034b47cb29d162d9d803cc405356f4ac0ec07fe847ace431385fe8acf3e6e5-10
fee=0.1
payload=0x1234
payloadHash=0x56570de287d73cd1cb6092bb8fdee6173974955fdef345ae579ee9f475ea7432
env=$(grep ENV= .env | cut -d '=' -f2 | tr -d '\n')
config=$(cat "axelar-chains-config/info/${env}.json")
destinationId=$(echo $config | jq -r '.sui.contracts.Example.objects.GmpChannelId')
Send a messsage from SUI to the destination chain.
Example:
node sui/gmp.js sendCall $sourceChain $sourceAddress $fee $payload
Execute a message from the source chain at SUI application module.
- Approve the incoming message
node sui/gateway.js approve --proof wallet $sourceChain $messageId $sourceAddress $destinationId $payloadHash
- Execute the incoming message
This command will execute the message to the deployed test contract.
node sui/gmp.js execute $sourceChain $messageId $sourceAddress $payload