Skip to main content
The Quickstart got hello deployed. To keep an actor running and improve it over time, you need a little more: which network your commands reach, what a deploy does, how an actor pays for its work, and how to ship a change once its code is fixed.

Environments

Every command talks to a network, which the CLI calls an environment. You’ll normally deploy to cloud, the public one. Once you choose an environment, the project remembers it, whether you chose it with cowboy init --env, with cowboy deploy --env, or like this:
Output
env current shows the network, address and key this folder’s commands will use. Networks has more on each one.

Wallets

Your wallet pays for deploys and calls. cowboy wallet create keeps its key in ~/.cowboy/keys/, outside every project. Back that folder up, because whoever has the key controls the wallet and every actor it owns. A new wallet can get a one-time credit with cowboy credit claim, and Billing covers adding more.

Deploy

Output
A deploy starts by building the actor and working out the most it can cost, and it stops there if your wallet can’t cover that. Otherwise, it creates the actor at a new address, runs its init, and makes you its owner. It also asks how much to move from your wallet to the actor, 1 CBY by default. To skip the question, pass --fund <CBY>. If a deploy stops partway, run the same command again to continue. cowboy deploy lists the other flags.

After deploy

Once the actor is live, you can call it and see what it’s doing. Every actor command takes the actor’s name inside the project, or any actor’s address. A call reports that it went through, not what the handler returned.

Keep it funded

An actor that can’t pay stops working, so it helps to know who pays for what. Whoever calls a handler pays that call’s fee. The work the actor starts itself comes out of its own balance: its scheduled runs, its runner jobs and off-chain calls, and the state it stores. You can add money at any time. cowboy actor fund hello --amount 5 moves 5 CBY from your wallet to the actor. If you’d rather not do that by hand, cowboy actor auto-topup set hello --target 0.5 --cap 10 refills the actor to 0.5 CBY about once a day, up to 10 CBY in all. An actor that spends faster can still run short. Your wallet also backs the actor up by default. When the actor’s balance runs short, your wallet covers its messages and the delivery of its job results, with no cap. Scheduled runs still come only from the actor’s balance. cowboy actor owner-funding hello shows the setting, and --off turns it off. The actor also pays rent for the state it stores, and if that stays unpaid for about a month, the state can be removed (CIP-4).

Ship a change

You can’t replace a deployed actor’s code, so shipping a change means deploying a new actor. Edit the actor, run cowboy check and cowboy test, then deploy it with --new:
Output
The new actor gets a new address and fresh state, and hello now points at it. The old actor keeps running, with its own state, balance and schedules. If you leave out --new, a terminal asks first and a script stops. Two things can change without a new actor. cowboy actor update-offchain replaces a project’s off-chain code and keeps the actor’s code, address and state. And deploying a workload again updates it (Run a web app or service).
Once a workload is registered, a deploy won’t change its owning actor or routes. Settle its routes before the first deploy.

List it in the General Store

When the actor is ready for others, submit it on Cloud.

Next