Skip to content

Latest commit

 

History

History
128 lines (89 loc) · 5.79 KB

File metadata and controls

128 lines (89 loc) · 5.79 KB

wallet-cli — Java implementation

The original, full-featured implementation of wallet-cli: an interactive prompt (REPL) covering the complete TRON feature surface — managing accounts and keystores, TRX / TRC10 / TRC20 transfers, staking resources, voting for super representatives, deploying and calling smart contracts, Ledger hardware signing, and GasFree gas-less transfers. All gRPC calls run on the Trident SDK.

For what wallet-cli is and how this compares to the scriptable, JSON-first TypeScript implementation, see the repository overview.

Quick links: Setup · Quickstart · Commands · Understanding TRON mechanics · Configuration

Need help? Join the Telegram developer group.

Setup

Download

git clone https://github.com/tronprotocol/wallet-cli.git

Configuration

A minimal config.conf only needs a network type and a full node to talk to:

net {
  type = mainnet
}

fullnode = {
  ip.list = [
    "fullnode ip : port"
  ]
}

You can also switch networks at runtime with the SwitchNetwork command, so editing config.conf is only needed for a custom node or advanced features. The full annotated config — optional Solidity node, Ledger debug, account lock, GasFree, TronGrid API key, TronLink multi-sig, and record limits — and a field-by-field reference are in docs/reference/config.md.

Build and run

  • Connect to fullNode — see java-tron deployment. Run a fullNode on either your local PC or a remote server.

  • Compile and run:

    $ cd wallet-cli
    $ ./gradlew build
    $ cd build/libs
    $ java -jar wallet-cli.jar

wallet-cli connects to java-tron via the gRPC protocol, which can be deployed locally or remotely. Configure the java-tron node IP and port in src/main/resources/config.conf, or use SwitchNetwork to switch among mainnet, testnets (Nile and Shasta), and custom networks.

Quickstart

Build, create an account, and send your first transfer — all from the interactive prompt:

# 1. Build
$ git clone https://github.com/tronprotocol/wallet-cli.git
$ cd wallet-cli && ./gradlew build && cd build/libs

# 2. Start the interactive wallet
$ java -jar wallet-cli.jar

# 3. In the wallet prompt: create an account (or ImportWallet), unlock, and inspect it
> RegisterWallet 123456      # create a keystore with password 123456
> Login                      # unlock the account
> GetAddress                 # show your address
> GetBalance                 # TRX balance

# 4. Send 1 TRX (amounts are in SUN; 1 TRX = 1,000,000 SUN)
> SendCoin <toAddress> 1000000

On mainnet these commands move real funds. While learning, switch to a testnet with SwitchNetwork (Nile or Shasta) and top up from that network's faucet.

The full first-run walkthrough is in the getting-started guide; for a worked end-to-end session, see the command-line operation flow. All guides are indexed in docs/guide/.

Commands

Every command is documented on a family page under docs/commands/. The command index has the full A–Z list linking each command to its section; in the wallet, typing any command shows its built-in usage tips.

Wallets & accounts

Area Page
Create / import / export / back up wallets, sub-accounts, login, lock, switch wallet
Account queries, metadata, backup & transaction records, receive QR account
Switch / show network network

Transfers & tokens

Area Page
USDT / TRC20 balance & transfers, address book usdt
Issue / update / transfer / query TRC10 tokens transfer-trc10

Staking & resources

Area Page
FreezeV2 staking, delegation, unbonding (Stake 2.0) stake-v2
Legacy freeze / unfreeze / delegation (Stake 1.0) stake-v1-legacy
Resource unit prices & memo fee resources

Voting, rewards & governance

Area Page
Vote for SRs, brokerage & rewards, witnesses vote-reward
Governance proposals proposals
On-chain exchange (Bancor) exchange
TRON-DEX order market dex
Multi-signature: permissions, co-signing, TronLink multi-sign multisig

Contracts, GasFree & chain data

Area Page
Deploy, trigger, and inspect smart contracts contract
GasFree gas-less TRC20 transfers gasfree
Transactions, blocks, chain parameters, encoding utilities chain-data

Understanding TRON mechanics

These are worth understanding up front to avoid surprises (all indexed in docs/concepts/):