Skip to content

Latest commit

 

History

History
93 lines (63 loc) · 2.41 KB

File metadata and controls

93 lines (63 loc) · 2.41 KB

Stellar deployments

Installation

Install libsodium for faster signing operations optionally. Install npm dependencies afterwards.

brew install libsodium

npm ci

Install Soroban CLI

cargo install --locked soroban-cli --features opt

Add Soroban network in the config

soroban network add testnet --rpc-url https://soroban-testnet.stellar.org:443 "Test SDF Network ; September 2015" --global

Create a new Stellar keypair

soroban keys generate wallet --network testnet

# Address
soroban keys address wallet

# Get private key
soroban keys show wallet

Set PRIVATE_KEY in .env to the above value.

Deployments

Setup

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

Gateway

Deploy the auth contract

node stellar/deploy-contract.js --contractName axelar_auth_verifiers --wasmPath ../axelar-cgp-soroban/target/wasm32-unknown-unknown/release/axelar_auth_verifier.optimized.wasm

Deploy the gateway contract and initialize it with the auth contract

node stellar/deploy-contract.js --contractName axelar_gateway --wasmPath ../axelar-cgp-soroban/target/wasm32-unknown-unknown/release/axelar_gateway.optimized.wasm --initialize

Initialize the auth contract. TODO: run initialize during the first step itself once initialize works correctly.

node stellar/deploy-contract.js --contractName axelar_auth_verifiers --wasmPath ../axelar-cgp-soroban/target/wasm32-unknown-unknown/release/axelar_auth_verifier.optimized.wasm --initialize --address [auth contract address] --estimateCost

-estimateCost will show the gas costs for the initialize transaction.

Operators

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

Generate bindings

Generate TypeScript bindings for the contract

node stellar/generate-bindings.js --wasmPath /path/to/optimized.wasm --contractId [contract address] --outputDir ./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.

soroban contract invoke --network testnet --id [contract address] --source-account wallet -- --help