cowboy.toml at its root. Every project command (check, test, run, build, deploy, actor ..., workload ...) finds the project by walking up from the current folder to the nearest cowboy.toml, so you can run them from any folder inside it.
A project holds one or more actors, and can add off-chain functions and workloads (Where your code runs compares them).
What cowboy init writes
An actor
Output
cowboy init <name> again inside a project to add another actor next to the first. init keeps the files that are already there.
An off-chain function
Output
actors/fn/ and an offchain/ package beside it:
[offchain] table to cowboy.toml and sets up a second Python environment for local runs in .cowboy/local/offchain-env/. The function is Python by default; --offchain-runtime node writes a Node function instead.
A workload
Output
workloads/api/, an empty folder for your service.actors/api_owner/andtests/test_api_owner.py, the actor that owns the workload, with its tests.--owning-actor <actor>names an existing actor of the project instead;initthen writes noroute, so add one (such asroute = "/*") if the workload should answer at the actor’s URL.- A
[workloads.api]table incowboy.toml, which raisesschema_versionto 6.
--runtime is node, python or rust. Without it, init reads it from a package.json, pyproject.toml or Cargo.toml already in workloads/api/. Run a web app or service continues from here.
Add --dry-run to any of these to see the plan without writing files.
What’s in .cowboy/
.cowboy/ holds what the CLI writes as you work. It belongs to your machine, and .gitignore keeps it out of git.
Two things are not in the project:
- Keys.
cowboy wallet createkeeps your key in~/.cowboy/keys/default, outside every project, so it never lands in a repository. - The remembered environment.
init --env,deploy --envandenv userecord the project’s environment in~/.cowboy/config.json, by the project’s path.
offchain.lock, which cowboy build writes at the project root for a project with off-chain functions, pins the base its image builds on. Commit it.
cowboy.toml
The manifestinit writes for an actor project is one line:
schema_version
The CLI reads versions 1 to 7. Each table needs at least the version shown; an older file that uses one is refused with a message naming the version to set:init writes 2, and 6 once the project has a workload.
Actors
Without any[actors] table, each actors/<name>/main.py is an actor named <name>; so is a file actors/<name>.py that defines an Actor subclass. Names are lowercase letters, digits and _, starting with a letter. A project holds at most 64 actors.
Declare an actor when its code lives somewhere else:
[offchain]
Settings for the project’s off-chain functions. An empty table uses the defaults.[web]
Static files for the actor’s website.cowboy deploy publishes the folder to a public storage volume before it deploys the actor, and the actor’s routes serve it. cowboy deploy --web-only republishes the files alone.
[workloads.<name>]
One table per workload.runtime, run and resource_class are required.
[environments]
Per-environment values for a workload’svars. A value here replaces the one with the same name in [workloads.<name>] when you deploy to that environment:
vars is the only key an environment can override.
A complete example
A project with an actor that owns a workload, off-chain functions, and a static site.cowboy check accepts it:
Output
Next steps
Test your actor
cowboy test, SimulatedChain and cowboy runDeploy and operate
Environments, wallets, deploys and keeping an actor funded