Run these steps once locally from your machine. Takes ~20 minutes total.
# 1. Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
rustup target add wasm32-unknown-unknown
# 2. Soroban CLI
cargo install --locked soroban-cli
# 3. Verify
soroban --version
# → soroban 21.x.xcd AtriumMind-contracts # or wherever you cloned
node ../atriumind-deploy/scripts/01-generate-keypairs.jsSave all 5 keypairs in a password manager. You need:
- DEPLOYER secret key — for deploying contracts
- BACKEND public key — set as the admin of access-lease + subscription
- PUBLISHER1/2 — for seeding the catalog
- BUYER1 — for testing purchases
node ../atriumind-deploy/scripts/02-fund-accounts.js \
GDEPLOYER... GBACKEND... GPUBLISHER1... GPUBLISHER2... GBUYER1...Each account gets 10,000 XLM on testnet — free, takes ~5 seconds.
Check balances at: https://stellar.expert/explorer/testnet
export DEPLOYER_SECRET=Syour_deployer_secret_key_here
bash ../atriumind-deploy/scripts/03-deploy-contracts.shThis will:
- Build all 3 contracts to WASM (
~3 minutes) - Deploy
vault-registry→ prints contract ID - Deploy
access-lease→ prints contract ID - Deploy
subscription→ prints contract ID - Save all IDs to
contract-ids.env
Expected output:
▸ Building WASM contracts…
✅ Build complete
▸ Deploying vault_registry…
Contract ID: CCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
▸ Deploying access_lease…
Contract ID: CDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
▸ Deploying subscription…
Contract ID: CEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
source contract-ids.env
export DEPLOYER_SECRET=Syour_deployer_secret_key_here
export BACKEND_PUBLIC=Gyour_backend_wallet_public_key
bash ../atriumind-deploy/scripts/04-init-contracts.shThis calls init(admin) on access-lease and subscription, setting your backend
wallet as the sole lease-granting authority.
Visit these URLs (replace with your actual contract IDs):
https://stellar.expert/explorer/testnet/contract/CC[vault_registry_id]
https://stellar.expert/explorer/testnet/contract/CD[access_lease_id]
https://stellar.expert/explorer/testnet/contract/CE[subscription_id]
You should see the contracts with their deployed WASM and storage entries.
STELLAR_CONTRACT_VAULT_REGISTRY=CC...
STELLAR_CONTRACT_ACCESS_LEASE=CD...
STELLAR_CONTRACT_SUBSCRIPTION=CE...Then redeploy the backend (Railway redeploys automatically on env change).
# Read vault-registry count
soroban contract invoke \
--id $vault_registry --source deployer --network testnet \
-- count
# Grant a test lease (30 days = 518400 ledgers)
soroban contract invoke \
--id $access_lease --source deployer --network testnet \
-- grant_lease \
--resource_id "test-resource-1" \
--buyer GBUYER1_PUBLIC_KEY \
--duration_ledgers 518400
# Check if valid
soroban contract invoke \
--id $access_lease --source deployer --network testnet \
-- is_valid \
--resource_id "test-resource-1" \
--buyer GBUYER1_PUBLIC_KEY
# → true| Error | Fix |
|---|---|
account not found |
Fund the account with Friendbot first |
Error: wasm too large |
Run with --release flag |
insufficient balance |
Fund deployer wallet — needs XLM for fees |
contract already exists |
Use --wasm-hash flag to reuse existing upload |
Error: HostError: Value(InvalidInput) |
Check argument types match contract signature |