This page is a workflow map, not the source of truth for exact command syntax or SDK APIs. Use it to choose the next step, then follow the linked SDK and CLI reference pages for implementation details.
Start Here
The typical flow looks like this:Use This Page To Route
Use this page for:- deciding what to do next in the program development loop
- understanding the required order of ABI validation, deployment, and testing
- spotting the common failure points before they cost you time
- exact CLI flags
- exact ABI command syntax
- exact C SDK API behavior
- detailed runtime or VM semantics
- Build a C Program for the program scaffold and binary layout
- Validation and roundtrip testing for ABI proof loops
- Publishing and Iteration for ABI publishing flows
- Program, ABI, Transaction, and Network for exact CLI usage
Prerequisites
Before writing code, make sure the environment is ready: For most C program work, the important install steps are:Phase 1: Write the Program
Start from the C SDK and the minimal program guides: What tends to help most:- start from a small working scaffold
- keep local C tests close to the program
- validate account ordering and CPI assumptions early
- account ordering is still unclear
- the program entrypoint or instruction layout is still changing rapidly
- CPI authorization assumptions are not yet nailed down
Authorization and CPI
One recurring gotcha is that a correct wire format is not enough if the authorization model is wrong. This shows up most often around CPI:- the instruction bytes may be correct
- but the program still fails because account access or CPI authorization is wrong
Phase 2: Write the ABI
Move to the ABI guides once the instruction and account model is stable enough to describe: Important reality:- ABIs are handwritten today
- they do not stay in sync with the program automatically
- agents should assume the ABI must be validated explicitly after every meaningful program change
Phase 3: Validate the ABI roundtrip
Before deployment, run the local proof loop: The high-value loop is:Phase 4: Deploy the Program and ABI
When the program and ABI are both ready:- the ABI and program should use the same seed
Phase 5: Test Real On-Chain Behavior
Beyond local C tests, meaningful program testing currently means interacting with a live chain, usually a devnet. Important constraints:- there is no localnet support yet
- you need a devnet RPC URL
- Network is the easiest CLI surface for managing endpoints
- use ABI-generated TypeScript to build instruction data
- use @thru/thru-sdk to submit the transaction
- read transaction or account data back from the chain
- reflect it with ABI tooling or inspect it in the explorer
- verify the deployed program accepts the instruction bytes you think it accepts
- verify the resulting account or event data reflects the way you expect
- avoid inventing new ABI or program structure changes while debugging deployment behavior
Phase 6: Debug Failures
When deployment or testing fails, start by classifying the failure:-765means something in the program threw- other failures are runtime or system errors
- invalid memory access
- ABI drift between the program and the handwritten schema
- CPI account ordering or authorization mistakes
- partial deployment state left behind from a failed previous attempt
- if the payload shape is wrong, go back to ABI roundtrip validation
- if the payload shape is right but execution still fails, inspect program logic, CPI authorization, memory access, and runtime errors
Phase 7: Recover and Iterate
If a create or upgrade flow fails partway through, cleanup is often necessary before retrying. The usual recovery tools are:- Uploader
cleanup - Program
destroy - ABI Account
close
Recommended Traversal For Agents
- Setup the DevKit
- Build a C Program
- ABI Overview
- Validation and roundtrip testing
- Publishing and Iteration
- Program, ABI, and Network for exact commands