Skip to content

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

bash
ctg init my-dapp
cd my-dapp
npm install

pnpm install also works. See Templates — pnpm for pnpm 10.26+/11.x.

Verify the environment

bash
npx ctg doctor --network testnet --source alice

Expected shape:

txt
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: ready

A STELLAR_CLI_UNTESTED_VERSION warning is advisory and does not block deploys. See the Stellar CLI version contract.

Build, deploy, invoke

bash
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:

bash
npx ctg deploy counter --network testnet --source alice --force

Browser 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 — run npx ctg build counter before deploy
  • CAATINGA_STELLAR_CLI_NOT_FOUND — install Stellar CLI; ensure stellar is on PATH
  • CAATINGA_RUST_TARGET_NOT_FOUNDrustup target add wasm32v1-none
  • CAATINGA_UNSAFE_SOURCE_ACCOUNT — use a local identity such as alice, not a public G... address