How to Use the Tornado-CLI Command Line Tool

by Doris.M,translated by John

If you encounter issues accessing the Tornado web version, you can try using the Tornado CLI version (command line).

Currently, there are two versions available:

I have tried all two versions, and only the Theo version works for me.

How to Install Tornado CLI:

(❗️❗️The following steps use the Theo version on Windows 10 as an example!)

🟢 Step 1: Download the Tornado CLI Source Code

Open the Theo Maintained Version link: https://git.tornado.ws/tornadocash/tornado-cli

Download the CLI source code package.

After downloading, you’ll have the tornado-cli-master.zip source code package. Place it anywhere, preferably in a dedicated folder for easier management (e.g., create a tornado folder in drive D).

Extract tornado-cli-master.zip to the tornado folder, resulting in a folder named tornado-cli.

Extract the CLI installation package.

🟢 Step 2: Install Node.js Runtime Environment

Open the Node.js official website:

https://nodejs.org/

Download the Node.js installer: node-v20.17.0-x64.msi.

Run the installer and proceed with the default “Next” options until completed.

Check the Node.js installation by verifying the version:Open the tornado-cli extracted directory (e.g., D:\tornado\tornado-cli).

Open Windows PowerShell as an administrator from the “File” menu.

open Windows PowerShell

In the terminal, type node -v and press Enter. If the version number (v20.17.0) appears, the installation was successful.

Similarly, check the npm version by typing npm -v. Ensure it is at least version 10.5.0. Lower versions may not work properly.

Check Node.js version

🟢 Step 3: Install Tornado CLI Dependencies

In the same PowerShell window, type npm install and press Enter.

This will begin downloading the required dependency libraries for Tornado CLI (❗️❗️It may take some time; do not close the window).

Download CLI dependencies

If you see “Error” messages during the process, repeat the npm install command until it completes without errors.

Download CLI dependencies

Note: If the dependency download is slow or fails, you can set the npm registry to a local mirror by running:

npm config set registry https://registry.npmmirror.com

Then Run npm install again.

🟢 Step 4: Use Tornado CLI for Deposits and Withdrawals

Deposit Command Format (using BSC network as an example):

node cli.js deposit <currency> <amount> --rpc <rpc url> --tor <torPort> --private-key <private key>

Parameter Details:

  • : The cryptocurrency (e.g., eth, bnb).

  • : Deposit amount (e.g., 0.1, 1, 10, 100).

  • : RPC URL (e.g., https://bscrpc.com/).

  • : Proxy port (optional; omit if not using a proxy).

  • : Your wallet’s private key (without the 0x prefix).

Example: To deposit 0.1 bnb:

node cli.js deposit bnb 0.1 --rpc https://tornadocash-rpc.com/mainnet --private-key <your-wallet-private-key>

If using a proxy, add --tor at the end.

deposit

Withdrawal Command Format (using BSC network as an example):

node cli.js withdraw <note> <recipient> --rpc <rpc url> --relayer <relayer url> --tor <torPort>

Parameter Details:

  • : Deposit note (e.g., tornado-bnb-0.1-56-0x1111111111111).

  • : Recipient wallet address (e.g., 0x176F3DAb24a159341c0509bB36B833E7fdd0a132).

  • : RPC URL (e.g., https://bscrpc.com/).

  • : Relayer URL (e.g., https://bsc.gm777.xyz/).

  • : Proxy port (optional; omit if not using a proxy).

Example: To withdraw 0.1 bnb:

node cli.js withdraw tornado-bnb-0.1-56-0x1111111111111 <recipient-address> --rpc https://tornadocash-rpc.com/mainnet --relayer https://bsc.gm777.xyz/

If using a proxy, add --tor at the end.

Withdrawal (Synchronizing Deposit Events)

When executing the withdrawal command, the tool will first synchronize the historical deposit event logs up to the latest block (❗️❗️ This may take some time, so please be patient).

You can also pre-synchronize the deposit events using a dedicated command and complete the synchronization before running the withdrawal command.

Synchronization Commands

For example, to sync events for 100 BNB and 10 BNB on the BSC network (each amount must be synchronized separately):

node cli.js syncEvents deposit bnb 100 --rpc https://bscrpc.com
node cli.js syncEvents deposit bnb 10 --rpc https://bscrpc.com

❤️ Note:For Ethereum, replace bnb with eth in the command and use an Ethereum RPC URL.

After Synchronization

Once the deposit events are retrieved, you'll see the prompt:Computing deposit events merkle tree and its root

The speed of this process depends on your computer's CPU performance. Be patient while it completes.

After computing, the prompt will ask:Confirm the transaction [Y/n]Type Y and press Enter to finalize the withdrawal.

If Errors Occur

  • If you encounter errors, repeat the command or try using a different RPC URL.

🚨 Common Errors and Solutions:

  1. Request timeout or connection error: Try a different RPC or register new ones at:

    https://blockpi.io/

    https://1rpc.io/

    https://meganode.nodereal.io/

    https://getblock.io/

  2. Contract address not allowed: Switch to another RPC.

  3. Merkle tree is corrupted: Replace the local deposit event files from the original source and sync again.

  4. Block not found: Switch RPCs and try again.

  5. The note is already spent: Indicates the deposit has already been withdrawn.

  6. The deposit is not found in the tree: Ensure deposit events are fully synced or verify the note is correct.

❤️ If this guide helped you, consider buying me(@DorisMM) a drink! 😘

💹 Wallet Address (any chain): 0x089c03c1601543a405362176ff055C8AB41D65d4

Mirror文章信息

Mirror原文:查看原文

作者地址:0xac295671C427cbe1bFd54d9910B11382E19cbd4a

内容类型:application/json

应用名称:MirrorXYZ

内容摘要:sG5BiH11IuEZQZqnZJ_eN2ePMHnvU20YpsBQ0Uejnzw

原始内容摘要:SGIFLQLs-HBY7Q1B-CfLtCTdLN8qmzQa9SEpyDd4JH8

区块高度:1568397

发布时间:2024-12-15 06:13:48