This directory contains scripts to automate the deployment, initialization, and upgrade of the PromptHash contract.
- Stellar CLI installed.
- Rust and Soroban target installed (
rustup target add wasm32-unknown-unknown).
Deploys and initializes the contract to a specified network. It also automatically updates your .env and .env.local files.
Usage:
# Deploy to testnet (default)
./scripts/deploy.sh
# Deploy to local network
./scripts/deploy.sh localEnvironment Variables:
NETWORK: Target network (testnet,local). Defaults totestnet.ADMIN_ALIAS: Alias for the admin identity. Defaults toadmin.FEE_WALLET_ALIAS: Alias for the fee wallet identity. Defaults tofee_wallet.
Upgrades an existing contract instance with a new Wasm version.
Usage:
# Upgrade on testnet
./scripts/upgrade.sh
# Upgrade on local
./scripts/upgrade.sh localNote: Ensure CONTRACT_ID is set in your .env file or passed as an environment variable.
Performs a comprehensive check of the deployed contract's configuration (owner, fee settings, XLM SAC, etc.).
Usage:
./scripts/verify.sh localThe deploy.sh script synchronizes the following variables across .env and .env.local:
PUBLIC_STELLAR_NETWORKPUBLIC_STELLAR_NETWORK_PASSPHRASEPUBLIC_STELLAR_RPC_URLPUBLIC_PROMPT_HASH_CONTRACT_IDPUBLIC_STELLAR_NATIVE_ASSET_CONTRACT_ID
This ensures that the frontend and backend are always pointing to the correct contract instance.
- The
upgradefunction can only be called by the current contract owner. - The new Wasm hash must be installed on the network first (handled by the script).
- Contract state is preserved during the upgrade.