This guide covers repeatable deployment of Teye contracts to local and Stellar networks.
It is aligned with the scripts in scripts/ and the artifact flow in this repository.
- Build contract WASM artifacts
- Deploy a selected contract to a target network
- Initialize/admin handoff flow
- Verify deployment health
- Roll back consumer references to a previous contract ID
- Rust toolchain with
wasm32-unknown-unknowntarget - Soroban CLI installed and authenticated (
soroban keysand network configs) - Network alias configured in Soroban CLI (
local,testnet,futurenet, ormainnet) - Deployer key available as
defaultsource account - Access to this repository and write permission for
deployments/
- Build output:
target/wasm32-unknown-unknown/release/<contract>.wasm - Deployment descriptor:
deployments/<network>_<contract>.json - Previous descriptor backup (testnet flow):
deployments/testnet_<contract>_previous.json
Run checks before deploying:
cargo test
cargo build --target wasm32-unknown-unknown --releaseOptional: generate all release artifacts and checksums:
./scripts/build_release_artifacts.shUse the base deployment script:
./scripts/deploy.sh <network> [contract]Examples:
./scripts/deploy.sh local vision_records
./scripts/deploy.sh testnet stakingOn success, the script prints:
DEPLOYMENT_CONTRACT_ID=<id>- a deployment descriptor JSON under
deployments/
Most contracts require explicit initialization after deployment. Example for vision_records:
soroban contract invoke \
--id <CONTRACT_ID> \
--source default \
--network <network> \
-- \
initialize \
--admin <ADMIN_ADDRESS>Contracts in this repository generally use a two-step admin transfer (propose_admin, accept_admin).
Step 1 (current admin):
soroban contract invoke \
--id <CONTRACT_ID> \
--source <CURRENT_ADMIN_SOURCE> \
--network <network> \
-- \
propose_admin \
--current_admin <CURRENT_ADMIN_ADDRESS> \
--new_admin <NEW_ADMIN_ADDRESS>Step 2 (new admin):
soroban contract invoke \
--id <CONTRACT_ID> \
--source <NEW_ADMIN_SOURCE> \
--network <network> \
-- \
accept_admin \
--new_admin <NEW_ADMIN_ADDRESS>Minimum required checks:
- Contract responds to a lightweight read method (for
vision_records, useversion) - Admin address is correct (
get_adminwhere available) - Deployment descriptor contains expected
contract_id, timestamp, andwasm_hash
Example:
soroban contract invoke \
--id <CONTRACT_ID> \
--source default \
--network <network> \
--fn versionUse the testnet wrapper for safer descriptor handling:
./scripts/deploy_testnet.sh [contract]Behavior:
- Backs up current descriptor to
_previous.json - Runs
scripts/deploy.sh testnet <contract> - Runs lightweight verification (
versionforvision_records) - Restores previous descriptor if verification fails
- Emits
VERIFIED_CONTRACT_ID=<id>on success
On Soroban, deployed contracts are immutable. Rollback means repointing off-chain consumers.
- Identify last known-good contract ID from:
deployments/<network>_<contract>_previous.json- release notes or run logs
- Update all consumers to use that contract ID:
- backend services
- indexers
- frontend/app config
- Re-run smoke checks against the previous contract ID
- Record incident and root cause in ops/release notes
- Build/test gates before deployment
- One environment promotion path (
local -> testnet -> production) - Persist deployment descriptors in git history
- Capture contract ID + WASM checksum in release notes
- Use manual approval for production deployment jobs
Before marking a deployment complete:
- Contract ID published to all consuming systems
- Monitoring updated to track the new contract ID
- Alerts green for at least one observation window
- Backup snapshot updated (descriptors, artifacts, checksums)
- Upgrade path and rollback metadata documented