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.
If you familiar with git, cmd and so on, click here
- Install git, if not already installed
- Install latest nvm here
- Open cmd as administrator
git clone https://git.tornado.ws/tornadocash/tornado-cli
nvm install 14.21.3
- Install node-gyp dependencies [Optional]
npm install
Use according to docs.
Step 1: Install NVM
To install NodeJS 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 (extract) .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
If it responds with a version and help page (like on picture below), 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.21.3
nvm use 14.21.3
If both have successfully worked try to test if node and npm is installed by typing.
node -v
It should return version v14.21.3
.
If it shows error message, like node is not recognized
, just reopen console (Terminal / Powershell) as administrator.
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 command: cd <path-to-cli>
Replace <path-to-cli>
with real path: copy it from system explorer into the “Terminal” or “Powershell” window, and press enter. If successful the folder name should show on the left side, check example on the GIF below.
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. Don’t pay attention if it says about warnings or vulnerabilities, it is normal behaviour:
If npm install failed (really, don't do this for no reason)
Download node-gyp compiler and its dependecies
Run on opened Powershell or Terminal window: npm i -g node-gyp
Windows
Install latest Python from official site (just click big download button).
Install latest Visual Studio Build Tools: open this link and download will start automatically. When file named vs_BuildTools.exe
is uploaded, just run it and follow instructions in corresponding window, select `.
Linux
Open terminal and run: sudo apt-get install -y build-essentials
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.
Quick withdrawal guide
Prepare your private note and address to which you will withdraw.
Open Powershell or Terminal in CLI directory (you already know how to do it) and run following command: node cli.js withdraw <your note> <your address> --relayer <relayer link>
OR
node cli.js withdraw <your note> <your address> --private-key <private key>
For example: node cli.js withdraw tornado-eth-0.1-5-0xf73dd6833ccbcc046c44228c8e2aa312bf49e08389dadc7c65e6a73239867b7ef49c705c4db227e2fadd8489a494b6880bdcb6016047e019d1abec1c7652 0x8589427373D6D84E98730D7795D8f6f8731FDA16 --relayer https://goerli-relay.example.org
If there is no active relayers on chain or you want to withdraw using private key, first make sure that:
- Private key is from wallet to which you withdraw funds
- You have enough base chain currency on your wallet to cover the withdrawal fee
When events cache fetching is finished and SNARK withdrawal proof generated, you will see confirmation prompt:
If you are satisfied with gas fee and relayer fee, type Y
and press “Enter”.
After sending withdrawal transaction to the blockchain, a link to the transaction in block explorer will appear in console (Terminal/Powershell):
Notes
If you don’t like default RPC from config.js
, you can find RPC endpoints on chainlist.org or check recommended RPC links in README
Written by xGozzy, edited & updated by Theo.