CLI tool tutorial

This is a guide on how to use the command line interface (CLI) tool to interact with Classic, in the case where the frontend application is inaccessible or if there is no working working RPC endpoints that work because of being subject to rate-limiting. This document is meant for individuals with little technical knowledge.

Step 1: Install NVM

To install nvm easily and manage the different versions will use an open source implementation called Node Version Manager (NVM)

Windows

Visit the releases page of the nvm-windows repository and download the latest publication of the program, as highlighted below.

For this part you’ll need to be able to open .zip files, most operating systems allow this. Open the location where the file was downloaded to and open the file. It should create a folder in the same location with the resulting files, inside there should be an .exe file open it to start the installation.

After finishing the installation go to your taskbar on the bottom left where the Windows logo is and search for “Powershell”, right click and select “Run as administrator”. Once it opens type in

nvm -v

If it responds with a version if it has you have successfully installed NVM.

Linux

On Linux operating systems it is very easy to install NVM, open your “Terminal” application found by using the search function. Enter one of the following commands.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

OR

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

Once it finishes installing type in

nvm -v

If it responds with a version if it has you have successfully installed NVM.

Step 2: Install NodeJS

Now you need to install NodeJS using NVM, the CLI tool requires version 14 or less to work.

nvm install 14
nvm use 14

If both have successfully worked try to test if node and npm is installed by typing.

node -v

It should return version v14.X.X (where X = numbers) for node if successfully installed.

Step 3: Download CLI tool

Visit the tornado-cli repository page and download the latest publication of the program, as highlighted below.

Open the location where the file was downloaded to and open the file. It should create a folder in the same location with the resulting files, reopen “Terminal” or “Powershell” as described previously (Make sure to “Run as administrator” if using Windows)

Type the following for either operating system:

  • Windows: diră…¤
  • Linux: cdă…¤

Then from the location where the file was downloaded to drag it into the “Terminal” or “Powershell” window, and press enter. If successful the folder name should show on the left side. Final step install the packages.

npm install

If everything installed ok, you are ready to use the CLI tool. If you got an error related to “permissions” on Linux use sudo before npm and on Windows reopen Powershell as Administrator.

Step 4: Use CLI tool

From here you can follow the instructions on the offical repo to use the CLI for withdrawing or depositing from the same window in the previous step.

Notes

If you’re trying to withdraw without a relayer and are editing the “.env.example” file to do a withdrawal from a private key be sure that the file is saved without any extension, if it is saved as something like “.env.txt” this will not work it needs to be named “.env”

If you are looking for RPC endpoints to use see chainlist.org for options

2 Likes