From Zero to Testnet
Optional walkthrough: deploy and invoke a Soroban counter on Stellar testnet.
Before you start: complete Getting started — install, scaffold, and the basic CLI loop.
Create the project
ctg init my-dapp
cd my-dapp
npm installpnpm install also works. See Templates — pnpm for pnpm 10.26+/11.x.
Verify the environment
npx ctg doctor --network testnet --source aliceExpected shape:
Caatinga Doctor
✓ Node.js 22
✓ Stellar CLI 27.0.0
✓ Rust 1.84.0
✓ wasm32v1-none target installed
✓ caatinga.config.ts found
✓ caatinga.artifacts.json found
✓ network testnet found
✓ source identity alice found
Status: readyA STELLAR_CLI_UNTESTED_VERSION warning is advisory and does not block deploys. See the Stellar CLI version contract.
Build, deploy, invoke
npx ctg build counter
npx ctg deploy counter --network testnet --source alice
npx ctg invoke counter.increment --network testnet --source alice
npx ctg status --network testnet
npx ctg smoke --network testnet --source alice
npx ctg read counter.get --network testnet --expect '{"matcher":"reachable"}'deploy writes the contractId to caatinga.artifacts.json and auto-generates TypeScript bindings. Pass --no-generate to skip; recover with npx ctg generate --network testnet.
To redeploy when an artifact already exists:
npx ctg deploy counter --network testnet --source alice --forceBrowser client
After deploy, install client packages and wire @caatinga/client as in Getting started — Browser client. Full API: Client and Wallets.
Troubleshooting
For install warnings, audit findings, and CAATINGA_* errors on this walkthrough, see Troubleshooting.
Common quick fixes:
CAATINGA_ARTIFACT_NOT_FOUND— runnpx ctg build counterbefore deployCAATINGA_STELLAR_CLI_NOT_FOUND— install Stellar CLI; ensurestellaris onPATHCAATINGA_RUST_TARGET_NOT_FOUND—rustup target add wasm32v1-noneCAATINGA_UNSAFE_SOURCE_ACCOUNT— use a local identity such asalice, not a publicG...address