How to Debug Sent Messages

This guide provides instructions on debugging sent messages using command-line tools and hardhat. It covers retrieving message status, inspecting arguments of emitted events by the Endpoint, and more. If you have not deployed your custom protocol yet, refer to the Getting Started guide before proceeding.

Retrieving Account Balance

To get the balance of any account on an EVM-compatible network, execute the command below. It will print the specified account balance.

npx hardhat balance --acc <address> --network <network_name>
Output
Using network: teib

199.999999999953525184 native

Fetching Block Data

To retrieve block details from an EVM-compatible network, execute the command below. It will output the block number, block hash, and creation timestamp.

npx hardhat getBlock --num <block_number> --network <network_name>
Output
Reading block: 7892216

Number:  7892216
Hash:    0x69ad02f4b65f73043cb2d228d43c4ad1cd89b51c84410330ca4d6b301e1f0291
Time:    1741849068

Extracting Transaction Details

To obtain details of a specific transaction, execute the command below. It will output the sender address, the receiver address, msg.value, payload, and block number.

Output

In this example, some values have been shortened (indicated by "...") for visibility.

Printing Proposal Data

If a proposal was sent to the Endpoint, parse the emitted event by executing the below command. It will output the destination chain ID, msg.value, selector slot, agent parameters, sender address, destination address, encoded payload.

Output

In this example, some values have been shortened (indicated by "...") for visibility.

Retrieving Proposal and TEIB Message Hash

To find the message hash associated with a transaction hash from the source network, execute the command below. If a proposal is found in the transaction receipt, it will be reconstructed, and the corresponding message hashes will be displayed.

Status Codes

Output

In this example, some values have been shortened (indicated by "...") for visibility.

Retrieve Source & Destination Chain ID

The below command will output the status of the message with the specified hash, including the source and destination chain ID.

Output

Retrieve Initial msg.value

The below command will output the reward value of the specified hash.

Output

Retrieve Entire Message

The below command will retrieve the full message, including status, nonce, and initial proposal.

Output

In this example, some values have been shortened (indicated by "...") for visibility.

Check Message Status by Hash

To determine the current status of a sent message, execute the below command. If the transaction is found, the output will display its current status along with information from the initial proposal.

Output

Checking Message Execution on Destination Endpoint

The below command will retrieve the execution status of the provided hash on the specified network. There are 3 possible execution statuses, described below.

Output

Status Codes

Retrieving the Last Received Message by Sender

To get the last received message using a sender address, execute the command below. If the message is found, it will output message length and the message itself in bytes, which is the decoded representation.

Output

In this example, some values have been shortened (indicated by "...") for visibility.

Get Estimate Fee

To get estimated fee for message execution on destination chain + UIP commissions execute the below command.

Output

Last updated

Was this helpful?