In the last blog, we introduced CosmWasm and Cosmos SDK. In this blog we will set up the required tools. Which are -
Starport is an interface to the Cosmos SDK which lets you build networks with simple CLI commands.
You can use Starport in your browser, but it's not recommended for this article since we will be going back and forth with the code quite a bit.
If you're on Windows, try using WSL2.
Install the following tools-
GoLang is pretty easy to install, but make sure your version is up to date!
From here, you now need to add this to the path.
If you thought this was easy, wait till you install NodeJS.
Finally, to install protocol buffer compiler, run
You would need to install Rust.
Once installed, run the following to check
Let's now go ahead and install Starport.
If that didn't work for you, you can also install it manuall using make
on the Git repo and adding it into the path after solving all the errors.
Wasmd is a binary for a network that has CosmWasm enabled. When you run up a new Starport chain using starport app <repo link>
, it does not have CosmWasm enabled by default. We will learn it towards the end, in Preparing to deploy your contracts.
Instead of setting up a local WasmD node, you can also use the musselnet testnet. More on that in the next section.
Now that we have everything needed, let's go ahead and install wasmd
.
Please note that 0.14.0 is the latest release. Head over to the repo to figure out the latest release during the time of your reading.
Now let's check if we have installed wasmd
correctly.
Finally, we need to prepare our local environment to make sure wasmd
runs smooth.
Here we have configured a home directory, added a minimum gas price, added a genesis account for the genesis transaction, validated it and started the Blockchain node.
With all that done, you now have set up your environment for running Smart Contracts on a CosmWasm-enabled chain. For now, we will use Wasmd, but then shift to our own Starport network.
For using musselnet, you'll need the following:
ufrites
(for becoming a validator) and umayo
.We will also need to set up CLI.
We also need to set up Node REPL.
According to the documentations, this is out of date.
Add the keys fred, bob and thief.
Add some tokens into your wallet.
Testing out the REPL (Don't worry too much about this - yet)
And we should be done! We will start with the development next article onwards!