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.
Setup
- Checkout the axelar-cgp-soroban repo.
- Compile the Soroban wasm contracts
cargo wasm --release
- Optimize the contracts
./optimize.sh
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.
node stellar/deploy-contract.js --contractName axelar_operators --wasmPath ../axelar-cgp-soroban/target/wasm32-unknown-unknown/release/axelar_operators.optimized.wasm --initialize
Generate TypeScript bindings for the contract
node stellar/generate-bindings.js --wasmPath /path/to/optimized.wasm --contractId [contract address] --outputDir ./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.
soroban contract invoke --network testnet --id [contract address] --source-account wallet -- --help