Overview
This page lists the example actors that ship with the Cowboy monorepo. They cover everything from “hello world” to full LLM chat with runner callbacks.APIs shown here follow CIP-6. Check the CIP for authoritative semantics.
Starter Actors
Two tiny reference actors live at the repo root underactors/ and are scaffolded into every project by cowboy init.
actors/hello/main.py — Minimal Counter
A class-based actor using the low-level PVM host API:
actors/feed-subscriber/main.py — Watchtower Feed Consumer
A function-based actor that subscribes to a Watchtower stream (CIP-7) and stores incoming messages. Demonstrates:
- Explicit
pvm_host.get_state/set_statewith manual bytes serialization handle_message— the handler invoked by the chain when stream data arrives- Bounded storage (
MAX_STORED_MESSAGES = 100)
Worked End-to-End Examples
Longer, self-contained demos live undernode/examples/.
node/examples/llm_chat/ — LLM Chat with Runner Callback
End-to-end actor using the CIP-6 SDK:
@actordecorator injectsself.storage@runner.continuationsplits thechatmethod into a suspend/resume FSM- Submits an LLM job to a runner and resumes in a later block when the result arrives
- Uses
CowboyModel(ChatEntry) for typed, CBOR-serialized records - Includes a browser frontend under
frontend/and adeploy.shscript
node/examples/ring-demo/ — Multi-Actor Topology
Demonstrates inter-actor messaging by wiring actors into a ring and passing a token around. Useful for understanding:
- Asynchronous message ordering
- Cross-actor send + callback patterns
- Deploying multiple actors in one script (
deploy_ring.sh)
node/examples/token/ — CIP-20 Fungible Token
A minimal CIP-20 fungible token implementation — transfer, mint, burn, approve. Shows how to work with the token registry crate from Python.
Other Examples
| Path | Topic |
|---|---|
node/examples/multi_call/ | Chained actor calls within a single transaction |
node/examples/restart_test/ | Checkpoint/resume across process restarts |
node/examples/proof/ | Generating and verifying state proofs |
node/examples/indexer_test/ | Indexer integration testing |
node/examples/poison_tx_test/ | Malformed transaction handling |
See Also
- SDK Overview — what
cowboy_sdkgives you - Minimal Actor — anatomy of an actor
- Transaction Format
- Best Practices

