Audience:
new user·stellar contract developer(getting started)TL;DR: A guided tour of the ready-to-run example contracts and launch configs. Start with the zero-dependency Replay … with symbols configs to see source-level, forward-and-backward debugging in seconds — no toolchain needed — then graduate to the full build-and-run pipeline.
This folder is a self-contained example workspace for the Simbolik: Stellar Debugger (komet) extension. Pressing F5 ("Run Extension") in the extension repo opens this folder in an Extension Development Host with the extension already loaded, so you have a real Soroban project to debug immediately.
greeter/— a contract whose entry pointstore(value)returns nothing (unit /Void). Uses instance storage.adder/— the simplest possible contract (add(a, b) -> u32, pure arithmetic).increment/— a stateful counter (increment(by) -> u32, uses instance storage).stepper/—sum_triples(n): a real#[inline(never)]call inside awhileloop, for exercising step-in / step-over across a call and per-iteration stops.control/— one entry point per Rust construct (seq,branchif/else,countfor,while_callwhile+call,choosematch). It is the fixture behind the systematic stepping suite (test/control*Stepping.test.ts); the debugger builds it at opt-level=0 so every statement keeps its own line (higher optimization collapses a whole function onto one line — see../docs/stepping.md).traces/add.trace.jsonl— a capturedkomet-nodeexecution trace foradd, so the debugger works with no toolchain and no komet-node. It is the same real trace as../test/fixtures/adder-debug.trace.jsonl; paired with../test/fixtures/adder-debug.wasm(a debug build ofadder/) it also demonstrates full Rust source mapping offline.
Each contract is an independent crate (its own Cargo.toml/Cargo.lock/
target/), which is what a deploy step's contract field expects.
Open the Run and Debug view and pick a config from .vscode/launch.json:
- Stellar: Replay add(4, 3) with symbols — zero dependencies. Replays the
bundled trace together with its matching debug wasm: stack frames open
adder/src/lib.rs, breakpoints verify on Rust lines (sliding forward to the nearest executed line), stepping is statement-granular, and right-clicking the stack frame offers Open Disassembly View (annotated wasm, instruction breakpoints, instruction-granular stepping — also backwards). Start here. - Stellar: Replay add(4, 3) trace — the same trace without the wasm: the no-DWARF fallback. Frames carry only an instruction pointer; you debug in the Disassembly View.
- Stellar: Replay control while_call(3) / count(3) / branch(3) with symbols
— zero-dependency replays of the control fixtures, one per Rust construct:
step into
bumpand back out of awhileloop, watch aforbody stop once per iteration, or see anif/elseenter only the taken arm. - Stellar: Debug store(42) / add(1, 2) / increment(5) / control while_call(3)
— the full turnkey pipeline: builds the crate with DWARF debug info at
opt-level 0 (the extension injects
CARGO_PROFILE_RELEASE_DEBUG=true/CARGO_PROFILE_RELEASE_STRIP=none/CARGO_PROFILE_RELEASE_OPT_LEVEL=0; noCargo.tomlchanges needed — opt-level 0 is what keeps per-statement source stepping working), spawns komet-node, deploys, invokes, and replays the resulting trace with Rust source mapping. Requires the toolchain (Rust + wasm target, Stellar CLI, komet-node), all present in the devcontainer. Set"debugInfo": falseon adeploystep to opt out of the debug build (you then debug that contract at the wasm level only).
Note: komet-node's tracer stops at instructions it cannot decode (it reports
them as unknown, e.g. if), so a trace can end before the invocation does —
depending on codegen, some contracts replay only partially.
Drop a new crate directory here (with a Cargo.toml exposing a #[contract]),
then add a launch config whose transactions deploy it and invoke a function:
See ../docs/debug-config.md for the full
configuration reference (multi-contract systems, composite argument types,
trace selection, and offline replay).
{ "type": "stellar", "request": "launch", "name": "Stellar: Debug my_fn", "transactions": [ { "kind": "deploy", "id": "mine", "contract": "${workspaceFolder}/my_crate" }, { "kind": "invoke", "contract": "mine", "function": "my_fn", "args": { "x": 1 } } ] }