{"id":18966889,"url":"https://github.com/tronprotocol/java-http-client","last_synced_at":"2025-09-12T15:53:52.335Z","repository":{"id":92595098,"uuid":"138959553","full_name":"tronprotocol/java-http-client","owner":"tronprotocol","description":null,"archived":false,"fork":false,"pushed_at":"2018-06-28T07:40:14.000Z","size":29282,"stargazers_count":8,"open_issues_count":1,"forks_count":7,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-06-12T20:35:38.443Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tronprotocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-28T03:05:12.000Z","updated_at":"2025-02-18T18:59:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"425cbcb5-093d-4f1b-b9e1-62c85bf02fa2","html_url":"https://github.com/tronprotocol/java-http-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tronprotocol/java-http-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tronprotocol%2Fjava-http-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tronprotocol%2Fjava-http-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tronprotocol%2Fjava-http-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tronprotocol%2Fjava-http-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tronprotocol","download_url":"https://codeload.github.com/tronprotocol/java-http-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tronprotocol%2Fjava-http-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274832511,"owners_count":25358085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T14:38:58.930Z","updated_at":"2025-09-12T15:53:52.287Z","avatar_url":"https://github.com/tronprotocol.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wallet-cli [![Build Status](https://travis-ci.org/tronprotocol/wallet-cli.svg?branch=master)](https://travis-ci.org/tronprotocol/wallet-cli)\nWallet CLI\n\n\nDownload java-tron and wallet-cli\n---------------------------------\ngit clone https://github.com/tronprotocol/java-tron.git\n\ngit clone https://github.com/tronprotocol/wallet-cli.git\n\n\nBuild and run java-tron\n-------------------------\ncd java-tron  \n./gradlew build      \n./gradlew run -Pwitness\n \n\nBuild and run wallet-cli by command line\n----------------------------------------\nCreate a new command line terminal window.\n\ncd wallet-cli  \n./gradlew build      \n./gradlew run -Pcmd\n\nBuild and run web wallet\n----------------------------------------\ncd wallet-cli  \n./gradlew build      \ncd build\ncd libs          \njava -jar wallet-1.0-SNAPSHOT.jar\n\n\nHow wallet-cli connects to java-tron :\n--------------------------------------\nWallet-cli connect to java-tron by grpc protocol.          \nJava-tron nodes can be deployed locally or remotely.          \nWe can set the connected java-tron node IP in config.conf of wallet-cli.\n\nJava-tron provides grpc api list:\n------------------------------------\nPlease refer to the link for details.\nhttps://github.com/tronprotocol/Documentation\n\nrpc GetAccount (Account) returns (Account)           \nrpc CreateTransaction (TransferContract) returns (Transaction)        \nrpc BroadcastTransaction (Transaction) returns (Return)        \nrpc ListAccounts (EmptyMessage) returns (AccountList)      \nrpc CreateAccount (AccountCreateContract) returns (Transaction)      \nrpc VoteWitnessAccount (VoteWitnessContract) returns (Transaction)      \nrpc CreateAssetIssue (AssetIssueContract) returns (Transaction)     \nrpc ListWitnesses (EmptyMessage) returns (WitnessList)     \nrpc UpdateAccount (AccountUpdateContract) returns (Transaction)      \nrpc CreateWitness (WitnessCreateContract) returns (Transaction)    \nrpc TransferAsset (TransferAssetContract) returns (Transaction)      \nrpc ParticipateAssetIssue (ParticipateAssetIssueContract) returns (Transaction)       \nrpc ListNodes (EmptyMessage) returns (NodeList)      \nrpc GetAssetIssueList (EmptyMessage) returns (AssetIssueList)      \nrpc GetAssetIssueByAccount (Account) returns (AssetIssueList)    \nrpc GetAssetIssueByName (BytesMessage) returns (AssetIssueContract)       \nrpc GetNowBlock (EmptyMessage) returns (Block)         \nrpc GetBlockByNum (NumberMessage) returns (Block)       \nrpc FreezeBalance (FreezeBalanceContract) returns (Transaction)       \nrpc UnfreezeBalance (UnfreezeBalanceContract) returns (Transaction)       \nrpc WithdrawBalance (WithdrawBalanceContract) returns (Transaction)       \nrpc UpdateAsset (UpdateAssetContract) returns (Transaction)       \nrpc GetAccountNet (Account) returns (AccountNetMessage) \n \nWeb wallet host\n----------------------------------\n127.0.0.0:8088                     \nNote: make sure the baseUrl configured in interface.js is what you want, for example 127.0.0.1:8088.\n\n\nWallet-cli supported command list:\n----------------------------------\n\nRegisterWallet  \nRegisterWallet Password\nRegister a wallet in local.\nGenerate a pair of ecc keys.\nDerive a AES Key by password and then use the AES algorithm to encrypt and save the private key.\nThe account address is calculated by the public key sha3-256, and taking the last 20 bytes.\nAll subsequent operations that require the use of a private key must enter the password.\n\nImportWallet  \nImportwalletByBase64  \nChangePassword  \nLogin  \nLogout  \nBackupWallet  \nBackupWallet2Base64  \nGetaddress  \nGetBalance  \nGetAccount  \nGetAssetissueByAccount                          \nGetAssetIssueByName                       \nSendCoin  \nTransferAsset  \nParticipateAssetissue  \nAssetissue  \nCreateWitness  \nVoteWitness  \nFreezeBalance\nUnfreezeBalance\nWithdrawBalance\nListaccounts  \nListwitnesses  \nListassetissue    \nlistNodes               \nGetAssetIssueByName   \nGetblock\nUpdateAccount  \nExit or Quit  \nhelp  \n\nInput any one of then, you will get more tips.\n\nHow to get trx\n----------------------------------\nyou can gen one keypair and address by command line, then modify java-tron config.conf set genesis.block.assets address to yours. \n\nNow that you have a lot of trx, you can send it to any address.                             \nWith enough trx, you can issue assets, participate in asset, apply for witnesses, and more.\n\nHow to freeze/unfreeze balance\n----------------------------------\n\nAfter the funds are frozen, the corresponding number of shares and bandwidth will be obtained.\n Shares can be used for voting and bandwidth can be used for trading.\n The rules for the use and calculation of share and bandwidth are described later in this article.\n\n\n**Freeze operation is as follows：**\n\n```\nfreezebalance password amount time\n```\n\n*amount:The amount of frozen funds，the unit is drop.\nThe minimum value is **1000000 drop(1TRX)**.*\n\n*time：Freeze time, this value is currently only allowed for **3 days***\n\n\nFor example：\n```\nfreezebalance 123455 10000000 3\n```\n\n\nAfter the freeze operation,frozen funds will be transferred from Account Balance to Frozen,\nYou can view frozen funds from your account information.\nAfter being unfrozen, it is transferred back to Balance by Frozen, and the frozen funds cannot be used for trading.\n\n\nWhen more share or bandwidth is needed temporarily, additional funds may be frozen to obtain additional share and bandwidth.\nThe unfrozen time is postponed until 3 days after the last freeze operation\n\nAfter the freezing time expires, funds can be unfroze.\n\n\n**Unfreeze operation is as follows：**\n```\nunfreezebalance password \n```\n\n\n\nHow to vote\n----------------------------------\n\nVoting requires share. Share can be obtained by freezing funds.\n\n- The share calculation method is: **1** unit of share can be obtained for every **1TRX** frozen. \n- After unfreezing, previous vote will expire. You can avoid the invalidation of the vote by re-freezing and voting.\n\n**Note:** The Tron Network only records the status of your last vote, which means that each of your votes will cover all previous voting results.\n\nFor example：\n\n```\nfreezebalance 123455 10000000 3   // Freeze 10TRX and acquire 10 units of shares\n\nvotewitness 123455 witness1 4 witness2 6   // Cast 4 votes for witness1 and 6 votes for witness2 at the same time.\n\nvotewitness 123455 witness1 10   // Voted 10 votes for witness1.\n```\n\nThe final result of the above command was 10 votes for witness1 and 0 votes for witness2.\n\n\n\nHow to calculate bandwidth\n----------------------------------\n\nThe bandwidth calculation rule is：\n```\nconstant * FrozenFunds * days\n```\nAssuming freeze 1TRX（1_000_000 DROP），3 days，bandwidth obtained = 1* 1_000_000 * 3 = 3_000_000. \n\nAny contract needs to consume bandwidth, including transfer, transfer of assets, voting, freezing, etc. \nThe query does not consume bandwidth, and each contract needs to consume **100_000 bandwidth**. \n\nIf the previous contract exceeds a certain time (**10s**), this operation does not consume bandwidth. \n\nWhen the unfreezing operation occurs, the bandwidth is not cleared. \nThe next time the freeze is performed, the newly added bandwidth is accumulated.\n\n\nHow to withdraw balance\n----------------------------------\n\nAfter each block is produced, the block award is sent to the account's allowance, \nand an withdraw operation is allowed every **24 hours** from allowance to balance. \nThe funds in allowance cannot be locked or traded.\n \n\nHow to create witness\n----------------------------------\nApplying to become a witness account needs to consume **100_000TRX**.\nThis part of the funds will be burned directly.\n\n\nHow to create account\n----------------------------------\nIt is not allowed to create accounts directly. You can only create accounts by transferring funds to non-existing accounts.\nTransfer to a non-existent account with a minimum transfer amount of **1TRX**.\n\nCommand line operation flow example\n-----------------------------------      \n\ncd wallet-cli  \n./gradlew build      \n./gradlew run -Pcmd                                                                                  \nRegisterWallet 123456      (password = 123456)                                                        \nlogin 123456                                                                                           \ngetAddress                 (Print 'address = f286522619d962e6f93235ca27b2cb67a9e5c27b', backup it)                                                       \nBackupWallet 123456        (Print 'priKey = 22be575f19b9ac6e94c7646a19a4c89e06fe99e2c054bd242c0af2b6282a65e9', backup it) (BackupWallet2Base64 option)                                                    \ngetbalance                 (Print 'Balance = 0')                                                                                                                                          \n //set genesis.block.assets address to yours. restart java-tron.\ngetbalance                                                             \n          \nassetIssue 123456 testAssetIssue00001 10000000000000000 1 100 2018-4-1 2018-4-30 1 just-test https://github.com/tronprotocol/wallet-cli/                   \ngetaccount  f286522619d962e6f93235ca27b2cb67a9e5c27b                                                                        \n(Print balance: 9999900000                                                                          \nasset {                                                                                                     \n  key: \"testAssetIssue00001\"                                                                           \n  value: 10000000000000000                                                                             \n})                                                                                                       \n(cost trx 1000 trx for assetIssue)                                                                    \n(You can query the trx balance and other asset balances for any account )                                                \nTransferAsset 123456 649DDB4AB82D558AD6809C7AB2BA43D1D1054B3F testAssetIssue00001 10000                                                     \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftronprotocol%2Fjava-http-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftronprotocol%2Fjava-http-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftronprotocol%2Fjava-http-client/lists"}