This document explains how to deploy smart contracts into a CosmWasm enabled Cosmos SDK-based chain.
It assumes the chain is already existing and running, in the form of a devnet, testnet or mainnet. That is, this document doesn’t deal with the nuances of setting up / deploying a given blockchain, but rather, how to access it to store, instantiate and execute smart contracts.
This document also assumes the chain is permission-less, for simplicity. That is, that no special privileges are needed in order to deploy new smart contracts on the chain.
Finally, we’ll be using the Babylon chain for reference and examples. This can be adapted / extended to other CosmWasm-enabled chains if required.
A blockchain usually comes with a command line client, that it’s usually (but not always) the blockchain binary itself. In the case of Babylon, this utility is called babylond
. As mentioned, it serves both purposes of being the blockchain daemon / server program, and the client program as well.
Clone the repository that contains the blockchain CLI.
Switch to a version tag or commit compatible with the version of the chain you’re are planning to access.
Compile and install the CLI binary.
If needed, modify the PATH
variable so that the CLI program can be found.
Reference / Example Instructions:
Gas fees are required for storing and executing smart contracts.
The way to setup a funded address for the chain may vary, depending on if it’s a devnet, testnet or mainnet.
In the case of devnet or testnet, there’s usually a faucet mechanism, either manual or automatic, to fund your address after creation.
In the case of mainnet, you’ll have to fund your address through a CEX or DEX, by buying tokens of the mainnet chain.
This is out of scope for this document, but you’ll typically create a new address using a wallet, and then use its recovery phrase to import it into your local setup, so that it can be used from the CLI environment.
References: