Install libsodium
for faster signing operations optionally. Install npm dependencies afterwards.
brew install libsodium
npm ci
Install Stellar CLI
cargo install --locked stellar-cli --features opt
Add Soroban network in the config
stellar network add \
--global testnet \
--rpc-url https://soroban-testnet.stellar.org:443 \
--network-passphrase "Test SDF Network ; September 2015"
Create a new Stellar keypair
stellar keys generate wallet --network testnet
# Address
stellar keys address wallet
# Get private key
stellar keys show wallet
Set PRIVATE_KEY
in .env
to the above value.
Testnet funds can be obtained via a faucet, and transferred to your wallet.
Setup
- Checkout the axelar-cgp-soroban repo.
- Compile the Soroban wasm contracts
cargo build
stellar contract build
- Optimize the contracts
./optimize.sh
Deploy the gateway contract
node stellar/deploy-contract.js deploy axelar_gateway --wasm-path ../axelar-cgp-soroban/target/wasm32-unknown-unknown/release/axelar_gateway.optimized.wasm --initialize
Provide --estimate-cost
to show the gas costs for the initialize transaction instead of executing it.
node stellar/deploy-contract.js deploy axelar_operators --wasm-path ../axelar-cgp-soroban/target/wasm32-unknown-unknown/release/axelar_operators.optimized.wasm --initialize
node stellar/deploy-contract.js deploy interchain_token_service --wasm-path ../axelar-cgp-soroban/target/wasm32-unknown-unknown/release/interchain_token_service.optimized.wasm --initialize
Generate TypeScript bindings for the contract
node stellar/generate-bindings.js --wasm-path /path/to/optimized.wasm --contract-id [contract-address] --output-dir ./stellar/bindings/[contract-name]
Soroban contracts can be interacted directly via the CLI as well. See the help text for individual contract cmds as follows.
stellar contract invoke --network testnet --id [contract-address] --source-account wallet -- --help
To get help on the gateway commands, run:
node stellar/gateway.js --help
node stellar/gateway.js call-contract [destination-chain] [dstination-address] [payload]
# Example
node stellar/gateway.js call-contract avalanche 0x4F4495243837681061C4743b74B3eEdf548D56A5 0x1234
Submit a proof constructed on Amplifier to the Stellar gateway contract.
node stellar/gateway.js submit-proof [multisig-session-id]
A message approval can be submitted to the gateway contract for a test deployment where the wallet is the signer on the gateway. Setting [destination-address]
to wallet
will use the wallet address as the destination.
node stellar/gateway.js approve [source-chain] [message-id] [source-address] [destination-address] [payload]
An approved message can be validated by the gateway contract for a test deployment as follows:
node stellar/gateway.js validate-message [source-chain] [message-id] [source-address] [payload]
A signer rotation can be submitted to the gateway contract. Use --current-nonce
to override the default current nonce set for subsequent rotations. Skip --signers
to rotate to the Amplifier verifier set registered in the prover contract.
node stellar/gateway.js rotate --new-nonce test --signers wallet
node stellar/gateway.js rotate --new-nonce test2 --current-nonce test --signers wallet
To upgrade the gateway, run the following command:
node stellar/deploy-contract.js upgrade axelar_gateway --wasm-path ../axelar-cgp-soroban/target/wasm32-unknown-unknown/release/axelar_gateway.optimized.wasm
node stellar/its.js set-trusted-address [chain-name] [trusted-address]
node stellar/its.js remove-trusted-address [chain-name]