cowboy CLI and uv. Everything up to the deploy runs on your machine and is free.
1. Create the project
Output
2. Write the actor
Replaceactors/pricewatch/main.py with:
self.storageis the actor’s state. It’s still there on the next run, and anyone can read it.- Handlers are the methods the outside world can reach.
@publiclets anyone call one.@callable_by(OWNER)lets only you, the account that deployed the actor.questionandrecordhave no decorator, so only the actor’s own code can call them. @every(HOUR)makestickrun every hour oncestartstarts it. Nobody can calltickdirectly.await runner.http(...)andawait runner.llm(...)ask a runner, one of the machines that does work for actors, to fetch the page and ask the model. The handler pauses and continues when the answer arrives. The actor pays for each job from its own balance.page.datais the parsed JSON. This API refuses requests without aUser-Agent.runtime.emit_eventadds an entry to the actor’s public log.
tick and check_now repeat the same three lines because an await has to sit in the handler itself. A helper method can’t await a job.
A model’s answer is normally text. If its provider fails, the answer is an object with an error key instead of a failed job, so record checks for that.
Actor code can’t open a connection, because every handler must give the same result wherever it runs. That’s why the fetch goes through a runner (Determinism).
3. Test it
Replacetests/test_pricewatch.py with:
Output
SimulatedChain runs the actor in memory. advance_block moves time forward in seconds and runs whatever comes due, and reply answers the job the actor is waiting on, so you can test both jobs without a network or a model. Testing actors covers the rest.
4. Deploy it
An actor can call a model by default, but it needs permission to reach the web, and the permission names the hosts it may reach. Put that inmanifest.json. Step 6 needs the Telegram host, so it’s listed now:
Output
init and makes you the owner. It asks how much to move from your wallet to the actor’s balance, 1 CBY by default.
5. Watch it work
Ask it to check now, then read what it kept:Output
Output
actor state shows last_price and verdict. The model picks the wording, so your result can differ. If verdict stays null, the model provider failed, and actor logs shows price.no_verdict. Now start the schedule:
Output
Output
actor timers shows the next run, one hour away. From now on your laptop plays no part. Each hour adds a price.checked entry to actor logs.
The actor runs for as long as its balance can pay. If it can’t pay for a run, the schedule ends. To keep it going, add money with cowboy actor fund pricewatch --amount 5 and call start again (Keep it funded). To stop it, call stop.
6. Have it message you
This step uses Telegram, but any service with a web API works the same way. Create a Telegram bot with BotFather and note your chat id. An actor’s state is public, so the bot’s token goes in the secret store, where the runner fills it into the request and the actor never sees it. Replaceactors/pricewatch/main.py with this version. It adds the json import, the TELEGRAM_API constant and set_chat, and tick now ends with one more job:
Output
Output
secrets add prints a link where you type it in your browser:
Output
Output
start, the first message arrives.
Next
- Deploy and operate covers funding, updates and what a deploy spends.
- Call models, the web and tools covers failures and deadlines.
- Sell an actor lists what you built in the General Store.