logoAcademy

Interact with the ICM Registry

Retrieve latest Interchain Messaging version using the Registry.

Let's start by interacting with the registry. Registry is deployed on specific addresses depending the chain you're operating and the status of the network at the deployment time. For your local network you can find it out with the following command:

Get C-Chain Registry Address

avalanche primary describe
   _____       _____ _           _         _____
  / ____|     / ____| |         (_)       |  __ \
 | |   ______| |    | |__   __ _ _ _ __   | |__) |_ _ _ __ __ _ _ __ ___  ___ 
 | |  |______| |    | '_ \ / _  | | '_ \  |  ___/ _  | '__/ _  | '_   _ \/ __|
 | |____     | |____| | | | (_| | | | | | | |  | (_| | | | (_| | | | | | \__ \
  \_____|     \_____|_| |_|\__,_|_|_| |_| |_|   \__,_|_|  \__,_|_| |_| |_|___/
+------------------------------+--------------------------------------------------------------------------+
|          PARAMETER           |                                  VALUE                                   |
+------------------------------+--------------------------------------------------------------------------+
| RPC URL                      | http://127.0.0.1:9650/ext/bc/C/rpc                                       |
+------------------------------+--------------------------------------------------------------------------+
| Codespace RPC URL            | https://opulent-giggle-rxwwq774w553wq7p-9650.app.github.dev/ext/bc/C/rpc |
+------------------------------+--------------------------------------------------------------------------+
| EVM Chain ID                 | 43112                                                                    |
+------------------------------+--------------------------------------------------------------------------+
| TOKEN SYMBOL                 | AVAX                                                                     |
+------------------------------+--------------------------------------------------------------------------+
| Address                      | 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC                               |
+------------------------------+--------------------------------------------------------------------------+
| Balance                      | 49999478.838561118                                                       |
+------------------------------+--------------------------------------------------------------------------+
| Private Key                  | 56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027         |
+------------------------------+--------------------------------------------------------------------------+
| BlockchainID (CB58)          | NeA134STyTVwife7gYeNQ6Hwi5GPGC2X7aUFvWsnusnpM2do6                        |
+------------------------------+--------------------------------------------------------------------------+
| BlockchainID (HEX)           | 0x31233cae135e3974afa396e90f465aa28027de5f97f729238c310d2ed2f71902       |
+------------------------------+--------------------------------------------------------------------------+
| Teleporter Messenger Address | 0x253b2784c75e510dD0fF1da844684a1aC0aa5fcf                               |
+------------------------------+--------------------------------------------------------------------------+
| Teleporter Registry Address  | 0x17aB05351fC94a1a67Bf3f56DdbB941aE6c63E25                               |
+------------------------------+--------------------------------------------------------------------------+

Save C-Chain Registry Address

Let's put the address of the registry in an environment variable:

export C_CHAIN_REGISTRY_ADDRESS=0x17aB05351fC94a1a67Bf3f56DdbB941aE6c63E25

Get L1 Registry Address

avalanche blockchain describe myblockchain
+-------------------------------------------------------------------------------------------+
|                                         TELEPORTER                                        |
+---------------+------------------------------+--------------------------------------------+
| Local Network | Teleporter Messenger Address | 0x253b2784c75e510dD0fF1da844684a1aC0aa5fcf |
|               +------------------------------+--------------------------------------------+
|               | Teleporter Registry Address  | 0x98F9971D3832B94241A2FbBC39712d6e13D8Df99 |
+---------------+------------------------------+--------------------------------------------+

Save L1 Registry Address

export MYBLOCKCHAIN_REGISTRY_ADDRESS=0x98F9971D3832B94241A2FbBC39712d6e13D8Df99

Retrieve Latest ICM Messenger Version:

Let's interact with the Registry by getting the latest version of the Interchain Messaging Messenger deployed on C-Chain:

cast call --rpc-url local-c $C_CHAIN_REGISTRY_ADDRESS "latestVersion()(uint256)" 

On this page