In this section, you will start building a blockchain to play the checkers game. You will build it natively with Cosmos SDK v0.50. At least, you will build some initial elements.
This section uses the following repositories:
- A minimal Cosmos v0.50 app with no extra modules, found here (opens new window).
- A minimal v0.50 module example, found here (opens new window).
Version 0.50 of the Cosmos SDK was created, in part, with a view to facilitate module integration. This section seeks to demonstrate that. In particular, you will keep your checkers module separate from the (minimal) app.
Before you can start building, you need to prepare your computer. The simplest way is to rely on Docker (opens new window), as the Cosmos team has prepared a Docker image for developers (opens new window) built via this Dockerfile (opens new window). If you need a refresher on Docker, head here.
You will also need to have
make (opens new window) on your computer.
# The minimal app
Since you are building off the minimal app, clone it locally:
You can already confirm that it compiles and runs correctly. You need Go version 1.21. To compile it, run:
Make use of
scripts/init.sh to set it up with test values:
You should see the familiar log:
In another shell, you can confirm the list of modules that are included:
This confirms that your minimal chain is working as expected. You can stop it with CTRL-C.
# The module example
Since you are going to copy a (small) number of files from the module example, it is convenient to have a local copy somewhere:
Moreover, your checkers module is going to be named
github.com/alice/checkers, so to make your file copying even easier you can use the provided renaming script:
The updated files will come in handy when you want to copy-paste them.
rename.sh files self-removes when the process is complete. If an error happens, you may have to reset hard with Git before retrying:
This assumes that you have no other uncommitted changes that are worth keeping.
If you get something like:
Note that the
\r points to line endings. Try changing the script's line endings from Windows to Unix/Linux style, or vice-versa.
# Up next
With the minimal chain and a copy of the minimal module, it is time to build your own module.