Become an Amplifier Verifier (Worker)

💡

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.

By running a verifier (also called a worker) for a chain integration with Axelar, you will be responsible for voting on the validity of transactions on the Axelar network for a given chain.

Prerequisites

  1. Pull the tofnd and ampd image from Docker Hub:
    docker pull haiyizxx/tofnd:latest
    docker pull haiyizxx/ampd:v0.0.2
    
  2. Create an ampd folder in your working directory, download config.toml, and put it in ampd folder.

Onboard as a verifier

Run tofnd

  • If you are running tofnd for the first time, a verifier key will be generated for you automatically.

    
    docker run  -p 50051:50051 --env MNEMONIC_CMD=auto  --env NOPASSWORD=true -v tofnd:/.tofnd haiyizxx/tofnd:latest
    

    If you have done this before, don’t run this, cmmand, instead restart your existing container by container id.

  • Now check to ensure it’s running successfully

    docker ps -a --filter ancestor=haiyizxx/tofnd:latest
    

    if you see tofnd container is up and running, you are good to go. e.g.

    
    CONTAINER ID   IMAGE                  ...   STATUS       PORTS
    1df5dba065e0   haiyizxx/tofnd:latest  ...   Up 2 weeks   0.0.0.0:50051->50051/tcp
    

    Otherwise, restart the container by container id, e.g.

    docker start 1df5dba065e0
    

Bond your verifier

Bonding your verifier registers it as a voting verifier as part of the pool. Bonded verifiers will stay bonded until they unbond, or are removed by governance.

  1. Query your verifier address
docker run --network host -v $(pwd)/ampd:/root/.ampd haiyizxx/ampd:v0.0.2 worker-address

Sample response

Worker address is axelar1up3vvhxg4swh2lfeh8n84dat86j6hmgz20d6d3

Create an issue on Axelar Support asking for devnet funds and to be whitelisted.

  1. After your address has been funded, bond your verifier (Simply copy and paste the command without altering the arguments.) (Can skip if you reuse the verifier key)
docker run --network host -v $(pwd)/ampd:/root/.ampd haiyizxx/ampd:v0.0.2 bond-worker "axelar15xkahjmdkxu9jm63nlfff5kczkye5nj53f29d26ktqrc9nk8sy6srcwxyy" "validators" 100 "uamplifier"
  1. Declare chain support (Simply copy and paste the command without altering the arguments.)
docker run --network host -v $(pwd)/ampd:/root/.ampd haiyizxx/ampd:v0.0.2 declare-chain-support  "axelar15xkahjmdkxu9jm63nlfff5kczkye5nj53f29d26ktqrc9nk8sy6srcwxyy" "validators" "sui-2" "avalanche"
  1. Register your public key (Can skip if you reuse the verifier key)
docker run --network host -v $(pwd)/ampd:/root/.ampd haiyizxx/ampd:v0.0.2 register-public-key
  1. You can now run ampd
docker run --network host -v $(pwd)/ampd:/root/.ampd haiyizxx/ampd:v0.0.2

Key Rotation

  1. Update verifier set

    axelard tx wasm execute $SUI_PROVER '"update_worker_set"' --from validator --gas auto --gas-adjustment 2
    

    Query multisig contract to get signing state

    axelard q wasm contract-state smart $MULTISIG '{"get_multisig":{"session_id":"12"}}'
    
  2. Query signed command

    axelard q wasm contract-state smart $SUI_PROVER '{"get_proof":{"multisig_session_id":"12"}}'
    
  3. Relay the batch to Sui gateway

  4. Verify key rotation happened on Sui

    axelard tx wasm execute $SUI_VERIFIER '{"confirm_worker_set":{"message_id":"9RSAJtcr5z4wJte5nzdmhLHjWzzNegvHECfpWJ3FwUTs:0","new_operators":{"weights_by_addresses":[["021c4f23e560c7fe709dfc9d21564c50ae7d47849564b9c3321c38a8ad1b94d30d","1"],["023054b468b4d9e85144225705aa5dd06e46226a12aae6e854b16046df272145f3","1"],["026fa53253c4e5ca8ba71690470c887686f865fadb49430c2e95dfcc3a864e0c8c","1"],["027561c44dd85e1f08a99f4da41af912fc6a4986a431b3209cf1c8ecdb77609aae","1"],["02d3eef76c31694945e855423b1d7244d80dbbd04c2dbe707f3f4ec9bdcfe88950","1"],["02fdf3916dd87dc1357cd27c9d3ec302bb1a4e331decde00f7479db12c3bc9c96e","1"],["030d47294351c4800e804281e7e24d7fad7b3a53c666958fa5bdcf071a927f78df","1"],["03b36f52c88d68db7fb1a39d1c6a298dbf6936c8c73f8c7d3986145a13b7993744","1"],["03faa1ac20735bdc5647390f9bb9a763d139c284720bb05b46e8db54ca77059d7d","1"]], "threshold":"5"}}}' --from validator --gas auto --gas-adjustment 2
    
    axelard tx wasm execute $SUI_VERIFIER '{"end_poll":{"poll_id":"8"}}' --from validator --gas auto --gas-adjustment 2
    
  5. Confirm verifier set

    axelard tx wasm execute $SUI_PROVER '"confirm_worker_set"' --from validator --gas auto --gas-adjustment 2
    
    axelard q wasm contract-state smart $SUI_PROVER '"get_worker_set"'
    
  6. Distribute rewards

# for AVAX voting verifier
axelard tx wasm execute $REWARDS '{"distribute_rewards": {"contract_address": "'$SUI_VERIFIER'", "epoch_count":1000}}' --from validator --gas auto --gas-adjustment 2

# for Multisig
axelard tx wasm execute $REWARDS '{"distribute_rewards": {"contract_address": "'$MULTISIG'", "epoch_count":2000}}' --from validator --gas auto --gas-adjustment 2

Message Passing from Avalanche to Sui

  1. Send a cross chain message

  2. Verifiers verify the source transaction

    MESSAGE_ID=0x2cfe059bde1de13cbb2ebbe4a79265cce41e50e21a86d8a72a708a9a1cabd9a1:0
    SOURCE_CHAIN=avalanche
    SOURCE_ADDRESS=0x777d2d82dab1bf06a4dcf5a3e07057c41100c22d
    DESTINATION_CHAIN=sui-2
    DESTINATION_ADDRESS=16d3de825d0e59e9dcf7726a7d4607841eab211f5fa7741a7c44d6453fe38545
    PAYLOAD_HASH=5FE7F977E71DBA2EA1A68E21057BEEBB9BE2AC30C6410AA38D4F3FBE41DCFFD2
    
    axelard tx wasm execute $AVAX_GATEWAY '{"verify_messages":[{"cc_id":{"chain":"avalanche","id":"'$MESSAGE_ID'"}, "source_address":"'$SOURCE_ADDRESS'","destination_chain":"'$DESTINATION_CHAIN'","destination_address":"'$DESTINATION_ADDRESS'","payload_hash":"'$PAYLOAD_HASH'"}]}' --from validator --gas auto --gas-adjustment 2
    
    
    axelard tx wasm execute $AVAX_VERIFIER '{"end_poll":{"poll_id":"11"}}' --from validator --gas auto --gas-adjustment 2
    

    Check message verified

    axelard q wasm contract-state smart $AVAX_VERIFIER '{"is_verified":{"messages":[{"cc_id":{"chain":"avalanche","id":"'$MESSAGE_ID'"},"source_address":"'$SOURCE_ADDRESS'","destination_chain":"'$DESTINATION_CHAIN'","destination_address":"'$DESTINATION_ADDRESS'","payload_hash":"'$PAYLOAD_HASH'"}]}}'
    
    
  3. Distribute rewards

    axelard tx wasm execute $REWARDS '{"distribute_rewards": {"contract_address": "'$AVAX_VERIFIER'", "epoch_count":1000}}' --from validator --gas auto --gas-adjustment 2
    
  4. Route message

    axelard tx wasm execute $AVAX_GATEWAY '{"route_messages":[{"cc_id":{"chain":"avalanche","id":"'$MESSAGE_ID'"}, "source_address":"'$SOURCE_ADDRESS'","destination_chain":"'$DESTINATION_CHAIN'","destination_address":"'$DESTINATION_ADDRESS'","payload_hash":"'$PAYLOAD_HASH'"}]}' --from validator --gas auto --gas-adjustment 2
    

    Verify message arrived at destination gateway

    axelard q wasm contract-state smart $SUI_GATEWAY '{"get_messages":{"message_ids":[{"chain":"avalanche","id":"'$MESSAGE_ID'"}]}}'
    
  5. Construct proof

    axelard tx wasm execute $SUI_PROVER '{"construct_proof":{"message_ids":["avalanche:'$MESSAGE_ID'"]}}' --from validator --gas auto --gas-adjustment 2
    
  6. Distribute Rewards

    axelard tx wasm execute $REWARDS '{"distribute_rewards": {"contract_address": "'$MULTISIG'", "epoch_count":1000}}' --from validator --gas auto --gas-adjustment 2
    
  7. Relay proof to Avalanche gateway

    axelard q wasm contract-state smart $SUI_PROVER '{"get_proof":{"multisig_session_id":"13"}}'
    

Productionizing

You should now switch to running your own full Axelar node and your own full node for any chains you are voting on.

Edit this page