Inspiration

I'm very new to Cosmos SDK and Starport, and I experimented with different tutorials. Every tutorial used a different Starport version, and also, for the hackatom, I was using the latest version of Starport, which was different from the previous ones.

I was struggling to keep up with the different versions!

In the past, I have used asdf to solve these problems, and I have decided to create a plugin for asdf for Starport to simplify my life.

What is asdf?

asdf is a CLI tool that can manage multiple language runtime versions on a per-project basis. It is like gvm, nvm, rbenv & pyenv (and more) all in one! Simply install your language's plugin!

🎭 Read the ballad of asdf here

What it does

The plugin I have developed for asdf allows to install and switch between different Starport versions quickly.

To install asdf, please refer to this guide

# Add the plugin to asdf
asdf plugin add starport

# Show all installable versions
asdf list-all starport

# Install the latest version
asdf install starport latest

Set a version

asdf performs a version lookup of a tool in all .tool-versions files from the current working directory up to the $HOME directory. The lookup occurs just in time when you execute a tool that asdf manages.

TL;DR keep a .tool-version in your folder with starport <VERSION> to quickly switch to that specific version of Starport

Global

Global defaults are managed in $HOME/.tool-versions. Set a global version with:

asdf global starport latest

$HOME/.tool-versions will then look like:

starport 0.18.6

Local

Local versions are defined in the $PWD/.tool-versions file (your current working directory). Usually, this will be the Git repository for a project. When in your desired directory, execute:

asdf local starport 0.18.0

$PWD/.tool-versions will then look like:

starport 0.18.0

How we built it

asdf comes with an extensible plugin system.

I have created a plugin for asdf following the requested process in this repository and merged it in the official asdf-plugin repository.

Accomplishments that we're proud of

The PR I made to the asdf-plugin repository it's already merged, and anyone can use this plugin immediately!

Go asdf! :tada:

What we learned

Cosmos SDK and Starport are amazing, and they are actively maintained. It could be challenging to keep up with the pace.

Configuration of Cosmos SDK and Starport shouldn't be intimidating (especially to beginners).

I hope that this contribution will save some headaches for everyone using it.

What's next for asdf-starport

I will keep the plugin updated to ensure that it's usable by the community.

Built With

  • asdf
Share this project:

Updates