- Install required packages and Rust:
apt update && apt install -y git curl build-essential pkg-config libssl-dev
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
These commands should be run with sudo if necessary, depending on the execution environment.
- Clone the repository in arbitrary directory and install the CLI:
git clone https://github.com/internetMaximalism/intmax2-mining-cli.git
cd intmax2-mining-cli
cargo install --path .
- Run the CLI:
cd intmax2-mining-cli
mining-cli --version
- Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- Follow steps 2 and 3 from the Linux/WSL instructions.
To update the v1-mining-cli to the latest version:
- Navigate to the repository directory and pull the latest changes:
cd path/to/intmax2-mining-cli
git pull origin main
- Rebuild and reinstall the CLI:
cargo install --path .
- Restart the mining-cli if it's currently running.
The CLI can be operated interactively or run automatically by setting environment variables. Below is a list of environment variables required by the CLI. Users utilizing the interactive mode do not need to set these environment variables.
Name | Description | Example | Default Value |
---|---|---|---|
RPC_URL |
Blockchain RPC URL. Alchemy's RPC is strongly recommended. Required. | https://eth-mainnet.alchemyapi.io/v2/YOUR-API-KEY |
None |
NETWORK |
The network to connect to. Takes values "mainnet" or "holesky". | "mainnet" |
"holesky" |
MAX_GAS_PRICE |
Maximum gas price in GWei allowed when executing transactions. | 30 |
"30" (mainnet), "200" (testnet) |
MINING_UNIT |
Amount of ETH per mining operation. | "0.1" or "1" |
"0.1" |
MINING_TIMES |
Number of mining operations (sets of deposit and withdrawal). | "10" or "100" |
"10" |
WITHDRAWAL_ADDRESS |
Withdrawal address. | "0x456..." |
None |
WITHDRAWAL_PRIVATE_KEY |
Private key of withdrawal address. Required when ENCRYPT is false . |
"0x789..." |
None |
ENCRYPTED_WITHDRAWAL_PRIVATE_KEY |
Encrypted form of withdrawal private key. Required when ENCRYPT is true . |
"e356.." |
None |
ENCRYPT |
Flag to specify whether to encrypt and store deposit private keys and withdrawal private key. Takes values "true" or "false". | "true" or "false" |
"true" |
-
mining-cli mining
- Performs mining by repeatedly executing deposits and withdrawals.
-
mining-cli claim
- Claims available ITX tokens.
-
mining-cli exit
- Withdraws all balances currently in the simplified intmax2 and cancels pending deposits.
-
mining-cli export
- Exports the all deposit private keys.