IntroductionEVM RelayerCosmos GMPSolidity UtilitiesSandbox
InterchainTokenServiceInterchainTokenFactoryTokenManagerAxelarGateway AxelarGasServiceAxelarExecutableAxelarJS SDK
Onboard your IBC chainBug Bounty
Crosschain Message FlowaxlUSDCSecurity OverviewInterchain Transaction DurationEVM Contract Governance

Integrate a Chain

đź’ˇ

The Axelar Virtual Machine (AVM) and Amplifier are currently under active development, so these instructions are likely to change. Please check back frequently for updates.

Prerequisites

  • You should know how to deploy and interact with a CosmWasm contract. Refer to the Osmosis CosmWasm testnet deployment tutorial if you’d like a refresher — just replace osmosisid with axelard and use the amd64 version if building on Linux and arm64 version of the contract optimizer if you are working on a Mac with Apple silicon.
  • Run --gas auto --gas-adjustment 1.5 to provide your transactions with sufficient gas.

Devnet information

  • Devnet RPC: http://devnet-amplifier.axelar.dev:26657
  • Devnet LCD (REST API/JSON RPC): http://devnet-amplifier.axelar.dev:1317
  • Devnet gRPC: devnet-amplifier.axelar.dev:9090
  • Chain ID: devnet-amplifier

Other info can be found in devnet-amplifier.json.

Get the axelard binary

Install the v0.35.5 axelard binary. You can either download the pre-built version or build it yourself from axelar-core.

Option 1: Download the pre-built binary

  1. Download the pre-built axelard binary along with the latest version of the WasmVM.

  2. Add the folder containing the library to LD_LIBRARY_PATH:

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/[your-path]
    ln -s axelard-darwin-arm64-v0.35.5 axelard
    chmod a+x axelard-darwin-arm64-v0.35.5 
    

    If you run into a Mac warning telling you that either the axelard binary or the WasmVM cannot be verified, you can disable it by running:

    xattr -d com.apple.quarantine [filename]
    

Option 2: Build the binary yourself

  1. Clone the axelar-core repo.
  2. Checkout the v0.35.5 release tag.
  3. Run make build.

Make sure you have a funded wallet

  1. Generate an account by running:

    axelard keys add wallet --keyring-backend test
    
  2. Fund your devnet account with uamplifier tokens:

    • Join the Axelar Discord.
    • Get the Developer Role.
    • Go to the #faucet channel and submit a request with your account to get 100 test tokens:
    !faucet devnet-amplifier [your axelar wallet address]
    
  3. Query your account balance by running:

    axelard q bank balances [your axelar wallet] —-node http://devnet-amplifier.axelar.dev:26657
    

Onboard a chain to Amplifier

Once you are running ampd and tofnd, you can onboard a chain to the Amplifier by instantiating the gateway, voting verifier, and multisig prover contracts.

You can either use the existing deployed contracts and on the devnet via their code_ids, or build and store these contracts from the axelar-examples repo. A code_id is a CosmWasm identifier of a stored contract that can be instantiated. You will need to insantinate the contracts no matter which option you choose.

Option 1: Use existing deployed contracts

Use the existing deployments for all three contracts, making note of the existing deployment’s code_id:

  • Voting verifier (code_id: 234)
  • Gateway (code_id: 235)
  • Mutisig prover (code_id: 236)

Option 2: Build and deploy the contracts yourself

  1. Clone the axelar-amplifier repo.

    git clone https://github.com/axelarnetwork/axelar-amplifier
    cd axelar-amplifier
    git checkout ampd-v0.4.0
    
  2. Build the gateway, voting verifier, and multisig prover contracts from using the CosmWasm rust-optimizer. From the root of the repo, run:

    docker run --rm -v "$(pwd)":/code \
    --mount type=volume,source="$(basename "$(pwd)")_cache",target=/target \
    --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
    cosmwasm/optimizer:0.15.1
    

    This process can take many minutes as it will compile all of the contracts in the repository. Any unused import warnings during this process can be ignored.

  3. Deploy the voting verifier:

    axelard tx wasm store artifacts/voting_verifier.wasm \
        --keyring-backend test \
        --from wallet \
        --gas auto --gas-adjustment 1.5 --gas-prices 0.007uamplifier \
        --chain-id devnet-amplifier \
        --node http://devnet-amplifier.axelar.dev:26657
    

    Each wasm store transaction will store your smart contract on the blockchain. You should look in the response to find the code_id in logs.events. This gives you a number representing where your smart contract is stored, which will be needed to instantiate it.

    {
    "height": "128706",
    "txhash": "6D9D90DC86A4FC7B1EAE23062997C50ACE988B0091C4BD2B0C785A9F8D133A68",
    "codespace": "",
    "code": 0,
    "data": "0A460A1E2F636F736D7761736D2E7761736D2E76312E4D736753746F7265436F646512240809122073A8B7CF0BE0CAC97C87E2079CFBBD14F3B373ECFA981BF6322A349EEFBEA227",
    "raw_log": "[{\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"/cosmwasm.wasm.v1.MsgStoreCode\"},{\"key\":\"module\",\"value\":\"wasm\"},{\"key\":\"sender\",\"value\":\"axelar1ypt7vtlj4c67ezex8nwc0vm0acf6d6evss2dau\"}]},{\"type\":\"store_code\",\"attributes\":[{\"key\":\"code_checksum\",\"value\":\"73a8b7cf0be0cac97c87e2079cfbbd14f3b373ecfa981bf6322a349eefbea227\"},{\"key\":\"code_id\",\"value\":\"9\"}]}]}]",
    "logs": [
        {
        "msg_index": 0,
        "log": "",
        "events": [
            {
            "type": "message",
            "attributes": [
                { "key": "action", "value": "/cosmwasm.wasm.v1.MsgStoreCode" },
                { "key": "module", "value": "wasm" },
                {
                "key": "sender",
                "value": "axelar1ypt7vtlj4c67ezex8nwc0vm0acf6d6evss2dau"
                }
            ]
            },
            {
            "type": "store_code",
            "attributes": [
                {
                "key": "code_checksum",
                "value": "73a8b7cf0be0cac97c87e2079cfbbd14f3b373ecfa981bf6322a349eefbea227"
                },
                { "key": "code_id", "value": "9" }
            ]
            }
        ]
        }
    ],
    "info": "",
    "gas_wanted": "6153520",
    "gas_used": "3091569",
    "tx": null,
    "timestamp": "",
    "events": [...]
    }
    
  4. Deploy the gateway:

    axelard tx wasm store artifacts/gateway.wasm \
        --keyring-backend test \
        --from wallet \
        --gas auto --gas-adjustment 1.5 --gas-prices 0.007uamplifier \
        --chain-id devnet-amplifier \
        --node http://devnet-amplifier.axelar.dev:26657
    

    Remember to save your code_id.

  5. Deploy the multisig prover:

    axelard tx wasm store artifacts/multisig_prover.wasm \
        --keyring-backend test \
        --from wallet \
        --gas auto --gas-adjustment 1.5 --gas-prices 0.007uamplifier \
        --chain-id devnet-amplifier \
        --node http://devnet-amplifier.axelar.dev:26657
    

    Remember to save your code_id.

Option 3: Deploy a custom implementation of the Amplifier contracts

You can also deploy a custom implementation of the gateway, verifier, and prover contracts and optimize them with the Cosmwasm rust-optimizer. Follow the same steps as Option 2 with your own implementations of the Amplifier contracts.

Instantiate the contracts

  1. Instantiate the voting verifier:

    Set your parameters.

    export VERIFIER_CODE_ID=234 # Set your Code ID
    export MY_WALLET_ADDRESS="axelar14r0xzwz8hmkshau39dyja5kx503dx6zu52623h"
    export MY_SOURCE_CHAIN_GATEWAY_ADDRESS="0xCa85f85C72df5f8428a440887CA7c449D94e0D0c"
    
    axelard tx wasm instantiate $VERIFIER_CODE_ID \
        '{
            "governance_address": "axelar1zlr7e5qf3sz7yf890rkh9tcnu87234k6k7ytd9",
            "service_registry_address":"axelar1c9fkszt5lq34vvvlat3fxj6yv7ejtqapz04e97vtc9m5z9cwnamq8zjlhz",
            "service_name":"validators",
            "source_gateway_address":"'"$MY_SOURCE_CHAIN_GATEWAY_ADDRESS"'",
            "voting_threshold":["1","1"],
            "block_expiry":10,
            "confirmation_height":1,
            "source_chain":"test",
            "rewards_address":"axelar1vaj9sfzc3z0gpel90wu4ljutncutv0wuhvvwfsh30rqxq422z89qnd989l",
            "msg_id_format":"hex_tx_hash_and_event_index"
        }' \
        --keyring-backend test \
        --from wallet \
        --gas auto --gas-adjustment 1.5 --gas-prices 0.007uamplifier \
        --chain-id devnet-amplifier \
        --node http://devnet-amplifier.axelar.dev:26657 \
        --label test-voting-verifier \
        --admin $MY_WALLET_ADDRESS
    

    Search the output of this command and note the _contract_address. It will be in the in logs.events property. You’ll need to do this for each instantiation to use in future steps.

    {
    "height": "128761",
    "txhash": "B122F59D82CC52C5E69DBEDAB4D4F41DFFC125312DBA4220EDD979A568637FD6",
    "codespace": "",
    "code": 0,
    "data": "...",
    "raw_log": "[{\"events\":[{\"type\":\"instantiate\",\"attributes\":[{\"key\":\"_contract_address\",\"value\":\"axelar1x3960tw9cml6xsqtvzt4gmw3scauaxdd83rhs9dmlpjfjf9z9s7qjx8g0j\"},{\"key\":\"code_id\",\"value\":\"9\"}]},{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"/cosmwasm.wasm.v1.MsgInstantiateContract\"},{\"key\":\"module\",\"value\":\"wasm\"},{\"key\":\"sender\",\"value\":\"axelar1ypt7vtlj4c67ezex8nwc0vm0acf6d6evss2dau\"}]},{\"type\":\"wasm-instantiated\",\"attributes\":[{\"key\":\"_contract_address\",\"value\":\"axelar1x3960tw9cml6xsqtvzt4gmw3scauaxdd83rhs9dmlpjfjf9z9s7qjx8g0j\"},{\"key\":\"service_name\",\"value\":\"validators\"},{\"key\":\"service_registry_contract\",\"value\":\"axelar1hrpna9v7vs3stzyd4z3xf00676kf78zpe2u5ksvljswn2vnjp3ystlgl4x\"},{\"key\":\"source_gateway_address\",\"value\":\"0xCa85f85C72df5f8428a440887CA7c449D94e0D0c\"},{\"key\":\"voting_threshold\",\"value\":\"[\\\"9\\\",\\\"10\\\"]\"},{\"key\":\"block_expiry\",\"value\":\"10\"},{\"key\":\"confirmation_height\",\"value\":\"1\"}]}]}]",
    "logs": [
        {
        "msg_index": 0,
        "log": "",
        "events": [
            ...,
            {
            "type": "wasm-instantiated",
            "attributes": [
                {
                "key": "_contract_address",
                "value": "axelar1x3960tw9cml6xsqtvzt4gmw3scauaxdd83rhs9dmlpjfjf9z9s7qjx8g0j"
                },
                ...
            ]
            }
        ]
        }
    ],
    "info": "",
    "gas_wanted": "337608",
    "gas_used": "183564",
    "tx": null,
    "timestamp": "",
    "events": [...]
    }
    
  2. Instantiate the gateway:

    Set your parameters, including the verifier address from the previous step.

    export GATEWAY_CODE_ID=235 # Set your Code ID
    export MY_VERIFIER_ADDRESS="axelar1x3960tw9cml6xsqtvzt4gmw3scauaxdd83rhs9dmlpjfjf9z9s7qjx8g0j"
    

    Now instantiate the contract.

    axelard tx wasm instantiate $GATEWAY_CODE_ID \
        '{
            "verifier_address": "'"$MY_VERIFIER_ADDRESS"'",
            "router_address": "axelar14jjdxqhuxk803e9pq64w4fgf385y86xxhkpzswe9crmu6vxycezst0zq8y"
        }' \
        --keyring-backend test \
        --from wallet \
        --gas auto --gas-adjustment 1.5 --gas-prices 0.007uamplifier \
        --chain-id devnet-amplifier \
        --node http://devnet-amplifier.axelar.dev:26657 \
        --label test-gateway \
        --admin $MY_WALLET_ADDRESS
    

    Search the output of this command and note the _contract_address.

  3. Instantiate the multisig prover:

    Set your parameters, including the gateway address from the previous step.

    export PROVER_CODE_ID=236 # Set your Code ID
    export MY_GATEWAY_ADDRESS="axelar1ufs3tlq4umljk0qfe8k5ya0x6hpavn897u2cnf9k0en9jr7qarqqa9263g"
    export MY_CHAIN_ID=43113
    

    Now instantiate the contract.

    đź’ˇ

    The domain_separator is a 32-length byte array derived from the hash of the chain name, router address, and Axelar chain ID.

    axelard tx wasm instantiate $PROVER_CODE_ID \
        '{
            "admin_address": "'"$MY_WALLET_ADDRESS"'",
            "governance_address": "axelar1zlr7e5qf3sz7yf890rkh9tcnu87234k6k7ytd9",
            "gateway_address": "'"$MY_GATEWAY_ADDRESS"'",
            "multisig_address": "axelar19jxy26z0qnnspa45y5nru0l5rmy9d637z5km2ndjxthfxf5qaswst9290r",
            "coordinator_address":"axelar1m2498n4h2tskcsmssjnzswl5e6eflmqnh487ds47yxyu6y5h4zuqr9zk4g",
            "service_registry_address":"axelar1c9fkszt5lq34vvvlat3fxj6yv7ejtqapz04e97vtc9m5z9cwnamq8zjlhz",
            "voting_verifier_address": "'"$MY_VERIFIER_ADDRESS"'",
            "signing_threshold": ["1","1"],
            "service_name": "validators",
            "chain_name":"test",
            "verifier_set_diff_threshold": 1,
            "encoder": "abi",
            "key_type": "ecdsa",
            "domain_separator":[hash(chain_name, router_address, MY_CHAIN_ID)]
        }' \
        --keyring-backend test \
        --from wallet \
        --gas auto --gas-adjustment 1.5 --gas-prices 0.007uamplifier \
        --chain-id devnet-amplifier \
        --node http://devnet-amplifier.axelar.dev:26657 \
        --label test-prover  \
        --admin $MY_WALLET_ADDRESS
    

    Search the output of this command and note the _contract_address.

  4. Send the chain’s gateway and multisig prover contract addresses to the Interop Labs team by filling out the Axelar Amplifier Integration Form. The team will register the chain and gateway with the router and authorize the prover.

Add verifiers to your chain

Every new chain will need a verifier, which requires running ampd and tofnd. See Become an Amplifier Verifier (Worker) for detailed instructions on how to do this on your machine.

Begin routing messages

Once your chain is registered with the protocol, it will need verifiers to begin routing messages. See Become an Amplifier Verifier (Worker) for instructions to onboard a verifier. Note that chain integrators will onboard on devnet-amplifier and not devnet-verifier.

Edit this page