CosmWasm Quickstart
The fastest path from nothing to a deployed contract on Osmosis. Each step links to the page with the full detail; this page is the ordered happy path.
1. Install Beaker
Beaker is the recommended scaffolding and deployment tool. It is a Rust toolchain binary, installed with cargo:
cargo install -f beaker
2. Scaffold a project
Create a new workspace and add a contract to it:
beaker new my-dapp
cd my-dapp
beaker wasm new counter
This gives you a cargo workspace with a contract, an interactive console, and a sample frontend wired up. See Beaker for the project layout and configuration.
3. Build and test locally
Build the contract and develop against a local chain. Spin up LocalOsmosis:
make localnet-start # from a checkout of the osmosis repo
Then build and deploy your contract to it with Beaker:
beaker wasm build --no-wasm-opt
beaker wasm deploy counter --signer-account test1 --no-wasm-opt --raw '{ "count": 0 }'
deploy stores the code and instantiates it in one step. See CosmWasm & LocalOsmosis for the local accounts and full workflow.
4. Deploy to testnet
When the contract works locally, deploy to a public testnet, either with Beaker (see CosmWasm & Beaker) or with osmosisd directly (see testnet deployment). Storing code on a network where governance gates it goes through a governance proposal.
Next steps
- Script and test across environments with cw-orchestrator.
- Verify your deployed contract reproducibly: Verifying Smart Contracts.
- Call the contract from an app: the JavaScript guide, or build a full frontend with Frontend & SDKs.