Skip to content

Latest commit

 

History

History
168 lines (110 loc) · 4.17 KB

File metadata and controls

168 lines (110 loc) · 4.17 KB

Stellar deployments

Installation

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.

Deployments

Setup

  1. Checkout the axelar-cgp-soroban repo.
  2. Compile the Soroban wasm contracts
cargo build
stellar contract build
  1. Optimize the contracts
./optimize.sh

Gateway

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.

Operators

node stellar/deploy-contract.js deploy axelar_operators --wasm-path ../axelar-cgp-soroban/target/wasm32-unknown-unknown/release/axelar_operators.optimized.wasm --initialize

Interchain Token Service

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 bindings

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]

Contract Interaction

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

Gateway

To get help on the gateway commands, run:

node stellar/gateway.js --help

Call contract

node stellar/gateway.js call-contract [destination-chain] [dstination-address] [payload]

# Example
node stellar/gateway.js call-contract avalanche 0x4F4495243837681061C4743b74B3eEdf548D56A5 0x1234

Submit multisig prover proof

Submit a proof constructed on Amplifier to the Stellar gateway contract.

node stellar/gateway.js submit-proof [multisig-session-id]

Approve messages

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]

Validate messages

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]

Rotate signers

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

Upgrade Gateway

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

Interchain Token Service

Set Trusted Address

node stellar/its.js set-trusted-address [chain-name] [trusted-address]

Remove Trusted Address

node stellar/its.js remove-trusted-address [chain-name]