Bringing interchain liquid staking to Cosmos
The easiest way to develop cosmos-sdk applications is by using the ignite cli to scaffold code. Ignite (developed by the core cosmos team at Tendermint) makes it possible to scaffold new chains, run relayers, build cosmos related proto files, add messages/queries, add new data structures and more. The drawback of creating thousands of lines of code using ignite is that it is difficult to discern which changes were made by the ignite cli and which changes were made manually by developers. To make it easier to review code written using ignite and to make it easier to retrace our steps if something breaks later, add a commit for each ignite command directly after executing it.
For example, adding a new message type and updating the logic of that message would be two commits.
// add the new data type
>>> ignite scaffold list loan amount fee collateral deadline state borrower lender
>>> git add . && git commit -m 'ignite scaffold list loan amount fee collateral deadline state borrower lender'
// make some updates to the keeper method in your code editor
>>> git add . && git commit -m 'update loan list keeper method'
An example of a PR using this strategy can be found here. Notice, it's easy to differentiate between changes made by ignite and those made manually by reviewing commits. For example, in commit fd3e254bc0, it's easy to see that a few lines were changes manually even though nearly ~300k LOC were scaffolded.
Opening a PR will automatically create Summary and Test plan fields in the PR description. In the summary, add a high-level summary of what the change entails and the ignite commands run. Summary Updating some code. Test plan Add test plan here.
stride is a blockchain built using Cosmos SDK and Tendermint and created with Starport.
starport chain serve
serve
command installs dependencies, builds, initializes, and starts your blockchain in development.
Your blockchain in development can be configured with config.yml
. To learn more, see the Starport docs.
Starport has scaffolded a Vue.js-based web app in the vue
directory. Run the following commands to install dependencies and start the app:
cd vue
npm install
npm run serve
The frontend app is built using the @starport/vue
and @starport/vuex
packages. For details, see the monorepo for Starport front-end development.
To release a new version of your blockchain, create and push a new tag with v
prefix. A new draft release with the configured targets will be created.
git tag v0.1
git push origin v0.1
After a draft release is created, make your final changes from the release page and publish it.
To install the latest version of your blockchain node's binary, execute the following command on your machine:
curl https://get.starport.com/Stride-Labs/stride@latest! | sudo bash
Stride-Labs/stride
should match the username
and repo_name
of the Github repository to which the source code was pushed. Learn more about the install process.
Please run make init
to build and serve 3 Stride nodes, 3 Gaia nodes, and 1 Hermes relayer on docker images.
You can run make init build=stride
(the default option) to
- Run
ignite chain build
to build the Stride binary - Rebuild Stride, using cache when possible
- Spin up the 7 docker containers and start all processes
Alternatively, you can run make init build=strideall
to re-build the docker image from scratch.
If you want to re-build all images, you can run make init build=base
to:
- Run
ignite chain build
to build the Stride binary - Rebuild Stride, Gaia, Hermes and ICQ docker images, using cache when possible
- Spin up the 7 docker containers and start all processes
Alternatively, you can run make init build=all
to
- Run
ignite chain build
to build the Stride binary - Fully rebuild Stride, Gaia, Hermes and ICQ docker images, ignoring the cache
- Spin up the 7 docker containers and start all processes
Or, if you just want to re-serve, run make init build=none
to
- Use existing Stride binary
- Use existing docker images
- Spin up the 7 docker containers and start all processes
Proceed with lower-level building at your own discretion. Only make init
is well-supported.
You can run sh scripts/init.sh
to achieve the same output as the above. The following flags are supported
-b
This will runignite chain build
-d
This will re-build all docker images, using cache-f
This will re-build all docker images, ignoring cache.-s
This will re-build Stride's docker images, using cache.-a
This will re-build Stride's docker images, ignoring cache.
At the end, all 7 docker images will be served.
To run the full test suite, run make init
, then sh scripts/tests/run_all_tests.sh
.
If bats testing subdirectories are not populated, run git submodule update --init
.