solvm

command module
v0.8.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2021 License: MIT Imports: 1 Imported by: 0

README

solvm

A simple, WYSIWYG version manager for solc, inspired by nvm and kubectx.

solvm demo

Installation

Build From Source (1337 way to do it)

solvm can be easily built and installed from source. The only requirement is Go 1.16 or higher installed on your machine.

Prerequisite steps:

  1. git clone https://github.com/jalavosus/solvm
Steps (pure Go commands)
  1. cd solvm
  2. go build ./cmd/solvm
  3. (Optional: install to GOBIN) go install ./cmd/solvm
Steps (using make)
  1. cd solvm
  2. make all
Using go install (best way to do it)
  1. go install github.com/jalavosus/solvm@latest
  2. ???
  3. Profit!
Download from Github Releases (not the best way to do it)
  1. Make your way to the Releases page
  2. Find the binary for your operating system
    1. Note: M1 Mac users should download the darwin_arm64 binary
    2. Note 2: I have no proof that this works on Windows.
  3. Download said binary
  4. Copy it to /usr/local/bin: cp [path to downloaded binary] /usr/local/bin

Updating

Just follow the same steps as above.

Usage

Run solvm init to initialize solvm for the first time. If you want to install a specific solc version during initialization, just run solvm init --version [version], with the version flag being a standard semver tag (with or without a leading "v").

By default, solvm stores configuration data and binaries in $HOME/.solvm. If for some reason you'd like to change that, you can do so in one of two ways:

  • Pass the --data-dir flag to solvm. Ex. solvm --data-dir [directory] init [--version version]
  • Set SOLVM_DATA_DIRECTORY in your environment to the directory where you'd like solvm to store its data. This is the preferable way to do it, since typing out --data-dir [directory] every single time you want to run solvm might get tedious.

If you ran solvm init with the --version flag, you'll notice a line of output which looks something like

add the following line (without backticks) to your shell's rc file to ensure that solvm's solc binary is the one used by your shell:
`alias 'solc'='[solvm data directory here]/solvm_solc'`

This is important, as this alias ensures that the core functionality of solvm (quickly and easily switching between solc versions) actually works.

If you initialized solvm without also installing a specific version, make sure to put alias 'solc'='[solvm data directory]/solvm_solc' into your shell's rc file sometime soon. Note that [solvm data directory], if you use the default settings, is $HOME/.solvm.

Super Duper Experimental

If you're using bash or zsh, you can run solvm add-shell-alias to put the above alias declaration into your .bashrc/.zshrc for you.

Please do be careful with that one.

Installing solc versions

Easy as pie: solvm install [version], where [version] is a semver string (with or without a leading "v"), or "latest" to fetch the latest available solc version.

Switching solc versions

Also easy as pie: solvm use [version or alias]. use is also interchangeable with switch. The single positional argument can either be a specific version or an alias you've set for a specific version.

Aliases

Adding an alias: solvm alias [alias] [version] (useful example: solvm alias default 0.7.6)

Removing an alias: solvm alias remove [alias]

Listing all stored aliases: solvm alias list

Getting the current version in use

solvm current

Listing all locally installed solc versions

solvm ls local or solvm ls

Listing available versions

solvm ls remote

TODO

  • Alias listing
  • Uninstalling versions
  • Config reset/nuking
  • Better ls remote output (including color)
  • Support for nightly/prerelease versions
  • Code cleanup (this is perpetual)

Contributing, modification, etc.

Like most of my personal projects, solvm is licensed using the MIT License. This means that you -- ostensibly a living breathing person -- can take my code, do whatever you want to it, repackage it, and redistribute it however you'd like. This is fine, and that's the entire point of the MIT License. However, I would absolutely love if you open up Pull Requests with your changes if you feel like they'd be useful for the project (and/or especially if those changes are bug fixes).

Please report bugs in the issue tracker if you find any, with steps to reproduce and expected vs. actual output and the like.

Hypnotoad

All Glory to the Hypnotoad.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
log

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL