Skip to main content

Install the Chromia CLI

This topic contains instructions to install and update the Chromia CLI.

Prerequisite

Install

Before you install the Chromia CLI, make sure that you have installed the Java Development Kit (open JDK) and have at least Java 11. For more information, see JDK Installation Guide.

You can download and install the latest Chromia CLI from here or via a package manager:

brew tap chromia/core https://gitlab.com/chromaway/core-tools/homebrew-chromia.git
brew install chr

Update

You can download and install the latest Chromia CLI from here, or if you have installed the Chromia CLI via a package manager, you can update it with:

brew update
brew upgrade chr

Docker

You can use Docker to run a standalone Linux container with the Chromia CLI pre-installed. Make sure that you have set up the PostgreSQL database.

To use the published Docker images, you first need to have Docker installed and configured on your host machine. Please refer to the Docker documentation on how to install Docker on Windows, Mac, and Linux.

Start the Docker container with Chromia CLI pre-installed

To run the latest version of the Chromia CLI, use the docker run command and specify the CLI docker image name and chr.

docker run --rm -v $(pwd):/usr/app registry.gitlab.com/chromaway/core-tools/chromia-cli/chr:0.4.0 chr

You see the following prompt in the terminal:

Usage: chr [OPTIONS] COMMAND [ARGS]...

Options:
--version Show the version and exit
-h, --help Show this message and exit

Commands:
init Generates a template project
test Run tests in working directory
repl Run rell commands in shell
node Interract with a test node
deploy Deploy blockchain into container
build Build an application and create a blockchain configuration
query Make a query towards a running node
tx Make a transaction
keygen Generates public/private key pair

For information about updating or uninstalling the Docker image, see the Docker command line reference.