Skip to content

Commit 62b5300

Browse files
authored
feat: amplifier doc improvements and environments (#1237)
1 parent 9c13e34 commit 62b5300

File tree

2 files changed

+122
-15
lines changed

2 files changed

+122
-15
lines changed

src/content/docs/dev/amplifier/chain-integration/relay-messages/manual.mdx

Lines changed: 113 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,37 @@ Chains integrated with Amplifier can [pass GMP messages](/dev/general-message-pa
1414
1. Verifiers participate in the signing session.
1515
1. Once enough signatures have been submitted, the relayer gets the fully signed proof from the prover and relays the proof to the destination chain to approve the transactions. This relayer can now execute any approved transactions on the destination chain.
1616

17-
## Axelar contract deployments
17+
## Live Axelar contract deployments
1818

19-
The following code samples illustrate a transaction from Avalanche to Ethereum Sepolia. Information for other chains can be found on [`testnet.json`](https://github.com/axelarnetwork/axelar-contract-deployments/blob/main/axelar-chains-config/info/testnet.json).
19+
1. [`Devnet Deployments`](https://github.com/axelarnetwork/axelar-contract-deployments/blob/main/axelar-chains-config/info/devnet-amplifier.json).
20+
1. [`Stagenet Deployments`](https://github.com/axelarnetwork/axelar-contract-deployments/blob/main/axelar-chains-config/info/stagenet.json).
21+
1. [`Testnet Deployments`](https://github.com/axelarnetwork/axelar-contract-deployments/blob/main/axelar-chains-config/info/testnet.json).
22+
1. [`Mainnet Deployments`](https://github.com/axelarnetwork/axelar-contract-deployments/blob/main/axelar-chains-config/info/mainnet.json).
2023

2124
## Verify messages
2225

23-
[`verify_messages`](https://github.com/axelarnetwork/axelar-amplifier/blob/f76dc8a775b8bb529cf50147bab9259d1ec7f784/packages/gateway-api/src/msg.rs#L9) is a command on the gateway that prompts verifiers to begin voting so that a message can be verified and then routed. It takes a vector of messages to be verified.
26+
Once a call has been [executed](https://sepolia.etherscan.io/tx/0x4f5b0ed0dc717b317f16c841a407c79226deba7bc15e82ba98b4d4aab1169baf) on an external chain such as Ethereum, the first step is to get that message [verified](https://devnet-amplifier.axelarscan.io/tx/3F1C367A3424CE90FE046ADA41A295910FACA543DC83893784548F214CC2AF7B) with your integration's unique `Verifier Contract`
2427

28+
The [`verify_messages`](https://github.com/axelarnetwork/axelar-amplifier/blob/f76dc8a775b8bb529cf50147bab9259d1ec7f784/packages/gateway-api/src/msg.rs#L9) command on the [gateway](https://github.com/axelarnetwork/axelar-amplifier/blob/main/doc/src/contracts/gateway.md) prompts verifiers (in the case of a VotingVerifier verification choice) to begin voting so that a message can be verified and then routed. It takes a vector of messages to be verified. This example will trigger the [verify_messages](https://github.com/axelarnetwork/axelar-amplifier/blob/f76dc8a775b8bb529cf50147bab9259d1ec7f784/contracts/voting-verifier/src/execute.rs#L96) function in the Voting Verifier contract.
29+
30+
Note: A [Voting Verifier](https://github.com/axelarnetwork/axelar-amplifier/blob/f76dc8a775b8bb529cf50147bab9259d1ec7f784/doc/src/contracts/voting_verifier.md) verification is just one of many possibilities to verify messages. Other options include but are not limited to the use of ZK Proofs or light clients.
31+
<tabs>
32+
<tab-item title="devnet">
33+
```bash
34+
export SOURCE_CHAIN_GATEWAY="axelar1exenpcymaxz5gpkl0lmv85kxzgm6rk0czn9ysxn0ssf8j7c4rkts8ltcvw" # Chain integrations unique gateway
35+
export CHAIN_NAME="toronto" # Chain name
36+
export TX_HASH="0x4f5b0ed0dc717b317f16c841a407c79226deba7bc15e82ba98b4d4aab1169baf" # Hash of tx on Toronto chain
37+
export TX_EVENT="1" # Index of call-contract event on Toronto chain
38+
export DESTINATION_CHAIN="avalanche-fuji" # Name of dest chain as indicated in devnet-deployments.json file
39+
export DESTINATION_ADDRESS="0x8f8dedd09E23E22E1555e9D2C25D7c7332291919" # Receiving dapp address on Avalanche
40+
export SOURCE_ADDRESS="0x4501dc2E5Da9C3c8Eb6A68ecdE7a351229AA3134" # Sending dapp address on Toronto
41+
export PAYLOAD_HASH="510904852D8E69EBFD1F84DC0DD0BF7A75C97A8C7EF873BF5BEF26DC41AD1C0F" # Hash of GMP payload sent
42+
export RPC="http://devnet-amplifier.axelar.dev:26657" # Devnet RPC
43+
export GAS_PRICE="0.007uamplifier" # Gas price for devnet tx
44+
export CHAIN_ID="devnet-amplifier" # Devnet chain id
45+
```
46+
</tab-item>
47+
<tab-item title="testnet">
2548
```bash
2649
export SOURCE_CHAIN_GATEWAY="axelar1vnfn0e4vnn58ydpm05wqcc9zp8t5ztwd5rw5f895lykqaezmuccqujmwl2"
2750
export CHAIN_NAME="avalanche"
@@ -32,7 +55,13 @@ export DESTINATION_ADDRESS="0x8f8dedd09E23E22E1555e9D2C25D7c7332291919"
3255
export SOURCE_ADDRESS="0x0a3b8dc7706c47b6dd87d771df63875b1c5cd867"
3356
export PAYLOAD_HASH="220f68445e3cec114bff50cd6b251e3deabc7684b10280c2116b20bcc6795a96"
3457
export RPC="https://tm.axelar-testnet.lava.build:443"
58+
export GAS_PRICE="0.007uverifiers"
59+
export CHAIN_ID="axelar-testnet-lisbon-3 "
3560
```
61+
</tab-item>
62+
</tabs>
63+
64+
Running this command will trigger a [vote](https://devnet-amplifier.axelarscan.io/amplifier-poll/axelar1uzfz5v5694llyg0a2aafz4gu3d8njc44vp6fw6j9kscyrrn3x5as50wuux_43) among the chain's registered verifiers to come to consensus about the message that was sent.
3665

3766
```bash
3867
axelard tx wasm execute $SOURCE_CHAIN_GATEWAY \
@@ -52,14 +81,46 @@ axelard tx wasm execute $SOURCE_CHAIN_GATEWAY \
5281
}' \
5382
--keyring-backend test \
5483
--from wallet \
55-
--gas auto --gas-adjustment 1.5 --gas-prices 0.007uverifiers \
56-
--chain-id axelar-testnet-lisbon-3 \
84+
--gas auto --gas-adjustment 1.5 --gas-prices $GAS_PRICE \
85+
--chain-id $CHAIN_ID \
5786
--node $RPC
5887
```
5988

6089
## Route messages
90+
With the message now verified, the next step is to [route](https://devnet-amplifier.axelarscan.io/tx/C8AD9EA8DC25CF6CDF8CDFE4C8BBD081BE54A89858D95F8556CA447D80C93AF4) the message to the destination chain's [Prover contract](https://github.com/axelarnetwork/axelar-amplifier/blob/main/doc/src/contracts/multisig_prover.md). To do this you can run the [`route_messages`](https://github.com/axelarnetwork/axelar-amplifier/blob/f76dc8a775b8bb529cf50147bab9259d1ec7f784/packages/gateway-api/src/msg.rs#L14) command on the [gateway](https://github.com/axelarnetwork/axelar-amplifier/blob/f76dc8a775b8bb529cf50147bab9259d1ec7f784/contracts/gateway/src/contract/execute.rs#L22). It takes a vector of verified messages to be routed.
6191

62-
[`route_messages`](https://github.com/axelarnetwork/axelar-amplifier/blob/f76dc8a775b8bb529cf50147bab9259d1ec7f784/packages/gateway-api/src/msg.rs#L14) is a command on the gateway that routes successfully verified messages to the destination chain. It takes a vector of verified messages to be routed.
92+
<tabs>
93+
<tab-item title="devnet">
94+
```bash
95+
export SOURCE_CHAIN_GATEWAY="axelar1exenpcymaxz5gpkl0lmv85kxzgm6rk0czn9ysxn0ssf8j7c4rkts8ltcvw" # Chain integrations unique gateway
96+
export CHAIN_NAME="toronto" # Chain name
97+
export TX_HASH="0x4f5b0ed0dc717b317f16c841a407c79226deba7bc15e82ba98b4d4aab1169baf" # Hash of tx on Toronto chain
98+
export TX_EVENT="1" # Index of call-contract event on Toronto chain
99+
export DESTINATION_CHAIN="avalanche-fuji" # Name of dest chain as indicated in devnet-deployments.json file
100+
export DESTINATION_ADDRESS="0x8f8dedd09E23E22E1555e9D2C25D7c7332291919" # Receiving dapp address on Avalanche
101+
export SOURCE_ADDRESS="0x4501dc2E5Da9C3c8Eb6A68ecdE7a351229AA3134" # Sending dapp address on Toronto
102+
export PAYLOAD_HASH="510904852D8E69EBFD1F84DC0DD0BF7A75C97A8C7EF873BF5BEF26DC41AD1C0F" # Hash of GMP payload sent
103+
export RPC="http://devnet-amplifier.axelar.dev:26657" # Devnet RPC
104+
export GAS_PRICE="0.007uamplifier" # Gas price for devnet tx
105+
export CHAIN_ID="devnet-amplifier" # Devnet chain id
106+
```
107+
</tab-item>
108+
<tab-item title="testnet">
109+
```bash
110+
export SOURCE_CHAIN_GATEWAY="axelar1vnfn0e4vnn58ydpm05wqcc9zp8t5ztwd5rw5f895lykqaezmuccqujmwl2"
111+
export CHAIN_NAME="avalanche"
112+
export TX_HASH="0x41d08bd627d7be301e0858312b63b3ede840d7fad145a9da333c26adf5d98614"
113+
export TX_EVENT="0"
114+
export DESTINATION_CHAIN="ethereum-sepolia"
115+
export DESTINATION_ADDRESS="0x8f8dedd09E23E22E1555e9D2C25D7c7332291919"
116+
export SOURCE_ADDRESS="0x0a3b8dc7706c47b6dd87d771df63875b1c5cd867"
117+
export PAYLOAD_HASH="220f68445e3cec114bff50cd6b251e3deabc7684b10280c2116b20bcc6795a96"
118+
export RPC="https://tm.axelar-testnet.lava.build:443"
119+
export GAS_PRICE="0.007uverifiers"
120+
export CHAIN_ID="axelar-testnet-lisbon-3"
121+
```
122+
</tab-item>
123+
</tabs>
63124

64125
```bash
65126
axelard tx wasm execute $SOURCE_CHAIN_GATEWAY \
@@ -79,18 +140,39 @@ axelard tx wasm execute $SOURCE_CHAIN_GATEWAY \
79140
}' \
80141
--keyring-backend test \
81142
--from wallet \
82-
--gas auto --gas-adjustment 1.5 --gas-prices 0.007uverifiers \
83-
--chain-id axelar-testnet-lisbon-3 \
143+
--gas auto --gas-adjustment 1.5 --gas-prices $GAS_PRICE \
144+
--chain-id $CHAIN_ID \
84145
--node $RPC
85146
```
86147

87148
## Construct a proof
88-
149+
Now that the message has been routed, the [Prover](https://github.com/axelarnetwork/axelar-amplifier/blob/f76dc8a775b8bb529cf50147bab9259d1ec7f784/doc/src/contracts/multisig_prover.md) of the destination chain can [construct the proof](https://devnet-amplifier.axelarscan.io/tx/6693F9316263A079ECC75664E843BBF91C9F7F0B6A5723102886AF57954C9516) for it.
89150
[`construct_proof`](https://github.com/axelarnetwork/axelar-amplifier/blob/f76dc8a775b8bb529cf50147bab9259d1ec7f784/contracts/multisig-prover/src/msg.rs#L61) takes a vector of `CrossChainID`s and builds a proof that includes the messages to be routed so that the message can be relayed to the destination gateway. It also passes the message from the gateway to the prover.
90151

152+
<tabs>
153+
<tab-item title="devnet">
154+
```bash
155+
export DESTINATION_CHAIN_MULTISIG_PROVER="axelar14smpvv72hkaajh7rqzuhxum5vj3yh5smftaescucdmfsh9eednyqdme35j" # Chain integrations unique prover
156+
export CHAIN_NAME="toronto" # Chain name
157+
export TX_HASH="0x4f5b0ed0dc717b317f16c841a407c79226deba7bc15e82ba98b4d4aab1169baf" # Hash of tx on Toronto chain
158+
export TX_EVENT="1" # Index of call-contract event on Toronto chain
159+
export RPC="http://devnet-amplifier.axelar.dev:26657" # Devnet RPC
160+
export GAS_PRICE="0.007uamplifier" # Gas price for devnet tx
161+
export CHAIN_ID="devnet-amplifier" # Devnet chain id
162+
```
163+
</tab-item>
164+
<tab-item title="testnet">
91165
```bash
92166
export DESTINATION_CHAIN_MULTISIG_PROVER="axelar1xz4cya4qm2ws6nzperhvc40wdjcq4872fl6d3j2s4cytyx8j80eqenv87g"
167+
export CHAIN_NAME="avalanche"
168+
export TX_HASH="0x41d08bd627d7be301e0858312b63b3ede840d7fad145a9da333c26adf5d98614"
169+
export TX_EVENT="0"
170+
export RPC="https://tm.axelar-testnet.lava.build:443"
171+
export GAS_PRICE="0.007uverifiers"
172+
export CHAIN_ID="axelar-testnet-lisbon-3"
93173
```
174+
</tab-item>
175+
</tabs>
94176

95177
```bash
96178
axelard tx wasm execute $DESTINATION_CHAIN_MULTISIG_PROVER \
@@ -102,22 +184,37 @@ axelard tx wasm execute $DESTINATION_CHAIN_MULTISIG_PROVER \
102184
"message_id":"'"$TX_HASH-$TX_EVENT"'"
103185
}
104186
]
105-
187+
106188
}' \
107189
--keyring-backend test \
108190
--from wallet \
109-
--gas auto --gas-adjustment 1.5 --gas-prices 0.007uverifiers \
110-
--chain-id axelar-testnet-lisbon-3 \
191+
--gas auto --gas-adjustment 1.5 --gas-prices $GAS_PRICE \
192+
--chain-id $CHAIN_ID \
111193
--node $RPC
112194
```
113195

196+
114197
## Get the proof
115198

116-
[`get_proof`](https://github.com/axelarnetwork/axelar-amplifier/blob/f76dc8a775b8bb529cf50147bab9259d1ec7f784/contracts/multisig-prover/src/msg.rs#L81) returns the fully signed proof from the multisig prover after verifiers vote.
199+
Now that the proof has been submitted you can run [`get_proof`](https://github.com/axelarnetwork/axelar-amplifier/blob/f76dc8a775b8bb529cf50147bab9259d1ec7f784/contracts/multisig-prover/src/msg.rs#L81) to return the fully signed proof from the multisig prover.
117200

201+
<tabs>
202+
<tab-item title="devnet">
203+
```bash
204+
export DESTINATION_CHAIN_MULTISIG_PROVER="axelar14smpvv72hkaajh7rqzuhxum5vj3yh5smftaescucdmfsh9eednyqdme35j" # Chain integrations unique prover
205+
export MULTISIG_SESSION_ID="1742" # Unique value for each proof generation
206+
export RPC="http://devnet-amplifier.axelar.dev:26657" # Devnet RPC
207+
```
208+
</tab-item>
209+
<tab-item title="testnet">
118210
```bash
211+
export DESTINATION_CHAIN_MULTISIG_PROVER="axelar1xz4cya4qm2ws6nzperhvc40wdjcq4872fl6d3j2s4cytyx8j80eqenv87g"
119212
export MULTISIG_SESSION_ID="3457"
213+
export RPC="https://tm.axelar-testnet.lava.build:443"
120214
```
215+
</tab-item>
216+
</tabs>
217+
121218

122219
```bash
123220
axelard q wasm contract-state smart $DESTINATION_CHAIN_MULTISIG_PROVER \
@@ -129,8 +226,8 @@ axelard q wasm contract-state smart $DESTINATION_CHAIN_MULTISIG_PROVER \
129226
--node $RPC
130227
```
131228

132-
## Send the proof to the destination chain
133229

230+
## Send the proof to the destination chain
134231
<tabs>
135232

136233
<tab-item title="<code>cast</code> (Foundry)">
@@ -148,6 +245,7 @@ cast send $OUTPUT \
148245
--rpc-url $RPC \
149246
--mnemonic-path ./private.mneumonic
150247
```
248+
151249
</tab-item>
152250
153251
<tab-item title="MetaMask">
@@ -163,4 +261,4 @@ Use your [MetaMask wallet](https://metamask.io/) to send the output of `get_proo
163261
The proof should then be sent to the destination chain.
164262
</tab-item>
165263
166-
</tabs>
264+
</tabs>

src/content/docs/validator/amplifier/verifier-onboarding.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,18 @@ Prior to running the `ampd` daemon, you will need to set up your wallet with dev
479479

480480
1. Register support for desired chains, enabling `ampd` to participate in voting and signing for your supported chains.
481481

482+
<tabs>
483+
<tab-item title="devnet">
484+
```bash
485+
ampd register-chain-support validators flow
486+
```
487+
</tab-item>
488+
<tab-item title="testnet">
482489
```bash
483490
ampd register-chain-support amplifier flow
484491
```
492+
</tab-item>
493+
</tabs>
485494

486495
Multiple chain names can be passed, separated by a space (`ampd register-chain-support [service name] [chains]...`). Note that any chain you want to support here must be configured in your ampd `config.toml` file.
487496

0 commit comments

Comments
 (0)