Skip to content

java-tron gRPC API

A java-tron node exposes its API over gRPC. This directory lists short reference docs for 82 commonly used gRPC methods, organized by topic.

Services and default ports

Service Default port Description Source
protocol.Wallet 50051 FullNode full-feature service (includes write transactions) framework/src/main/java/org/tron/core/services/RpcApiService.java
protocol.WalletSolidity on a FullNode 50061 Read-only solidified view, available when node.rpc.solidityEnable is enabled framework/src/main/java/org/tron/core/services/interfaceOnSolidity/RpcApiServiceOnSolidity.java
protocol.WalletSolidity on a standalone SolidityNode 50051 Read-only service on the node's main gRPC port framework/src/main/java/org/tron/core/services/RpcApiService.java

The main gRPC port is configured by node.rpc.port (default 50051). A FullNode's additional solidified view uses node.rpc.solidityPort (default 50061) when enabled; a standalone SolidityNode serves WalletSolidity on node.rpc.port. See Node Configuration.

The proto definition lives in protocol/src/main/protos/api/api.proto.

Calling

gRPC identifies Wallet and WalletSolidity by their protobuf service names. The port depends on the node mode and configuration:

# Wallet
grpc://<host>:50051   protocol.Wallet/<Method>

# WalletSolidity on a FullNode (read-only; node.rpc.solidityEnable=true)
grpc://<host>:50061   protocol.WalletSolidity/<Method>

# WalletSolidity on a standalone SolidityNode (read-only)
grpc://<host>:50051   protocol.WalletSolidity/<Method>

Each method doc contains:

  • The method name (top-level heading, PascalCase, identical to the proto)
  • A short description
  • Service support (Wallet / WalletSolidity / both)
  • The matching protobuf signature

Account

Method Description
GetAccount Look up an account by address
GetAccountBalance Query an account's balance at a specific block
GetAccountNet Query an account's bandwidth resource
GetAccountResource Query an account's bandwidth + energy + TronPower
CreateAccount2 Build an account-creation transaction; execution incurs an additional account-creation fee set by getCreateNewAccountFeeInSystemContract (currently 1,000,000 sun, or 1 TRX, on Mainnet).
UpdateAccount2 Update the account name
AccountPermissionUpdate Configure multi-sig permissions

Block / transaction query

Method Description
GetNowBlock2 The latest block
GetBlock Generic block lookup (by num/hash)
GetBlockByNum2 Look up a block by height
GetBlockById Look up a block by hash
GetBlockByLimitNext2 Look up a range of blocks
GetBlockByLatestNum2 Get the most recent N blocks
GetBlockBalanceTrace Query account balance changes within a block
GetTransactionCountByBlockNum Number of transactions in a block
GetTransactionById Look up a transaction by txID
GetTransactionInfoById Look up a transaction's receipt by txID
GetTransactionInfoByBlockNum Look up transaction receipts by block
GetPendingSize Pending pool size
GetTransactionFromPending Look up a single pending transaction
GetTransactionListFromPending All pending transaction IDs

Transaction build / broadcast

Method Description
CreateTransaction2 Build a TRX transfer transaction
GetTransactionSignWeight Query the current accumulated multi-sig weight
GetTransactionApprovedList List signing addresses after all signatures pass validation
BroadcastTransaction Broadcast a signed protobuf Transaction

TRC-10 asset

Method Description
CreateAssetIssue2 Issue a TRC-10 token
UpdateAsset2 Update a TRC-10's description / URL / bandwidth limit
TransferAsset2 Transfer TRC-10
ParticipateAssetIssue2 Participate in a TRC-10 sale
UnfreezeAsset2 Unfreeze TRC-10 locked by the issuer
GetAssetIssueById Look up TRC-10 by id (recommended)
GetAssetIssueByName Look up TRC-10 by name (errors on duplicate names)
GetAssetIssueListByName List TRC-10s sharing a given name
GetAssetIssueByAccount TRC-10s issued by an account
GetAssetIssueList All TRC-10s on chain
GetPaginatedAssetIssueList Paginated TRC-10 list

Smart contract

Method Description
DeployContract Deploy a contract
TriggerContract Trigger a contract (write)
TriggerConstantContract Read-only contract call
EstimateEnergy Estimate the energy cost of a call
GetContract Query contract metadata
GetContractInfo Query a contract's full runtime info
ClearContractABI Clear a contract's ABI
UpdateSetting Update the user-energy percentage
UpdateEnergyLimit Update the deployer energy limit

Witness / governance

Method Description
CreateWitness2 Apply to become an SR candidate
UpdateWitness2 Update an SR's URL
ListWitnesses List all SR candidates
GetPaginatedNowWitnessList Paginated SR list
VoteWitnessAccount2 Vote for SRs
GetBrokerageInfo An SR's current brokerage rate
UpdateBrokerage An SR updates its brokerage
GetRewardInfo Query an account's total claimable rewards in sun.
WithdrawBalance2 Withdraw block-production rewards / voter rewards
ProposalCreate Create a chain-parameter proposal
ProposalApprove An SR votes on a proposal
ProposalDelete Cancel a proposal you created
ListProposals List proposals
GetProposalById Look up a proposal by ID
GetPaginatedProposalList Paginated proposal list
GetChainParameters Current values of all chain parameters
GetNextMaintenanceTime Time of the next maintenance period

Stake 1.0 (unfreeze and query only)

After proposal #70 UNFREEZE_DELAY_DAYS was passed (mainnet has activated it), new V1 freeze requests are rejected on chain; the unfreeze and query methods remain so legacy positions can still be wound down.

The trailing 2 in file names (e.g. FreezeBalance2) is a historical proto naming suffix (the V1 method that returns TransactionExtention) and is not the same method as Stake 2.0's FreezeBalanceV2.

Method Description
FreezeBalance2 Freeze TRX for resources (V1, chain rejects new requests)
UnfreezeBalance2 Unfreeze matured resources (V1, still usable for legacy unfreezing)
GetDelegatedResource Look up delegation records (V1, read-only)
GetDelegatedResourceAccountIndex Look up delegation counterparty addresses (V1, read-only)

Stake 2.0

Method Description
FreezeBalanceV2 Freeze TRX for resources
UnfreezeBalanceV2 Initiate an unfreeze; the waiting period is set by UNFREEZE_DELAY_DAYS (currently 14 days on Mainnet).
WithdrawExpireUnfreeze Withdraw matured unfreeze
CancelAllUnfreezeV2 Cancel all unmatured unfreezes
DelegateResource Delegate resources to another account
UnDelegateResource Undelegate resources
GetDelegatedResourceV2 Look up delegation records
GetDelegatedResourceAccountIndexV2 Look up delegation counterparty addresses
GetCanDelegatedMaxSize Current maximum delegatable amount
GetAvailableUnfreezeCount Remaining unfreeze slots
GetCanWithdrawUnfreezeAmount Withdrawable amount at a given timestamp

Node / pricing / tools

Method Description
GetNodeInfo Node status
ListNodes Known peer nodes
GetEnergyPrices Historical energy unit prices
GetBandwidthPrices Historical bandwidth unit prices
GetBurnTrx Cumulative burned TRX