diff --git a/architecture/event/index.html b/architecture/event/index.html index 22c30681..91240313 100644 --- a/architecture/event/index.html +++ b/architecture/event/index.html @@ -257,7 +257,10 @@

Contract Log Event

Note

-

Historical data query is not supported.

+
    +
  1. Historical data query is not supported.
  2. +
  3. When subscribing to non-solidified events, be sure to use the two parameters blockNumber and blockHash as the criteria to verify that the received events are valid. In special cases such as unstable network connections causing chain reorg, event reorg may occur as well, resulting in stale events.
  4. +

New Features

    diff --git a/index.html b/index.html index 8d76c26c..43b90641 100644 --- a/index.html +++ b/index.html @@ -224,5 +224,5 @@

    Welcome to the Java-tron user manu diff --git a/search/search_index.json b/search/search_index.json index 8a440aa5..6b8ae7fb 100644 --- a/search/search_index.json +++ b/search/search_index.json @@ -1 +1 @@ -{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"Welcome to the Java-tron user manual! \u00b6 Java-tron is a TRON client implemented in Java, it provides completely open source code, you can download the Java-tron source code on Github. This article will introduce the knowledge related to Java-tron. Through this article, you will learn how to use Java-tron and how to participate in the development and maintenance of Java-tron, including the following parts: Getting Started Guide Using Java-tron Protocol Guide Java-tron Development DAPP Development APIs Wallet-CLI For other TRON related information, please visit the official website tron.network or the following resource links: TRON Whitepaper TRON Architecture TRON Improvement Proposals (TIPs) TRON Developer Hub","title":"Welcome to the Java-tron user manual!"},{"location":"#welcome-to-the-java-tron-user-manual","text":"Java-tron is a TRON client implemented in Java, it provides completely open source code, you can download the Java-tron source code on Github. This article will introduce the knowledge related to Java-tron. Through this article, you will learn how to use Java-tron and how to participate in the development and maintenance of Java-tron, including the following parts: Getting Started Guide Using Java-tron Protocol Guide Java-tron Development DAPP Development APIs Wallet-CLI For other TRON related information, please visit the official website tron.network or the following resource links: TRON Whitepaper TRON Architecture TRON Improvement Proposals (TIPs) TRON Developer Hub","title":"Welcome to the Java-tron user manual!"},{"location":"glossary/","text":"Glossary \u00b6 energyUsage The Energy conumption of the contract caller in one contract trigger. energyFee The number of TRX burned from the contract caller for Energy conumption in one contract trigger. originEnergyUsage The total Energy conumption of the contract developer in one contract trigger. energyUsageTotal The total Energy conumption of the contract developer and the contract caller combined. Feelimit When the user triggers or create the contract, this is used to set the usage limit of the Energy consumption got from burning TRX or staking TRX, Energy got from staking TRX will be used first. CallValue When the user triggers or create the contract, this can be used to send TRX to the contract. consume_user_resource_percent For a contract, Resource consumption is composed of two parts, one part is afforded by contract developer and the other part is afforded by contract caller. This is the percentage of the two parts in the Resource consumption. origin_energy_limit The usage limit of the Energy consumption of the developer in one contract trigger, should be greater than 0. net_usage The Bandwidth consumption in one contract trigger. (NetFee not included) net_fee The TRX burned for Bandwidth consumption in one contract trigger. Bandwidth The Bandwidth Points consumed by a transaction is the size of the byte array in this transaction. If the byte array length of a transaction is 100, then the transaction needs to consume 100 Bandwidth Points. Energy The creation and operation of a smart contract consume CPU resources. It takes time for smart contracts to operate in virtual machines (VMs), and the time consumed in the system is calculated in microseconds. CPU resources are consumed in energy, which means 1 Energy = 1 Microsecond (\u03bcs). If a contract takes 100 \u03bcs to execute in a VM, it needs to consume 100 Energy. TRON Power(TP) 1 staked TRX = 1 TP, TP can be used to vote, 1 TP = 1 vote. Super Representative(SR) The current block producing Top 27 nodes.","title":"Glossary"},{"location":"glossary/#glossary","text":"energyUsage The Energy conumption of the contract caller in one contract trigger. energyFee The number of TRX burned from the contract caller for Energy conumption in one contract trigger. originEnergyUsage The total Energy conumption of the contract developer in one contract trigger. energyUsageTotal The total Energy conumption of the contract developer and the contract caller combined. Feelimit When the user triggers or create the contract, this is used to set the usage limit of the Energy consumption got from burning TRX or staking TRX, Energy got from staking TRX will be used first. CallValue When the user triggers or create the contract, this can be used to send TRX to the contract. consume_user_resource_percent For a contract, Resource consumption is composed of two parts, one part is afforded by contract developer and the other part is afforded by contract caller. This is the percentage of the two parts in the Resource consumption. origin_energy_limit The usage limit of the Energy consumption of the developer in one contract trigger, should be greater than 0. net_usage The Bandwidth consumption in one contract trigger. (NetFee not included) net_fee The TRX burned for Bandwidth consumption in one contract trigger. Bandwidth The Bandwidth Points consumed by a transaction is the size of the byte array in this transaction. If the byte array length of a transaction is 100, then the transaction needs to consume 100 Bandwidth Points. Energy The creation and operation of a smart contract consume CPU resources. It takes time for smart contracts to operate in virtual machines (VMs), and the time consumed in the system is calculated in microseconds. CPU resources are consumed in energy, which means 1 Energy = 1 Microsecond (\u03bcs). If a contract takes 100 \u03bcs to execute in a VM, it needs to consume 100 Energy. TRON Power(TP) 1 staked TRX = 1 TP, TP can be used to vote, 1 TP = 1 vote. Super Representative(SR) The current block producing Top 27 nodes.","title":"Glossary"},{"location":"api/http/","text":"HTTP API \u00b6 This article introduces FullNode's HTTP APIs and their usage. Note Although TRON has avoided XSS by setting the Content-Type of HTTP APIs to application/json, there are a few APIs that don't have input validation. To better protect user data security, we recommend that you correctly encode any data from APIs before they use it in any UI, especially when the parameter visible equals true. Here is a typical XSS protection method: Encode all data from the APIs in HTML. Use methods such as encodeURIComponent() or escape() to encode the data, which can convert special characters into their HTML entities and prevent them from being interpreted as HTML code by the browser. Please be sure to implement XSS protection for all data from the APIs to ensure the security of user data. We understand that you may need more information about XSS protection. It is recommended that you refer to the following resources: OWASP XSS Prevention Cheat Sheet . First, Let's explain the selection of the address format in the HTTP API: Account addresses of the TRON network have two formats: HexString format and Base58 format. The Fullnode HTTP API supports address format selection. Users can set the address format through the visible parameter. The default value is false and the address format in the parameter and return value is hex format. When visible is set to true , the address format in the parameter and return value are in Base58 format. If the parameter format does not match the visible setting, an error will be reported. Setting method: For HTTP GET API or the api needs no parameter: by adding visible=true parameter to the url http://127.0.0.1:8090/wallet/listexchanges?visible=true For POST API: By adding \"visible\": true parameter to the most out layer of the json curl - X POST h tt p : //127.0.0.1:8090/wallet/createtransaction -d ' { \"owner_address\" : \"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ\" , \"to_address\" : \"TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW\" , \"amount\" : 1000000 , \"visible\" : true } ' Fullnode HTTP API \u00b6 The FullNode HTTP API is categorized as follows: Accounts Transfer and Transactions Account Resources Query The Network Smart Contracts TRC-10 Token Voting & SRs Proposals DEX Exchange TRONZ Shielded Smart Contract Pending Pool Accounts \u00b6 The following are the APIs related to on-chain accounts: wallet/validateaddress wallet/createaccount wallet/getaccount wallet/updateaccount wallet/accountpermissionupdate wallet/getaccountbalance wallet/setaccountid wallet/getaccountbyid wallet/validateaddress \u00b6 Description: Check the validity of the address curl -X POST http://127.0.0.1:8090/wallet/validateaddress -d '{\"address\": \"4189139CB1387AF85E3D24E212A008AC974967E561\"}' Parameters: address Return: the address is correct or not wallet/createaccount \u00b6 Description: Create an account. Uses an already activated account to create a new account. If the owner_address has enough bandwidth obtained by freezing TRX, then creating an account will only consume bandwidth , otherwise, 0.1 TRX will be burned to pay for bandwidth, and at the same time, 1 TRX will be required to be created. curl -X POST http://127.0.0.1:8090/wallet/createaccount -d '{\"owner_address\":\"41d1e7a6bc354106cb410e65ff8b181c600ff14292\", \"account_address\": \"41e552f6487585c2b58bc2c9bb4492bc1f17132cd0\"}' Parameters: owner_address Owner address, default hexString account_address New address, default hexString Permission_id Optional, for multi-signature use Return: Unsigned transaction object wallet/getaccount \u00b6 Description: Query an account information curl -X POST http://127.0.0.1:8090/wallet/getaccount -d '{\"address\": \"41E552F6487585C2B58BC2C9BB4492BC1F17132CD0\"}' Parameters: address - account address Return: Account object wallet/updateaccount \u00b6 Description: Update the name of an account curl -X POST http://127.0.0.1:8090/wallet/updateaccount -d '{\"account_name\": \"0x7570646174654e616d6531353330383933343635353139\" ,\"owner_address\":\"41d1e7a6bc354106cb410e65ff8b181c600ff14292\"}' Parameters: account_name Account name, default hexString owner_address Owner address, default hexString Permission_id Optional, for multi-signature use Return:\u672a\u7b7e\u540d\u7684\u4fee\u6539\u540d\u79f0Transaction wallet/accountpermissionupdate \u00b6 Description: Update the account's permission. curl -X POST http://127.0.0.1:8090/wallet/accountpermissionupdate -d '{ \"owner_address\": \"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ\", \"owner\": { \"type\": 0, \"permission_name\": \"owner\", \"threshold\": 1, \"keys\": [{ \"address\": \"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ\", \"weight\": 1 }] }, \"witness\": { \"type\": 1, \"permission_name\": \"witness\", \"threshold\": 1, \"keys\": [{ \"address\": \"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ\", \"weight\": 1 }] }, \"actives\": [{ \"type\": 2, \"permission_name\": \"active12323\", \"threshold\": 2, \"operations\": \"7fff1fc0033e0000000000000000000000000000000000000000000000000000\", \"keys\": [{ \"address\": \"TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR\", \"weight\": 1 }, { \"address\": \"TKwhcDup8L2PH5r6hxp5CQvQzZqJLmKvZP\", \"weight\": 1 }] }], \"visible\": true}' Parameters: owner_address: Owner address of the account, default hexString owner: Account owner permission witness: Account witness permission, only for witness actives: List of active permissions for the account Return: Unsigned transaction wallet/getaccountbalance \u00b6 Description\uff1a Get the account balance in a specific block. curl -X POST http://127.0.0.1:8090/wallet/getaccountbalance -d '{ \"account_identifier\": { \"address\": \"TLLM21wteSPs4hKjbxgmH1L6poyMjeTbHm\" }, \"block_identifier\": { \"hash\": \"0000000000010c4a732d1e215e87466271e425c86945783c3d3f122bfa5affd9\", \"number\": 68682 }, \"visible\": true }' Parameters: account_identifier : The account address. block_identifier : The block number. Return: The balance object of the account in a specific block, the block_identifier is the block hash. { \"balance\": 64086449348265042, \"block_identifier\": { \"hash\": \"0000000000010c4a732d1e215e87466271e425c86945783c3d3f122bfa5affd9\", \"number\": 68682 } } wallet/setaccountid \u00b6 Description: To set an account id for an account curl -X POST http://127.0.0.1:8090/wallet/setaccountid -d '{ \"owner_address\":\"41a7d8a35b260395c14aa456297662092ba3b76fc0\",\"account_id\":\"6161616162626262\"}' Parameters: owner_address : Owner address, default hexString account_id :Account id, default hexString Return: Unsigned transaction wallet/getaccountbyid \u00b6 Description: Query an account information by account id curl -X POST http://127.0.0.1:8090/wallet/getaccountbyid -d '{\"account_id\":\"6161616162626262\"}' Parameters: account_id Account id, default hexString Return:Account object Transfers and transactions \u00b6 The following are transfer and transaction related APIs: wallet/createtransaction wallet/broadcasttransaction wallet/broadcasthex wallet/getsignweight wallet/getapprovedlist wallet/createtransaction \u00b6 Description: Create a transfer transaction, if to address is not existed, then create the account on the blockchain curl -X POST http://127.0.0.1:8090/wallet/createtransaction -d '{\"to_address\": \"41e9d79cc47518930bc322d9bf7cddd260a0260a8d\", \"owner_address\": \"41D1E7A6BC354106CB410E65FF8B181C600FF14292\", \"amount\": 1000 }' Parameters: to_address To address, default hexString owner_address Owner address, default hexString amount Transfer amount Permission_id Optional, for multi-signature use Return: Unsigned transaction wallet/broadcasttransaction \u00b6 Description: Broadcast transaction after sign curl -X POST http://127.0.0.1:8090/wallet/broadcasttransaction -d '{\"signature\":[\"97c825b41c77de2a8bd65b3df55cd4c0df59c307c0187e42321dcc1cc455ddba583dd9502e17cfec5945b34cad0511985a6165999092a6dec84c2bdd97e649fc01\"],\"txID\":\"454f156bf1256587ff6ccdbc56e64ad0c51e4f8efea5490dcbc720ee606bc7b8\",\"raw_data\":{\"contract\":[{\"parameter\":{\"value\":{\"amount\":1000,\"owner_address\":\"41e552f6487585c2b58bc2c9bb4492bc1f17132cd0\",\"to_address\":\"41d1e7a6bc354106cb410e65ff8b181c600ff14292\"},\"type_url\":\"type.googleapis.com/protocol.TransferContract\"},\"type\":\"TransferContract\"}],\"ref_block_bytes\":\"267e\",\"ref_block_hash\":\"9a447d222e8de9f2\",\"expiration\":1530893064000,\"timestamp\":1530893006233}}' Parameters: Transaction after sign Return:The result of the broadcast wallet/broadcasthex \u00b6 Description: Broadcast transaction hex string after sign curl -X POST http://127.0.0.1:8090/wallet/broadcasthex -d '{\"transaction\":\"0A8A010A0202DB2208C89D4811359A28004098A4E0A6B52D5A730802126F0A32747970652E676F6F676C65617069732E636F6D2F70726F746F636F6C2E5472616E736665724173736574436F6E747261637412390A07313030303030311215415A523B449890854C8FC460AB602DF9F31FE4293F1A15416B0580DA195542DDABE288FEC436C7D5AF769D24206412418BF3F2E492ED443607910EA9EF0A7EF79728DAAAAC0EE2BA6CB87DA38366DF9AC4ADE54B2912C1DEB0EE6666B86A07A6C7DF68F1F9DA171EEE6A370B3CA9CBBB00\"}' Parameters: Transaction hex after sign Return: The result of the broadcast wallet/getsignweight \u00b6 Description: Query the current signatures total weight of a transaction after sign curl -X POST http://127.0.0.1:8090/wallet/getsignweight -d '{ \"signature\": [ \"e0bd4a60f1b3c89d4da3894d400e7e32385f6dd690aee17fdac4e016cdb294c5128b66f62f3947a7182c015547496eba95510c113bda2a361d811b829343c36501\", \"596ead6439d0f381e67f30b1ed6b3687f2bd53ce5140cdb126cfe4183235804741eeaf79b4e91f251fd7042380a9485d4d29d67f112d5387bc7457b355cd3c4200\" ], \"txID\": \"0ae84a8439f5aa8fd2c458879a4031a7452aebed8e6e99ffbccd26842d4323c4\", \"raw_data\": { \"contract\": [{ \"parameter\": { \"value\": { \"amount\": 1000000, \"owner_address\": \"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ\", \"to_address\": \"TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW\" }, \"type_url\": \"type.googleapis.com/protocol.TransferContract\" }, \"type\": \"TransferContract\" }], \"ref_block_bytes\": \"163d\", \"ref_block_hash\": \"77ef4ace148b05ba\", \"expiration\": 1555664823000, \"timestamp\": 1555664763418 }, \"raw_data_hex\": \"0a02163d220877ef4ace148b05ba40d8c5e5a6a32d5a69080112630a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412320a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18c0843d2802709af4e1a6a32d\", \"visible\": true}' Parameters: Transaction object after sign Return: The current signatures total weight wallet/getapprovedlist \u00b6 Description: Query the signatures list of a transaction after sign curl -X POST http://127.0.0.1:8090/wallet/getapprovedlist -d '{ \"signature\": [ \"e0bd4a60f1b3c89d4da3894d400e7e32385f6dd690aee17fdac4e016cdb294c5128b66f62f3947a7182c015547496eba95510c113bda2a361d811b829343c36501\", \"596ead6439d0f381e67f30b1ed6b3687f2bd53ce5140cdb126cfe4183235804741eeaf79b4e91f251fd7042380a9485d4d29d67f112d5387bc7457b355cd3c4200\" ], \"txID\": \"0ae84a8439f5aa8fd2c458879a4031a7452aebed8e6e99ffbccd26842d4323c4\", \"raw_data\": { \"contract\": [{ \"parameter\": { \"value\": { \"amount\": 1000000, \"owner_address\": \"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ\", \"to_address\": \"TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW\" }, \"type_url\": \"type.googleapis.com/protocol.TransferContract\" }, \"type\": \"TransferContract\" }], \"ref_block_bytes\": \"163d\", \"ref_block_hash\": \"77ef4ace148b05ba\", \"expiration\": 1555664823000, \"timestamp\": 1555664763418 }, \"raw_data_hex\": \"0a02163d220877ef4ace148b05ba40d8c5e5a6a32d5a69080112630a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412320a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18c0843d2802709af4e1a6a32d\", \"visible\": true}' Parameter: Transaction object after sign Return: The list of the signatures Account Resources \u00b6 The following are account resource related APIs: wallet/getaccountresource wallet/getaccountnet wallet/unfreezebalance wallet/getdelegatedresource wallet/getdelegatedresourceaccountindex wallet/freezebalancev2 wallet/unfreezebalancev2 wallet/cancelallunfreezev2 wallet/delegateresource wallet/undelegateresource wallet/withdrawexpireunfreeze wallet/getavailableunfreezecount wallet/getcanwithdrawunfreezeamount wallet/getcandelegatedmaxsize wallet/getdelegatedresourcev2 wallet/getdelegatedresourceaccountindexv2 wallet/getaccountresource \u00b6 Description: Query the resource information of an account curl -X POST http://127.0.0.1:8090/wallet/getaccountresource -d {\"address\" : \"419844f7600e018fd0d710e2145351d607b3316ce9\"} Parameters: address : Address, default hexString Return: The resource information wallet/getaccountnet \u00b6 Description: Query the bandwidth information of an account curl -X POST http://127.0.0.1:8090/wallet/getaccountnet -d '{\"address\": \"4112E621D5577311998708F4D7B9F71F86DAE138B5\"}' Parameters: address - Address, default hexString Return: Bandwidth information wallet/freezebalance \u00b6 Description: Stake TRX. This interface has been deprecated, please use FreezeBalanceV2 to stake TRX to obtain resources. wallet/unfreezebalance \u00b6 Description: Unstake the TRX that staked during stake1.0 phase. curl -X POST http://127.0.0.1:8090/wallet/unfreezebalance -d '{ \"owner_address\":\"41e472f387585c2b58bc2c9bb4492bc1f17342cd1\", \"resource\": \"BANDWIDTH\", \"receiver_address\":\"414332f387585c2b58bc2c9bb4492bc1f17342cd1\" }' Parameters: owner_address Owner address, default hexString resource unstake type 'BANDWIDTH' or 'ENERGY' receiverAddress The address that will lose the resource, default hexString Permission_id Optional, for multi-signature use Return: Unsigned transaction wallet/getdelegatedresource \u00b6 Description: Query the resource delegation information curl -X POST http://127.0.0.1:8090/wallet/getdelegatedresource -d ' { \"fromAddress\": \"419844f7600e018fd0d710e2145351d607b3316ce9\", \"toAddress\": \"41c6600433381c731f22fc2b9f864b14fe518b322f\" }' Parameters: fromAddress : from address, default hexString toAddress : to address, default hexString Return: Resource delegation information wallet/getdelegatedresourceaccountindex \u00b6 Description: Query the resource delegation by an account during stake1.0 phase. i.e. list all addresses that have delegated resources to an account. curl -X POST http://127.0.0.1:8090/wallet/getdelegatedresourceaccountindex -d ' { \"value\": \"419844f7600e018fd0d710e2145351d607b3316ce9\", }' Parameters: value : account address Return:resource delegation index wallet/freezebalancev2 \u00b6 Description: Stake TRX curl -X POST http://127.0.0.1:8090/wallet/freezebalancev2 -d '{ \"owner_address\": \"41e472f387585c2b58bc2c9bb4492bc1f17342cd1\", \"frozen_balance\": 10000, \"resource\": \"BANDWIDTH\" }' Parameters: owner_address : Owner address, default hexString frozen_balance : TRX stake amount, the unit is sun resource : TRX stake type, 'BANDWIDTH' or 'ENERGY' permission_id : Optional, for multi-signature use Return: Unsigned transaction wallet/unfreezebalancev2 \u00b6 Description: Unstake some TRX staked in Stake2.0, release the corresponding amount of bandwidth or energy, and voting rights (TP) curl -X POST http://127.0.0.1:8090/wallet/unfreezebalancev2 -d '{ \"owner_address\": \"41e472f387585c2b58bc2c9bb4492bc1f17342cd1\", \"unfreeze_balance\": 1000000, \"resource\": \"BANDWIDTH\" }' Parameters: owner_address : Owner address, default hexString resource : Resource type: 'BANDWIDTH' or 'ENERGY' unfreeze_balance : The amount of TRX to unstake, in sun permission_id : Optional, for multi-signature use Return:Unsigned transaction wallet/cancelallunfreezev2 \u00b6 Description: Cancel unstakings, all unstaked funds still in the waiting period will be re-staked, all unstaked funds that exceeded the 14-day waiting period will be automatically withdrawn to the owner\u2019s account curl -X POST http://127.0.0.1:8090/wallet/cancelallunfreezev2 -d '{ \"owner_address\": \"41e472f387585c2b58bc2c9bb4492bc1f17342cd1\" }' Parameters: owner_address : Owner address, default hexString permission_id : Optional, for multi-signature use Return:Unsigned transaction wallet/delegateresource \u00b6 Description: Delegate bandwidth or energy resources to other accounts in Stake2.0. curl -X POST http://127.0.0.1:8090/wallet/delegateresource -d '{ \"owner_address\": \"41e472f387585c2b58bc2c9bb4492bc1f17342cd1\", \"receiver_address\": \"41d1e7a6bc354106cb410e65ff8b181c600ff14292\", \"balance\": 1000000, \"resource\": \"BANDWIDTH\", \"lock\": false }' Parameters: owner_address : Account address receiver_address : Resource receiver address balance : Amount of TRX staked for resources to be delegated, unit is sun resource : Resource type: 'BANDWIDTH' or 'ENERGY' lock : Whether it is locked, if it is set to true, the delegated resources cannot be undelegated within 3 days. When the lock time is not over, if the owner delegates the same type of resources using the lock to the same address, the lock time will be reset to 3 days lock_period : lock time,The unit is block interval(3 seconds), indicates the time of how many blocks will be produced from the moment the transaction is executed. Only when lock is true, this field is valid. If the delegate lock period is 1 day, the lock_period is: 28800 permission_id : Optional, for multi-signature use Return:Unsigned transaction wallet/undelegateresource \u00b6 Description: Cancel the delegation of bandwidth or energy resources to other account curl -X POST http://127.0.0.1:8090/wallet/undelegateresource -d '{ \"owner_address\": \"41e472f387585c2b58bc2c9bb4492bc1f17342cd1\", \"receiver_address\": \"41d1e7a6bc354106cb410e65ff8b181c600ff14292\", \"balance\": 1000000, \"resource\": \"BANDWIDTH\" }' Parameters: owner_address : Account address receiver_address : Resource receiver address balance : Amount of TRX staked for resources to be delegated, unit is sun resource : Resource type: 'BANDWIDTH' or 'ENERGY' permission_id : Optional, for multi-signature use Return:Unsigned transaction wallet/withdrawexpireunfreeze \u00b6 Description: Withdraw unfrozen balance in Stake2.0, the user can call this API to get back their funds after executing /wallet/unfreezebalancev2 transaction and waiting N days, N is a network parameter curl -X POST http://127.0.0.1:8090/wallet/withdrawexpireunfreeze -d '{ \"owner_address\": \"41e472f387585c2b58bc2c9bb4492bc1f17342cd1\", }' Parameters: owner_address : Account address permission_id : Optional, for multi-signature use Return: Unsigned transaction wallet/getavailableunfreezecount \u00b6 Description:Remaining times of executing unstake operation in Stake2.0 curl -X POST http://127.0.0.1:8090/wallet/getavailableunfreezecount -d '{ \"owner_address\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\", \"visible\": true } ' Parameters: owner_address : Account address Return:Remaining times of available unstaking. wallet/getcanwithdrawunfreezeamount \u00b6 Description:Query the withdrawable balance at the specified timestamp In Stake2.0 curl -X POST http://127.0.0.1:8090/wallet/getcanwithdrawunfreezeamount -d '{ \"owner_address\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\", \"timestamp\": 1667977444000, \"visible\": true } ' Parameters: owner_address : Account address timestamp : query cutoff timestamp, in milliseconds. Return: withdrawable balance, unit is sun. wallet/getcandelegatedmaxsize \u00b6 Description: In Stake2.0, query the amount of delegatable resources share of the specified resource type for an address, unit is sun. curl -X POST http://127.0.0.1:8090/wallet/getcandelegatedmaxsize -d '{ \"owner_address\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\", \"type\": 0, \"visible\": true } ' Parameters: owner_address : Account address type : resource type, 0 is bandwidth, 1 is energy Return:the amount of delegatable resource share, unit is sun. wallet/getdelegatedresourcev2 \u00b6 In Stake2.0, query the detail of resource share delegated from fromAddress to toAddress curl -X POST http://127.0.0.1:8090/wallet/getdelegatedresourcev2 -d '{ \"fromAddress\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\", \"toAddress\": \"TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1\", \"visible\": true } ' Parameters: fromAddress : resource from address, default hexString toAddress : resource to address Return:Resource delegation list wallet/getdelegatedresourceaccountindexv2 \u00b6 In Stake2.0, query the resource delegation index by an account. Two lists will return, one is the list of addresses the account has delegated its resources(toAddress), and the other is the list of addresses that have delegated resources to the account(fromAddress). curl -X POST http://127.0.0.1:8090/wallet/getdelegatedresourceaccountindexv2 -d '{ \"value\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\", \"visible\": true } ' Parameters: value : account address Return:Two lists will return, one is the list of addresses the account has delegated its resources(toAddress), and the other is the list of addresses that have delegated resources to the account(fromAddress). Query The Network \u00b6 The following is the API for querying data on the chain: wallet/getnowblock wallet/getblock wallet/getblockbynum wallet/getblockbyid wallet/getblockbylatestnum wallet/getblockbylimitnext wallet/getblockbalance wallet/gettransactionbyid wallet/gettransactioninfobyid wallet/gettransactioncountbyblocknum wallet/gettransactioninfobyblocknum wallet/listnodes wallet/getnodeinfo wallet/getchainparameters wallet/getenergyprices wallet/getbandwidthprices wallet/getburntrx wallet/getnowblock \u00b6 Description: Query the latest block information curl -X POST http://127.0.0.1:8090/wallet/getnowblock Parameters: N/A Return: The latest block wallet/getblock \u00b6 Query block header information or entire block information according to block height or block hash curl -X POST http://127.0.0.1:8090/wallet/getblock -d '{\"detail\":false}' Parameters: id_or_num : id_or_num can be the block height or the block hash. No value entered means to query the latest block. detail : true means query the entire block information include the header and body. false means only query the block header information. Return: block or block header wallet/getblockbynum \u00b6 Description: Query a block information by block height curl -X POST http://127.0.0.1:8090/wallet/getblockbynum -d '{\"num\": 1}' Parameters: Block height Return: block wallet/getblockbyid \u00b6 Description: Query a block information by block id curl -X POST http://127.0.0.1:8090/wallet/getblockbyid -d '{\"value\": \"0000000000038809c59ee8409a3b6c051e369ef1096603c7ee723c16e2376c73\"}' Parameters: Block id Return: block wallet/getblockbylatestnum \u00b6 Description: Query the several latest blocks curl -X POST http://127.0.0.1:8090/wallet/getblockbylatestnum -d '{\"num\": 5}' Parameters: The number of the blocks expected to return Return:The list of the blocks wallet/getblockbylimitnext \u00b6 Description: Query a list of blocks by range curl -X POST http://127.0.0.1:8090/wallet/getblockbylimitnext -d '{\"startNum\": 1, \"endNum\": 2}' Parameters: startNum : The start block height, itself included endNum : The end block height, itself not included Return: The list of the blocks wallet/getblockbalance \u00b6 Description\uff1aGet all balance change operations in a block. curl -X POST http://127.0.0.1:8090/wallet/getblockbalance -d '{ \"hash\": \"000000000000dc2a3731e28a75b49ac1379bcc425afc95f6ab3916689fbb0189\", \"number\": 56362, \"visible\": true }' Parameters: The hash and block number must match. Return: { \"block_identifier\": { \"hash\": \"000000000000dc2a3731e28a75b49ac1379bcc425afc95f6ab3916689fbb0189\", \"number\": 56362 }, \"timestamp\": 1530060672000, \"transaction_balance_trace\": [ { \"transaction_identifier\": \"e6cabb1833cd1f795eed39d8dd7689eaa70e5bb217611766c74c7aa9feea80df\", \"operation\": [ { \"operation_identifier\": 0, \"address\": \"TPttBLmFuykRi83y9HxDoEWxTQw6CCcQ4p\", \"amount\": -100000 }, { \"operation_identifier\": 1, \"address\": \"TLsV52sRDL79HXGGm9yzwKibb6BeruhUzy\", \"amount\": 100000 }, { \"operation_identifier\": 2, \"address\": \"TPttBLmFuykRi83y9HxDoEWxTQw6CCcQ4p\", \"amount\": -10000000 }, { \"operation_identifier\": 3, \"address\": \"TMrysg7DbwR1M8xqhpaPdVCHCuWFhw7uk1\", \"amount\": 10000000 } ], \"type\": \"TransferContract\", \"status\": \"SUCCESS\" } ] } wallet/gettransactionbyid \u00b6 Description: Query a transaction information by transaction id curl -X POST http://127.0.0.1:8090/wallet/gettransactionbyid -d '{\"value\": \"d5ec749ecc2a615399d8a6c864ea4c74ff9f523c2be0e341ac9be5d47d7c2d62\"}' Parameters: Transaction id Return: Transaction information wallet/gettransactioninfobyid \u00b6 Description: Query the transaction fee, block height by transaction id curl -X POST http://127.0.0.1:8090/wallet/gettransactioninfobyid -d '{\"value\" : \"309b6fa3d01353e46f57dd8a8f27611f98e392b50d035cef213f2c55225a8bd2\"}' Parameters: value - Transaction id Return: Transaction fee & block height wallet/gettransactioncountbyblocknum \u00b6 Description: Query th the number of transactions in a specific block curl -X POST http://127.0.0.1:8090/wallet/gettransactioncountbyblocknum -d '{\"num\" : 100}' Parameters: num - Block height Return: The number of transactions wallet/gettransactioninfobyblocknum \u00b6 Description: Query the list of transaction information in a specific block curl -X POST http://127.0.0.1:8090/wallet/gettransactioninfobyblocknum -d '{\"num\" : 100}' Parameters: num is the Block height Return:The list of transaction information wallet/listnodes \u00b6 Description: Query the list of nodes connected to the ip of the api curl -X POST http://127.0.0.1:8090/wallet/listnodes Parameters: N/A Return: The list of nodes wallet/getnodeinfo \u00b6 Description: Query the current node information curl http://127.0.0.1:8090/wallet/getnodeinfo Return: The node information wallet/getchainparameters \u00b6 Description: Query the parameters of the blockchain used for witnessses to create a proposal curl -X POST http://127.0.0.1:8090/wallet/getchainparameters Return: The list of parameters of the blockchain wallet/getenergyprices \u00b6 Description: Query historical energy unit price curl -X POST http://127.0.0.1:8090/wallet/getenergyprices Return: All historical energy unit price information. Each unit price change is separated by a comma. Before the colon is the millisecond timestamp, and after the colon is the energy unit price in sun. wallet/getbandwidthprices \u00b6 Description: Query historical bandwidth unit price curl -X POST http://127.0.0.1:8090/wallet/getbandwidthprices Return: All historical bandwidth unit price information. Each unit price change is separated by a comma. Before the colon is the millisecond timestamp, and after the colon is the bandwidth unit price in sun. wallet/getburntrx \u00b6 Description: Query the amount of TRX burned due to on-chain transaction fees since No. 54 Committee Proposal took effect curl -X POST http://127.0.0.1:8090/wallet/getburntrx Return: Amount of TRX burned, in sun. Smart Contracts \u00b6 The following are smart contract related APIs: wallet/getcontract wallet/getcontractinfo wallet/deploycontract wallet/triggersmartcontract wallet/triggerconstantcontract wallet/updatesetting wallet/updateenergylimit wallet/clearabi wallet/estimateenergy wallet/getcontract \u00b6 Queries a contract's information from the blockchain, including the bytecode of the contract, ABI, configuration parameters, etc. curl -X POST http://127.0.0.1:8090/wallet/getcontract -d '{\"value\":\"4189139CB1387AF85E3D24E212A008AC974967E561\"}' Parameters: value - Contract address Return:SmartContract wallet/getcontractinfo \u00b6 Queries a contract's information from the blockchain. The difference from the wallet/getcontract interface is that this interface returns not only the bytecode but also the runtime bytecode of the contract. Compared with bytecode, runtime bytecode does not contain constructor and constructor parameter information. curl -X POST http://127.0.0.1:8090/wallet/getcontractinfo -d '{\"value\":\"4189139CB1387AF85E3D24E212A008AC974967E561\"}' Parameters: value - Contract address Return: contract's information wallet/deploycontract \u00b6 Description: Deploy a smart contract curl -X POST http://127.0.0.1:8090/wallet/deploycontract -d '{\"abi\":\"[{\\\"constant\\\":false,\\\"inputs\\\":[{\\\"name\\\":\\\"key\\\",\\\"type\\\":\\\"uint256\\\"},{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"uint256\\\"}],\\\"name\\\":\\\"set\\\",\\\"outputs\\\":[],\\\"payable\\\":false,\\\"stateMutability\\\":\\\"nonpayable\\\",\\\"type\\\":\\\"function\\\"},{\\\"constant\\\":true,\\\"inputs\\\":[{\\\"name\\\":\\\"key\\\",\\\"type\\\":\\\"uint256\\\"}],\\\"name\\\":\\\"get\\\",\\\"outputs\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"uint256\\\"}],\\\"payable\\\":false,\\\"stateMutability\\\":\\\"view\\\",\\\"type\\\":\\\"function\\\"}]\",\"bytecode\":\"608060405234801561001057600080fd5b5060de8061001f6000396000f30060806040526004361060485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631ab06ee58114604d5780639507d39a146067575b600080fd5b348015605857600080fd5b506065600435602435608e565b005b348015607257600080fd5b50607c60043560a0565b60408051918252519081900360200190f35b60009182526020829052604090912055565b600090815260208190526040902054905600a165627a7a72305820fdfe832221d60dd582b4526afa20518b98c2e1cb0054653053a844cf265b25040029\",\"parameter\":\"\",\"call_value\":100,\"name\":\"SomeContract\",\"consume_user_resource_percent\":30,\"fee_limit\":10,\"origin_energy_limit\": 10,\"owner_address\":\"41D1E7A6BC354106CB410E65FF8B181C600FF14292\"}' Parameters: abi :abi bytecode :bytecode\uff0chexString parameter :The list of the parameters of the constructor, It should be converted hexString after encoded according to ABI encoder. If constructor has no parameter, this can be optional consume_user_resource_percent : Consume user's resource percentage. It should be an integer between [0, 100]. if 0, means it does not consume user's resource until the developer's resource has been used up fee_limit : The maximum TRX burns for resource consumption call_value : The TRX transfer to the contract for each call owner_address :Owner address of the contract, default hexString name :Contract name origin_energy_limit : The maximum resource consumption of the creator in one execution or creation call_token_value : The amount of trc10 token transfer to the contract for each call (Optional) token_id :The id of trc10 token transfer to the contract (Optional) Permission_id : Optional, for multi-signature use Return:Unsigned transaction wallet/triggersmartcontract \u00b6 Description: Trigger smart contract $ curl -X POST http://127.0.0.1:8090/wallet/triggersmartcontract -d '{ \"contract_address\": \"4189139CB1387AF85E3D24E212A008AC974967E561\", \"function_selector\": \"set(uint256,uint256)\", \"parameter\": \"00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002\", \"fee_limit\": 10, \"call_value\": 100, \"owner_address\": \"41D1E7A6BC354106CB410E65FF8B181C600FF14292\" }' Parameters: contract_address : Contract address, default hexString function_selector : Function call, must not leave a blank space parameter : The parameter passed to 'function_selector', the format must match with the VM's requirement. You can use a js tool provided by remix to convert a parameter like [1,2] to the format that VM requires data : The data for interacting with smart contracts, including the contract function and parameters. You can choose to use this field, or you can choose to use function_selector and parameter for contract interaction. When both of data and function_selector exist, function_selector is preferred fee_limit : The maximum TRX burns for resource consumption call_value : The TRX transfer to the contract for each call call_token_value : The amount of trc10 token transfer to the contract for each call token_id : The id of trc10 token transfer to the contract owner_address : Owner address that triggers the contract, default hexString permission_id : Optional, for multi-signature use Return:Unsigned transaction wallet/triggerconstantcontract \u00b6 Description: Trigger the constant of the smart contract, the transaction is off the blockchain $ curl -X POST http://127.0.0.1:8090/wallet/triggerconstantcontract -d '{ \"contract_address\": \"4189139CB1387AF85E3D24E212A008AC974967E561\", \"function_selector\": \"set(uint256,uint256)\", \"parameter\": \"00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002\", \"call_value\": 100, \"owner_address\": \"41D1E7A6BC354106CB410E65FF8B181C600FF14292\" }' Parameters: contract_address : Smart contract address, default hexString function_selector : Function call, must not leave a blank space parameter : The parameter passed to 'function_selector', the format must match with the VM's requirement. You can use a hs tool provided by remix to convert a parameter like [1,2] to the format that VM requires data : The data for interacting with smart contracts, including the contract function and parameters. You can choose to use this field, or you can choose to use function_selector and parameter for contract interaction. When both of data and function_selector exist, function_selector is preferred call_value : The TRX transfer to the contract for each call owner_address : Owner address that triggers the contract, default hexString call_token_value : The amount of trc10 token transfer to the contract for each call token_id : The id of trc10 token transfer to the contract Return: Transaction object Note: The unit of TRX in the parameters is SUN wallet/updatesetting \u00b6 Description: Update the consume_user_resource_percent parameter of a smart contract $ curl -X POST http://127.0.0.1:8090/wallet/updatesetting -d '{ \"owner_address\": \"419844f7600e018fd0d710e2145351d607b3316ce9\", \"contract_address\": \"41c6600433381c731f22fc2b9f864b14fe518b322f\", \"consume_user_resource_percent\": 7 }' owner_address :Owner address of the smart contract, default hexString contract_address :Smart contract address, default hexString consume_user_resource_percent :Consume user's resource percentage Permission_id : Optional, for multi-signature use Return: Transaction object wallet/updateenergylimit \u00b6 Description: Update the origin_energy_limit parameter of a smart contract $ curl -X POST http://127.0.0.1:8090/wallet/updateenergylimit -d '{ \"owner_address\": \"419844f7600e018fd0d710e2145351d607b3316ce9\", \"contract_address\": \"41c6600433381c731f22fc2b9f864b14fe518b322f\", \"origin_energy_limit\": 7 }' Parameters: owner_address : Owner address of the smart contract, default hexString contract_address : Smart contract address, default hexString origin_energy_limit : The maximum resource consumption of the creator in one execution or creation permission_id : Optional, for multi-signature use Return: Transaction object wallet/clearabi \u00b6 Description: To clear the abi of a smart contract $ curl -X POST http://127.0.0.1:8090/wallet/clearabi -d '{ \"owner_address\": \"41a7d8a35b260395c14aa456297662092ba3b76fc0\", \"contract_address\": \"417bcb781f4743afaacf9f9528f3ea903b3782339f\" }' Parameters: owner_address :Owner address of the smart contract contract_address : Smart contract address, default hexString Return: Transaction object wallet/estimateenergy \u00b6 Estimate the energy required for the successful execution of smart contract transactions curl -X POST http://127.0.0.1:8090/wallet/estimateenergy -d '{ \"owner_address\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\", \"contract_address\": \"TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs\", \"function_selector\": \"transfer(address,uint256)\", \"parameter\": \"00000000000000000000004115208EF33A926919ED270E2FA61367B2DA3753DA0000000000000000000000000000000000000000000000000000000000000032\", \"visible\": true }' Parameters: contract_address : Smart contract address. If visible=true, use base58check format, otherwise use hex format. function_selector : Function call, must not be left blank. parameter : Parameter encoding needs to be in accordance with the ABI rules, the rules are more complicated, users can use the ethers library to encode data : The data for interacting with smart contracts, including the contract function and parameters. You can choose to use this field, or you can choose to use function_selector and parameter for contract interaction. When both of data and function_selector exist, function_selector is preferred call_value : The TRX transfer to the contract for each call owner_address :Owner address that triggers the contract. If visible=true, use base58check format, otherwise use hex call_token_value : The amount of trc10 token transfer to the contract for each call token_id : The id of trc10 token transfer to the contract Return:Estimated the energy value TRC10 token \u00b6 The following are TRC10 token-related APIs: wallet/getassetissuebyaccount wallet/getassetissuebyname wallet/getassetissuelistbyname wallet/getassetissuebyid wallet/getassetissuelist wallet/getpaginatedassetissuelist wallet/transferasset wallet/participateassetissue wallet/createassetissue wallet/unfreezeasset wallet/updateasset wallet/getassetissuebyaccount \u00b6 Description: Query the token issue information of an account $ curl -X POST http://127.0.0.1:8090/wallet/getassetissuebyaccount -d '{ \"address\": \"41F9395ED64A6E1D4ED37CD17C75A1D247223CAF2D\" }' Parameter address: Token issuer's address, default hexString Return: Token object wallet/getassetissuebyname \u00b6 Description: Query a token by token name $ curl -X POST http://127.0.0.1:8090/wallet/getassetissuebyname -d '{ \"value\": \"44756354616E\" }' Parameter value: Token name, default hexString Return: Token object wallet/getassetissuelistbyname \u00b6 Description: Query the list of tokens by name $ curl -X POST http://127.0.0.1:8090/wallet/getassetissuelistbyname -d '{ \"value\": \"44756354616E\" }' Parameter value: Token name, default hexString Return: The list of tokens wallet/getassetissuebyid \u00b6 Description: Query a token by token id $ curl -X POST http://127.0.0.1:8090/wallet/getassetissuebyid -d '{ \"value\": \"1000001\" }' Parameter value: Token id Return: Token object wallet/getassetissuelist \u00b6 Description: Query the list of all the tokens $ curl -X GET http://127.0.0.1:8090/wallet/getassetissuelist Parameter: No parameter Return: The list of all the tokens wallet/getpaginatedassetissuelist \u00b6 Description: Query the list of all the tokens by pagination $ curl -X POST http://127.0.0.1:8090/wallet/getpaginatedassetissuelist -d '{ \"offset\": 0, \"limit\": 10 }' Parameters: offset : The index of the start token limit : The amount of tokens per page Return: The list of tokens by pagination wallet/transferasset \u00b6 Description: Transfer token $ curl -X POST http://127.0.0.1:8090/wallet/transferasset -d '{ \"owner_address\": \"41d1e7a6bc354106cb410e65ff8b181c600ff14292\", \"to_address\": \"41e552f6487585c2b58bc2c9bb4492bc1f17132cd0\", \"asset_name\": \"31303030303031\", \"amount\": 100 }' Parameters: owner_address : Owner address, default hexString to_address : To address, default hexString asset_name : Token id, default hexString amount : Token transfer amount permission_id : Optional, for multi-signature use Return: Transaction object Note: The unit of 'amount' is the smallest unit of the token wallet/participateassetissue \u00b6 Description: Participate a token $ curl -X POST http://127.0.0.1:8090/wallet/participateassetissue -d '{ \"to_address\": \"41e552f6487585c2b58bc2c9bb4492bc1f17132cd0\", \"owner_address\": \"41e472f387585c2b58bc2c9bb4492bc1f17342cd1\", \"amount\": 100, \"asset_name\": \"3230313271756265696a696e67\" }' Parameters: to_address : The issuer address of the token, default hexString owner_address : The participant address, default hexString amount : Participate token amount asset_name : Token id, default hexString permission_id : Optional, for multi-signature use Return: Transaction object Note: The unit of 'amount' is the smallest unit of the token wallet/createassetissue \u00b6 Description: Issue a token $ curl -X POST http://127.0.0.1:8090/wallet/createassetissue -d '{ \"owner_address\": \"41e552f6487585c2b58bc2c9bb4492bc1f17132cd0\", \"name\": \"0x6173736574497373756531353330383934333132313538\", \"abbr\": \"0x6162627231353330383934333132313538\", \"total_supply\": 4321, \"trx_num\": 1, \"num\": 1, \"start_time\": 1530894315158, \"end_time\": 1533894312158, \"description\": \"007570646174654e616d6531353330363038383733343633\", \"url\": \"007570646174654e616d6531353330363038383733343633\", \"free_asset_net_limit\": 10000, \"public_free_asset_net_limit\": 10000, \"frozen_supply\": { \"frozen_amount\": 1, \"frozen_days\": 2 } }' Parameters: owner_address : Owner address, default hexString name : Token name, default hexString abbr : Token name abbreviation, default hexString total_supply : Token total supply trx_num : Define the price by the ratio of trx_num/num num : Define the price by the ratio of trx_num/num start_time : ICO start time end_time : ICO end time description : Token description, default hexString url : Token official website url, default hexString free_asset_net_limit : Token free asset net limit public_free_asset_net_limit : Token public free asset net limit frozen_supply : Token staked supply permission_id : Optional, for multi-signature use Return: Transaction object Note: The unit of 'trx_num' is SUN wallet/unfreezeasset \u00b6 Description: Unstake the staked token that is due $ curl -X POST http://127.0.0.1:8090/wallet/unfreezeasset -d '{ \"owner_address\": \"41e472f387585c2b58bc2c9bb4492bc1f17342cd1\" }' Parameters: - owner_address : Owner address, default hexString - permission_id : Optional, for multi-signature use Return: Transaction object wallet/updateasset \u00b6 Description: Update token information $ curl -X POST http://127.0.0.1:8090/wallet/updateasset -d '{ \"owner_address\": \"41e472f387585c2b58bc2c9bb4492bc1f17342cd1\", \"description\": \"\", \"url\": \"\", \"new_limit\": 1000000, \"new_public_limit\": 100 }' Parameters: owner_address : The issuers address of the token, default hexString description : The description of token, default hexString url : The token's website url, default hexString new_limit : Each token holder's free bandwidth new_public_limit : The total free bandwidth of the token permission_id : Optional, for multi-signature use Return: Transaction object Vote and SR \u00b6 The following are voting and SR related APIs: wallet/createwitness wallet/updatewitness wallet/listwitnesses wallet/withdrawbalance wallet/votewitnessaccount wallet/getBrokerage wallet/updateBrokerage wallet/getReward wallet/getnextmaintenancetime wallet/createwitness \u00b6 Description: Apply to become a witness $ curl -X POST http://127.0.0.1:8090/wallet/createwitness -d '{ \"owner_address\": \"41d1e7a6bc354106cb410e65ff8b181c600ff14292\", \"url\": \"007570646174654e616d6531353330363038383733343633\" }' Parameters: owner_address : Owner address, default hexString url : Website url, default hexString permission_id : Optional, for multi-signature use Return: Transaction object wallet/updatewitness \u00b6 Description: Update the witness' website url $ curl -X POST http://127.0.0.1:8090/wallet/updatewitness -d '{ \"owner_address\": \"41d1e7a6bc354106cb410e65ff8b181c600ff14292\", \"update_url\": \"007570646174654e616d6531353330363038383733343633\" }' Parameters: owner_address : Owner address, default hexString update_url : Website url, default hexString permission_id : Optional, for multi-signature use Return: Transaction object wallet/listwitnesses \u00b6 Description: Qyery the list of the witnesses curl -X POST http://127.0.0.1:8090/wallet/listwitnesses Parameters: N/A Return:witness list wallet/withdrawbalance \u00b6 Description: Withdraw reward to account balance for witnesses $ curl -X POST http://127.0.0.1:8090/wallet/withdrawbalance -d '{ \"owner_address\": \"41e472f387585c2b58bc2c9bb4492bc1f17342cd1\" }' Parameters: owner_address : Owner address, default hexString permission_id : Optional, for multi-signature use Return: Transaction object Note: It can only withdraw once for every 24 hours wallet/votewitnessaccount \u00b6 Description: Vote for witnesses $ curl -X POST http://127.0.0.1:8090/wallet/votewitnessaccount -d '{ \"owner_address\": \"41d1e7a6bc354106cb410e65ff8b181c600ff14292\", \"votes\": [ { \"vote_address\": \"41e552f6487585c2b58bc2c9bb4492bc1f17132cd0\", \"vote_count\": 5 } ] }' Parameters: owner_address : Owner address, default hexString votes : 'vote_address' stands for the address of the witness you want to vote, default hexString, 'vote_count' stands for the number of votes you want to vote permission_id : Optional, for multi-signature use Return: Transaction object wallet/getBrokerage \u00b6 Description: Query the ratio of brokerage of the witness $ curl -X GET http://127.0.0.1:8090/wallet/getBrokerage -d ' { \"address\":\"41E552F6487585C2B58BC2C9BB4492BC1F17132CD0\"}' Parameter address : The address of the witness's account, default hexString Return: The ratio of brokerage of the witness wallet/updateBrokerage \u00b6 Description: Update the ratio of brokerage $ curl -X POST http://127.0.0.1:8090/wallet/updateBrokerage -d ' { \"owner_address\":\"41E552F6487585C2B58BC2C9BB4492BC1F17132CD0\", \"brokerage\":30 }' Parameters: owner_address : The address of the witness's account, default hexString brokerage : The ratio of brokerage you want to update to Return: Transaction object wallet/getReward \u00b6 Description: Query unclaimed reward $ curl -X GET http://127.0.0.1:8090/wallet/getReward -d '{ \"address\":\"41E552F6487585C2B58BC2C9BB4492BC1F17132CD0\"}' Parameter address : The address of the voter's account, default hexString Return: Unclaimed reward wallet/getnextmaintenancetime \u00b6 Description: Query the time interval till the next vote round curl -X POST http://127.0.0.1:8090/wallet/getnextmaintenancetime Parameters: N/A Return: The time interval till the next vote round(unit: ms) Proposals \u00b6 The following are proposal-related APIs: wallet/proposalcreate wallet/getproposalbyid wallet/listproposals wallet/proposalapprove wallet/proposaldelete wallet/getpaginatedproposallist wallet/proposalcreate \u00b6 Description: Create a proposal $ curl -X POST http://127.0.0.1:8090/wallet/proposalcreate -d '{ \"owner_address\": \"419844F7600E018FD0D710E2145351D607B3316CE9\", \"parameters\": [ { \"key\": 0, \"value\": 100000 }, { \"key\": 1, \"value\": 2 } ] }' Parameters: owner_address : Creator address parameters : Proposal parameters permission_id : Optional, for multi-signature use Return: Transaction object wallet/getproposalbyid \u00b6 Description: Query a proposal by proposal id $ curl -X POST http://127.0.0.1:8090/wallet/getproposalbyid -d '{ \"id\": 1 }' Parameter id : Proposal id Return: The proposal information wallet/listproposals \u00b6 Description: Query all the proposals $ curl -X POST http://127.0.0.1:8090/wallet/listproposals Parameter: No parameter Return: The list of all the proposals wallet/proposalapprove \u00b6 Description: To approve a proposal $ curl -X POST http://127.0.0.1:8090/wallet/proposalapprove -d '{ \"owner_address\": \"419844F7600E018FD0D710E2145351D607B3316CE9\", \"proposal_id\": 1, \"is_add_approval\": true }' Parameters: owner_address : The address that makes the approve action, default hexString proposal_id : Proposal id is_add_approval : Whether to approve permission_id : Optional, for multi-signature use Return: Transaction object wallet/proposaldelete \u00b6 Description: To delete a proposal $ curl -X POST http://127.0.0.1:8090/wallet/proposaldelete -d '{ \"owner_address\": \"419844F7600E018FD0D710E2145351D607B3316CE9\", \"proposal_id\": 1 }' Parameters: owner_address : Owner address of the proposal, default hexString proposal_id : Proposal id permission_id : Optional, for multi-signature use Return: Transaction object wallet/getpaginatedproposallist \u00b6 Description: Query the list of all the proposals by pagination $ curl -X POST http://127.0.0.1:8090/wallet/getpaginatedproposallist -d '{ \"offset\": 0, \"limit\": 10 }' Parameters: offset : The index of the start proposal limit : The amount of proposals per page Return: The list of proposals by pagination DEX Exchange \u00b6 The following are the APIs related to decentralized exchanges: wallet/exchangecreate wallet/exchangeinject wallet/exchangewithdraw wallet/exchangetransaction wallet/getexchangebyid wallet/listexchanges wallet/getpaginatedexchangelist wallet/marketsellasset wallet/marketcancelorder wallet/getmarketorderbyaccount wallet/getmarketpairlist wallet/getmarketorderlistbypair wallet/getmarketpricebypair wallet/getmarketorderbyid wallet/exchangecreate \u00b6 Description: Create an exchange pair $ curl -X POST http://127.0.0.1:8090/wallet/exchangecreate -d '{ \"owner_address\": \"419844f7600e018fd0d710e2145351d607b3316ce9\", \"first_token_id\": \"token_a\", \"first_token_balance\": 100, \"second_token_id\": \"token_b\", \"second_token_balance\": 200 }' Parameters: owner_address : address first_token_id : The first token's id, default hexString first_token_balance : The first token's balance second_token_id : The second token's id, default hexString second_token_balance : The second token's balance permission_id : Optional, for multi-signature use Return: Transaction object Note: The unit of 'first_token_balance' and 'second_token_balance' is the smallest unit of the token wallet/exchangeinject \u00b6 Description: Inject funds for exchange pair $ curl -X POST http://127.0.0.1:8090/wallet/exchangeinject -d '{ \"owner_address\": \"419844f7600e018fd0d710e2145351d607b3316ce9\", \"exchange_id\": 1, \"token_id\": \"74726f6e6e616d65\", \"quant\": 100 }' Parameters: owner_address : Owner address of the exchange pair, default hexString exchange_id : Exchange pair id token_id : Token id, default hexString quant : Token inject amount permission_id : Optional, for multi-signature use Return: Transaction object Note: The unit of 'quant' is the smallest unit of the token wallet/exchangewithdraw \u00b6 Description: Withdraw from exchange pair $ curl -X POST http://127.0.0.1:8090/wallet/exchangewithdraw -d '{ \"owner_address\": \"419844f7600e018fd0d710e2145351d607b3316ce9\", \"exchange_id\": 1, \"token_id\": \"74726f6e6e616d65\", \"quant\": 100 }' Parameters: owner_address : Owner address of the exchange pair, default hexString exchange_id : Exchange pair id token_id : Token id, default hexString quant : Token withdraw amount permission_id : Optional, for multi-signature use Return: Transaction object Note: The unit of 'quant' is the smallest unit of the token wallet/exchangetransaction \u00b6 Description: Participate the transaction of exchange pair $ curl -X POST http://127.0.0.1:8090/wallet/exchangetransaction -d '{ \"owner_address\": \"419844f7600e018fd0d710e2145351d607b3316ce9\", \"exchange_id\": 1, \"token_id\": \"74726f6e6e616d65\", \"quant\": 100, \"expected\": 10 }' Parameters: owner_address : Owner address of the exchange pair, default hexString exchange_id : Exchange pair id token_id : Token id, default hexString quant : Sell token amount expected : Expected token amount to get permission_id : Optional, for multi-signature use Return: Transaction object Note: The unit of 'quant' and 'expected' is the smallest unit of the token wallet/getexchangebyid \u00b6 Description: Query an exchange pair by exchange pair id $ curl -X POST http://127.0.0.1:8090/wallet/getexchangebyid -d '{ \"id\": 1 }' Parameter id: Exchange pair id Return: Exchange pair information wallet/listexchanges \u00b6 Description: Query the list of all the exchange pairs $ curl -X GET http://127.0.0.1:8090/wallet/listexchanges Parameter: No parameter Return: The list of all the exchange pairs wallet/getpaginatedexchangelist \u00b6 Description: Query the list of all the exchange pairs by pagination $ curl -X POST http://127.0.0.1:8090/wallet/getpaginatedexchangelist -d '{ \"offset\": 0, \"limit\": 10 }' Parameters: offset : The index of the start exchange pair limit : The amount of exchange pairs per page Return: The list of exchange pairs by pagination wallet/marketsellasset \u00b6 Description\uff1aCreate an market order curl -X POST http://127.0.0.1:8090/wallet/marketsellasset -d '{ \"owner_address\": \"4184894b42f66dce8cb84aec2ed11604c991351ac8\", \"sell_token_id\": \"5f\", \"sell_token_quantity\": 100, \"buy_token_id\": \"31303030303031\", \"buy_token_quantity\": 200 }' Parameters\uff1a owner_address \uff1aowner address, default hexString sell_token_id \uff1asell token id, default hexString sell_token_quantity \uff1asell token quantity buy_token_id \uff1abuy token id, default hexString buy_token_quantity \uff1abuy token quantity (min to receive) Return\uff1aTransaction object wallet/marketcancelorder \u00b6 Description\uff1aCancel the order curl -X POST http://127.0.0.1:8090/wallet/marketcancelorder -d '{ \"owner_address\": \"4184894b42f66dce8cb84aec2ed11604c991351ac8\", \"order_id\": \"0a7af584a53b612bcff1d0fc86feab05f69bc4528f26a4433bb344d453bd6eeb\" }' Parameters\uff1a owner_address \uff1aowner address, default hexString order_id \uff1aorder id Return\uff1aTransaction object wallet/getmarketorderbyaccount \u00b6 Description\uff1aGet all orders for the account curl -X POST http://127.0.0.1:8090/wallet/getmarketorderbyaccount -d '{ \"value\": \"4184894b42f66dce8cb84aec2ed11604c991351ac8\" }' Parameters\uff1a value - owner address, default hexString Return\uff1aorder list wallet/getmarketpairlist \u00b6 Description\uff1aGet all trading pairs curl -X get http://127.0.0.1:8090/wallet/getmarketpairlist Parameters: N/A Return: makket pair list wallet/getmarketorderlistbypair \u00b6 Description\uff1aGet all orders for the trading pair demo: curl -X POST http://127.0.0.1:8090/wallet/getmarketorderlistbypair -d '{ \"sell_token_id\": \"5f\" , \"buy_token_id\": \"31303030303031\" }' Parameters\uff1a sell_token_id \uff1asell token id, default hexString buy_token_id \uff1abuy token id, default hexString Return\uff1aorder list wallet/getmarketpricebypair \u00b6 Description\uff1aGet all prices for the trading pair curl -X POST http://127.0.0.1:8090/wallet/getmarketpricebypair -d '{ \"sell_token_id\": \"5f\" \"buy_token_id\": \"31303030303031\" }' Parameters\uff1a sell_token_id \uff1asell token id, default hexString buy_token_id \uff1abuy token id, default hexString Return\uff1aprice list wallet/getmarketorderbyid \u00b6 Description\uff1aGet all orders for the account curl -X POST http://127.0.0.1:8090/wallet/getmarketorderbyid -d '{ \"value\": \"orderid\" }' Parameters\uff1a value - order id, default hexString Return\uff1aorder TRONZ Shielded Smart Contract \u00b6 The following are TRONZ anonymous smart contract related APIs: wallet/getexpandedspendingkey wallet/getakfromask wallet/getnkfromnsk wallet/getspendingkey wallet/getdiversifier wallet/getincomingviewingkey wallet/getzenpaymentaddress wallet/createshieldedtransactionwithoutspendauthsig wallet/scannotebyivk wallet/scanandmarknotebyivk wallet/scannotebyovk wallet/createshieldnullifier wallet/getshieldtransactionhash wallet/createshieldedtransaction wallet/getnewshieldedaddress wallet/createshieldedcontractparameters wallet/createshieldedcontractparameterswithoutask wallet/scanshieldedtrc20notesbyivk wallet/scanshieldedtrc20notesbyovk wallet/isshieldedtrc20contractnotespent wallet/gettriggerinputforshieldedtrc20contract wallet/getrcm wallet/getmerkletreevoucherinfo wallet/isspend wallet/createspendauthsig wallet/getexpandedspendingkey \u00b6 Description: To get expanded spending keys from spending key curl -X POST http://127.0.0.1:8090/wallet/getexpandedspendingkey -d '{ \"value\": \"06b02aaa00f230b0887ff57a6609d76691369972ac3ba568fe7a8a0897fce7c4\" }' Parameters: value:Spending key Return: Expanded spending keys, it consists of three keys: ask, nsk and ovk. wallet/getakfromask \u00b6 Description: To get ak key from ask key curl -X POST http://127.0.0.1:8090/wallet/getakfromask -d '{ \"value\": \"653b3a3fdd40b60d2f53ba121df8840f6590384993f8fa9a0ecb0dfb23496604\" }' Parameters: value:Ask Return:Ak wallet/getnkfromnsk \u00b6 Description: To get nk key from nsk key curl -X POST http://127.0.0.1:8090/wallet/getnkfromnsk -d '{ \"value\": \"428ff3c9e101dc1fca08f7b0e3387b23b68016746ae565aefc19d112b696db01\" }' Parameters: value:Nsk Return:Nk wallet/getspendingkey \u00b6 Description: To get spending key curl -X GET http://127.0.0.1:8090/wallet/getspendingkey Parameters: N/A Return:Spending key wallet/getdiversifier \u00b6 Description: To get diversifier curl -X GET http://127.0.0.1:8090/wallet/getdiversifier Parameters: N/A Return: Diversifier wallet/getincomingviewingkey \u00b6 Description: To get incoming viewing key curl -X POST http://127.0.0.1:8090/wallet/getincomingviewingkey -d '{ \"ak\":\"b443f1a303ef5837ba95750b48b6fef15f9c77f63a8c28c161bcd6613f423b5c\", \"nk\":\"632137e69179df3d10e252fcce85d13464c3163fe7a619edf8d43ebefa8162d9\" }' Parameters: ak :Ak nk :Nk Return:Incoming viewing key wallet/getzenpaymentaddress \u00b6 Description: To get payment address curl -X POST http://127.0.0.1:8090/wallet/getzenpaymentaddress -d '{ \"ivk\":\"8c7852e10862d8eec058635974f70f24c1f8d73819131bb5b54028d0a9408a03\", \"d\":\"736ba8692ed88a5473e009\" }' Parameters: ivk :Ivk d :D Return: Payment address wallet/createshieldedtransactionwithoutspendauthsig \u00b6 Description: To create shielded transaction without using ask $ curl -X POST http://127.0.0.1:8090/wallet/createshieldedtransactionwithoutspendauthsig -d '{ \"ivk\":\"8c7852e10862d8eec058635974f70f24c1f8d73819131bb5b54028d0a9408a03\", \"d\":\"736ba8692ed88a5473e009\" }' Parameters: transparent_from_address : Transparent sender's address from_amount : Send amount from transparent address ask : Ask nsk : Nsk ovk : Ovk shielded_receives : Shielded receive information shieldedSpends : Shielded spend information transparent_to_address : Transparent receiver's address to_amount : Send amount to transparent address Return: Transaction object wallet/createshieldedtransactionwithoutspendauthsig \u00b6 Description: To create shielded transaction with using ask curl -X POST http://127.0.0.1:8090/wallet/createshieldedtransactionwithoutspendauthsig -d '{ \"ak\": \"bf051629fd8122cd9dd8591d72947b026c214cf7cdac1f68eff97179727d38e9\", \"nsk\": \"42963d26af8122204273fa3489d9efd6babf1f7179ff193c955a1f3d9c2df10c\", \"ovk\": \"bc9848a83966709655b12efadc9e978785858316045e0115a0e72567a9a2a823\", \"shielded_spends\": [ { \"note\": { \"value\": 500000000, \"payment_address\": \"ztron1jld8fmvujrz2vgkc867zuwklmewy4ypw0wtwgweqs2paee0uhc8f3azy90el770arksa2kunl02\", \"rcm\": \"723053bcbfecdf5da66c18ab0376476ef308c61b7abe891b2c01e903bcb87c0e\" }, \"alpha\": \"2608999c3a97d005a879ecdaa16fd29ae434fb67b177c5e875b0c829e6a1db04\", \"voucher\": { \"tree\": { \"left\": { \"content\": \"a3d5c9b2db9699f32afec5febbd5586ce9ff33a0bef6fee5691028313b8e1f6a\" }, \"parents\": [ { \"content\": \"d9c38484296b3aa8f5e8b59d418a3775e2bb414e75498ad352e4614f05aae548\" }, { \"content\": \"d0420777afdc4151c3f14fbe4c714d82dc15873edb1ca65ebb3887334a4bae15\" } ] }, \"rt\": \"fb1115d5ddd16c5427c3a608d6b5add5967e70f51c890307c6142083a2c28565\" }, \"path\": \"2020b2eed031d4d6a4f02a097f80b54cc1541d4163c6b6f5971f88b6e41d35c538142012935f14b676509b81eb49ef25f39269ed72309238b4c145803544b646dca62d20e1f34b034d4a3cd28557e2907ebf990c918f64ecb50a94f01d6fda5ca5c7ef722028e7b841dcbc47cceb69d7cb8d94245fb7cb2ba3a7a6bc18f13f945f7dbd6e2a20a5122c08ff9c161d9ca6fc462073396c7d7d38e8ee48cdb3bea7e2230134ed6a20d2e1642c9a462229289e5b0e3b7f9008e0301cbb93385ee0e21da2545073cb582016d6252968971a83da8521d65382e61f0176646d771c91528e3276ee45383e4a20fee0e52802cb0c46b1eb4d376c62697f4759f6c8917fa352571202fd778fd712204c6937d78f42685f84b43ad3b7b00f81285662f85c6a68ef11d62ad1a3ee0850200769557bc682b1bf308646fd0b22e648e8b9e98f57e29f5af40f6edb833e2c492008eeab0c13abd6069e6310197bf80f9c1ea6de78fd19cbae24d4a520e6cf3023208d5fa43e5a10d11605ac7430ba1f5d81fb1b68d29a640405767749e841527673206aca8448d8263e547d5ff2950e2ed3839e998d31cbc6ac9fd57bc6002b15921620cd1c8dbf6e3acc7a80439bc4962cf25b9dce7c896f3a5bd70803fc5a0e33cf00206edb16d01907b759977d7650dad7e3ec049af1a3d875380b697c862c9ec5d51c201ea6675f9551eeb9dfaaa9247bc9858270d3d3a4c5afa7177a984d5ed1be245120d6acdedf95f608e09fa53fb43dcd0990475726c5131210c9e5caeab97f0e642f20bd74b25aacb92378a871bf27d225cfc26baca344a1ea35fdd94510f3d157082c201b77dac4d24fb7258c3c528704c59430b630718bec486421837021cf75dab65120ec677114c27206f5debc1c1ed66f95e2b1885da5b7be3d736b1de98579473048204777c8776a3b1e69b73a62fa701fa4f7a6282d9aee2c7a6b82e7937d7081c23c20ba49b659fbd0b7334211ea6a9d9df185c757e70aa81da562fb912b84f49bce722043ff5457f13b926b61df552d4e402ee6dc1463f99a535f9a713439264d5b616b207b99abdc3730991cc9274727d7d82d28cb794edbc7034b4f0053ff7c4b68044420d6c639ac24b46bd19341c91b13fdcab31581ddaf7f1411336a271f3d0aa52813208ac9cf9c391e3fd42891d27238a81a8a5c1d3a72b1bcbea8cf44a58ce738961320912d82b2c2bca231f71efcf61737fbf0a08befa0416215aeef53e8bb6d23390a20e110de65c907b9dea4ae0bd83a4b0a51bea175646a64c12b4c9f931b2cb31b4920d8283386ef2ef07ebdbb4383c12a739a953a4d6e0d6fb1139a4036d693bfbb6c20d0420777afdc4151c3f14fbe4c714d82dc15873edb1ca65ebb3887334a4bae1520d9c38484296b3aa8f5e8b59d418a3775e2bb414e75498ad352e4614f05aae5482001000000000000000000000000000000000000000000000000000000000000000600000000000000\" } ], \"shielded_receives\": [ { \"note\": { \"value\": 40000000, \"payment_address\": \"ztron1wd46s6fwmz99gulqpxul6zffqtevzfpl93ng3s5834fhwf6e7w5l6zmjhmpvtwsc4wxa7dusmvr\", \"rcm\": \"ccced07d36641fc93cba33cddda7064cb82f6962a0bdf15a4240a4a742770e03\" } } ] }' Parameters: transparent_from_address : Transparent sender's address from_amount : Send amount from transparent address ak : Ak nsk : Nsk ovk : Ovk shielded_receives : Shielded receive information shieldedSpends : Shielded spend information transparent_to_address : Transparent receiver's address to_amount : Send amount to transparent address Return: Transaction object wallet/scannotebyivk \u00b6 Description: To get all the notes by ivk $ curl -X POST http://127.0.0.1:8090/wallet/scannotebyivk -d '{ \"start_block_index\": 0, \"end_block_index\": 100, \"ivk\": \"80a481c3c739e54b4e0608090b3a1a6e9f8dce42346e95bf5a2d8a487bf45c05\" }' Parameters: start_block_index : The start block height, itself included end_block_index : The end block height, itself not included ivk : Incoming viewing key Return: Notes list Note: Range limit (end_block_index - start_block_index <= 1000) wallet/scanandmarknotebyivk \u00b6 Description: To get all the notes with spent status by ivk $ curl -X POST http://127.0.0.1:8090/wallet/scanandmarknotebyivk -d '{ \"start_block_index\": 0, \"end_block_index\": 100, \"ivk\": \"80a481c3c739e54b4e0608090b3a1a6e9f8dce42346e95bf5a2d8a487bf45c05\", \"ak\": \"1d4f9b5551f4aa9443ceb263f0e208eb7e26080264571c5ef06de97a646fe418\", \"nk\": \"748522c7571a9da787e43940c9a474aa0c5c39b46c338905deb6726fa3678bdb\" }' Parameters: start_block_index : The start block height, itself included end_block_index : The end block height, itself not included ivk : Incoming viewing key ak : Ak key nk : Nk key Return: Notes list Note: Range limit (end_block_index - start_block_index <= 1000) wallet/scannotebyovk \u00b6 Description: To get all the notes by ovk $ curl -X POST http://127.0.0.1:8090/wallet/scannotebyovk -d '{ \"start_block_index\": 0, \"end_block_index\": 100, \"ovk\": \"705145aa18cbe6c11d5d0011419a98f3d5b1d341eb4727f1315597f4bdaf8539\" }' Parameters: start_block_index : The start block height, itself included end_block_index : The end block height, itself not included ovk : Outgoing viewing key Return: Notes list Note: Range limit (end_block_index - start_block_index <= 1000) wallet/createshieldnullifier \u00b6 Description: To create a shielded nullifier $ curl -X POST http://127.0.0.1:8090/wallet/createshieldnullifier -d '{ \"note\": { \"payment_address\": \"ztron1aqgauawtkelxfu2w6s48cwh0mchjt6kwpj44l4wym3pullx0294j4r4v7kpm75wnclzycsw73mq\", \"rcm\": \"74a16c1b27ec7fbf06881d9d35ddaab1554838b1bddcd54f6bd8a9fb4ba0b80a\", \"value\": 500000000 }, \"voucher\": { \"tree\": { \"left\": { \"content\": \"a4d763fae3fee78964ccdf7567ec3062c95a5b97825d731202d3dfa6cb01c143\" } }, \"rt\": \"7dc3652c2a16e8518a8be0e3e038f9d28c3eb96f13e8da8acc2a9b650702f33e\" }, \"ak\": \"a3e65d509b675aaa2aeda977ceff11eebd76218079b6f543d78a615e396ca129\", \"nk\": \"62cfda9bea09a53cf2a21022057913734a8458969e11e0bb9c59ead48fbce83e\" }' Parameters: note : Note information voucher : Voucher information ak : Ak nk : Nk Return: A shielded nullifier wallet/getshieldtransactionhash \u00b6 Description: To get a shielded transaction hash curl -X POST http://127.0.0.1:8090/wallet/getshieldtransactionhash -d '{ \"txID\": \"de639a64497d86bb27e34a2953093a0cc488ec4c7bc9624ac5857d3799748595\", \"raw_data\": { \"contract\": [ { \"parameter\": { \"value\": { \"binding_signature\": \"2b8ae5e11ecad3e6946f54b7ad513bd8692a3edae72d29e266b28e47c9b37ccdb38e3b6433575694b6681136b1734f85afcfe672061d2ee7368755ad0b96a80b\", \"spend_description\": [ { \"value_commitment\": \"cbe1063adbe7e10919421fa6133f03150253913f5aff02d165e2c019cea4a869\", \"anchor\": \"fb1115d5ddd16c5427c3a608d6b5add5967e70f51c890307c6142083a2c28565\", \"nullifier\": \"93e329d464e1dbddc8bb4d2dcc939a796dfe11e985d4e9033a15edf0e3df4f35\", \"rk\": \"10c702d6dff1509502ee5acc0b01d4b4531b2ff53b0dd54488aea6031b5e6d16\", \"zkproof\": \"abf64b3beacfd873b1db764c3da9f739993518f3f740e761cb8af60682b7171892895c3ccfb550c3cf757e906dbf5313a3676b8226b0b84960f76a185c8d3fdfc3fa9c08479a704852d7b3dfeb913cf13e01c25657561e00a06c61e7c65b50b812902ddc4f17bfe2bcb2f247c2dc6132d0f0e0abcecc0332fdd99077af10d07bbdb88c4fd257948428e233c57f84eee8b2eeab2162c1aeccf2e1dfaa306d5803a8b2d281a549440fbd5a3657a830c1ca07a384cea446aa077b195b29b23023b1\" } ], \"receive_description\": [ { \"value_commitment\": \"f6d45db8ec5a1c8dbbde040b4ea138efbe8db2d0597ed2306ff3fdd0620b3c5a\", \"note_commitment\": \"ec3f5472ac8114a9a07987d1c2a0e1254504e352d9574971e77084293900312e\", \"epk\": \"719eeb5ebaeeccc55c9f0d73767aadf0c0513603400ccb50bd789637d984b8e6\", \"c_enc\": \"3a6c4fe0e79f5b23fed34a419c4728d0b26bca23180a22871743b0a9444c27663cf07c55a0ea6db504d70421768bf17384e180b2ad8b8be88ff5cf662c53a4ba086effc3a4b1df39265f71dfac884bff5a69e1dcdcae8aecf6ae443168ffab692a5c1e4908b415dd830dcf6432fae1c32461132080da74d6b83d3d00887eb2ce9965a749f8d8410ea4182969371ac2fd5e0e74d27d883492a08e6209cd9959d74bb67c2a9fe7faac5a4777f1bff19cf0b6398a2faa9b194bbb93d60f132f382f7d693a722e8cbca1da084ee7e0c371397419a7259d1fa0943078cfe5ea352e4b53907bb6c04ca8ad409fb0ae0b110a6b312200e21ab79d543ae7aeb16802cf87afdac1e8954038caa42818f4ca2847fd642360c098accfeeade4abd1cc9ca3315a4336be224ba3516973c7dae3f41875457236675993df38d3a544470c4f9335d77b005e6a9aec40fd881b34852ec9bbbcc3d24ee92930eae770a5462ce04c4e37b0524ef07e00e8d58c810d6aefb19fa7bc2c3a2fdfab6dd4fe73dbecc0795a280f9b7ca35cc8bc1062aed8e26bd81ba33c6f4c318974636f6d796723e77772ced3dbc1f42afec6fc9bb61f8beac704affea9baf2e2de226250c1d427c7d78b1eb1d239e1f3eb6af0f017b80541333f4fce17340048d826b9b0be8477c996ad8bfc3440dc686fdff6d0d63986db4d95962d7977289cbfd14c745de7c79d4dc0bcd220e5b4ced5b409e79142e0f336e44ca29a9a87f6f43707d8c4936e895236dd2b393a478a8bc27b1f682496ba84a0ddc549da06cb7855c4d8680dc66ac40240733b7f\", \"c_out\": \"50be6e77854d4c427b2af4f16e5275f0b0c206b3ea2d2a24ffb287ea356f323523354cd83d15e7c48e6f1fa103dfca3d49ca2263dbb0cd8bfb35d72cdcad1351de6fba7a30aea27184a68bcda19cc6da\", \"zkproof\": \"a4e6c50d5753092d005689922c2bdeafc98775bce59db840974163ace23c13fec18112e32aae1c39842c645ed172ad8fa277e63c1e3d6d7fb12eb15d56b573237b776f562a81d0e6be362d147d8604fdfec421482270ca82950de1883fda06e719f5d256d7a039769bffc570a1778d70c17295d1c0336a6ae0903d2460dc139a9563c2d40f37bffefa73003a55af1ff0861b6f79ef40099b6a0cb25ab3f40727210e4629647d0711abff125712a5f0d64fcb6e6a6b0b34478d7da0552b493a80\" } ] }, \"type_url\": \"type.googleapis.com/protocol.ShieldedTransferContract\" }, \"type\": \"ShieldedTransferContract\" } ], \"ref_block_bytes\": \"0d59\", \"ref_block_hash\": \"7356ce5c35d8265e\", \"expiration\": 1559237283000, \"timestamp\": 1559201285590 }, \"raw_data_hex\": \"0a020d5922087356ce5c35d8265e40b899a3ceb02d5a940b0833128f0b0a35747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e536869656c6465645472616e73666572436f6e747261637412d50a1acb020a20cbe1063adbe7e10919421fa6133f03150253913f5aff02d165e2c019cea4a8691220fb1115d5ddd16c5427c3a608d6b5add5967e70f51c890307c6142083a2c285651a2093e329d464e1dbddc8bb4d2dcc939a796dfe11e985d4e9033a15edf0e3df4f35222010c702d6dff1509502ee5acc0b01d4b4531b2ff53b0dd54488aea6031b5e6d162ac001abf64b3beacfd873b1db764c3da9f739993518f3f740e761cb8af60682b7171892895c3ccfb550c3cf757e906dbf5313a3676b8226b0b84960f76a185c8d3fdfc3fa9c08479a704852d7b3dfeb913cf13e01c25657561e00a06c61e7c65b50b812902ddc4f17bfe2bcb2f247c2dc6132d0f0e0abcecc0332fdd99077af10d07bbdb88c4fd257948428e233c57f84eee8b2eeab2162c1aeccf2e1dfaa306d5803a8b2d281a549440fbd5a3657a830c1ca07a384cea446aa077b195b29b23023b122c2070a20f6d45db8ec5a1c8dbbde040b4ea138efbe8db2d0597ed2306ff3fdd0620b3c5a1220ec3f5472ac8114a9a07987d1c2a0e1254504e352d9574971e77084293900312e1a20719eeb5ebaeeccc55c9f0d73767aadf0c0513603400ccb50bd789637d984b8e622c4043a6c4fe0e79f5b23fed34a419c4728d0b26bca23180a22871743b0a9444c27663cf07c55a0ea6db504d70421768bf17384e180b2ad8b8be88ff5cf662c53a4ba086effc3a4b1df39265f71dfac884bff5a69e1dcdcae8aecf6ae443168ffab692a5c1e4908b415dd830dcf6432fae1c32461132080da74d6b83d3d00887eb2ce9965a749f8d8410ea4182969371ac2fd5e0e74d27d883492a08e6209cd9959d74bb67c2a9fe7faac5a4777f1bff19cf0b6398a2faa9b194bbb93d60f132f382f7d693a722e8cbca1da084ee7e0c371397419a7259d1fa0943078cfe5ea352e4b53907bb6c04ca8ad409fb0ae0b110a6b312200e21ab79d543ae7aeb16802cf87afdac1e8954038caa42818f4ca2847fd642360c098accfeeade4abd1cc9ca3315a4336be224ba3516973c7dae3f41875457236675993df38d3a544470c4f9335d77b005e6a9aec40fd881b34852ec9bbbcc3d24ee92930eae770a5462ce04c4e37b0524ef07e00e8d58c810d6aefb19fa7bc2c3a2fdfab6dd4fe73dbecc0795a280f9b7ca35cc8bc1062aed8e26bd81ba33c6f4c318974636f6d796723e77772ced3dbc1f42afec6fc9bb61f8beac704affea9baf2e2de226250c1d427c7d78b1eb1d239e1f3eb6af0f017b80541333f4fce17340048d826b9b0be8477c996ad8bfc3440dc686fdff6d0d63986db4d95962d7977289cbfd14c745de7c79d4dc0bcd220e5b4ced5b409e79142e0f336e44ca29a9a87f6f43707d8c4936e895236dd2b393a478a8bc27b1f682496ba84a0ddc549da06cb7855c4d8680dc66ac40240733b7f2a5050be6e77854d4c427b2af4f16e5275f0b0c206b3ea2d2a24ffb287ea356f323523354cd83d15e7c48e6f1fa103dfca3d49ca2263dbb0cd8bfb35d72cdcad1351de6fba7a30aea27184a68bcda19cc6da32c001a4e6c50d5753092d005689922c2bdeafc98775bce59db840974163ace23c13fec18112e32aae1c39842c645ed172ad8fa277e63c1e3d6d7fb12eb15d56b573237b776f562a81d0e6be362d147d8604fdfec421482270ca82950de1883fda06e719f5d256d7a039769bffc570a1778d70c17295d1c0336a6ae0903d2460dc139a9563c2d40f37bffefa73003a55af1ff0861b6f79ef40099b6a0cb25ab3f40727210e4629647d0711abff125712a5f0d64fcb6e6a6b0b34478d7da0552b493a802a402b8ae5e11ecad3e6946f54b7ad513bd8692a3edae72d29e266b28e47c9b37ccdb38e3b6433575694b6681136b1734f85afcfe672061d2ee7368755ad0b96a80b70d68b8ebdb02d\" }' Parameter transaction: Transaction object Return: a shielded transaction hash wallet/createshieldedtransaction \u00b6 Description: To create shielded transaction Please refer to The Demo Parameters: transparent_from_address : Transparent sender's address from_amount : Send amount from transparent address ask : Ask nsk : Nsk ovk : Ovk shielded_receives : Shielded receive information shieldedSpends : Shielded spend information transparent_to_address : Transparent receiver's address to_amount : Send amount to transparent address Return: Transaction object wallet/getnewshieldedaddress \u00b6 Description: To get new shieldedAddress curl -X GET http://127.0.0.1:8090/wallet/getnewshieldedaddress Parameters: N/A Return: Spending key Ask key Nsk key Outgoing viewing key Ak Key Nk key incoming viewing key Diversifier pkD payment address wallet/createshieldedcontractparameters \u00b6 Description: create the shielded TRC-20 transaction parameters, which has three types: mint, transfer and burn demo: curl -X POST http://127.0.0.1:8090/wallet/createshieldedcontractparameters -d '{ \"ask\": \"0f63eabdfe2bbfe08012f6bb2db024e6809c16e8ed055aa41a6095424f192005\", \"nsk\": \"cd43d722fd4b6b01f19449ea826c3e935609648520fcc2a95c0026f0fa9ee404\", \"ovk\": \"1797de3b7f33cafffe3fe18c6b43ec6760add2ad81b10978d1fca5290497ede9\", \"from_amount\": \"5000\", \"shielded_receives\": { \"note\": { \"value\": 50, \"payment_address\": \"ztron15js0jkuxczt8caq5hp59rnh6rgf34sek7vqn9u6ljelxv4nuzz2x9qe3ffm2wzz6ck53yxyhxs6\", \"rcm\": \"74baec30dfac8ed59968955ff245ae002009005194e5b824c35ab88c52e5170e\" } }, \"shielded_TRC20_contract_address\": \"41f3392eaa7d38749176e0671dbc6912f8ef956943\" }' Parameters: ask : Ask nsk : Nsk ovk : Outgoing view key from_amount : the amount for mint, which is scaled by scalingfactor with note value , namely from_amount = value * scalingFactor . In the above example, the value of scalingFactor is 100 shielded_receives : the shielded notes to be created shielded_TRC20_contract_address : shielded TRC-20 contract address Return: the shielded TRC-20 transaction parameters Note: the input parameters will differ according to the variety of shielded TRC-20 transaction type wallet/createshieldedcontractparameterswithoutask \u00b6 Description: create the shielded TRC-20 transaction parameters without Ask, which has three types: mint, transfer and burn demo: curl -X POST http://127.0.0.1:8090/wallet/createshieldedcontractparameterswithoutask -d '{ \"ovk\": \"cd361834b3adc06f130de24f7d0c18f92a093cc885d9ce492cc6c02071f7a4f0\", \"from_amount\": \"5000\", \"shielded_receives\": { \"note\": { \"value\": 50, \"payment_address\": \"ztron13lvfnt4rau4ad9mmgztd3aftw49e3amz8gm2kvyzrsaw0ugz2grxwkvcfys5e2gkchj7cnnetjz\", \"rcm\": \"499e73f2f8aaf05fac41a35b8343bde27f6629cbe66d35da5364a99b94a55a06\" } }, \"shielded_TRC20_contract_address\": \"41f3392eaa7d38749176e0671dbc6912f8ef956943\" }' Parameters: ovk : Outgoing view key from_amount : the amount for mint, which is scaled by scalingfactor with note value , namely from_amount = value * scalingFactor . In the above example, the value of scalingFactor is 100 shielded_receives : the shielded notes to be created shielded_TRC20_contract_address : shielded TRC-20 contract address Return: the shielded TRC-20 transaction parameters Note: the input parameters will differ according to the variety of shielded TRC-20 transaction type wallet/scanshieldedtrc20notesbyivk \u00b6 Description: scan the shielded TRC-20 notes by ivk and mark their status of whether spent demo: curl -X POST http://127.0.0.1:8090/wallet/scanshieldedtrc20notesbyivk -d '{ \"start_block_index\": 9200, \"end_block_index\": 9240, \"shielded_TRC20_contract_address\": \"41274fc7464fadac5c00c893c58bce6c39bf59e4c7\", \"ivk\": \"9f8e74bb3d7188a2781dc1db38810c6914eef4570a79e8ec8404480948e4e305\", \"ak\":\"8072d9110c9de9d9ade33d5d0f5890a7aa65b0cde42af7816d187297caf2fd64\", \"nk\":\"590bf33f93f792be659fd404df91e75c3b08d38d4e08ee226c3f5219cf598f14\" }' Parameters: start_block_index : the start block index, inclusive end_block_index : the end block index, exclusive shielded_TRC20_contract_address : shielded TRC-20 contract address ivk : Incoming viewing key ak : Ak key nk : Nk key Return: notes list Note: block limit\uff08end_block_index - start_block_index <= 1000\uff09 wallet/scanshieldedtrc20notesbyovk \u00b6 Description: scan the shielded TRC-20 notes by ovk demo: curl -X POST http://127.0.0.1:8090/wallet/scanshieldedtrc20notesbyovk -d '{ \"start_block_index\": 9200, \"end_block_index\": 9240, \"shielded_TRC20_contract_address\": \"41274fc7464fadac5c00c893c58bce6c39bf59e4c7\", \"ovk\": \"0ff58efd75e083fe4fd759c8701e1c8cb6961c4297a12b2c800bdb7b2bcab889\" }' Parameters: start_block_index : start block index, inclusive end_block_index : end block index, exclusive shielded_TRC20_contract_address : shielded TRC-20 contract address ovk : Outgoing viewing key Return: notes list Note: block limit\uff08end_block_index - start_block_index <= 1000\uff09 wallet/isshieldedtrc20contractnotespent \u00b6 Description: check the status whether the specified shielded TRC-20 note is spent Parameters: note : the specified note ak : Ak nk : Nk position : the leaf position index of note commitment in the Merkle tree shielded_TRC20_contract_address : the shielded TRC-20 contract address Return: note status Note: the value in note is the scaled value by scalingFactor set in the shielded TRC-20 contract, namely real_amount = value * scalingFactor . wallet/gettriggerinputforshieldedtrc20contract \u00b6 Description: get the trigger input data of shielded TRC-20 contract for the shielded TRC-20 parameters without spend authority signature. demo: curl -X POST http://127.0.0.1:8090/wallet/gettriggerinputforshieldedtrc20contract -d '{ \"shielded_TRC20_Parameters\": {\"spend_description\": [{\"value_commitment\": \"e3fcc8609ff6a4b00b77a00ef624f305cec5f55cc7312ff5526d0b3057f2ef9e\",\"anchor\": \"4c9cbebece033dc1d253b93e4a3682187daae4f905515761d10287b801e69816\",\"nullifier\": \"74edce8798a3976ee41e045bb666f3a121c27235b0f1b44b3456d2c84bc725dc\",\"rk\": \"9dcf4254aa7c4fb7c8bc6956d4b0c7c6c87c37a2552e7bf4e60c12cb5bc6c8cd\",\"zkproof\": \"9926045cd1442a7d20153e6abda9f77a6526895f0a29a57cb1bc76ef6b7cacef2d0f4c94aa97c3acacdb95cabb065057b7edb4cbea098149a8aa7114a6a6b340c58007ac64b64e592eb18fdd299de5962a2a32ab0caebb2ab198704c751a9d0e143d68a50257d7c9e2230a7420fa46450299fd167141367e201726532d8e815413d8571d6c8c12937674dec92caf1f4583ebe560ac4c7eba290deee0a1c0da5f72c0b9df89fb3b338c683b654b3dc2373a4c2a4fef7f4fa489b44405fb7d2bfb\"}],\"binding_signature\": \"11e949887d9ec92eb32c78f0bc48afdc9a16a2ecbd5a0eca1be070fb900eeda347918bd6e9521d4baf1f74963bee0c1956559623a9e7cbc886941b227341ea06\",\"message_hash\": \"7e6a00736c4f9e0036cb74c7fa3b1e3cd8f6bf0f038edeb03b668c4c5536a357\",\"parameter_type\": \"burn\"}, \"spend_authority_signature\": [ { \"value\": \"eeaaecd725ac80ec398b95cf188b769c1be66cc8e76e6c90843b7f23818704595719ce8bf694ffb8cd7aaa8739d50fe8eea7ba39d5026c4b019c973185ca7201\" } ], \"amount\": \"6000\", \"transparent_to_address\": \"4140cd765f8e637a2bbe00f9bc458f6b21eb0e648f\" }' Parameters: shielded_TRC20_Parameters : the generated shielded TRC-20 parameters spend_authority_signature : the spend authority signatures amount : the amount transparent_to_address : the receiver for the burn operation. Return: the input data for triggering shielded TRC-20 contract. wallet/getrcm \u00b6 Description: To get a random commitment trapdoor curl -X GET http://127.0.0.1:8090/wallet/getrcm Parameters: N/A Return:rcm wallet/getmerkletreevoucherinfo \u00b6 Description: To get a merkle tree information of a note $ curl -X POST http://127.0.0.1:8090/wallet/getmerkletreevoucherinfo -d '{ \"out_points\":[{ \"hash\":\"185b3e085723f5862b3a3c3cf54d52f5c1eaf2541e3a1e0ecd08bc12cd958d74\", \"index\":0 }] }' Parameter out_points : Note information Return: A merkle tree of a note wallet/isspend \u00b6 Description: To check whether a note is spent or not $ curl -X POST http://127.0.0.1:8090/wallet/isspend -d '{ \"ak\": \"a3e65d509b675aaa2aeda977ceff11eebd76218079b6f543d78a615e396ca129\", \"nk\": \"62cfda9bea09a53cf2a21022057913734a8458969e11e0bb9c59ead48fbce83e\", \"note\": { \"payment_address\": \"ztron1aqgauawtkelxfu2w6s48cwh0mchjt6kwpj44l4wym3pullx0294j4r4v7kpm75wnclzycsw73mq\", \"rcm\": \"74a16c1b27ec7fbf06881d9d35ddaab1554838b1bddcd54f6bd8a9fb4ba0b80a\", \"value\": 500000000 }, \"txid\": \"7d09e471bb047d3ac044d5d6691b3721a2dddbb683ac02c207fbe78af6302463\", \"index\": 1 }' Parameters: ak : Ak key nk : Nk key note : Note information txid : Transaction id index : Note index Return: Note status wallet/createspendauthsig \u00b6 Description: To create a signature for a transaction $ curl -X POST http://127.0.0.1:8090/wallet/createspendauthsig -d '{ \"ask\": \"e3ebcba1531f6d9158d9c162660c5d7c04dadf77d85d7436a9c98b291ff69a09\", \"tx_hash\": \"3b78fee6e956f915ffe082284c5f18640edca9c57a5f227e5f7d7eb65ad61502\", \"alpha\": \"2608999c3a97d005a879ecdaa16fd29ae434fb67b177c5e875b0c829e6a1db04\" }' Parameters: ask : Ask key tx_hash : Transaction hash alpha : Alpha Return: A signature Pending Pool \u00b6 The following are Pending Pool related APIs: wallet/gettransactionfrompending wallet/gettransactionlistfrompending wallet/getpendingsize wallet/gettransactionfrompending \u00b6 Get transaction details from the pending pool curl -X POST http://127.0.0.1:8090/wallet/gettransactionfrompending -d '{ \"value\": \"txId\" }' Parameters: value: transaction id Return: Transaction details wallet/gettransactionlistfrompending \u00b6 Get transaction list information from pending pool curl -X get http://127.0.0.1:8090/wallet/gettransactionlistfrompending Parameters: N/A Return: Pending transaction IDs in the pool wallet/getpendingsize \u00b6 Get the size of the pending pool queue curl -X get http://127.0.0.1:8090/wallet/getpendingsize Parameters: N/A Return:pending pool size FullNode Solidity HTTP API \u00b6 Account Resources \u00b6 walletsolidity/getaccount \u00b6 Description: Query an account information curl -X POST http://127.0.0.1:8091/walletsolidity/getaccount -d '{\"address\": \"41E552F6487585C2B58BC2C9BB4492BC1F17132CD0\"}' Parameters: address - Account to query, default hexString Return: Account object walletsolidity/getdelegatedresource \u00b6 Description: Query the energy delegation information curl -X POST http://127.0.0.1:8091/walletsolidity/getdelegatedresource -d ' { \"fromAddress\": \"419844f7600e018fd0d710e2145351d607b3316ce9\", \"toAddress\": \"41c6600433381c731f22fc2b9f864b14fe518b322f\" }' Parameters: fromAddress : Energy from address, default hexString toAddress : Energy to address, default hexString Return: Energy delegation information list, the elements of the list is DelegatedResource walletsolidity/getdelegatedresourceaccountindex \u00b6 Description: Query the energy delegation index by an account curl -X POST http://127.0.0.1:8091/walletsolidity/getdelegatedresourceaccountindex -d ' { \"value\": \"419844f7600e018fd0d710e2145351d607b3316ce9\", }' Parameters: value : Address, default hexString Return: DelegatedResourceAccountIndex of the address walletsolidity/getaccountbyid \u00b6 Description: Query an account information by account id curl -X POST http://127.0.0.1:8091/walletsolidity/getaccountbyid -d '{\"account_id\":\"6161616162626262\"}' Parameters: account_id - Account id, default hexString Return: Account object walletsolidity/getavailableunfreezecount \u00b6 Description:Remaining times of executing unstake operation in Stake2.0 curl -X POST http://127.0.0.1:8090/walletsolidity/getavailableunfreezecount -d '{ \"owner_address\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\", \"visible\": true } ' Parameters: owner_address : Account address Return:Remaining times of available unstaking. walletsolidity/getcanwithdrawunfreezeamount \u00b6 Description: Query the withdrawable balance at the specified timestamp In Stake2.0 curl -X POST http://127.0.0.1:8090/walletsolidity/getcanwithdrawunfreezeamount -d '{ \"owner_address\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\", \"timestamp\": 1667977444000, \"visible\": true } ' Parameters: owner_address : Account address timestamp : query cutoff timestamp, in milliseconds. Return: Withdrawable balance, unit is sun. walletsolidity/getcandelegatedmaxsize \u00b6 Description: In Stake2.0, query the amount of delegatable resources share of the specified resource type for an address, unit is sun. curl -X POST http://127.0.0.1:8090/walletsolidity/getcandelegatedmaxsize -d '{ \"owner_address\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\", \"type\": 0, \"visible\": true } ' Parameters: owner_address : Account address type : Resource type, 0 is bandwidth, 1 is energy Return: The amount of delegatable resource share, unit is sun. walletsolidity/getdelegatedresourcev2 \u00b6 In Stake2.0, query the detail of resource share delegated from fromAddress to toAddress curl -X POST http://127.0.0.1:8090/walletsolidity/getdelegatedresourcev2 -d '{ \"fromAddress\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\", \"toAddress\": \"TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1\", \"visible\": true } ' Parameters: fromAddress : resource from address, default hexString toAddress : resource to address Return: Resource delegation list walletsolidity/getdelegatedresourceaccountindexv2 \u00b6 In Stake2.0, query the resource delegation index by an account. Two lists will return, one is the list of addresses the account has delegated its resources( toAddress ), and the other is the list of addresses that have delegated resources to the account( fromAddress ). curl -X POST http://127.0.0.1:8090/walletsolidity/getdelegatedresourceaccountindexv2 -d '{ \"value\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\", \"visible\": true } ' Parameters: value : account address Return: Two lists will return, one is the list of addresses the account has delegated its resources( toAddress ), and the other is the list of addresses that have delegated resources to the account( fromAddress ). Voting & SRs \u00b6 walletsolidity/listwitnesses \u00b6 Description: Query the list of witnesses curl -X POST http://127.0.0.1:8091/walletsolidity/listwitnesses Parameters: N/A Return: List of all witnesses TRC10 Token \u00b6 walletsolidity/getassetissuelist \u00b6 Description: Query the list of all tokens curl -X POST http://127.0.0.1:8091/walletsolidity/getassetissuelist Parameters: N/A Return: The list of all tokens walletsolidity/getpaginatedassetissuelist \u00b6 Description: Query the list of all the tokens by pagination curl -X POST http://127.0.0.1:8091/walletsolidity/getpaginatedassetissuelist -d '{\"offset\": 0, \"limit\":10}' Parameters: - offset : The index of the start token - limit : The amount of tokens per page Return: List of tokens walletsolidity/getassetissuebyname \u00b6 Description: Query a token by token name curl -X POST http://127.0.0.1:8091/walletsolidity/getassetissuebyname -d '{\"value\": \"44756354616E\"}' Parameters: value - Token name, default hexString Return: Token object Note: Since Odyssey-v3.2, getassetissuebyid or getassetissuelistbyname is recommended, as since v3.2, token name can be repeatable. If the token name you query is not unique, this api will throw out an error. walletsolidity/getassetissuelistbyname \u00b6 Description: Query the token list by name curl -X POST http://127.0.0.1:8091/walletsolidity/getassetissuelistbyname -d '{\"value\": \"44756354616E\"}' Parameters: value - Token name, default hexString Return: Token list walletsolidity/getassetissuebyid \u00b6 Description: Query a token by token id curl -X POST http://127.0.0.1:8091/walletsolidity/getassetissuebyid -d '{\"value\": \"1000001\"}' Parameters: value - Token id Return: Token object Blocks \u00b6 walletsolidity/getnowblock \u00b6 Description: Query the latest block information curl -X POST http://127.0.0.1:8091/walletsolidity/getnowblock Parameters: N/A Return: The latest block from solidityNode walletsolidity/getblockbynum \u00b6 Description: Query a block information by block height curl -X POST http://127.0.0.1:8091/walletsolidity/getblockbynum -d '{\"num\" : 100}' Parameters: num - Block height Return: Block information walletsolidity/getblockbyid \u00b6 Description: Query a block information by block id curl -X POST http://127.0.0.1:8091/walletsolidity/getblockbyid-d '{\"value\": \"0000000000038809c59ee8409a3b6c051e369ef1096603c7ee723c16e2376c73\"}' Parameters: value - Block id Return: The block object walletsolidity/getblockbylimitnext \u00b6 Description: Query a list of blocks by range curl -X POST http://127.0.0.1:8091/walletsolidity/getblockbylimitnext -d '{\"startNum\": 1, \"endNum\": 2}' Parameters: startNum : The start block height, inclusive endNum : The end block height, exclusive Return: List of blocks walletsolidity/getblockbylatestnum \u00b6 Description: Query the latest few blocks curl -X POST http://127.0.0.1:8091/walletsolidity/getblockbylatestnum -d '{\"num\": 5}' Parameters: num - The number of blocks expected to return Return: List of blocks wallet/getnodeinfo \u00b6 Description: Query the current node information curl -X GET http://127.0.0.1:8091/wallet/getnodeinfo Parameters: N/A Return: NodeInfo of the current node Transactions \u00b6 walletsolidity/gettransactionbyid \u00b6 Description: Query an transaction information by transaction id curl -X POST http://127.0.0.1:8091/walletsolidity/gettransactionbyid -d '{\"value\" : \"309b6fa3d01353e46f57dd8a8f27611f98e392b50d035cef213f2c55225a8bd2\"}' Parameters: value - Transaction id Return: Transaction information walletsolidity/gettransactioncountbyblocknum \u00b6 Description: Query th the number of transactions in a specific block curl -X POST http://127.0.0.1:8091/walletsolidity/gettransactioncountbyblocknum -d '{\"num\" : 100}' Parameters: num - Block height Return: The number of transactions walletsolidity/gettransactioninfobyid \u00b6 Description: Query the transaction fee, block height by transaction id curl -X POST http://127.0.0.1:8091/walletsolidity/gettransactioninfobyid -d '{\"value\" : \"309b6fa3d01353e46f57dd8a8f27611f98e392b50d035cef213f2c55225a8bd2\"}' Parameters: value - Transaction id Return: Transaction fee, block height and the time of creation walletsolidity/gettransactioninfobyblocknum \u00b6 Description: Query the list of transaction information in a specific block curl -X POST http://127.0.0.1:8091/walletsolidity/gettransactioninfobyblocknum -d '{\"num\" : 100}' Parameters: num - Block height Return: The list of transaction information inside the queried block DEX Exchanges \u00b6 walletsolidity/getexchangebyid \u00b6 Description: Query an exchange pair by exchange pair id curl -X POST http://127.0.0.1:8091/walletsolidity/getexchangebyid -d {\"id\":1} Parameters: id: Exchange pair id Return: Exchange pair information walletsolidity/listexchanges \u00b6 Description: Query the list of all the exchange pairs curl -X POST http://127.0.0.1:8091/walletsolidity/listexchanges Parameters: N/A Return: The list of all the exchange pairs TRONZ Shielded Smart Contract \u00b6 walletsolidity/getmerkletreevoucherinfo \u00b6 Description: Get the Merkle tree information of a note curl -X POST http://127.0.0.1:8090/walletsolidity/getmerkletreevoucherinfo -d '{ \"out_points\":[{ \"hash\":\"185b3e085723f5862b3a3c3cf54d52f5c1eaf2541e3a1e0ecd08bc12cd958d74\", \"index\":0 }] }' Parameters: out_points : Note information Return: Merkle tree information of a note walletsolidity/scannotebyivk \u00b6 Description: Get all notes related to ivk curl -X POST http://127.0.0.1:8090/walletsolidity/scannotebyivk -d '{ \"start_block_index\": 0, \"end_block_index\": 100, \"ivk\": \"80a481c3c739e54b4e0608090b3a1a6e9f8dce42346e95bf5a2d8a487bf45c05\" }' Parameters: start_block_index : The start block height, inclusive end_block_index : The end block height, exclusive ivk : Incoming viewing key Return: Notes list Note: Range limit (end_block_index - start_block_index <= 1000) walletsolidity/scanandmarknotebyivk \u00b6 Description: Get all notes with spent status related to ivk curl -X POST http://127.0.0.1:8090/walletsolidity/scanandmarknotebyivk -d '{ \"start_block_index\": 0, \"end_block_index\": 100, \"ivk\": \"80a481c3c739e54b4e0608090b3a1a6e9f8dce42346e95bf5a2d8a487bf45c05\", \"ak\": \"1d4f9b5551f4aa9443ceb263f0e208eb7e26080264571c5ef06de97a646fe418\", \"nk\": \"748522c7571a9da787e43940c9a474aa0c5c39b46c338905deb6726fa3678bdb\" }' Parameters: start_block_index : The start block height, inclusive end_block_index : The end block height, exclusive ivk : Incoming viewing key ak : Ak key nk : Nk key Return: Notes list Note: Range limit (end_block_index - start_block_index <= 1000) walletsolidity/scannotebyovk \u00b6 Description: Query all notes related to ovk curl -X POST http://127.0.0.1:8090/walletsolidity/scannotebyovk -d '{ \"start_block_index\": 0, \"end_block_index\": 100, \"ovk\": \"705145aa18cbe6c11d5d0011419a98f3d5b1d341eb4727f1315597f4bdaf8539\" }' Parameters: start_block_index : The start block height, inclusive end_block_index : The end block height, exclusive ovk : Outgoing viewing key Return: Notes list Note: Range limit (end_block_index - start_block_index <= 1000) walletsolidity/isspend \u00b6 Description: Check whether a note has been spent curl -X POST http://127.0.0.1:8090/walletsolidity/isspend -d '{ \"ak\": \"a3e65d509b675aaa2aeda977ceff11eebd76218079b6f543d78a615e396ca129\", \"nk\": \"62cfda9bea09a53cf2a21022057913734a8458969e11e0bb9c59ead48fbce83e\", \"note\": { \"payment_address\": \"ztron1aqgauawtkelxfu2w6s48cwh0mchjt6kwpj44l4wym3pullx0294j4r4v7kpm75wnclzycsw73mq\", \"rcm\": \"74a16c1b27ec7fbf06881d9d35ddaab1554838b1bddcd54f6bd8a9fb4ba0b80a\", \"value\": 500000000 }, \"txid\": \"7d09e471bb047d3ac044d5d6691b3721a2dddbb683ac02c207fbe78af6302463\", \"index\": 1 }' Parameters: ak : Ak nk : Nk note : Note information txid : Transaction id index : Note index Return: Whether a note has been spent walletsolidity/scanshieldedtrc20notesbyivk \u00b6 Description: Scan the shielded TRC-20 notes by ivk, and mark whether it has been spent curl -X POST http://127.0.0.1:8091/walletsolidity/scanshieldedtrc20notesbyivk -d '{ \"start_block_index\": 9200, \"end_block_index\": 9240, \"shielded_TRC20_contract_address\": \"41274fc7464fadac5c00c893c58bce6c39bf59e4c7\", \"ivk\": \"9f8e74bb3d7188a2781dc1db38810c6914eef4570a79e8ec8404480948e4e305\", \"ak\":\"8072d9110c9de9d9ade33d5d0f5890a7aa65b0cde42af7816d187297caf2fd64\", \"nk\":\"590bf33f93f792be659fd404df91e75c3b08d38d4e08ee226c3f5219cf598f14\" }' Parameters: start_block_index : The start block index, inclusive end_block_index : The end block index, exclusive shielded_TRC20_contract_address : Shielded TRC-20 contract address ivk : Incoming viewing key ak : Ak key nk : Nk key Return: Notes list Note: Block limit\uff08end_block_index - start_block_index <= 1000\uff09 walletsolidity/scanshieldedtrc20notesbyovk \u00b6 Description: Scan the shielded TRC-20 notes by ovk curl -X POST http://127.0.0.1:8091/walletsolidity/scanshieldedtrc20notesbyovk -d '{ \"start_block_index\": 9200, \"end_block_index\": 9240, \"shielded_TRC20_contract_address\": \"41274fc7464fadac5c00c893c58bce6c39bf59e4c7\", \"ovk\": \"0ff58efd75e083fe4fd759c8701e1c8cb6961c4297a12b2c800bdb7b2bcab889\" }' Parameters: start_block_index : Start block index, inclusive end_block_index : Start block index, inclusive shielded_TRC20_contract_address : Shielded TRC-20 contract address ovk : Outgoing viewing key Return: Notes list Note: Block limit (end_block_index - start_block_index <= 1000) walletsolidity/isshieldedtrc20contractnotespent \u00b6 Description: Check the status whether the specified shielded TRC-20 note is spent curl -X POST http://127.0.0.1:8091/walletsolidity/scanshieldedtrc20notesbyovk -d '{ \"note\": { \"value\": 40, \"payment_address\":\"ztron1768kf7dy4qquefp46szk978d65eeua66yhr4zv260c0uzj68t3tfjl3en9lhyyfxalv4jus30xs\", \"rcm\": \"296070782a94c6936b0b4f6daf8d7c7605a4374fe595b96148dc0f4b59015d0d\" }, \"ak\": \"8072d9110c9de9d9ade33d5d0f5890a7aa65b0cde42af7816d187297caf2fd64\", \"nk\": \"590bf33f93f792be659fd404df91e75c3b08d38d4e08ee226c3f5219cf598f14\", \"position\": 272, \"shielded_TRC20_contract_address\": \"41274fc7464fadac5c00c893c58bce6c39bf59e4c7\" }' Parameters: note : The specified note ak : Ak nk : Nk position : The leaf position index of note commitment in the Merkle tree shielded_TRC20_contract_address : The shielded TRC-20 contract address Return: Note status Note: The value in note is the scaled value by scalingFactor set in the shielded TRC-20 contract, namely real_amount = value * scalingFactor .","title":"HTTP API"},{"location":"api/http/#http-api","text":"This article introduces FullNode's HTTP APIs and their usage. Note Although TRON has avoided XSS by setting the Content-Type of HTTP APIs to application/json, there are a few APIs that don't have input validation. To better protect user data security, we recommend that you correctly encode any data from APIs before they use it in any UI, especially when the parameter visible equals true. Here is a typical XSS protection method: Encode all data from the APIs in HTML. Use methods such as encodeURIComponent() or escape() to encode the data, which can convert special characters into their HTML entities and prevent them from being interpreted as HTML code by the browser. Please be sure to implement XSS protection for all data from the APIs to ensure the security of user data. We understand that you may need more information about XSS protection. It is recommended that you refer to the following resources: OWASP XSS Prevention Cheat Sheet . First, Let's explain the selection of the address format in the HTTP API: Account addresses of the TRON network have two formats: HexString format and Base58 format. The Fullnode HTTP API supports address format selection. Users can set the address format through the visible parameter. The default value is false and the address format in the parameter and return value is hex format. When visible is set to true , the address format in the parameter and return value are in Base58 format. If the parameter format does not match the visible setting, an error will be reported. Setting method: For HTTP GET API or the api needs no parameter: by adding visible=true parameter to the url http://127.0.0.1:8090/wallet/listexchanges?visible=true For POST API: By adding \"visible\": true parameter to the most out layer of the json curl - X POST h tt p : //127.0.0.1:8090/wallet/createtransaction -d ' { \"owner_address\" : \"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ\" , \"to_address\" : \"TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW\" , \"amount\" : 1000000 , \"visible\" : true } '","title":"HTTP API"},{"location":"api/http/#fullnode-http-api","text":"The FullNode HTTP API is categorized as follows: Accounts Transfer and Transactions Account Resources Query The Network Smart Contracts TRC-10 Token Voting & SRs Proposals DEX Exchange TRONZ Shielded Smart Contract Pending Pool","title":"Fullnode HTTP API"},{"location":"api/http/#accounts","text":"The following are the APIs related to on-chain accounts: wallet/validateaddress wallet/createaccount wallet/getaccount wallet/updateaccount wallet/accountpermissionupdate wallet/getaccountbalance wallet/setaccountid wallet/getaccountbyid","title":"Accounts"},{"location":"api/http/#walletvalidateaddress","text":"Description: Check the validity of the address curl -X POST http://127.0.0.1:8090/wallet/validateaddress -d '{\"address\": \"4189139CB1387AF85E3D24E212A008AC974967E561\"}' Parameters: address Return: the address is correct or not","title":"wallet/validateaddress"},{"location":"api/http/#walletcreateaccount","text":"Description: Create an account. Uses an already activated account to create a new account. If the owner_address has enough bandwidth obtained by freezing TRX, then creating an account will only consume bandwidth , otherwise, 0.1 TRX will be burned to pay for bandwidth, and at the same time, 1 TRX will be required to be created. curl -X POST http://127.0.0.1:8090/wallet/createaccount -d '{\"owner_address\":\"41d1e7a6bc354106cb410e65ff8b181c600ff14292\", \"account_address\": \"41e552f6487585c2b58bc2c9bb4492bc1f17132cd0\"}' Parameters: owner_address Owner address, default hexString account_address New address, default hexString Permission_id Optional, for multi-signature use Return: Unsigned transaction object","title":"wallet/createaccount"},{"location":"api/http/#walletgetaccount","text":"Description: Query an account information curl -X POST http://127.0.0.1:8090/wallet/getaccount -d '{\"address\": \"41E552F6487585C2B58BC2C9BB4492BC1F17132CD0\"}' Parameters: address - account address Return: Account object","title":"wallet/getaccount"},{"location":"api/http/#walletupdateaccount","text":"Description: Update the name of an account curl -X POST http://127.0.0.1:8090/wallet/updateaccount -d '{\"account_name\": \"0x7570646174654e616d6531353330383933343635353139\" ,\"owner_address\":\"41d1e7a6bc354106cb410e65ff8b181c600ff14292\"}' Parameters: account_name Account name, default hexString owner_address Owner address, default hexString Permission_id Optional, for multi-signature use Return:\u672a\u7b7e\u540d\u7684\u4fee\u6539\u540d\u79f0Transaction","title":"wallet/updateaccount"},{"location":"api/http/#walletaccountpermissionupdate","text":"Description: Update the account's permission. curl -X POST http://127.0.0.1:8090/wallet/accountpermissionupdate -d '{ \"owner_address\": \"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ\", \"owner\": { \"type\": 0, \"permission_name\": \"owner\", \"threshold\": 1, \"keys\": [{ \"address\": \"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ\", \"weight\": 1 }] }, \"witness\": { \"type\": 1, \"permission_name\": \"witness\", \"threshold\": 1, \"keys\": [{ \"address\": \"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ\", \"weight\": 1 }] }, \"actives\": [{ \"type\": 2, \"permission_name\": \"active12323\", \"threshold\": 2, \"operations\": \"7fff1fc0033e0000000000000000000000000000000000000000000000000000\", \"keys\": [{ \"address\": \"TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR\", \"weight\": 1 }, { \"address\": \"TKwhcDup8L2PH5r6hxp5CQvQzZqJLmKvZP\", \"weight\": 1 }] }], \"visible\": true}' Parameters: owner_address: Owner address of the account, default hexString owner: Account owner permission witness: Account witness permission, only for witness actives: List of active permissions for the account Return: Unsigned transaction","title":"wallet/accountpermissionupdate"},{"location":"api/http/#walletgetaccountbalance","text":"Description\uff1a Get the account balance in a specific block. curl -X POST http://127.0.0.1:8090/wallet/getaccountbalance -d '{ \"account_identifier\": { \"address\": \"TLLM21wteSPs4hKjbxgmH1L6poyMjeTbHm\" }, \"block_identifier\": { \"hash\": \"0000000000010c4a732d1e215e87466271e425c86945783c3d3f122bfa5affd9\", \"number\": 68682 }, \"visible\": true }' Parameters: account_identifier : The account address. block_identifier : The block number. Return: The balance object of the account in a specific block, the block_identifier is the block hash. { \"balance\": 64086449348265042, \"block_identifier\": { \"hash\": \"0000000000010c4a732d1e215e87466271e425c86945783c3d3f122bfa5affd9\", \"number\": 68682 } }","title":"wallet/getaccountbalance"},{"location":"api/http/#walletsetaccountid","text":"Description: To set an account id for an account curl -X POST http://127.0.0.1:8090/wallet/setaccountid -d '{ \"owner_address\":\"41a7d8a35b260395c14aa456297662092ba3b76fc0\",\"account_id\":\"6161616162626262\"}' Parameters: owner_address : Owner address, default hexString account_id :Account id, default hexString Return: Unsigned transaction","title":"wallet/setaccountid"},{"location":"api/http/#walletgetaccountbyid","text":"Description: Query an account information by account id curl -X POST http://127.0.0.1:8090/wallet/getaccountbyid -d '{\"account_id\":\"6161616162626262\"}' Parameters: account_id Account id, default hexString Return:Account object","title":"wallet/getaccountbyid"},{"location":"api/http/#transfers-and-transactions","text":"The following are transfer and transaction related APIs: wallet/createtransaction wallet/broadcasttransaction wallet/broadcasthex wallet/getsignweight wallet/getapprovedlist","title":"Transfers and transactions"},{"location":"api/http/#walletcreatetransaction","text":"Description: Create a transfer transaction, if to address is not existed, then create the account on the blockchain curl -X POST http://127.0.0.1:8090/wallet/createtransaction -d '{\"to_address\": \"41e9d79cc47518930bc322d9bf7cddd260a0260a8d\", \"owner_address\": \"41D1E7A6BC354106CB410E65FF8B181C600FF14292\", \"amount\": 1000 }' Parameters: to_address To address, default hexString owner_address Owner address, default hexString amount Transfer amount Permission_id Optional, for multi-signature use Return: Unsigned transaction","title":"wallet/createtransaction"},{"location":"api/http/#walletbroadcasttransaction","text":"Description: Broadcast transaction after sign curl -X POST http://127.0.0.1:8090/wallet/broadcasttransaction -d '{\"signature\":[\"97c825b41c77de2a8bd65b3df55cd4c0df59c307c0187e42321dcc1cc455ddba583dd9502e17cfec5945b34cad0511985a6165999092a6dec84c2bdd97e649fc01\"],\"txID\":\"454f156bf1256587ff6ccdbc56e64ad0c51e4f8efea5490dcbc720ee606bc7b8\",\"raw_data\":{\"contract\":[{\"parameter\":{\"value\":{\"amount\":1000,\"owner_address\":\"41e552f6487585c2b58bc2c9bb4492bc1f17132cd0\",\"to_address\":\"41d1e7a6bc354106cb410e65ff8b181c600ff14292\"},\"type_url\":\"type.googleapis.com/protocol.TransferContract\"},\"type\":\"TransferContract\"}],\"ref_block_bytes\":\"267e\",\"ref_block_hash\":\"9a447d222e8de9f2\",\"expiration\":1530893064000,\"timestamp\":1530893006233}}' Parameters: Transaction after sign Return:The result of the broadcast","title":"wallet/broadcasttransaction"},{"location":"api/http/#walletbroadcasthex","text":"Description: Broadcast transaction hex string after sign curl -X POST http://127.0.0.1:8090/wallet/broadcasthex -d '{\"transaction\":\"0A8A010A0202DB2208C89D4811359A28004098A4E0A6B52D5A730802126F0A32747970652E676F6F676C65617069732E636F6D2F70726F746F636F6C2E5472616E736665724173736574436F6E747261637412390A07313030303030311215415A523B449890854C8FC460AB602DF9F31FE4293F1A15416B0580DA195542DDABE288FEC436C7D5AF769D24206412418BF3F2E492ED443607910EA9EF0A7EF79728DAAAAC0EE2BA6CB87DA38366DF9AC4ADE54B2912C1DEB0EE6666B86A07A6C7DF68F1F9DA171EEE6A370B3CA9CBBB00\"}' Parameters: Transaction hex after sign Return: The result of the broadcast","title":"wallet/broadcasthex"},{"location":"api/http/#walletgetsignweight","text":"Description: Query the current signatures total weight of a transaction after sign curl -X POST http://127.0.0.1:8090/wallet/getsignweight -d '{ \"signature\": [ \"e0bd4a60f1b3c89d4da3894d400e7e32385f6dd690aee17fdac4e016cdb294c5128b66f62f3947a7182c015547496eba95510c113bda2a361d811b829343c36501\", \"596ead6439d0f381e67f30b1ed6b3687f2bd53ce5140cdb126cfe4183235804741eeaf79b4e91f251fd7042380a9485d4d29d67f112d5387bc7457b355cd3c4200\" ], \"txID\": \"0ae84a8439f5aa8fd2c458879a4031a7452aebed8e6e99ffbccd26842d4323c4\", \"raw_data\": { \"contract\": [{ \"parameter\": { \"value\": { \"amount\": 1000000, \"owner_address\": \"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ\", \"to_address\": \"TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW\" }, \"type_url\": \"type.googleapis.com/protocol.TransferContract\" }, \"type\": \"TransferContract\" }], \"ref_block_bytes\": \"163d\", \"ref_block_hash\": \"77ef4ace148b05ba\", \"expiration\": 1555664823000, \"timestamp\": 1555664763418 }, \"raw_data_hex\": \"0a02163d220877ef4ace148b05ba40d8c5e5a6a32d5a69080112630a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412320a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18c0843d2802709af4e1a6a32d\", \"visible\": true}' Parameters: Transaction object after sign Return: The current signatures total weight","title":"wallet/getsignweight"},{"location":"api/http/#walletgetapprovedlist","text":"Description: Query the signatures list of a transaction after sign curl -X POST http://127.0.0.1:8090/wallet/getapprovedlist -d '{ \"signature\": [ \"e0bd4a60f1b3c89d4da3894d400e7e32385f6dd690aee17fdac4e016cdb294c5128b66f62f3947a7182c015547496eba95510c113bda2a361d811b829343c36501\", \"596ead6439d0f381e67f30b1ed6b3687f2bd53ce5140cdb126cfe4183235804741eeaf79b4e91f251fd7042380a9485d4d29d67f112d5387bc7457b355cd3c4200\" ], \"txID\": \"0ae84a8439f5aa8fd2c458879a4031a7452aebed8e6e99ffbccd26842d4323c4\", \"raw_data\": { \"contract\": [{ \"parameter\": { \"value\": { \"amount\": 1000000, \"owner_address\": \"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ\", \"to_address\": \"TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW\" }, \"type_url\": \"type.googleapis.com/protocol.TransferContract\" }, \"type\": \"TransferContract\" }], \"ref_block_bytes\": \"163d\", \"ref_block_hash\": \"77ef4ace148b05ba\", \"expiration\": 1555664823000, \"timestamp\": 1555664763418 }, \"raw_data_hex\": \"0a02163d220877ef4ace148b05ba40d8c5e5a6a32d5a69080112630a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412320a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18c0843d2802709af4e1a6a32d\", \"visible\": true}' Parameter: Transaction object after sign Return: The list of the signatures","title":"wallet/getapprovedlist"},{"location":"api/http/#account-resources","text":"The following are account resource related APIs: wallet/getaccountresource wallet/getaccountnet wallet/unfreezebalance wallet/getdelegatedresource wallet/getdelegatedresourceaccountindex wallet/freezebalancev2 wallet/unfreezebalancev2 wallet/cancelallunfreezev2 wallet/delegateresource wallet/undelegateresource wallet/withdrawexpireunfreeze wallet/getavailableunfreezecount wallet/getcanwithdrawunfreezeamount wallet/getcandelegatedmaxsize wallet/getdelegatedresourcev2 wallet/getdelegatedresourceaccountindexv2","title":"Account Resources"},{"location":"api/http/#walletgetaccountresource","text":"Description: Query the resource information of an account curl -X POST http://127.0.0.1:8090/wallet/getaccountresource -d {\"address\" : \"419844f7600e018fd0d710e2145351d607b3316ce9\"} Parameters: address : Address, default hexString Return: The resource information","title":"wallet/getaccountresource"},{"location":"api/http/#walletgetaccountnet","text":"Description: Query the bandwidth information of an account curl -X POST http://127.0.0.1:8090/wallet/getaccountnet -d '{\"address\": \"4112E621D5577311998708F4D7B9F71F86DAE138B5\"}' Parameters: address - Address, default hexString Return: Bandwidth information","title":"wallet/getaccountnet"},{"location":"api/http/#walletfreezebalance","text":"Description: Stake TRX. This interface has been deprecated, please use FreezeBalanceV2 to stake TRX to obtain resources.","title":"wallet/freezebalance"},{"location":"api/http/#walletunfreezebalance","text":"Description: Unstake the TRX that staked during stake1.0 phase. curl -X POST http://127.0.0.1:8090/wallet/unfreezebalance -d '{ \"owner_address\":\"41e472f387585c2b58bc2c9bb4492bc1f17342cd1\", \"resource\": \"BANDWIDTH\", \"receiver_address\":\"414332f387585c2b58bc2c9bb4492bc1f17342cd1\" }' Parameters: owner_address Owner address, default hexString resource unstake type 'BANDWIDTH' or 'ENERGY' receiverAddress The address that will lose the resource, default hexString Permission_id Optional, for multi-signature use Return: Unsigned transaction","title":"wallet/unfreezebalance"},{"location":"api/http/#walletgetdelegatedresource","text":"Description: Query the resource delegation information curl -X POST http://127.0.0.1:8090/wallet/getdelegatedresource -d ' { \"fromAddress\": \"419844f7600e018fd0d710e2145351d607b3316ce9\", \"toAddress\": \"41c6600433381c731f22fc2b9f864b14fe518b322f\" }' Parameters: fromAddress : from address, default hexString toAddress : to address, default hexString Return: Resource delegation information","title":"wallet/getdelegatedresource"},{"location":"api/http/#walletgetdelegatedresourceaccountindex","text":"Description: Query the resource delegation by an account during stake1.0 phase. i.e. list all addresses that have delegated resources to an account. curl -X POST http://127.0.0.1:8090/wallet/getdelegatedresourceaccountindex -d ' { \"value\": \"419844f7600e018fd0d710e2145351d607b3316ce9\", }' Parameters: value : account address Return:resource delegation index","title":"wallet/getdelegatedresourceaccountindex"},{"location":"api/http/#walletfreezebalancev2","text":"Description: Stake TRX curl -X POST http://127.0.0.1:8090/wallet/freezebalancev2 -d '{ \"owner_address\": \"41e472f387585c2b58bc2c9bb4492bc1f17342cd1\", \"frozen_balance\": 10000, \"resource\": \"BANDWIDTH\" }' Parameters: owner_address : Owner address, default hexString frozen_balance : TRX stake amount, the unit is sun resource : TRX stake type, 'BANDWIDTH' or 'ENERGY' permission_id : Optional, for multi-signature use Return: Unsigned transaction","title":"wallet/freezebalancev2"},{"location":"api/http/#walletunfreezebalancev2","text":"Description: Unstake some TRX staked in Stake2.0, release the corresponding amount of bandwidth or energy, and voting rights (TP) curl -X POST http://127.0.0.1:8090/wallet/unfreezebalancev2 -d '{ \"owner_address\": \"41e472f387585c2b58bc2c9bb4492bc1f17342cd1\", \"unfreeze_balance\": 1000000, \"resource\": \"BANDWIDTH\" }' Parameters: owner_address : Owner address, default hexString resource : Resource type: 'BANDWIDTH' or 'ENERGY' unfreeze_balance : The amount of TRX to unstake, in sun permission_id : Optional, for multi-signature use Return:Unsigned transaction","title":"wallet/unfreezebalancev2"},{"location":"api/http/#walletcancelallunfreezev2","text":"Description: Cancel unstakings, all unstaked funds still in the waiting period will be re-staked, all unstaked funds that exceeded the 14-day waiting period will be automatically withdrawn to the owner\u2019s account curl -X POST http://127.0.0.1:8090/wallet/cancelallunfreezev2 -d '{ \"owner_address\": \"41e472f387585c2b58bc2c9bb4492bc1f17342cd1\" }' Parameters: owner_address : Owner address, default hexString permission_id : Optional, for multi-signature use Return:Unsigned transaction","title":"wallet/cancelallunfreezev2"},{"location":"api/http/#walletdelegateresource","text":"Description: Delegate bandwidth or energy resources to other accounts in Stake2.0. curl -X POST http://127.0.0.1:8090/wallet/delegateresource -d '{ \"owner_address\": \"41e472f387585c2b58bc2c9bb4492bc1f17342cd1\", \"receiver_address\": \"41d1e7a6bc354106cb410e65ff8b181c600ff14292\", \"balance\": 1000000, \"resource\": \"BANDWIDTH\", \"lock\": false }' Parameters: owner_address : Account address receiver_address : Resource receiver address balance : Amount of TRX staked for resources to be delegated, unit is sun resource : Resource type: 'BANDWIDTH' or 'ENERGY' lock : Whether it is locked, if it is set to true, the delegated resources cannot be undelegated within 3 days. When the lock time is not over, if the owner delegates the same type of resources using the lock to the same address, the lock time will be reset to 3 days lock_period : lock time,The unit is block interval(3 seconds), indicates the time of how many blocks will be produced from the moment the transaction is executed. Only when lock is true, this field is valid. If the delegate lock period is 1 day, the lock_period is: 28800 permission_id : Optional, for multi-signature use Return:Unsigned transaction","title":"wallet/delegateresource"},{"location":"api/http/#walletundelegateresource","text":"Description: Cancel the delegation of bandwidth or energy resources to other account curl -X POST http://127.0.0.1:8090/wallet/undelegateresource -d '{ \"owner_address\": \"41e472f387585c2b58bc2c9bb4492bc1f17342cd1\", \"receiver_address\": \"41d1e7a6bc354106cb410e65ff8b181c600ff14292\", \"balance\": 1000000, \"resource\": \"BANDWIDTH\" }' Parameters: owner_address : Account address receiver_address : Resource receiver address balance : Amount of TRX staked for resources to be delegated, unit is sun resource : Resource type: 'BANDWIDTH' or 'ENERGY' permission_id : Optional, for multi-signature use Return:Unsigned transaction","title":"wallet/undelegateresource"},{"location":"api/http/#walletwithdrawexpireunfreeze","text":"Description: Withdraw unfrozen balance in Stake2.0, the user can call this API to get back their funds after executing /wallet/unfreezebalancev2 transaction and waiting N days, N is a network parameter curl -X POST http://127.0.0.1:8090/wallet/withdrawexpireunfreeze -d '{ \"owner_address\": \"41e472f387585c2b58bc2c9bb4492bc1f17342cd1\", }' Parameters: owner_address : Account address permission_id : Optional, for multi-signature use Return: Unsigned transaction","title":"wallet/withdrawexpireunfreeze"},{"location":"api/http/#walletgetavailableunfreezecount","text":"Description:Remaining times of executing unstake operation in Stake2.0 curl -X POST http://127.0.0.1:8090/wallet/getavailableunfreezecount -d '{ \"owner_address\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\", \"visible\": true } ' Parameters: owner_address : Account address Return:Remaining times of available unstaking.","title":"wallet/getavailableunfreezecount"},{"location":"api/http/#walletgetcanwithdrawunfreezeamount","text":"Description:Query the withdrawable balance at the specified timestamp In Stake2.0 curl -X POST http://127.0.0.1:8090/wallet/getcanwithdrawunfreezeamount -d '{ \"owner_address\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\", \"timestamp\": 1667977444000, \"visible\": true } ' Parameters: owner_address : Account address timestamp : query cutoff timestamp, in milliseconds. Return: withdrawable balance, unit is sun.","title":"wallet/getcanwithdrawunfreezeamount"},{"location":"api/http/#walletgetcandelegatedmaxsize","text":"Description: In Stake2.0, query the amount of delegatable resources share of the specified resource type for an address, unit is sun. curl -X POST http://127.0.0.1:8090/wallet/getcandelegatedmaxsize -d '{ \"owner_address\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\", \"type\": 0, \"visible\": true } ' Parameters: owner_address : Account address type : resource type, 0 is bandwidth, 1 is energy Return:the amount of delegatable resource share, unit is sun.","title":"wallet/getcandelegatedmaxsize"},{"location":"api/http/#walletgetdelegatedresourcev2","text":"In Stake2.0, query the detail of resource share delegated from fromAddress to toAddress curl -X POST http://127.0.0.1:8090/wallet/getdelegatedresourcev2 -d '{ \"fromAddress\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\", \"toAddress\": \"TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1\", \"visible\": true } ' Parameters: fromAddress : resource from address, default hexString toAddress : resource to address Return:Resource delegation list","title":"wallet/getdelegatedresourcev2"},{"location":"api/http/#walletgetdelegatedresourceaccountindexv2","text":"In Stake2.0, query the resource delegation index by an account. Two lists will return, one is the list of addresses the account has delegated its resources(toAddress), and the other is the list of addresses that have delegated resources to the account(fromAddress). curl -X POST http://127.0.0.1:8090/wallet/getdelegatedresourceaccountindexv2 -d '{ \"value\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\", \"visible\": true } ' Parameters: value : account address Return:Two lists will return, one is the list of addresses the account has delegated its resources(toAddress), and the other is the list of addresses that have delegated resources to the account(fromAddress).","title":"wallet/getdelegatedresourceaccountindexv2"},{"location":"api/http/#query-the-network","text":"The following is the API for querying data on the chain: wallet/getnowblock wallet/getblock wallet/getblockbynum wallet/getblockbyid wallet/getblockbylatestnum wallet/getblockbylimitnext wallet/getblockbalance wallet/gettransactionbyid wallet/gettransactioninfobyid wallet/gettransactioncountbyblocknum wallet/gettransactioninfobyblocknum wallet/listnodes wallet/getnodeinfo wallet/getchainparameters wallet/getenergyprices wallet/getbandwidthprices wallet/getburntrx","title":"Query The Network"},{"location":"api/http/#walletgetnowblock","text":"Description: Query the latest block information curl -X POST http://127.0.0.1:8090/wallet/getnowblock Parameters: N/A Return: The latest block","title":"wallet/getnowblock"},{"location":"api/http/#walletgetblock","text":"Query block header information or entire block information according to block height or block hash curl -X POST http://127.0.0.1:8090/wallet/getblock -d '{\"detail\":false}' Parameters: id_or_num : id_or_num can be the block height or the block hash. No value entered means to query the latest block. detail : true means query the entire block information include the header and body. false means only query the block header information. Return: block or block header","title":"wallet/getblock"},{"location":"api/http/#walletgetblockbynum","text":"Description: Query a block information by block height curl -X POST http://127.0.0.1:8090/wallet/getblockbynum -d '{\"num\": 1}' Parameters: Block height Return: block","title":"wallet/getblockbynum"},{"location":"api/http/#walletgetblockbyid","text":"Description: Query a block information by block id curl -X POST http://127.0.0.1:8090/wallet/getblockbyid -d '{\"value\": \"0000000000038809c59ee8409a3b6c051e369ef1096603c7ee723c16e2376c73\"}' Parameters: Block id Return: block","title":"wallet/getblockbyid"},{"location":"api/http/#walletgetblockbylatestnum","text":"Description: Query the several latest blocks curl -X POST http://127.0.0.1:8090/wallet/getblockbylatestnum -d '{\"num\": 5}' Parameters: The number of the blocks expected to return Return:The list of the blocks","title":"wallet/getblockbylatestnum"},{"location":"api/http/#walletgetblockbylimitnext","text":"Description: Query a list of blocks by range curl -X POST http://127.0.0.1:8090/wallet/getblockbylimitnext -d '{\"startNum\": 1, \"endNum\": 2}' Parameters: startNum : The start block height, itself included endNum : The end block height, itself not included Return: The list of the blocks","title":"wallet/getblockbylimitnext"},{"location":"api/http/#walletgetblockbalance","text":"Description\uff1aGet all balance change operations in a block. curl -X POST http://127.0.0.1:8090/wallet/getblockbalance -d '{ \"hash\": \"000000000000dc2a3731e28a75b49ac1379bcc425afc95f6ab3916689fbb0189\", \"number\": 56362, \"visible\": true }' Parameters: The hash and block number must match. Return: { \"block_identifier\": { \"hash\": \"000000000000dc2a3731e28a75b49ac1379bcc425afc95f6ab3916689fbb0189\", \"number\": 56362 }, \"timestamp\": 1530060672000, \"transaction_balance_trace\": [ { \"transaction_identifier\": \"e6cabb1833cd1f795eed39d8dd7689eaa70e5bb217611766c74c7aa9feea80df\", \"operation\": [ { \"operation_identifier\": 0, \"address\": \"TPttBLmFuykRi83y9HxDoEWxTQw6CCcQ4p\", \"amount\": -100000 }, { \"operation_identifier\": 1, \"address\": \"TLsV52sRDL79HXGGm9yzwKibb6BeruhUzy\", \"amount\": 100000 }, { \"operation_identifier\": 2, \"address\": \"TPttBLmFuykRi83y9HxDoEWxTQw6CCcQ4p\", \"amount\": -10000000 }, { \"operation_identifier\": 3, \"address\": \"TMrysg7DbwR1M8xqhpaPdVCHCuWFhw7uk1\", \"amount\": 10000000 } ], \"type\": \"TransferContract\", \"status\": \"SUCCESS\" } ] }","title":"wallet/getblockbalance"},{"location":"api/http/#walletgettransactionbyid","text":"Description: Query a transaction information by transaction id curl -X POST http://127.0.0.1:8090/wallet/gettransactionbyid -d '{\"value\": \"d5ec749ecc2a615399d8a6c864ea4c74ff9f523c2be0e341ac9be5d47d7c2d62\"}' Parameters: Transaction id Return: Transaction information","title":"wallet/gettransactionbyid"},{"location":"api/http/#walletgettransactioninfobyid","text":"Description: Query the transaction fee, block height by transaction id curl -X POST http://127.0.0.1:8090/wallet/gettransactioninfobyid -d '{\"value\" : \"309b6fa3d01353e46f57dd8a8f27611f98e392b50d035cef213f2c55225a8bd2\"}' Parameters: value - Transaction id Return: Transaction fee & block height","title":"wallet/gettransactioninfobyid"},{"location":"api/http/#walletgettransactioncountbyblocknum","text":"Description: Query th the number of transactions in a specific block curl -X POST http://127.0.0.1:8090/wallet/gettransactioncountbyblocknum -d '{\"num\" : 100}' Parameters: num - Block height Return: The number of transactions","title":"wallet/gettransactioncountbyblocknum"},{"location":"api/http/#walletgettransactioninfobyblocknum","text":"Description: Query the list of transaction information in a specific block curl -X POST http://127.0.0.1:8090/wallet/gettransactioninfobyblocknum -d '{\"num\" : 100}' Parameters: num is the Block height Return:The list of transaction information","title":"wallet/gettransactioninfobyblocknum"},{"location":"api/http/#walletlistnodes","text":"Description: Query the list of nodes connected to the ip of the api curl -X POST http://127.0.0.1:8090/wallet/listnodes Parameters: N/A Return: The list of nodes","title":"wallet/listnodes"},{"location":"api/http/#walletgetnodeinfo","text":"Description: Query the current node information curl http://127.0.0.1:8090/wallet/getnodeinfo Return: The node information","title":"wallet/getnodeinfo"},{"location":"api/http/#walletgetchainparameters","text":"Description: Query the parameters of the blockchain used for witnessses to create a proposal curl -X POST http://127.0.0.1:8090/wallet/getchainparameters Return: The list of parameters of the blockchain","title":"wallet/getchainparameters"},{"location":"api/http/#walletgetenergyprices","text":"Description: Query historical energy unit price curl -X POST http://127.0.0.1:8090/wallet/getenergyprices Return: All historical energy unit price information. Each unit price change is separated by a comma. Before the colon is the millisecond timestamp, and after the colon is the energy unit price in sun.","title":"wallet/getenergyprices"},{"location":"api/http/#walletgetbandwidthprices","text":"Description: Query historical bandwidth unit price curl -X POST http://127.0.0.1:8090/wallet/getbandwidthprices Return: All historical bandwidth unit price information. Each unit price change is separated by a comma. Before the colon is the millisecond timestamp, and after the colon is the bandwidth unit price in sun.","title":"wallet/getbandwidthprices"},{"location":"api/http/#walletgetburntrx","text":"Description: Query the amount of TRX burned due to on-chain transaction fees since No. 54 Committee Proposal took effect curl -X POST http://127.0.0.1:8090/wallet/getburntrx Return: Amount of TRX burned, in sun.","title":"wallet/getburntrx"},{"location":"api/http/#smart-contracts","text":"The following are smart contract related APIs: wallet/getcontract wallet/getcontractinfo wallet/deploycontract wallet/triggersmartcontract wallet/triggerconstantcontract wallet/updatesetting wallet/updateenergylimit wallet/clearabi wallet/estimateenergy","title":"Smart Contracts"},{"location":"api/http/#walletgetcontract","text":"Queries a contract's information from the blockchain, including the bytecode of the contract, ABI, configuration parameters, etc. curl -X POST http://127.0.0.1:8090/wallet/getcontract -d '{\"value\":\"4189139CB1387AF85E3D24E212A008AC974967E561\"}' Parameters: value - Contract address Return:SmartContract","title":"wallet/getcontract"},{"location":"api/http/#walletgetcontractinfo","text":"Queries a contract's information from the blockchain. The difference from the wallet/getcontract interface is that this interface returns not only the bytecode but also the runtime bytecode of the contract. Compared with bytecode, runtime bytecode does not contain constructor and constructor parameter information. curl -X POST http://127.0.0.1:8090/wallet/getcontractinfo -d '{\"value\":\"4189139CB1387AF85E3D24E212A008AC974967E561\"}' Parameters: value - Contract address Return: contract's information","title":"wallet/getcontractinfo"},{"location":"api/http/#walletdeploycontract","text":"Description: Deploy a smart contract curl -X POST http://127.0.0.1:8090/wallet/deploycontract -d '{\"abi\":\"[{\\\"constant\\\":false,\\\"inputs\\\":[{\\\"name\\\":\\\"key\\\",\\\"type\\\":\\\"uint256\\\"},{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"uint256\\\"}],\\\"name\\\":\\\"set\\\",\\\"outputs\\\":[],\\\"payable\\\":false,\\\"stateMutability\\\":\\\"nonpayable\\\",\\\"type\\\":\\\"function\\\"},{\\\"constant\\\":true,\\\"inputs\\\":[{\\\"name\\\":\\\"key\\\",\\\"type\\\":\\\"uint256\\\"}],\\\"name\\\":\\\"get\\\",\\\"outputs\\\":[{\\\"name\\\":\\\"value\\\",\\\"type\\\":\\\"uint256\\\"}],\\\"payable\\\":false,\\\"stateMutability\\\":\\\"view\\\",\\\"type\\\":\\\"function\\\"}]\",\"bytecode\":\"608060405234801561001057600080fd5b5060de8061001f6000396000f30060806040526004361060485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631ab06ee58114604d5780639507d39a146067575b600080fd5b348015605857600080fd5b506065600435602435608e565b005b348015607257600080fd5b50607c60043560a0565b60408051918252519081900360200190f35b60009182526020829052604090912055565b600090815260208190526040902054905600a165627a7a72305820fdfe832221d60dd582b4526afa20518b98c2e1cb0054653053a844cf265b25040029\",\"parameter\":\"\",\"call_value\":100,\"name\":\"SomeContract\",\"consume_user_resource_percent\":30,\"fee_limit\":10,\"origin_energy_limit\": 10,\"owner_address\":\"41D1E7A6BC354106CB410E65FF8B181C600FF14292\"}' Parameters: abi :abi bytecode :bytecode\uff0chexString parameter :The list of the parameters of the constructor, It should be converted hexString after encoded according to ABI encoder. If constructor has no parameter, this can be optional consume_user_resource_percent : Consume user's resource percentage. It should be an integer between [0, 100]. if 0, means it does not consume user's resource until the developer's resource has been used up fee_limit : The maximum TRX burns for resource consumption call_value : The TRX transfer to the contract for each call owner_address :Owner address of the contract, default hexString name :Contract name origin_energy_limit : The maximum resource consumption of the creator in one execution or creation call_token_value : The amount of trc10 token transfer to the contract for each call (Optional) token_id :The id of trc10 token transfer to the contract (Optional) Permission_id : Optional, for multi-signature use Return:Unsigned transaction","title":"wallet/deploycontract"},{"location":"api/http/#wallettriggersmartcontract","text":"Description: Trigger smart contract $ curl -X POST http://127.0.0.1:8090/wallet/triggersmartcontract -d '{ \"contract_address\": \"4189139CB1387AF85E3D24E212A008AC974967E561\", \"function_selector\": \"set(uint256,uint256)\", \"parameter\": \"00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002\", \"fee_limit\": 10, \"call_value\": 100, \"owner_address\": \"41D1E7A6BC354106CB410E65FF8B181C600FF14292\" }' Parameters: contract_address : Contract address, default hexString function_selector : Function call, must not leave a blank space parameter : The parameter passed to 'function_selector', the format must match with the VM's requirement. You can use a js tool provided by remix to convert a parameter like [1,2] to the format that VM requires data : The data for interacting with smart contracts, including the contract function and parameters. You can choose to use this field, or you can choose to use function_selector and parameter for contract interaction. When both of data and function_selector exist, function_selector is preferred fee_limit : The maximum TRX burns for resource consumption call_value : The TRX transfer to the contract for each call call_token_value : The amount of trc10 token transfer to the contract for each call token_id : The id of trc10 token transfer to the contract owner_address : Owner address that triggers the contract, default hexString permission_id : Optional, for multi-signature use Return:Unsigned transaction","title":"wallet/triggersmartcontract"},{"location":"api/http/#wallettriggerconstantcontract","text":"Description: Trigger the constant of the smart contract, the transaction is off the blockchain $ curl -X POST http://127.0.0.1:8090/wallet/triggerconstantcontract -d '{ \"contract_address\": \"4189139CB1387AF85E3D24E212A008AC974967E561\", \"function_selector\": \"set(uint256,uint256)\", \"parameter\": \"00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002\", \"call_value\": 100, \"owner_address\": \"41D1E7A6BC354106CB410E65FF8B181C600FF14292\" }' Parameters: contract_address : Smart contract address, default hexString function_selector : Function call, must not leave a blank space parameter : The parameter passed to 'function_selector', the format must match with the VM's requirement. You can use a hs tool provided by remix to convert a parameter like [1,2] to the format that VM requires data : The data for interacting with smart contracts, including the contract function and parameters. You can choose to use this field, or you can choose to use function_selector and parameter for contract interaction. When both of data and function_selector exist, function_selector is preferred call_value : The TRX transfer to the contract for each call owner_address : Owner address that triggers the contract, default hexString call_token_value : The amount of trc10 token transfer to the contract for each call token_id : The id of trc10 token transfer to the contract Return: Transaction object Note: The unit of TRX in the parameters is SUN","title":"wallet/triggerconstantcontract"},{"location":"api/http/#walletupdatesetting","text":"Description: Update the consume_user_resource_percent parameter of a smart contract $ curl -X POST http://127.0.0.1:8090/wallet/updatesetting -d '{ \"owner_address\": \"419844f7600e018fd0d710e2145351d607b3316ce9\", \"contract_address\": \"41c6600433381c731f22fc2b9f864b14fe518b322f\", \"consume_user_resource_percent\": 7 }' owner_address :Owner address of the smart contract, default hexString contract_address :Smart contract address, default hexString consume_user_resource_percent :Consume user's resource percentage Permission_id : Optional, for multi-signature use Return: Transaction object","title":"wallet/updatesetting"},{"location":"api/http/#walletupdateenergylimit","text":"Description: Update the origin_energy_limit parameter of a smart contract $ curl -X POST http://127.0.0.1:8090/wallet/updateenergylimit -d '{ \"owner_address\": \"419844f7600e018fd0d710e2145351d607b3316ce9\", \"contract_address\": \"41c6600433381c731f22fc2b9f864b14fe518b322f\", \"origin_energy_limit\": 7 }' Parameters: owner_address : Owner address of the smart contract, default hexString contract_address : Smart contract address, default hexString origin_energy_limit : The maximum resource consumption of the creator in one execution or creation permission_id : Optional, for multi-signature use Return: Transaction object","title":"wallet/updateenergylimit"},{"location":"api/http/#walletclearabi","text":"Description: To clear the abi of a smart contract $ curl -X POST http://127.0.0.1:8090/wallet/clearabi -d '{ \"owner_address\": \"41a7d8a35b260395c14aa456297662092ba3b76fc0\", \"contract_address\": \"417bcb781f4743afaacf9f9528f3ea903b3782339f\" }' Parameters: owner_address :Owner address of the smart contract contract_address : Smart contract address, default hexString Return: Transaction object","title":"wallet/clearabi"},{"location":"api/http/#walletestimateenergy","text":"Estimate the energy required for the successful execution of smart contract transactions curl -X POST http://127.0.0.1:8090/wallet/estimateenergy -d '{ \"owner_address\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\", \"contract_address\": \"TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs\", \"function_selector\": \"transfer(address,uint256)\", \"parameter\": \"00000000000000000000004115208EF33A926919ED270E2FA61367B2DA3753DA0000000000000000000000000000000000000000000000000000000000000032\", \"visible\": true }' Parameters: contract_address : Smart contract address. If visible=true, use base58check format, otherwise use hex format. function_selector : Function call, must not be left blank. parameter : Parameter encoding needs to be in accordance with the ABI rules, the rules are more complicated, users can use the ethers library to encode data : The data for interacting with smart contracts, including the contract function and parameters. You can choose to use this field, or you can choose to use function_selector and parameter for contract interaction. When both of data and function_selector exist, function_selector is preferred call_value : The TRX transfer to the contract for each call owner_address :Owner address that triggers the contract. If visible=true, use base58check format, otherwise use hex call_token_value : The amount of trc10 token transfer to the contract for each call token_id : The id of trc10 token transfer to the contract Return:Estimated the energy value","title":"wallet/estimateenergy"},{"location":"api/http/#trc10-token","text":"The following are TRC10 token-related APIs: wallet/getassetissuebyaccount wallet/getassetissuebyname wallet/getassetissuelistbyname wallet/getassetissuebyid wallet/getassetissuelist wallet/getpaginatedassetissuelist wallet/transferasset wallet/participateassetissue wallet/createassetissue wallet/unfreezeasset wallet/updateasset","title":"TRC10 token"},{"location":"api/http/#walletgetassetissuebyaccount","text":"Description: Query the token issue information of an account $ curl -X POST http://127.0.0.1:8090/wallet/getassetissuebyaccount -d '{ \"address\": \"41F9395ED64A6E1D4ED37CD17C75A1D247223CAF2D\" }' Parameter address: Token issuer's address, default hexString Return: Token object","title":"wallet/getassetissuebyaccount"},{"location":"api/http/#walletgetassetissuebyname","text":"Description: Query a token by token name $ curl -X POST http://127.0.0.1:8090/wallet/getassetissuebyname -d '{ \"value\": \"44756354616E\" }' Parameter value: Token name, default hexString Return: Token object","title":"wallet/getassetissuebyname"},{"location":"api/http/#walletgetassetissuelistbyname","text":"Description: Query the list of tokens by name $ curl -X POST http://127.0.0.1:8090/wallet/getassetissuelistbyname -d '{ \"value\": \"44756354616E\" }' Parameter value: Token name, default hexString Return: The list of tokens","title":"wallet/getassetissuelistbyname"},{"location":"api/http/#walletgetassetissuebyid","text":"Description: Query a token by token id $ curl -X POST http://127.0.0.1:8090/wallet/getassetissuebyid -d '{ \"value\": \"1000001\" }' Parameter value: Token id Return: Token object","title":"wallet/getassetissuebyid"},{"location":"api/http/#walletgetassetissuelist","text":"Description: Query the list of all the tokens $ curl -X GET http://127.0.0.1:8090/wallet/getassetissuelist Parameter: No parameter Return: The list of all the tokens","title":"wallet/getassetissuelist"},{"location":"api/http/#walletgetpaginatedassetissuelist","text":"Description: Query the list of all the tokens by pagination $ curl -X POST http://127.0.0.1:8090/wallet/getpaginatedassetissuelist -d '{ \"offset\": 0, \"limit\": 10 }' Parameters: offset : The index of the start token limit : The amount of tokens per page Return: The list of tokens by pagination","title":"wallet/getpaginatedassetissuelist"},{"location":"api/http/#wallettransferasset","text":"Description: Transfer token $ curl -X POST http://127.0.0.1:8090/wallet/transferasset -d '{ \"owner_address\": \"41d1e7a6bc354106cb410e65ff8b181c600ff14292\", \"to_address\": \"41e552f6487585c2b58bc2c9bb4492bc1f17132cd0\", \"asset_name\": \"31303030303031\", \"amount\": 100 }' Parameters: owner_address : Owner address, default hexString to_address : To address, default hexString asset_name : Token id, default hexString amount : Token transfer amount permission_id : Optional, for multi-signature use Return: Transaction object Note: The unit of 'amount' is the smallest unit of the token","title":"wallet/transferasset"},{"location":"api/http/#walletparticipateassetissue","text":"Description: Participate a token $ curl -X POST http://127.0.0.1:8090/wallet/participateassetissue -d '{ \"to_address\": \"41e552f6487585c2b58bc2c9bb4492bc1f17132cd0\", \"owner_address\": \"41e472f387585c2b58bc2c9bb4492bc1f17342cd1\", \"amount\": 100, \"asset_name\": \"3230313271756265696a696e67\" }' Parameters: to_address : The issuer address of the token, default hexString owner_address : The participant address, default hexString amount : Participate token amount asset_name : Token id, default hexString permission_id : Optional, for multi-signature use Return: Transaction object Note: The unit of 'amount' is the smallest unit of the token","title":"wallet/participateassetissue"},{"location":"api/http/#walletcreateassetissue","text":"Description: Issue a token $ curl -X POST http://127.0.0.1:8090/wallet/createassetissue -d '{ \"owner_address\": \"41e552f6487585c2b58bc2c9bb4492bc1f17132cd0\", \"name\": \"0x6173736574497373756531353330383934333132313538\", \"abbr\": \"0x6162627231353330383934333132313538\", \"total_supply\": 4321, \"trx_num\": 1, \"num\": 1, \"start_time\": 1530894315158, \"end_time\": 1533894312158, \"description\": \"007570646174654e616d6531353330363038383733343633\", \"url\": \"007570646174654e616d6531353330363038383733343633\", \"free_asset_net_limit\": 10000, \"public_free_asset_net_limit\": 10000, \"frozen_supply\": { \"frozen_amount\": 1, \"frozen_days\": 2 } }' Parameters: owner_address : Owner address, default hexString name : Token name, default hexString abbr : Token name abbreviation, default hexString total_supply : Token total supply trx_num : Define the price by the ratio of trx_num/num num : Define the price by the ratio of trx_num/num start_time : ICO start time end_time : ICO end time description : Token description, default hexString url : Token official website url, default hexString free_asset_net_limit : Token free asset net limit public_free_asset_net_limit : Token public free asset net limit frozen_supply : Token staked supply permission_id : Optional, for multi-signature use Return: Transaction object Note: The unit of 'trx_num' is SUN","title":"wallet/createassetissue"},{"location":"api/http/#walletunfreezeasset","text":"Description: Unstake the staked token that is due $ curl -X POST http://127.0.0.1:8090/wallet/unfreezeasset -d '{ \"owner_address\": \"41e472f387585c2b58bc2c9bb4492bc1f17342cd1\" }' Parameters: - owner_address : Owner address, default hexString - permission_id : Optional, for multi-signature use Return: Transaction object","title":"wallet/unfreezeasset"},{"location":"api/http/#walletupdateasset","text":"Description: Update token information $ curl -X POST http://127.0.0.1:8090/wallet/updateasset -d '{ \"owner_address\": \"41e472f387585c2b58bc2c9bb4492bc1f17342cd1\", \"description\": \"\", \"url\": \"\", \"new_limit\": 1000000, \"new_public_limit\": 100 }' Parameters: owner_address : The issuers address of the token, default hexString description : The description of token, default hexString url : The token's website url, default hexString new_limit : Each token holder's free bandwidth new_public_limit : The total free bandwidth of the token permission_id : Optional, for multi-signature use Return: Transaction object","title":"wallet/updateasset"},{"location":"api/http/#vote-and-sr","text":"The following are voting and SR related APIs: wallet/createwitness wallet/updatewitness wallet/listwitnesses wallet/withdrawbalance wallet/votewitnessaccount wallet/getBrokerage wallet/updateBrokerage wallet/getReward wallet/getnextmaintenancetime","title":"Vote and SR"},{"location":"api/http/#walletcreatewitness","text":"Description: Apply to become a witness $ curl -X POST http://127.0.0.1:8090/wallet/createwitness -d '{ \"owner_address\": \"41d1e7a6bc354106cb410e65ff8b181c600ff14292\", \"url\": \"007570646174654e616d6531353330363038383733343633\" }' Parameters: owner_address : Owner address, default hexString url : Website url, default hexString permission_id : Optional, for multi-signature use Return: Transaction object","title":"wallet/createwitness"},{"location":"api/http/#walletupdatewitness","text":"Description: Update the witness' website url $ curl -X POST http://127.0.0.1:8090/wallet/updatewitness -d '{ \"owner_address\": \"41d1e7a6bc354106cb410e65ff8b181c600ff14292\", \"update_url\": \"007570646174654e616d6531353330363038383733343633\" }' Parameters: owner_address : Owner address, default hexString update_url : Website url, default hexString permission_id : Optional, for multi-signature use Return: Transaction object","title":"wallet/updatewitness"},{"location":"api/http/#walletlistwitnesses","text":"Description: Qyery the list of the witnesses curl -X POST http://127.0.0.1:8090/wallet/listwitnesses Parameters: N/A Return:witness list","title":"wallet/listwitnesses"},{"location":"api/http/#walletwithdrawbalance","text":"Description: Withdraw reward to account balance for witnesses $ curl -X POST http://127.0.0.1:8090/wallet/withdrawbalance -d '{ \"owner_address\": \"41e472f387585c2b58bc2c9bb4492bc1f17342cd1\" }' Parameters: owner_address : Owner address, default hexString permission_id : Optional, for multi-signature use Return: Transaction object Note: It can only withdraw once for every 24 hours","title":"wallet/withdrawbalance"},{"location":"api/http/#walletvotewitnessaccount","text":"Description: Vote for witnesses $ curl -X POST http://127.0.0.1:8090/wallet/votewitnessaccount -d '{ \"owner_address\": \"41d1e7a6bc354106cb410e65ff8b181c600ff14292\", \"votes\": [ { \"vote_address\": \"41e552f6487585c2b58bc2c9bb4492bc1f17132cd0\", \"vote_count\": 5 } ] }' Parameters: owner_address : Owner address, default hexString votes : 'vote_address' stands for the address of the witness you want to vote, default hexString, 'vote_count' stands for the number of votes you want to vote permission_id : Optional, for multi-signature use Return: Transaction object","title":"wallet/votewitnessaccount"},{"location":"api/http/#walletgetbrokerage","text":"Description: Query the ratio of brokerage of the witness $ curl -X GET http://127.0.0.1:8090/wallet/getBrokerage -d ' { \"address\":\"41E552F6487585C2B58BC2C9BB4492BC1F17132CD0\"}' Parameter address : The address of the witness's account, default hexString Return: The ratio of brokerage of the witness","title":"wallet/getBrokerage"},{"location":"api/http/#walletupdatebrokerage","text":"Description: Update the ratio of brokerage $ curl -X POST http://127.0.0.1:8090/wallet/updateBrokerage -d ' { \"owner_address\":\"41E552F6487585C2B58BC2C9BB4492BC1F17132CD0\", \"brokerage\":30 }' Parameters: owner_address : The address of the witness's account, default hexString brokerage : The ratio of brokerage you want to update to Return: Transaction object","title":"wallet/updateBrokerage"},{"location":"api/http/#walletgetreward","text":"Description: Query unclaimed reward $ curl -X GET http://127.0.0.1:8090/wallet/getReward -d '{ \"address\":\"41E552F6487585C2B58BC2C9BB4492BC1F17132CD0\"}' Parameter address : The address of the voter's account, default hexString Return: Unclaimed reward","title":"wallet/getReward"},{"location":"api/http/#walletgetnextmaintenancetime","text":"Description: Query the time interval till the next vote round curl -X POST http://127.0.0.1:8090/wallet/getnextmaintenancetime Parameters: N/A Return: The time interval till the next vote round(unit: ms)","title":"wallet/getnextmaintenancetime"},{"location":"api/http/#proposals","text":"The following are proposal-related APIs: wallet/proposalcreate wallet/getproposalbyid wallet/listproposals wallet/proposalapprove wallet/proposaldelete wallet/getpaginatedproposallist","title":"Proposals"},{"location":"api/http/#walletproposalcreate","text":"Description: Create a proposal $ curl -X POST http://127.0.0.1:8090/wallet/proposalcreate -d '{ \"owner_address\": \"419844F7600E018FD0D710E2145351D607B3316CE9\", \"parameters\": [ { \"key\": 0, \"value\": 100000 }, { \"key\": 1, \"value\": 2 } ] }' Parameters: owner_address : Creator address parameters : Proposal parameters permission_id : Optional, for multi-signature use Return: Transaction object","title":"wallet/proposalcreate"},{"location":"api/http/#walletgetproposalbyid","text":"Description: Query a proposal by proposal id $ curl -X POST http://127.0.0.1:8090/wallet/getproposalbyid -d '{ \"id\": 1 }' Parameter id : Proposal id Return: The proposal information","title":"wallet/getproposalbyid"},{"location":"api/http/#walletlistproposals","text":"Description: Query all the proposals $ curl -X POST http://127.0.0.1:8090/wallet/listproposals Parameter: No parameter Return: The list of all the proposals","title":"wallet/listproposals"},{"location":"api/http/#walletproposalapprove","text":"Description: To approve a proposal $ curl -X POST http://127.0.0.1:8090/wallet/proposalapprove -d '{ \"owner_address\": \"419844F7600E018FD0D710E2145351D607B3316CE9\", \"proposal_id\": 1, \"is_add_approval\": true }' Parameters: owner_address : The address that makes the approve action, default hexString proposal_id : Proposal id is_add_approval : Whether to approve permission_id : Optional, for multi-signature use Return: Transaction object","title":"wallet/proposalapprove"},{"location":"api/http/#walletproposaldelete","text":"Description: To delete a proposal $ curl -X POST http://127.0.0.1:8090/wallet/proposaldelete -d '{ \"owner_address\": \"419844F7600E018FD0D710E2145351D607B3316CE9\", \"proposal_id\": 1 }' Parameters: owner_address : Owner address of the proposal, default hexString proposal_id : Proposal id permission_id : Optional, for multi-signature use Return: Transaction object","title":"wallet/proposaldelete"},{"location":"api/http/#walletgetpaginatedproposallist","text":"Description: Query the list of all the proposals by pagination $ curl -X POST http://127.0.0.1:8090/wallet/getpaginatedproposallist -d '{ \"offset\": 0, \"limit\": 10 }' Parameters: offset : The index of the start proposal limit : The amount of proposals per page Return: The list of proposals by pagination","title":"wallet/getpaginatedproposallist"},{"location":"api/http/#dex-exchange","text":"The following are the APIs related to decentralized exchanges: wallet/exchangecreate wallet/exchangeinject wallet/exchangewithdraw wallet/exchangetransaction wallet/getexchangebyid wallet/listexchanges wallet/getpaginatedexchangelist wallet/marketsellasset wallet/marketcancelorder wallet/getmarketorderbyaccount wallet/getmarketpairlist wallet/getmarketorderlistbypair wallet/getmarketpricebypair wallet/getmarketorderbyid","title":"DEX Exchange"},{"location":"api/http/#walletexchangecreate","text":"Description: Create an exchange pair $ curl -X POST http://127.0.0.1:8090/wallet/exchangecreate -d '{ \"owner_address\": \"419844f7600e018fd0d710e2145351d607b3316ce9\", \"first_token_id\": \"token_a\", \"first_token_balance\": 100, \"second_token_id\": \"token_b\", \"second_token_balance\": 200 }' Parameters: owner_address : address first_token_id : The first token's id, default hexString first_token_balance : The first token's balance second_token_id : The second token's id, default hexString second_token_balance : The second token's balance permission_id : Optional, for multi-signature use Return: Transaction object Note: The unit of 'first_token_balance' and 'second_token_balance' is the smallest unit of the token","title":"wallet/exchangecreate"},{"location":"api/http/#walletexchangeinject","text":"Description: Inject funds for exchange pair $ curl -X POST http://127.0.0.1:8090/wallet/exchangeinject -d '{ \"owner_address\": \"419844f7600e018fd0d710e2145351d607b3316ce9\", \"exchange_id\": 1, \"token_id\": \"74726f6e6e616d65\", \"quant\": 100 }' Parameters: owner_address : Owner address of the exchange pair, default hexString exchange_id : Exchange pair id token_id : Token id, default hexString quant : Token inject amount permission_id : Optional, for multi-signature use Return: Transaction object Note: The unit of 'quant' is the smallest unit of the token","title":"wallet/exchangeinject"},{"location":"api/http/#walletexchangewithdraw","text":"Description: Withdraw from exchange pair $ curl -X POST http://127.0.0.1:8090/wallet/exchangewithdraw -d '{ \"owner_address\": \"419844f7600e018fd0d710e2145351d607b3316ce9\", \"exchange_id\": 1, \"token_id\": \"74726f6e6e616d65\", \"quant\": 100 }' Parameters: owner_address : Owner address of the exchange pair, default hexString exchange_id : Exchange pair id token_id : Token id, default hexString quant : Token withdraw amount permission_id : Optional, for multi-signature use Return: Transaction object Note: The unit of 'quant' is the smallest unit of the token","title":"wallet/exchangewithdraw"},{"location":"api/http/#walletexchangetransaction","text":"Description: Participate the transaction of exchange pair $ curl -X POST http://127.0.0.1:8090/wallet/exchangetransaction -d '{ \"owner_address\": \"419844f7600e018fd0d710e2145351d607b3316ce9\", \"exchange_id\": 1, \"token_id\": \"74726f6e6e616d65\", \"quant\": 100, \"expected\": 10 }' Parameters: owner_address : Owner address of the exchange pair, default hexString exchange_id : Exchange pair id token_id : Token id, default hexString quant : Sell token amount expected : Expected token amount to get permission_id : Optional, for multi-signature use Return: Transaction object Note: The unit of 'quant' and 'expected' is the smallest unit of the token","title":"wallet/exchangetransaction"},{"location":"api/http/#walletgetexchangebyid","text":"Description: Query an exchange pair by exchange pair id $ curl -X POST http://127.0.0.1:8090/wallet/getexchangebyid -d '{ \"id\": 1 }' Parameter id: Exchange pair id Return: Exchange pair information","title":"wallet/getexchangebyid"},{"location":"api/http/#walletlistexchanges","text":"Description: Query the list of all the exchange pairs $ curl -X GET http://127.0.0.1:8090/wallet/listexchanges Parameter: No parameter Return: The list of all the exchange pairs","title":"wallet/listexchanges"},{"location":"api/http/#walletgetpaginatedexchangelist","text":"Description: Query the list of all the exchange pairs by pagination $ curl -X POST http://127.0.0.1:8090/wallet/getpaginatedexchangelist -d '{ \"offset\": 0, \"limit\": 10 }' Parameters: offset : The index of the start exchange pair limit : The amount of exchange pairs per page Return: The list of exchange pairs by pagination","title":"wallet/getpaginatedexchangelist"},{"location":"api/http/#walletmarketsellasset","text":"Description\uff1aCreate an market order curl -X POST http://127.0.0.1:8090/wallet/marketsellasset -d '{ \"owner_address\": \"4184894b42f66dce8cb84aec2ed11604c991351ac8\", \"sell_token_id\": \"5f\", \"sell_token_quantity\": 100, \"buy_token_id\": \"31303030303031\", \"buy_token_quantity\": 200 }' Parameters\uff1a owner_address \uff1aowner address, default hexString sell_token_id \uff1asell token id, default hexString sell_token_quantity \uff1asell token quantity buy_token_id \uff1abuy token id, default hexString buy_token_quantity \uff1abuy token quantity (min to receive) Return\uff1aTransaction object","title":"wallet/marketsellasset"},{"location":"api/http/#walletmarketcancelorder","text":"Description\uff1aCancel the order curl -X POST http://127.0.0.1:8090/wallet/marketcancelorder -d '{ \"owner_address\": \"4184894b42f66dce8cb84aec2ed11604c991351ac8\", \"order_id\": \"0a7af584a53b612bcff1d0fc86feab05f69bc4528f26a4433bb344d453bd6eeb\" }' Parameters\uff1a owner_address \uff1aowner address, default hexString order_id \uff1aorder id Return\uff1aTransaction object","title":"wallet/marketcancelorder"},{"location":"api/http/#walletgetmarketorderbyaccount","text":"Description\uff1aGet all orders for the account curl -X POST http://127.0.0.1:8090/wallet/getmarketorderbyaccount -d '{ \"value\": \"4184894b42f66dce8cb84aec2ed11604c991351ac8\" }' Parameters\uff1a value - owner address, default hexString Return\uff1aorder list","title":"wallet/getmarketorderbyaccount"},{"location":"api/http/#walletgetmarketpairlist","text":"Description\uff1aGet all trading pairs curl -X get http://127.0.0.1:8090/wallet/getmarketpairlist Parameters: N/A Return: makket pair list","title":"wallet/getmarketpairlist"},{"location":"api/http/#walletgetmarketorderlistbypair","text":"Description\uff1aGet all orders for the trading pair demo: curl -X POST http://127.0.0.1:8090/wallet/getmarketorderlistbypair -d '{ \"sell_token_id\": \"5f\" , \"buy_token_id\": \"31303030303031\" }' Parameters\uff1a sell_token_id \uff1asell token id, default hexString buy_token_id \uff1abuy token id, default hexString Return\uff1aorder list","title":"wallet/getmarketorderlistbypair"},{"location":"api/http/#walletgetmarketpricebypair","text":"Description\uff1aGet all prices for the trading pair curl -X POST http://127.0.0.1:8090/wallet/getmarketpricebypair -d '{ \"sell_token_id\": \"5f\" \"buy_token_id\": \"31303030303031\" }' Parameters\uff1a sell_token_id \uff1asell token id, default hexString buy_token_id \uff1abuy token id, default hexString Return\uff1aprice list","title":"wallet/getmarketpricebypair"},{"location":"api/http/#walletgetmarketorderbyid","text":"Description\uff1aGet all orders for the account curl -X POST http://127.0.0.1:8090/wallet/getmarketorderbyid -d '{ \"value\": \"orderid\" }' Parameters\uff1a value - order id, default hexString Return\uff1aorder","title":"wallet/getmarketorderbyid"},{"location":"api/http/#tronz-shielded-smart-contract","text":"The following are TRONZ anonymous smart contract related APIs: wallet/getexpandedspendingkey wallet/getakfromask wallet/getnkfromnsk wallet/getspendingkey wallet/getdiversifier wallet/getincomingviewingkey wallet/getzenpaymentaddress wallet/createshieldedtransactionwithoutspendauthsig wallet/scannotebyivk wallet/scanandmarknotebyivk wallet/scannotebyovk wallet/createshieldnullifier wallet/getshieldtransactionhash wallet/createshieldedtransaction wallet/getnewshieldedaddress wallet/createshieldedcontractparameters wallet/createshieldedcontractparameterswithoutask wallet/scanshieldedtrc20notesbyivk wallet/scanshieldedtrc20notesbyovk wallet/isshieldedtrc20contractnotespent wallet/gettriggerinputforshieldedtrc20contract wallet/getrcm wallet/getmerkletreevoucherinfo wallet/isspend wallet/createspendauthsig","title":"TRONZ Shielded Smart Contract"},{"location":"api/http/#walletgetexpandedspendingkey","text":"Description: To get expanded spending keys from spending key curl -X POST http://127.0.0.1:8090/wallet/getexpandedspendingkey -d '{ \"value\": \"06b02aaa00f230b0887ff57a6609d76691369972ac3ba568fe7a8a0897fce7c4\" }' Parameters: value:Spending key Return: Expanded spending keys, it consists of three keys: ask, nsk and ovk.","title":"wallet/getexpandedspendingkey"},{"location":"api/http/#walletgetakfromask","text":"Description: To get ak key from ask key curl -X POST http://127.0.0.1:8090/wallet/getakfromask -d '{ \"value\": \"653b3a3fdd40b60d2f53ba121df8840f6590384993f8fa9a0ecb0dfb23496604\" }' Parameters: value:Ask Return:Ak","title":"wallet/getakfromask"},{"location":"api/http/#walletgetnkfromnsk","text":"Description: To get nk key from nsk key curl -X POST http://127.0.0.1:8090/wallet/getnkfromnsk -d '{ \"value\": \"428ff3c9e101dc1fca08f7b0e3387b23b68016746ae565aefc19d112b696db01\" }' Parameters: value:Nsk Return:Nk","title":"wallet/getnkfromnsk"},{"location":"api/http/#walletgetspendingkey","text":"Description: To get spending key curl -X GET http://127.0.0.1:8090/wallet/getspendingkey Parameters: N/A Return:Spending key","title":"wallet/getspendingkey"},{"location":"api/http/#walletgetdiversifier","text":"Description: To get diversifier curl -X GET http://127.0.0.1:8090/wallet/getdiversifier Parameters: N/A Return: Diversifier","title":"wallet/getdiversifier"},{"location":"api/http/#walletgetincomingviewingkey","text":"Description: To get incoming viewing key curl -X POST http://127.0.0.1:8090/wallet/getincomingviewingkey -d '{ \"ak\":\"b443f1a303ef5837ba95750b48b6fef15f9c77f63a8c28c161bcd6613f423b5c\", \"nk\":\"632137e69179df3d10e252fcce85d13464c3163fe7a619edf8d43ebefa8162d9\" }' Parameters: ak :Ak nk :Nk Return:Incoming viewing key","title":"wallet/getincomingviewingkey"},{"location":"api/http/#walletgetzenpaymentaddress","text":"Description: To get payment address curl -X POST http://127.0.0.1:8090/wallet/getzenpaymentaddress -d '{ \"ivk\":\"8c7852e10862d8eec058635974f70f24c1f8d73819131bb5b54028d0a9408a03\", \"d\":\"736ba8692ed88a5473e009\" }' Parameters: ivk :Ivk d :D Return: Payment address","title":"wallet/getzenpaymentaddress"},{"location":"api/http/#walletcreateshieldedtransactionwithoutspendauthsig","text":"Description: To create shielded transaction without using ask $ curl -X POST http://127.0.0.1:8090/wallet/createshieldedtransactionwithoutspendauthsig -d '{ \"ivk\":\"8c7852e10862d8eec058635974f70f24c1f8d73819131bb5b54028d0a9408a03\", \"d\":\"736ba8692ed88a5473e009\" }' Parameters: transparent_from_address : Transparent sender's address from_amount : Send amount from transparent address ask : Ask nsk : Nsk ovk : Ovk shielded_receives : Shielded receive information shieldedSpends : Shielded spend information transparent_to_address : Transparent receiver's address to_amount : Send amount to transparent address Return: Transaction object","title":"wallet/createshieldedtransactionwithoutspendauthsig"},{"location":"api/http/#walletcreateshieldedtransactionwithoutspendauthsig_1","text":"Description: To create shielded transaction with using ask curl -X POST http://127.0.0.1:8090/wallet/createshieldedtransactionwithoutspendauthsig -d '{ \"ak\": \"bf051629fd8122cd9dd8591d72947b026c214cf7cdac1f68eff97179727d38e9\", \"nsk\": \"42963d26af8122204273fa3489d9efd6babf1f7179ff193c955a1f3d9c2df10c\", \"ovk\": \"bc9848a83966709655b12efadc9e978785858316045e0115a0e72567a9a2a823\", \"shielded_spends\": [ { \"note\": { \"value\": 500000000, \"payment_address\": \"ztron1jld8fmvujrz2vgkc867zuwklmewy4ypw0wtwgweqs2paee0uhc8f3azy90el770arksa2kunl02\", \"rcm\": \"723053bcbfecdf5da66c18ab0376476ef308c61b7abe891b2c01e903bcb87c0e\" }, \"alpha\": \"2608999c3a97d005a879ecdaa16fd29ae434fb67b177c5e875b0c829e6a1db04\", \"voucher\": { \"tree\": { \"left\": { \"content\": \"a3d5c9b2db9699f32afec5febbd5586ce9ff33a0bef6fee5691028313b8e1f6a\" }, \"parents\": [ { \"content\": \"d9c38484296b3aa8f5e8b59d418a3775e2bb414e75498ad352e4614f05aae548\" }, { \"content\": \"d0420777afdc4151c3f14fbe4c714d82dc15873edb1ca65ebb3887334a4bae15\" } ] }, \"rt\": \"fb1115d5ddd16c5427c3a608d6b5add5967e70f51c890307c6142083a2c28565\" }, \"path\": \"2020b2eed031d4d6a4f02a097f80b54cc1541d4163c6b6f5971f88b6e41d35c538142012935f14b676509b81eb49ef25f39269ed72309238b4c145803544b646dca62d20e1f34b034d4a3cd28557e2907ebf990c918f64ecb50a94f01d6fda5ca5c7ef722028e7b841dcbc47cceb69d7cb8d94245fb7cb2ba3a7a6bc18f13f945f7dbd6e2a20a5122c08ff9c161d9ca6fc462073396c7d7d38e8ee48cdb3bea7e2230134ed6a20d2e1642c9a462229289e5b0e3b7f9008e0301cbb93385ee0e21da2545073cb582016d6252968971a83da8521d65382e61f0176646d771c91528e3276ee45383e4a20fee0e52802cb0c46b1eb4d376c62697f4759f6c8917fa352571202fd778fd712204c6937d78f42685f84b43ad3b7b00f81285662f85c6a68ef11d62ad1a3ee0850200769557bc682b1bf308646fd0b22e648e8b9e98f57e29f5af40f6edb833e2c492008eeab0c13abd6069e6310197bf80f9c1ea6de78fd19cbae24d4a520e6cf3023208d5fa43e5a10d11605ac7430ba1f5d81fb1b68d29a640405767749e841527673206aca8448d8263e547d5ff2950e2ed3839e998d31cbc6ac9fd57bc6002b15921620cd1c8dbf6e3acc7a80439bc4962cf25b9dce7c896f3a5bd70803fc5a0e33cf00206edb16d01907b759977d7650dad7e3ec049af1a3d875380b697c862c9ec5d51c201ea6675f9551eeb9dfaaa9247bc9858270d3d3a4c5afa7177a984d5ed1be245120d6acdedf95f608e09fa53fb43dcd0990475726c5131210c9e5caeab97f0e642f20bd74b25aacb92378a871bf27d225cfc26baca344a1ea35fdd94510f3d157082c201b77dac4d24fb7258c3c528704c59430b630718bec486421837021cf75dab65120ec677114c27206f5debc1c1ed66f95e2b1885da5b7be3d736b1de98579473048204777c8776a3b1e69b73a62fa701fa4f7a6282d9aee2c7a6b82e7937d7081c23c20ba49b659fbd0b7334211ea6a9d9df185c757e70aa81da562fb912b84f49bce722043ff5457f13b926b61df552d4e402ee6dc1463f99a535f9a713439264d5b616b207b99abdc3730991cc9274727d7d82d28cb794edbc7034b4f0053ff7c4b68044420d6c639ac24b46bd19341c91b13fdcab31581ddaf7f1411336a271f3d0aa52813208ac9cf9c391e3fd42891d27238a81a8a5c1d3a72b1bcbea8cf44a58ce738961320912d82b2c2bca231f71efcf61737fbf0a08befa0416215aeef53e8bb6d23390a20e110de65c907b9dea4ae0bd83a4b0a51bea175646a64c12b4c9f931b2cb31b4920d8283386ef2ef07ebdbb4383c12a739a953a4d6e0d6fb1139a4036d693bfbb6c20d0420777afdc4151c3f14fbe4c714d82dc15873edb1ca65ebb3887334a4bae1520d9c38484296b3aa8f5e8b59d418a3775e2bb414e75498ad352e4614f05aae5482001000000000000000000000000000000000000000000000000000000000000000600000000000000\" } ], \"shielded_receives\": [ { \"note\": { \"value\": 40000000, \"payment_address\": \"ztron1wd46s6fwmz99gulqpxul6zffqtevzfpl93ng3s5834fhwf6e7w5l6zmjhmpvtwsc4wxa7dusmvr\", \"rcm\": \"ccced07d36641fc93cba33cddda7064cb82f6962a0bdf15a4240a4a742770e03\" } } ] }' Parameters: transparent_from_address : Transparent sender's address from_amount : Send amount from transparent address ak : Ak nsk : Nsk ovk : Ovk shielded_receives : Shielded receive information shieldedSpends : Shielded spend information transparent_to_address : Transparent receiver's address to_amount : Send amount to transparent address Return: Transaction object","title":"wallet/createshieldedtransactionwithoutspendauthsig"},{"location":"api/http/#walletscannotebyivk","text":"Description: To get all the notes by ivk $ curl -X POST http://127.0.0.1:8090/wallet/scannotebyivk -d '{ \"start_block_index\": 0, \"end_block_index\": 100, \"ivk\": \"80a481c3c739e54b4e0608090b3a1a6e9f8dce42346e95bf5a2d8a487bf45c05\" }' Parameters: start_block_index : The start block height, itself included end_block_index : The end block height, itself not included ivk : Incoming viewing key Return: Notes list Note: Range limit (end_block_index - start_block_index <= 1000)","title":"wallet/scannotebyivk"},{"location":"api/http/#walletscanandmarknotebyivk","text":"Description: To get all the notes with spent status by ivk $ curl -X POST http://127.0.0.1:8090/wallet/scanandmarknotebyivk -d '{ \"start_block_index\": 0, \"end_block_index\": 100, \"ivk\": \"80a481c3c739e54b4e0608090b3a1a6e9f8dce42346e95bf5a2d8a487bf45c05\", \"ak\": \"1d4f9b5551f4aa9443ceb263f0e208eb7e26080264571c5ef06de97a646fe418\", \"nk\": \"748522c7571a9da787e43940c9a474aa0c5c39b46c338905deb6726fa3678bdb\" }' Parameters: start_block_index : The start block height, itself included end_block_index : The end block height, itself not included ivk : Incoming viewing key ak : Ak key nk : Nk key Return: Notes list Note: Range limit (end_block_index - start_block_index <= 1000)","title":"wallet/scanandmarknotebyivk"},{"location":"api/http/#walletscannotebyovk","text":"Description: To get all the notes by ovk $ curl -X POST http://127.0.0.1:8090/wallet/scannotebyovk -d '{ \"start_block_index\": 0, \"end_block_index\": 100, \"ovk\": \"705145aa18cbe6c11d5d0011419a98f3d5b1d341eb4727f1315597f4bdaf8539\" }' Parameters: start_block_index : The start block height, itself included end_block_index : The end block height, itself not included ovk : Outgoing viewing key Return: Notes list Note: Range limit (end_block_index - start_block_index <= 1000)","title":"wallet/scannotebyovk"},{"location":"api/http/#walletcreateshieldnullifier","text":"Description: To create a shielded nullifier $ curl -X POST http://127.0.0.1:8090/wallet/createshieldnullifier -d '{ \"note\": { \"payment_address\": \"ztron1aqgauawtkelxfu2w6s48cwh0mchjt6kwpj44l4wym3pullx0294j4r4v7kpm75wnclzycsw73mq\", \"rcm\": \"74a16c1b27ec7fbf06881d9d35ddaab1554838b1bddcd54f6bd8a9fb4ba0b80a\", \"value\": 500000000 }, \"voucher\": { \"tree\": { \"left\": { \"content\": \"a4d763fae3fee78964ccdf7567ec3062c95a5b97825d731202d3dfa6cb01c143\" } }, \"rt\": \"7dc3652c2a16e8518a8be0e3e038f9d28c3eb96f13e8da8acc2a9b650702f33e\" }, \"ak\": \"a3e65d509b675aaa2aeda977ceff11eebd76218079b6f543d78a615e396ca129\", \"nk\": \"62cfda9bea09a53cf2a21022057913734a8458969e11e0bb9c59ead48fbce83e\" }' Parameters: note : Note information voucher : Voucher information ak : Ak nk : Nk Return: A shielded nullifier","title":"wallet/createshieldnullifier"},{"location":"api/http/#walletgetshieldtransactionhash","text":"Description: To get a shielded transaction hash curl -X POST http://127.0.0.1:8090/wallet/getshieldtransactionhash -d '{ \"txID\": \"de639a64497d86bb27e34a2953093a0cc488ec4c7bc9624ac5857d3799748595\", \"raw_data\": { \"contract\": [ { \"parameter\": { \"value\": { \"binding_signature\": \"2b8ae5e11ecad3e6946f54b7ad513bd8692a3edae72d29e266b28e47c9b37ccdb38e3b6433575694b6681136b1734f85afcfe672061d2ee7368755ad0b96a80b\", \"spend_description\": [ { \"value_commitment\": \"cbe1063adbe7e10919421fa6133f03150253913f5aff02d165e2c019cea4a869\", \"anchor\": \"fb1115d5ddd16c5427c3a608d6b5add5967e70f51c890307c6142083a2c28565\", \"nullifier\": \"93e329d464e1dbddc8bb4d2dcc939a796dfe11e985d4e9033a15edf0e3df4f35\", \"rk\": \"10c702d6dff1509502ee5acc0b01d4b4531b2ff53b0dd54488aea6031b5e6d16\", \"zkproof\": \"abf64b3beacfd873b1db764c3da9f739993518f3f740e761cb8af60682b7171892895c3ccfb550c3cf757e906dbf5313a3676b8226b0b84960f76a185c8d3fdfc3fa9c08479a704852d7b3dfeb913cf13e01c25657561e00a06c61e7c65b50b812902ddc4f17bfe2bcb2f247c2dc6132d0f0e0abcecc0332fdd99077af10d07bbdb88c4fd257948428e233c57f84eee8b2eeab2162c1aeccf2e1dfaa306d5803a8b2d281a549440fbd5a3657a830c1ca07a384cea446aa077b195b29b23023b1\" } ], \"receive_description\": [ { \"value_commitment\": \"f6d45db8ec5a1c8dbbde040b4ea138efbe8db2d0597ed2306ff3fdd0620b3c5a\", \"note_commitment\": \"ec3f5472ac8114a9a07987d1c2a0e1254504e352d9574971e77084293900312e\", \"epk\": \"719eeb5ebaeeccc55c9f0d73767aadf0c0513603400ccb50bd789637d984b8e6\", \"c_enc\": \"3a6c4fe0e79f5b23fed34a419c4728d0b26bca23180a22871743b0a9444c27663cf07c55a0ea6db504d70421768bf17384e180b2ad8b8be88ff5cf662c53a4ba086effc3a4b1df39265f71dfac884bff5a69e1dcdcae8aecf6ae443168ffab692a5c1e4908b415dd830dcf6432fae1c32461132080da74d6b83d3d00887eb2ce9965a749f8d8410ea4182969371ac2fd5e0e74d27d883492a08e6209cd9959d74bb67c2a9fe7faac5a4777f1bff19cf0b6398a2faa9b194bbb93d60f132f382f7d693a722e8cbca1da084ee7e0c371397419a7259d1fa0943078cfe5ea352e4b53907bb6c04ca8ad409fb0ae0b110a6b312200e21ab79d543ae7aeb16802cf87afdac1e8954038caa42818f4ca2847fd642360c098accfeeade4abd1cc9ca3315a4336be224ba3516973c7dae3f41875457236675993df38d3a544470c4f9335d77b005e6a9aec40fd881b34852ec9bbbcc3d24ee92930eae770a5462ce04c4e37b0524ef07e00e8d58c810d6aefb19fa7bc2c3a2fdfab6dd4fe73dbecc0795a280f9b7ca35cc8bc1062aed8e26bd81ba33c6f4c318974636f6d796723e77772ced3dbc1f42afec6fc9bb61f8beac704affea9baf2e2de226250c1d427c7d78b1eb1d239e1f3eb6af0f017b80541333f4fce17340048d826b9b0be8477c996ad8bfc3440dc686fdff6d0d63986db4d95962d7977289cbfd14c745de7c79d4dc0bcd220e5b4ced5b409e79142e0f336e44ca29a9a87f6f43707d8c4936e895236dd2b393a478a8bc27b1f682496ba84a0ddc549da06cb7855c4d8680dc66ac40240733b7f\", \"c_out\": \"50be6e77854d4c427b2af4f16e5275f0b0c206b3ea2d2a24ffb287ea356f323523354cd83d15e7c48e6f1fa103dfca3d49ca2263dbb0cd8bfb35d72cdcad1351de6fba7a30aea27184a68bcda19cc6da\", \"zkproof\": \"a4e6c50d5753092d005689922c2bdeafc98775bce59db840974163ace23c13fec18112e32aae1c39842c645ed172ad8fa277e63c1e3d6d7fb12eb15d56b573237b776f562a81d0e6be362d147d8604fdfec421482270ca82950de1883fda06e719f5d256d7a039769bffc570a1778d70c17295d1c0336a6ae0903d2460dc139a9563c2d40f37bffefa73003a55af1ff0861b6f79ef40099b6a0cb25ab3f40727210e4629647d0711abff125712a5f0d64fcb6e6a6b0b34478d7da0552b493a80\" } ] }, \"type_url\": \"type.googleapis.com/protocol.ShieldedTransferContract\" }, \"type\": \"ShieldedTransferContract\" } ], \"ref_block_bytes\": \"0d59\", \"ref_block_hash\": \"7356ce5c35d8265e\", \"expiration\": 1559237283000, \"timestamp\": 1559201285590 }, \"raw_data_hex\": \"0a020d5922087356ce5c35d8265e40b899a3ceb02d5a940b0833128f0b0a35747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e536869656c6465645472616e73666572436f6e747261637412d50a1acb020a20cbe1063adbe7e10919421fa6133f03150253913f5aff02d165e2c019cea4a8691220fb1115d5ddd16c5427c3a608d6b5add5967e70f51c890307c6142083a2c285651a2093e329d464e1dbddc8bb4d2dcc939a796dfe11e985d4e9033a15edf0e3df4f35222010c702d6dff1509502ee5acc0b01d4b4531b2ff53b0dd54488aea6031b5e6d162ac001abf64b3beacfd873b1db764c3da9f739993518f3f740e761cb8af60682b7171892895c3ccfb550c3cf757e906dbf5313a3676b8226b0b84960f76a185c8d3fdfc3fa9c08479a704852d7b3dfeb913cf13e01c25657561e00a06c61e7c65b50b812902ddc4f17bfe2bcb2f247c2dc6132d0f0e0abcecc0332fdd99077af10d07bbdb88c4fd257948428e233c57f84eee8b2eeab2162c1aeccf2e1dfaa306d5803a8b2d281a549440fbd5a3657a830c1ca07a384cea446aa077b195b29b23023b122c2070a20f6d45db8ec5a1c8dbbde040b4ea138efbe8db2d0597ed2306ff3fdd0620b3c5a1220ec3f5472ac8114a9a07987d1c2a0e1254504e352d9574971e77084293900312e1a20719eeb5ebaeeccc55c9f0d73767aadf0c0513603400ccb50bd789637d984b8e622c4043a6c4fe0e79f5b23fed34a419c4728d0b26bca23180a22871743b0a9444c27663cf07c55a0ea6db504d70421768bf17384e180b2ad8b8be88ff5cf662c53a4ba086effc3a4b1df39265f71dfac884bff5a69e1dcdcae8aecf6ae443168ffab692a5c1e4908b415dd830dcf6432fae1c32461132080da74d6b83d3d00887eb2ce9965a749f8d8410ea4182969371ac2fd5e0e74d27d883492a08e6209cd9959d74bb67c2a9fe7faac5a4777f1bff19cf0b6398a2faa9b194bbb93d60f132f382f7d693a722e8cbca1da084ee7e0c371397419a7259d1fa0943078cfe5ea352e4b53907bb6c04ca8ad409fb0ae0b110a6b312200e21ab79d543ae7aeb16802cf87afdac1e8954038caa42818f4ca2847fd642360c098accfeeade4abd1cc9ca3315a4336be224ba3516973c7dae3f41875457236675993df38d3a544470c4f9335d77b005e6a9aec40fd881b34852ec9bbbcc3d24ee92930eae770a5462ce04c4e37b0524ef07e00e8d58c810d6aefb19fa7bc2c3a2fdfab6dd4fe73dbecc0795a280f9b7ca35cc8bc1062aed8e26bd81ba33c6f4c318974636f6d796723e77772ced3dbc1f42afec6fc9bb61f8beac704affea9baf2e2de226250c1d427c7d78b1eb1d239e1f3eb6af0f017b80541333f4fce17340048d826b9b0be8477c996ad8bfc3440dc686fdff6d0d63986db4d95962d7977289cbfd14c745de7c79d4dc0bcd220e5b4ced5b409e79142e0f336e44ca29a9a87f6f43707d8c4936e895236dd2b393a478a8bc27b1f682496ba84a0ddc549da06cb7855c4d8680dc66ac40240733b7f2a5050be6e77854d4c427b2af4f16e5275f0b0c206b3ea2d2a24ffb287ea356f323523354cd83d15e7c48e6f1fa103dfca3d49ca2263dbb0cd8bfb35d72cdcad1351de6fba7a30aea27184a68bcda19cc6da32c001a4e6c50d5753092d005689922c2bdeafc98775bce59db840974163ace23c13fec18112e32aae1c39842c645ed172ad8fa277e63c1e3d6d7fb12eb15d56b573237b776f562a81d0e6be362d147d8604fdfec421482270ca82950de1883fda06e719f5d256d7a039769bffc570a1778d70c17295d1c0336a6ae0903d2460dc139a9563c2d40f37bffefa73003a55af1ff0861b6f79ef40099b6a0cb25ab3f40727210e4629647d0711abff125712a5f0d64fcb6e6a6b0b34478d7da0552b493a802a402b8ae5e11ecad3e6946f54b7ad513bd8692a3edae72d29e266b28e47c9b37ccdb38e3b6433575694b6681136b1734f85afcfe672061d2ee7368755ad0b96a80b70d68b8ebdb02d\" }' Parameter transaction: Transaction object Return: a shielded transaction hash","title":"wallet/getshieldtransactionhash"},{"location":"api/http/#walletcreateshieldedtransaction","text":"Description: To create shielded transaction Please refer to The Demo Parameters: transparent_from_address : Transparent sender's address from_amount : Send amount from transparent address ask : Ask nsk : Nsk ovk : Ovk shielded_receives : Shielded receive information shieldedSpends : Shielded spend information transparent_to_address : Transparent receiver's address to_amount : Send amount to transparent address Return: Transaction object","title":"wallet/createshieldedtransaction"},{"location":"api/http/#walletgetnewshieldedaddress","text":"Description: To get new shieldedAddress curl -X GET http://127.0.0.1:8090/wallet/getnewshieldedaddress Parameters: N/A Return: Spending key Ask key Nsk key Outgoing viewing key Ak Key Nk key incoming viewing key Diversifier pkD payment address","title":"wallet/getnewshieldedaddress"},{"location":"api/http/#walletcreateshieldedcontractparameters","text":"Description: create the shielded TRC-20 transaction parameters, which has three types: mint, transfer and burn demo: curl -X POST http://127.0.0.1:8090/wallet/createshieldedcontractparameters -d '{ \"ask\": \"0f63eabdfe2bbfe08012f6bb2db024e6809c16e8ed055aa41a6095424f192005\", \"nsk\": \"cd43d722fd4b6b01f19449ea826c3e935609648520fcc2a95c0026f0fa9ee404\", \"ovk\": \"1797de3b7f33cafffe3fe18c6b43ec6760add2ad81b10978d1fca5290497ede9\", \"from_amount\": \"5000\", \"shielded_receives\": { \"note\": { \"value\": 50, \"payment_address\": \"ztron15js0jkuxczt8caq5hp59rnh6rgf34sek7vqn9u6ljelxv4nuzz2x9qe3ffm2wzz6ck53yxyhxs6\", \"rcm\": \"74baec30dfac8ed59968955ff245ae002009005194e5b824c35ab88c52e5170e\" } }, \"shielded_TRC20_contract_address\": \"41f3392eaa7d38749176e0671dbc6912f8ef956943\" }' Parameters: ask : Ask nsk : Nsk ovk : Outgoing view key from_amount : the amount for mint, which is scaled by scalingfactor with note value , namely from_amount = value * scalingFactor . In the above example, the value of scalingFactor is 100 shielded_receives : the shielded notes to be created shielded_TRC20_contract_address : shielded TRC-20 contract address Return: the shielded TRC-20 transaction parameters Note: the input parameters will differ according to the variety of shielded TRC-20 transaction type","title":"wallet/createshieldedcontractparameters"},{"location":"api/http/#walletcreateshieldedcontractparameterswithoutask","text":"Description: create the shielded TRC-20 transaction parameters without Ask, which has three types: mint, transfer and burn demo: curl -X POST http://127.0.0.1:8090/wallet/createshieldedcontractparameterswithoutask -d '{ \"ovk\": \"cd361834b3adc06f130de24f7d0c18f92a093cc885d9ce492cc6c02071f7a4f0\", \"from_amount\": \"5000\", \"shielded_receives\": { \"note\": { \"value\": 50, \"payment_address\": \"ztron13lvfnt4rau4ad9mmgztd3aftw49e3amz8gm2kvyzrsaw0ugz2grxwkvcfys5e2gkchj7cnnetjz\", \"rcm\": \"499e73f2f8aaf05fac41a35b8343bde27f6629cbe66d35da5364a99b94a55a06\" } }, \"shielded_TRC20_contract_address\": \"41f3392eaa7d38749176e0671dbc6912f8ef956943\" }' Parameters: ovk : Outgoing view key from_amount : the amount for mint, which is scaled by scalingfactor with note value , namely from_amount = value * scalingFactor . In the above example, the value of scalingFactor is 100 shielded_receives : the shielded notes to be created shielded_TRC20_contract_address : shielded TRC-20 contract address Return: the shielded TRC-20 transaction parameters Note: the input parameters will differ according to the variety of shielded TRC-20 transaction type","title":"wallet/createshieldedcontractparameterswithoutask"},{"location":"api/http/#walletscanshieldedtrc20notesbyivk","text":"Description: scan the shielded TRC-20 notes by ivk and mark their status of whether spent demo: curl -X POST http://127.0.0.1:8090/wallet/scanshieldedtrc20notesbyivk -d '{ \"start_block_index\": 9200, \"end_block_index\": 9240, \"shielded_TRC20_contract_address\": \"41274fc7464fadac5c00c893c58bce6c39bf59e4c7\", \"ivk\": \"9f8e74bb3d7188a2781dc1db38810c6914eef4570a79e8ec8404480948e4e305\", \"ak\":\"8072d9110c9de9d9ade33d5d0f5890a7aa65b0cde42af7816d187297caf2fd64\", \"nk\":\"590bf33f93f792be659fd404df91e75c3b08d38d4e08ee226c3f5219cf598f14\" }' Parameters: start_block_index : the start block index, inclusive end_block_index : the end block index, exclusive shielded_TRC20_contract_address : shielded TRC-20 contract address ivk : Incoming viewing key ak : Ak key nk : Nk key Return: notes list Note: block limit\uff08end_block_index - start_block_index <= 1000\uff09","title":"wallet/scanshieldedtrc20notesbyivk"},{"location":"api/http/#walletscanshieldedtrc20notesbyovk","text":"Description: scan the shielded TRC-20 notes by ovk demo: curl -X POST http://127.0.0.1:8090/wallet/scanshieldedtrc20notesbyovk -d '{ \"start_block_index\": 9200, \"end_block_index\": 9240, \"shielded_TRC20_contract_address\": \"41274fc7464fadac5c00c893c58bce6c39bf59e4c7\", \"ovk\": \"0ff58efd75e083fe4fd759c8701e1c8cb6961c4297a12b2c800bdb7b2bcab889\" }' Parameters: start_block_index : start block index, inclusive end_block_index : end block index, exclusive shielded_TRC20_contract_address : shielded TRC-20 contract address ovk : Outgoing viewing key Return: notes list Note: block limit\uff08end_block_index - start_block_index <= 1000\uff09","title":"wallet/scanshieldedtrc20notesbyovk"},{"location":"api/http/#walletisshieldedtrc20contractnotespent","text":"Description: check the status whether the specified shielded TRC-20 note is spent Parameters: note : the specified note ak : Ak nk : Nk position : the leaf position index of note commitment in the Merkle tree shielded_TRC20_contract_address : the shielded TRC-20 contract address Return: note status Note: the value in note is the scaled value by scalingFactor set in the shielded TRC-20 contract, namely real_amount = value * scalingFactor .","title":"wallet/isshieldedtrc20contractnotespent"},{"location":"api/http/#walletgettriggerinputforshieldedtrc20contract","text":"Description: get the trigger input data of shielded TRC-20 contract for the shielded TRC-20 parameters without spend authority signature. demo: curl -X POST http://127.0.0.1:8090/wallet/gettriggerinputforshieldedtrc20contract -d '{ \"shielded_TRC20_Parameters\": {\"spend_description\": [{\"value_commitment\": \"e3fcc8609ff6a4b00b77a00ef624f305cec5f55cc7312ff5526d0b3057f2ef9e\",\"anchor\": \"4c9cbebece033dc1d253b93e4a3682187daae4f905515761d10287b801e69816\",\"nullifier\": \"74edce8798a3976ee41e045bb666f3a121c27235b0f1b44b3456d2c84bc725dc\",\"rk\": \"9dcf4254aa7c4fb7c8bc6956d4b0c7c6c87c37a2552e7bf4e60c12cb5bc6c8cd\",\"zkproof\": \"9926045cd1442a7d20153e6abda9f77a6526895f0a29a57cb1bc76ef6b7cacef2d0f4c94aa97c3acacdb95cabb065057b7edb4cbea098149a8aa7114a6a6b340c58007ac64b64e592eb18fdd299de5962a2a32ab0caebb2ab198704c751a9d0e143d68a50257d7c9e2230a7420fa46450299fd167141367e201726532d8e815413d8571d6c8c12937674dec92caf1f4583ebe560ac4c7eba290deee0a1c0da5f72c0b9df89fb3b338c683b654b3dc2373a4c2a4fef7f4fa489b44405fb7d2bfb\"}],\"binding_signature\": \"11e949887d9ec92eb32c78f0bc48afdc9a16a2ecbd5a0eca1be070fb900eeda347918bd6e9521d4baf1f74963bee0c1956559623a9e7cbc886941b227341ea06\",\"message_hash\": \"7e6a00736c4f9e0036cb74c7fa3b1e3cd8f6bf0f038edeb03b668c4c5536a357\",\"parameter_type\": \"burn\"}, \"spend_authority_signature\": [ { \"value\": \"eeaaecd725ac80ec398b95cf188b769c1be66cc8e76e6c90843b7f23818704595719ce8bf694ffb8cd7aaa8739d50fe8eea7ba39d5026c4b019c973185ca7201\" } ], \"amount\": \"6000\", \"transparent_to_address\": \"4140cd765f8e637a2bbe00f9bc458f6b21eb0e648f\" }' Parameters: shielded_TRC20_Parameters : the generated shielded TRC-20 parameters spend_authority_signature : the spend authority signatures amount : the amount transparent_to_address : the receiver for the burn operation. Return: the input data for triggering shielded TRC-20 contract.","title":"wallet/gettriggerinputforshieldedtrc20contract"},{"location":"api/http/#walletgetrcm","text":"Description: To get a random commitment trapdoor curl -X GET http://127.0.0.1:8090/wallet/getrcm Parameters: N/A Return:rcm","title":"wallet/getrcm"},{"location":"api/http/#walletgetmerkletreevoucherinfo","text":"Description: To get a merkle tree information of a note $ curl -X POST http://127.0.0.1:8090/wallet/getmerkletreevoucherinfo -d '{ \"out_points\":[{ \"hash\":\"185b3e085723f5862b3a3c3cf54d52f5c1eaf2541e3a1e0ecd08bc12cd958d74\", \"index\":0 }] }' Parameter out_points : Note information Return: A merkle tree of a note","title":"wallet/getmerkletreevoucherinfo"},{"location":"api/http/#walletisspend","text":"Description: To check whether a note is spent or not $ curl -X POST http://127.0.0.1:8090/wallet/isspend -d '{ \"ak\": \"a3e65d509b675aaa2aeda977ceff11eebd76218079b6f543d78a615e396ca129\", \"nk\": \"62cfda9bea09a53cf2a21022057913734a8458969e11e0bb9c59ead48fbce83e\", \"note\": { \"payment_address\": \"ztron1aqgauawtkelxfu2w6s48cwh0mchjt6kwpj44l4wym3pullx0294j4r4v7kpm75wnclzycsw73mq\", \"rcm\": \"74a16c1b27ec7fbf06881d9d35ddaab1554838b1bddcd54f6bd8a9fb4ba0b80a\", \"value\": 500000000 }, \"txid\": \"7d09e471bb047d3ac044d5d6691b3721a2dddbb683ac02c207fbe78af6302463\", \"index\": 1 }' Parameters: ak : Ak key nk : Nk key note : Note information txid : Transaction id index : Note index Return: Note status","title":"wallet/isspend"},{"location":"api/http/#walletcreatespendauthsig","text":"Description: To create a signature for a transaction $ curl -X POST http://127.0.0.1:8090/wallet/createspendauthsig -d '{ \"ask\": \"e3ebcba1531f6d9158d9c162660c5d7c04dadf77d85d7436a9c98b291ff69a09\", \"tx_hash\": \"3b78fee6e956f915ffe082284c5f18640edca9c57a5f227e5f7d7eb65ad61502\", \"alpha\": \"2608999c3a97d005a879ecdaa16fd29ae434fb67b177c5e875b0c829e6a1db04\" }' Parameters: ask : Ask key tx_hash : Transaction hash alpha : Alpha Return: A signature","title":"wallet/createspendauthsig"},{"location":"api/http/#pending-pool","text":"The following are Pending Pool related APIs: wallet/gettransactionfrompending wallet/gettransactionlistfrompending wallet/getpendingsize","title":"Pending Pool"},{"location":"api/http/#walletgettransactionfrompending","text":"Get transaction details from the pending pool curl -X POST http://127.0.0.1:8090/wallet/gettransactionfrompending -d '{ \"value\": \"txId\" }' Parameters: value: transaction id Return: Transaction details","title":"wallet/gettransactionfrompending"},{"location":"api/http/#walletgettransactionlistfrompending","text":"Get transaction list information from pending pool curl -X get http://127.0.0.1:8090/wallet/gettransactionlistfrompending Parameters: N/A Return: Pending transaction IDs in the pool","title":"wallet/gettransactionlistfrompending"},{"location":"api/http/#walletgetpendingsize","text":"Get the size of the pending pool queue curl -X get http://127.0.0.1:8090/wallet/getpendingsize Parameters: N/A Return:pending pool size","title":"wallet/getpendingsize"},{"location":"api/http/#fullnode-solidity-http-api","text":"","title":"FullNode Solidity HTTP API"},{"location":"api/http/#account-resources_1","text":"","title":"Account Resources"},{"location":"api/http/#walletsoliditygetaccount","text":"Description: Query an account information curl -X POST http://127.0.0.1:8091/walletsolidity/getaccount -d '{\"address\": \"41E552F6487585C2B58BC2C9BB4492BC1F17132CD0\"}' Parameters: address - Account to query, default hexString Return: Account object","title":"walletsolidity/getaccount"},{"location":"api/http/#walletsoliditygetdelegatedresource","text":"Description: Query the energy delegation information curl -X POST http://127.0.0.1:8091/walletsolidity/getdelegatedresource -d ' { \"fromAddress\": \"419844f7600e018fd0d710e2145351d607b3316ce9\", \"toAddress\": \"41c6600433381c731f22fc2b9f864b14fe518b322f\" }' Parameters: fromAddress : Energy from address, default hexString toAddress : Energy to address, default hexString Return: Energy delegation information list, the elements of the list is DelegatedResource","title":"walletsolidity/getdelegatedresource"},{"location":"api/http/#walletsoliditygetdelegatedresourceaccountindex","text":"Description: Query the energy delegation index by an account curl -X POST http://127.0.0.1:8091/walletsolidity/getdelegatedresourceaccountindex -d ' { \"value\": \"419844f7600e018fd0d710e2145351d607b3316ce9\", }' Parameters: value : Address, default hexString Return: DelegatedResourceAccountIndex of the address","title":"walletsolidity/getdelegatedresourceaccountindex"},{"location":"api/http/#walletsoliditygetaccountbyid","text":"Description: Query an account information by account id curl -X POST http://127.0.0.1:8091/walletsolidity/getaccountbyid -d '{\"account_id\":\"6161616162626262\"}' Parameters: account_id - Account id, default hexString Return: Account object","title":"walletsolidity/getaccountbyid"},{"location":"api/http/#walletsoliditygetavailableunfreezecount","text":"Description:Remaining times of executing unstake operation in Stake2.0 curl -X POST http://127.0.0.1:8090/walletsolidity/getavailableunfreezecount -d '{ \"owner_address\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\", \"visible\": true } ' Parameters: owner_address : Account address Return:Remaining times of available unstaking.","title":"walletsolidity/getavailableunfreezecount"},{"location":"api/http/#walletsoliditygetcanwithdrawunfreezeamount","text":"Description: Query the withdrawable balance at the specified timestamp In Stake2.0 curl -X POST http://127.0.0.1:8090/walletsolidity/getcanwithdrawunfreezeamount -d '{ \"owner_address\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\", \"timestamp\": 1667977444000, \"visible\": true } ' Parameters: owner_address : Account address timestamp : query cutoff timestamp, in milliseconds. Return: Withdrawable balance, unit is sun.","title":"walletsolidity/getcanwithdrawunfreezeamount"},{"location":"api/http/#walletsoliditygetcandelegatedmaxsize","text":"Description: In Stake2.0, query the amount of delegatable resources share of the specified resource type for an address, unit is sun. curl -X POST http://127.0.0.1:8090/walletsolidity/getcandelegatedmaxsize -d '{ \"owner_address\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\", \"type\": 0, \"visible\": true } ' Parameters: owner_address : Account address type : Resource type, 0 is bandwidth, 1 is energy Return: The amount of delegatable resource share, unit is sun.","title":"walletsolidity/getcandelegatedmaxsize"},{"location":"api/http/#walletsoliditygetdelegatedresourcev2","text":"In Stake2.0, query the detail of resource share delegated from fromAddress to toAddress curl -X POST http://127.0.0.1:8090/walletsolidity/getdelegatedresourcev2 -d '{ \"fromAddress\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\", \"toAddress\": \"TPswDDCAWhJAZGdHPidFg5nEf8TkNToDX1\", \"visible\": true } ' Parameters: fromAddress : resource from address, default hexString toAddress : resource to address Return: Resource delegation list","title":"walletsolidity/getdelegatedresourcev2"},{"location":"api/http/#walletsoliditygetdelegatedresourceaccountindexv2","text":"In Stake2.0, query the resource delegation index by an account. Two lists will return, one is the list of addresses the account has delegated its resources( toAddress ), and the other is the list of addresses that have delegated resources to the account( fromAddress ). curl -X POST http://127.0.0.1:8090/walletsolidity/getdelegatedresourceaccountindexv2 -d '{ \"value\": \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\", \"visible\": true } ' Parameters: value : account address Return: Two lists will return, one is the list of addresses the account has delegated its resources( toAddress ), and the other is the list of addresses that have delegated resources to the account( fromAddress ).","title":"walletsolidity/getdelegatedresourceaccountindexv2"},{"location":"api/http/#voting-srs","text":"","title":"Voting & SRs"},{"location":"api/http/#walletsoliditylistwitnesses","text":"Description: Query the list of witnesses curl -X POST http://127.0.0.1:8091/walletsolidity/listwitnesses Parameters: N/A Return: List of all witnesses","title":"walletsolidity/listwitnesses"},{"location":"api/http/#trc10-token_1","text":"","title":"TRC10 Token"},{"location":"api/http/#walletsoliditygetassetissuelist","text":"Description: Query the list of all tokens curl -X POST http://127.0.0.1:8091/walletsolidity/getassetissuelist Parameters: N/A Return: The list of all tokens","title":"walletsolidity/getassetissuelist"},{"location":"api/http/#walletsoliditygetpaginatedassetissuelist","text":"Description: Query the list of all the tokens by pagination curl -X POST http://127.0.0.1:8091/walletsolidity/getpaginatedassetissuelist -d '{\"offset\": 0, \"limit\":10}' Parameters: - offset : The index of the start token - limit : The amount of tokens per page Return: List of tokens","title":"walletsolidity/getpaginatedassetissuelist"},{"location":"api/http/#walletsoliditygetassetissuebyname","text":"Description: Query a token by token name curl -X POST http://127.0.0.1:8091/walletsolidity/getassetissuebyname -d '{\"value\": \"44756354616E\"}' Parameters: value - Token name, default hexString Return: Token object Note: Since Odyssey-v3.2, getassetissuebyid or getassetissuelistbyname is recommended, as since v3.2, token name can be repeatable. If the token name you query is not unique, this api will throw out an error.","title":"walletsolidity/getassetissuebyname"},{"location":"api/http/#walletsoliditygetassetissuelistbyname","text":"Description: Query the token list by name curl -X POST http://127.0.0.1:8091/walletsolidity/getassetissuelistbyname -d '{\"value\": \"44756354616E\"}' Parameters: value - Token name, default hexString Return: Token list","title":"walletsolidity/getassetissuelistbyname"},{"location":"api/http/#walletsoliditygetassetissuebyid","text":"Description: Query a token by token id curl -X POST http://127.0.0.1:8091/walletsolidity/getassetissuebyid -d '{\"value\": \"1000001\"}' Parameters: value - Token id Return: Token object","title":"walletsolidity/getassetissuebyid"},{"location":"api/http/#blocks","text":"","title":"Blocks"},{"location":"api/http/#walletsoliditygetnowblock","text":"Description: Query the latest block information curl -X POST http://127.0.0.1:8091/walletsolidity/getnowblock Parameters: N/A Return: The latest block from solidityNode","title":"walletsolidity/getnowblock"},{"location":"api/http/#walletsoliditygetblockbynum","text":"Description: Query a block information by block height curl -X POST http://127.0.0.1:8091/walletsolidity/getblockbynum -d '{\"num\" : 100}' Parameters: num - Block height Return: Block information","title":"walletsolidity/getblockbynum"},{"location":"api/http/#walletsoliditygetblockbyid","text":"Description: Query a block information by block id curl -X POST http://127.0.0.1:8091/walletsolidity/getblockbyid-d '{\"value\": \"0000000000038809c59ee8409a3b6c051e369ef1096603c7ee723c16e2376c73\"}' Parameters: value - Block id Return: The block object","title":"walletsolidity/getblockbyid"},{"location":"api/http/#walletsoliditygetblockbylimitnext","text":"Description: Query a list of blocks by range curl -X POST http://127.0.0.1:8091/walletsolidity/getblockbylimitnext -d '{\"startNum\": 1, \"endNum\": 2}' Parameters: startNum : The start block height, inclusive endNum : The end block height, exclusive Return: List of blocks","title":"walletsolidity/getblockbylimitnext"},{"location":"api/http/#walletsoliditygetblockbylatestnum","text":"Description: Query the latest few blocks curl -X POST http://127.0.0.1:8091/walletsolidity/getblockbylatestnum -d '{\"num\": 5}' Parameters: num - The number of blocks expected to return Return: List of blocks","title":"walletsolidity/getblockbylatestnum"},{"location":"api/http/#walletgetnodeinfo_1","text":"Description: Query the current node information curl -X GET http://127.0.0.1:8091/wallet/getnodeinfo Parameters: N/A Return: NodeInfo of the current node","title":"wallet/getnodeinfo"},{"location":"api/http/#transactions","text":"","title":"Transactions"},{"location":"api/http/#walletsoliditygettransactionbyid","text":"Description: Query an transaction information by transaction id curl -X POST http://127.0.0.1:8091/walletsolidity/gettransactionbyid -d '{\"value\" : \"309b6fa3d01353e46f57dd8a8f27611f98e392b50d035cef213f2c55225a8bd2\"}' Parameters: value - Transaction id Return: Transaction information","title":"walletsolidity/gettransactionbyid"},{"location":"api/http/#walletsoliditygettransactioncountbyblocknum","text":"Description: Query th the number of transactions in a specific block curl -X POST http://127.0.0.1:8091/walletsolidity/gettransactioncountbyblocknum -d '{\"num\" : 100}' Parameters: num - Block height Return: The number of transactions","title":"walletsolidity/gettransactioncountbyblocknum"},{"location":"api/http/#walletsoliditygettransactioninfobyid","text":"Description: Query the transaction fee, block height by transaction id curl -X POST http://127.0.0.1:8091/walletsolidity/gettransactioninfobyid -d '{\"value\" : \"309b6fa3d01353e46f57dd8a8f27611f98e392b50d035cef213f2c55225a8bd2\"}' Parameters: value - Transaction id Return: Transaction fee, block height and the time of creation","title":"walletsolidity/gettransactioninfobyid"},{"location":"api/http/#walletsoliditygettransactioninfobyblocknum","text":"Description: Query the list of transaction information in a specific block curl -X POST http://127.0.0.1:8091/walletsolidity/gettransactioninfobyblocknum -d '{\"num\" : 100}' Parameters: num - Block height Return: The list of transaction information inside the queried block","title":"walletsolidity/gettransactioninfobyblocknum"},{"location":"api/http/#dex-exchanges","text":"","title":"DEX Exchanges"},{"location":"api/http/#walletsoliditygetexchangebyid","text":"Description: Query an exchange pair by exchange pair id curl -X POST http://127.0.0.1:8091/walletsolidity/getexchangebyid -d {\"id\":1} Parameters: id: Exchange pair id Return: Exchange pair information","title":"walletsolidity/getexchangebyid"},{"location":"api/http/#walletsoliditylistexchanges","text":"Description: Query the list of all the exchange pairs curl -X POST http://127.0.0.1:8091/walletsolidity/listexchanges Parameters: N/A Return: The list of all the exchange pairs","title":"walletsolidity/listexchanges"},{"location":"api/http/#tronz-shielded-smart-contract_1","text":"","title":"TRONZ Shielded Smart Contract"},{"location":"api/http/#walletsoliditygetmerkletreevoucherinfo","text":"Description: Get the Merkle tree information of a note curl -X POST http://127.0.0.1:8090/walletsolidity/getmerkletreevoucherinfo -d '{ \"out_points\":[{ \"hash\":\"185b3e085723f5862b3a3c3cf54d52f5c1eaf2541e3a1e0ecd08bc12cd958d74\", \"index\":0 }] }' Parameters: out_points : Note information Return: Merkle tree information of a note","title":"walletsolidity/getmerkletreevoucherinfo"},{"location":"api/http/#walletsolidityscannotebyivk","text":"Description: Get all notes related to ivk curl -X POST http://127.0.0.1:8090/walletsolidity/scannotebyivk -d '{ \"start_block_index\": 0, \"end_block_index\": 100, \"ivk\": \"80a481c3c739e54b4e0608090b3a1a6e9f8dce42346e95bf5a2d8a487bf45c05\" }' Parameters: start_block_index : The start block height, inclusive end_block_index : The end block height, exclusive ivk : Incoming viewing key Return: Notes list Note: Range limit (end_block_index - start_block_index <= 1000)","title":"walletsolidity/scannotebyivk"},{"location":"api/http/#walletsolidityscanandmarknotebyivk","text":"Description: Get all notes with spent status related to ivk curl -X POST http://127.0.0.1:8090/walletsolidity/scanandmarknotebyivk -d '{ \"start_block_index\": 0, \"end_block_index\": 100, \"ivk\": \"80a481c3c739e54b4e0608090b3a1a6e9f8dce42346e95bf5a2d8a487bf45c05\", \"ak\": \"1d4f9b5551f4aa9443ceb263f0e208eb7e26080264571c5ef06de97a646fe418\", \"nk\": \"748522c7571a9da787e43940c9a474aa0c5c39b46c338905deb6726fa3678bdb\" }' Parameters: start_block_index : The start block height, inclusive end_block_index : The end block height, exclusive ivk : Incoming viewing key ak : Ak key nk : Nk key Return: Notes list Note: Range limit (end_block_index - start_block_index <= 1000)","title":"walletsolidity/scanandmarknotebyivk"},{"location":"api/http/#walletsolidityscannotebyovk","text":"Description: Query all notes related to ovk curl -X POST http://127.0.0.1:8090/walletsolidity/scannotebyovk -d '{ \"start_block_index\": 0, \"end_block_index\": 100, \"ovk\": \"705145aa18cbe6c11d5d0011419a98f3d5b1d341eb4727f1315597f4bdaf8539\" }' Parameters: start_block_index : The start block height, inclusive end_block_index : The end block height, exclusive ovk : Outgoing viewing key Return: Notes list Note: Range limit (end_block_index - start_block_index <= 1000)","title":"walletsolidity/scannotebyovk"},{"location":"api/http/#walletsolidityisspend","text":"Description: Check whether a note has been spent curl -X POST http://127.0.0.1:8090/walletsolidity/isspend -d '{ \"ak\": \"a3e65d509b675aaa2aeda977ceff11eebd76218079b6f543d78a615e396ca129\", \"nk\": \"62cfda9bea09a53cf2a21022057913734a8458969e11e0bb9c59ead48fbce83e\", \"note\": { \"payment_address\": \"ztron1aqgauawtkelxfu2w6s48cwh0mchjt6kwpj44l4wym3pullx0294j4r4v7kpm75wnclzycsw73mq\", \"rcm\": \"74a16c1b27ec7fbf06881d9d35ddaab1554838b1bddcd54f6bd8a9fb4ba0b80a\", \"value\": 500000000 }, \"txid\": \"7d09e471bb047d3ac044d5d6691b3721a2dddbb683ac02c207fbe78af6302463\", \"index\": 1 }' Parameters: ak : Ak nk : Nk note : Note information txid : Transaction id index : Note index Return: Whether a note has been spent","title":"walletsolidity/isspend"},{"location":"api/http/#walletsolidityscanshieldedtrc20notesbyivk","text":"Description: Scan the shielded TRC-20 notes by ivk, and mark whether it has been spent curl -X POST http://127.0.0.1:8091/walletsolidity/scanshieldedtrc20notesbyivk -d '{ \"start_block_index\": 9200, \"end_block_index\": 9240, \"shielded_TRC20_contract_address\": \"41274fc7464fadac5c00c893c58bce6c39bf59e4c7\", \"ivk\": \"9f8e74bb3d7188a2781dc1db38810c6914eef4570a79e8ec8404480948e4e305\", \"ak\":\"8072d9110c9de9d9ade33d5d0f5890a7aa65b0cde42af7816d187297caf2fd64\", \"nk\":\"590bf33f93f792be659fd404df91e75c3b08d38d4e08ee226c3f5219cf598f14\" }' Parameters: start_block_index : The start block index, inclusive end_block_index : The end block index, exclusive shielded_TRC20_contract_address : Shielded TRC-20 contract address ivk : Incoming viewing key ak : Ak key nk : Nk key Return: Notes list Note: Block limit\uff08end_block_index - start_block_index <= 1000\uff09","title":"walletsolidity/scanshieldedtrc20notesbyivk"},{"location":"api/http/#walletsolidityscanshieldedtrc20notesbyovk","text":"Description: Scan the shielded TRC-20 notes by ovk curl -X POST http://127.0.0.1:8091/walletsolidity/scanshieldedtrc20notesbyovk -d '{ \"start_block_index\": 9200, \"end_block_index\": 9240, \"shielded_TRC20_contract_address\": \"41274fc7464fadac5c00c893c58bce6c39bf59e4c7\", \"ovk\": \"0ff58efd75e083fe4fd759c8701e1c8cb6961c4297a12b2c800bdb7b2bcab889\" }' Parameters: start_block_index : Start block index, inclusive end_block_index : Start block index, inclusive shielded_TRC20_contract_address : Shielded TRC-20 contract address ovk : Outgoing viewing key Return: Notes list Note: Block limit (end_block_index - start_block_index <= 1000)","title":"walletsolidity/scanshieldedtrc20notesbyovk"},{"location":"api/http/#walletsolidityisshieldedtrc20contractnotespent","text":"Description: Check the status whether the specified shielded TRC-20 note is spent curl -X POST http://127.0.0.1:8091/walletsolidity/scanshieldedtrc20notesbyovk -d '{ \"note\": { \"value\": 40, \"payment_address\":\"ztron1768kf7dy4qquefp46szk978d65eeua66yhr4zv260c0uzj68t3tfjl3en9lhyyfxalv4jus30xs\", \"rcm\": \"296070782a94c6936b0b4f6daf8d7c7605a4374fe595b96148dc0f4b59015d0d\" }, \"ak\": \"8072d9110c9de9d9ade33d5d0f5890a7aa65b0cde42af7816d187297caf2fd64\", \"nk\": \"590bf33f93f792be659fd404df91e75c3b08d38d4e08ee226c3f5219cf598f14\", \"position\": 272, \"shielded_TRC20_contract_address\": \"41274fc7464fadac5c00c893c58bce6c39bf59e4c7\" }' Parameters: note : The specified note ak : Ak nk : Nk position : The leaf position index of note commitment in the Merkle tree shielded_TRC20_contract_address : The shielded TRC-20 contract address Return: Note status Note: The value in note is the scaled value by scalingFactor set in the shielded TRC-20 contract, namely real_amount = value * scalingFactor .","title":"walletsolidity/isshieldedtrc20contractnotespent"},{"location":"api/rpc/","text":"RPC List \u00b6 For the specific definition of API, please refer to the following link: api/api.proto core/Contract.proto . Note SolidityNode is deprecated. Now a FullNode supports all RPCs of a SolidityNode. New developers should deploy FullNode only. 1. Get account information rpc GetAccount ( Account ) returns ( Account ) {} Nodes: Fullnode and SolidityNode 2. TRX transfer rpc CreateTransaction ( TransferContract ) returns ( Transaction ) {} Nodes: Fullnode 3. Broadcast transaction rpc BroadcastTransaction ( Transaction ) returns ( Return ) {} Nodes: Fullnode Description: Transfer, vote, issuance of token, or participation in token offering. Sending signed transaction information to node, and broadcasting it to the entire network after witness verification. 4. Create an account rpc CreateAccount ( AccountCreateContract ) returns ( Transaction ) {} Nodes: FullNode 5. Account name update rpc UpdateAccount ( AccountUpdateContract ) returns ( Transaction ) {} Nodes: Fullnode 6. Vote for super representative candidates rpc VoteWitnessAccount ( VoteWitnessContract ) returns ( Transaction ) {} Nodes: FullNode 7. Query the ratio of brokerage of the witness rpc GetBrokerageInfo ( BytesMessage ) returns ( NumberMessage ) {} Nodes: FullNode 8. Query unclaimed reward rpc GetRewardInfo ( BytesMessage ) returns ( NumberMessage ) {} Nodes: FullNode 9. Update the ratio of brokerage rpc UpdateBrokerage ( UpdateBrokerageContract ) returns ( TransactionExtention ) {} Nodes: FullNode 10. Issue a token rpc CreateAssetIssue ( AssetIssueContract ) returns ( Transaction ) {} Nodes: FullNode 11. Query of list of super representative candidates rpc ListWitnesses ( EmptyMessage ) returns ( WitnessList ) {} Nodes: FullNode and SolidityNode 12. Application for super representative rpc CreateWitness ( WitnessCreateContract ) returns ( Transaction ) {} Nodes: FullNode Description: To apply to become TRON\u2019s Super Representative candidate. 13. Information update of Super Representative candidates rpc UpdateWitness ( WitnessUpdateContract ) returns ( Transaction ) {} Nodes: FullNode Description: Update the website url of the SR. 14. Token transfer rpc TransferAsset ( TransferAssetContract ) returns ( Transaction ){} Node: FullNode 15. Participate a token rpc ParticipateAssetIssue ( ParticipateAssetIssueContract ) returns ( Transaction ) {} Nodes: FullNode 16. Query the list of nodes connected to the ip of the api rpc ListNodes ( EmptyMessage ) returns ( NodeList ) {} Nodes: FullNode and SolidityNode 17. Query the list of all issued tokens rpc GetAssetIssueList ( EmptyMessage ) returns ( AssetIssueList ) {} Nodes: FullNode and SolidityNode 18. Query the token issued by a given account rpc GetAssetIssueByAccount ( Account ) returns ( AssetIssueList ) {} Nodes: FullNode and SolidityNode 19. Query the token information by token name rpc GetAssetIssueByName ( BytesMessage ) returns ( AssetIssueContract ) {} Nodes: FullNode and Soliditynode 20. Query the list of tokens by timestamp rpc GetAssetIssueListByTimestamp ( NumberMessage ) returns ( AssetIssueList ){} Nodes: SolidityNode 21. Get current block information rpc GetNowBlock ( EmptyMessage ) returns ( Block ) {} Nodes: FullNode and SolidityNode 22. Get a block by block height rpc GetBlockByNum ( NumberMessage ) returns ( Block ) {} Nodes: FullNode and SolidityNode 23. Get the total number of transactions rpc TotalTransaction ( EmptyMessage ) returns ( NumberMessage ) {} Nodes: FullNode and SolidityNode 24. Query the transaction by transaction id rpc getTransactionById ( BytesMessage ) returns ( Transaction ) {} Nodes: SolidityNode 25. Query the transaction by timestamp rpc getTransactionsByTimestamp ( TimeMessage ) returns ( TransactionList ) {} Nodes: SolidityNode 26. Query the transactions initiated by an account rpc getTransactionsFromThis ( Account ) returns ( TransactionList ) {} Nodes: SolidityNode 27. Query the transactions received by an account rpc getTransactionsToThis ( Account ) returns ( NumberMessage ) {} Nodes: SolidityNode 28. Stake TRX This interface has been deprecated, please use FreezeBalanceV2 to stake TRX to obtain resources. rpc FreezeBalance ( FreezeBalanceContract ) returns ( Transaction ) {} Nodes: FullNode 29. Unstake TRX Unstake the TRX staked during Stake1.0. rpc UnfreezeBalance ( UnfreezeBalanceContract ) returns ( Transaction ) {} Nodes: FullNode 30. Block producing reward redemption rpc WithdrawBalance ( WithdrawBalanceContract ) returns ( Transaction ) {} Nodes: FullNode 31. Unstake token balance rpc UnfreezeAsset ( UnfreezeAssetContract ) returns ( Transaction ) {} Nodes: FullNode 32. Query the next maintenance time rpc GetNextMaintenanceTime ( EmptyMessage ) returns ( NumberMessage ) {} Nodes: FullNode 33. Query the transaction fee & block information rpc GetTransactionInfoById ( BytesMessage ) returns ( TransactionInfo ) {} Nodes: SolidityNode 34. Query block information by block id rpc GetBlockById ( BytesMessage ) returns ( Block ) {} Nodes: FullNode 35. Update token information rpc UpdateAsset ( UpdateAssetContract ) returns ( Transaction ) {} Nodes: Fullnode Description: Token update can only be initiated by the token issuer to update token description, url, maximum bandwidth consumption by each account and total bandwidth consumption. 36. Query the list of all the tokens by pagination rpc GetPaginatedAssetIssueList ( PaginatedMessage ) returns ( AssetIssueList ) {} Nodes: FullNode and SolidityNode 37. Deploy a smart contract rpc DeployContract ( CreateSmartContract ) returns ( TransactionExtention ) {} Nodes: FullNode and SolidityNode 38. Trigger a smart contract rpc TriggerContract ( TriggerSmartContract ) returns ( TransactionExtention ) {} Nodes: FullNode 39. Create a shielded transaction rpc CreateShieldedTransaction ( PrivateParameters ) returns ( TransactionExtention ) {} Nodes: FullNode 40. Get a Merkle tree information of a note rpc GetMerkleTreeVoucherInfo ( OutputPointInfo ) returns ( IncrementalMerkleVoucherInfo ) {} Nodes: FullNode 41. Scan note by ivk rpc ScanNoteByIvk ( IvkDecryptParameters ) returns ( DecryptNotes ) {} Nodes: FullNode 42. Scan note by ovk rpc ScanNoteByOvk ( OvkDecryptParameters ) returns ( DecryptNotes ) {} Nodes: FullNode 43. Get spending key rpc GetSpendingKey ( EmptyMessage ) returns ( BytesMessage ) {} Nodes: FullNode 44. Get expanded spending key rpc GetExpandedSpendingKey ( BytesMessage ) returns ( ExpandedSpendingKeyMessage ) {} Nodes: FullNode 45. Get ak from ask rpc GetAkFromAsk ( BytesMessage ) returns ( BytesMessage ) {} Nodes: FullNode 46. Get nk from nsk rpc GetNkFromNsk ( BytesMessage ) returns ( BytesMessage ) {} Nodes: FullNode 47. Get incoming viewing key rpc GetIncomingViewingKey ( ViewingKeyMessage ) returns ( IncomingViewingKeyMessage ) {} Nodes: FullNode 48. Get diversifier rpc GetDiversifier ( EmptyMessage ) returns ( DiversifierMessage ) {} Nodes: FullNode 49. Get zen payment address rpc GetZenPaymentAddress ( IncomingViewingKeyDiversifierMessage ) returns ( PaymentAddressMessage ) {} Nodes: FullNode 50. Get rcm rpc GetRcm ( EmptyMessage ) returns ( BytesMessage ) {} Nodes: FullNode 51. Get a note status of is spent or not rpc IsSpend ( NoteParameters ) returns ( SpendResult ) {} Nodes: FullNode 52. Create a shielded transaction without using ask rpc CreateShieldedTransactionWithoutSpendAuthSig ( PrivateParametersWithoutAsk ) returns ( TransactionExtention ) {} Nodes: FullNode 53. Create a shielded transaction hash rpc GetShieldTransactionHash ( Transaction ) returns ( BytesMessage ) {} Nodes: FullNode 54. Create a signature for a shielded transaction rpc CreateSpendAuthSig ( SpendAuthSigParameters ) returns ( BytesMessage ) {} Nodes: FullNode 55. Create a shield nullifier rpc CreateShieldNullifier ( NfParameters ) returns ( BytesMessage ) {} Nodes: FullNode 56. Get new shielded address rpc GetNewShieldedAddress ( EmptyMessage ) returns ( ShieldedAddressInfo ){} Nodes: FullNode 57. Create shielded contract parameters rpc CreateShieldedContractParameters ( PrivateShieldedTRC20Parameters ) returns ( ShieldedTRC20Parameters ) {} Nodes: FullNode 58. Create shielded contract parameters without ask rpc CreateShieldedContractParametersWithoutAsk ( PrivateShieldedTRC20ParametersWithoutAsk ) returns ( ShieldedTRC20Parameters ) {} Nodes: FullNode 59. Scan shielded TRC20 notes by ivk rpc ScanShieldedTRC20NotesbyIvk ( IvkDecryptTRC20Parameters ) returns ( DecryptNotesTRC20 ) {} Nodes: FullNode, SolidityNode 60. Scan shielded TRC20 notes by ovk rpc ScanShieldedTRC20NotesbyOvk ( OvkDecryptTRC20Parameters ) returns ( DecryptNotesTRC20 ) {} Nodes: FullNode, SolidityNode 61. Get the status of shielded TRC20 note of spent or not rpc IsShieldedTRC20ContractNoteSpent ( NfTRC20Parameters ) returns ( NullifierResult ) {} Nodes: FullNode, SolidityNode 62. Get the trigger input for the shielded TRC20 rpc GetTriggerInputForShieldedTRC20Contract ( ShieldedTRC20TriggerContractParameters ) returns ( BytesMessage ) {} Nodes: FullNode 63. Create an market order rpc MarketSellAsset (MarketSellAssetContract) returns (TransactionExtention) {}; Nodes: FullNode 64. Cancel the order rpc MarketCancelOrder (MarketCancelOrderContract) returns (TransactionExtention) {}; Nodes: FullNode 65. Get all orders for the account rpc GetMarketOrderByAccount (BytesMessage) returns (MarketOrderList) {}; Nodes: FullNode 66. Get all trading pairs rpc GetMarketPairList (EmptyMessage) returns (MarketOrderPairList) {}; Nodes: FullNode 67. Get all orders for the trading pair rpc GetMarketOrderListByPair (MarketOrderPair) returns (MarketOrderList) {}; Nodes: FullNode 68. Get all prices for the trading pair rpc GetMarketPriceByPair (MarketOrderPair) returns (MarketPriceList) {}; Nodes: FullNode 69. Get order by id rpc GetMarketOrderById (BytesMessage) returns (MarketOrder) {}; Nodes: FullNode 70. perform a historical balance lookup rpc GetAccountBalance (AccountBalanceRequest) returns (AccountBalanceResponse){}; Nodes: FullNode 71. fetch all balance-changing transactions in a block rpc GetBlockBalanceTrace (BlockBalanceTrace.BlockIdentifier) returns (BlockBalanceTrace) {}; Nodes: FullNode 72. get the burn trx amount rpc GetBurnTrx (EmptyMessage) returns (NumberMessage) {}; Nodes: FullNode and SolidityNode 73. Freeze TRX rpc FreezeBalanceV2 ( FreezeBalanceV2Contract ) returns ( TransactionExtention ) {} Nodes: FullNode 74. UnFreeze TRX rpc UnfreezeBalanceV2 ( UnfreezeBalanceV2Contract ) returns ( TransactionExtention ) {} Nodes: FullNode 75. Withdraw Staked TRX rpc WithdrawExpireUnfreeze ( WithdrawExpireUnfreezeContract ) returns ( TransactionExtention ) {} Nodes: FullNode 76. Delegate Resource rpc DelegateResource ( DelegateResourceContract ) returns ( TransactionExtention ) {} Nodes: FullNode 77. UnDelegate Resource rpc UnDelegateResource ( UnDelegateResourceContract ) returns ( TransactionExtention ) {} Nodes: FullNode 78. Query transaction information in the pending pool rpc GetTransactionFromPending (BytesMessage) returns (Transaction) {}; Nodes: FullNode 79. Query the pending pool transaction id list rpc GetTransactionListFromPending (EmptyMessage) returns (TransactionIdList) {}; Nodes: FullNode 80. Query the size of the pending pool rpc GetPendingSize (EmptyMessage) returns (NumberMessage) {}; Nodes: FullNode 81. Cancel UnFreeze rpc CancelAllUnfreezeV2 ( CancelAllUnfreezeV2Contract ) returns ( TransactionExtention ) {} Nodes: FullNode 82. Get bandwidth unit price rpc GetBandwidthPrices ( EmptyMessage ) returns ( PricesResponseMessage ) {} Nodes: FullNode 83. Get energy unit price rpc GetEnergyPrices ( EmptyMessage ) returns ( PricesResponseMessage ) {} Nodes: FullNode 84. Get transaction memo fee rpc GetMemoFee ( EmptyMessage ) returns ( PricesResponseMessage ) {} Nodes: FullNodes","title":"gRPC API"},{"location":"api/rpc/#rpc-list","text":"For the specific definition of API, please refer to the following link: api/api.proto core/Contract.proto . Note SolidityNode is deprecated. Now a FullNode supports all RPCs of a SolidityNode. New developers should deploy FullNode only. 1. Get account information rpc GetAccount ( Account ) returns ( Account ) {} Nodes: Fullnode and SolidityNode 2. TRX transfer rpc CreateTransaction ( TransferContract ) returns ( Transaction ) {} Nodes: Fullnode 3. Broadcast transaction rpc BroadcastTransaction ( Transaction ) returns ( Return ) {} Nodes: Fullnode Description: Transfer, vote, issuance of token, or participation in token offering. Sending signed transaction information to node, and broadcasting it to the entire network after witness verification. 4. Create an account rpc CreateAccount ( AccountCreateContract ) returns ( Transaction ) {} Nodes: FullNode 5. Account name update rpc UpdateAccount ( AccountUpdateContract ) returns ( Transaction ) {} Nodes: Fullnode 6. Vote for super representative candidates rpc VoteWitnessAccount ( VoteWitnessContract ) returns ( Transaction ) {} Nodes: FullNode 7. Query the ratio of brokerage of the witness rpc GetBrokerageInfo ( BytesMessage ) returns ( NumberMessage ) {} Nodes: FullNode 8. Query unclaimed reward rpc GetRewardInfo ( BytesMessage ) returns ( NumberMessage ) {} Nodes: FullNode 9. Update the ratio of brokerage rpc UpdateBrokerage ( UpdateBrokerageContract ) returns ( TransactionExtention ) {} Nodes: FullNode 10. Issue a token rpc CreateAssetIssue ( AssetIssueContract ) returns ( Transaction ) {} Nodes: FullNode 11. Query of list of super representative candidates rpc ListWitnesses ( EmptyMessage ) returns ( WitnessList ) {} Nodes: FullNode and SolidityNode 12. Application for super representative rpc CreateWitness ( WitnessCreateContract ) returns ( Transaction ) {} Nodes: FullNode Description: To apply to become TRON\u2019s Super Representative candidate. 13. Information update of Super Representative candidates rpc UpdateWitness ( WitnessUpdateContract ) returns ( Transaction ) {} Nodes: FullNode Description: Update the website url of the SR. 14. Token transfer rpc TransferAsset ( TransferAssetContract ) returns ( Transaction ){} Node: FullNode 15. Participate a token rpc ParticipateAssetIssue ( ParticipateAssetIssueContract ) returns ( Transaction ) {} Nodes: FullNode 16. Query the list of nodes connected to the ip of the api rpc ListNodes ( EmptyMessage ) returns ( NodeList ) {} Nodes: FullNode and SolidityNode 17. Query the list of all issued tokens rpc GetAssetIssueList ( EmptyMessage ) returns ( AssetIssueList ) {} Nodes: FullNode and SolidityNode 18. Query the token issued by a given account rpc GetAssetIssueByAccount ( Account ) returns ( AssetIssueList ) {} Nodes: FullNode and SolidityNode 19. Query the token information by token name rpc GetAssetIssueByName ( BytesMessage ) returns ( AssetIssueContract ) {} Nodes: FullNode and Soliditynode 20. Query the list of tokens by timestamp rpc GetAssetIssueListByTimestamp ( NumberMessage ) returns ( AssetIssueList ){} Nodes: SolidityNode 21. Get current block information rpc GetNowBlock ( EmptyMessage ) returns ( Block ) {} Nodes: FullNode and SolidityNode 22. Get a block by block height rpc GetBlockByNum ( NumberMessage ) returns ( Block ) {} Nodes: FullNode and SolidityNode 23. Get the total number of transactions rpc TotalTransaction ( EmptyMessage ) returns ( NumberMessage ) {} Nodes: FullNode and SolidityNode 24. Query the transaction by transaction id rpc getTransactionById ( BytesMessage ) returns ( Transaction ) {} Nodes: SolidityNode 25. Query the transaction by timestamp rpc getTransactionsByTimestamp ( TimeMessage ) returns ( TransactionList ) {} Nodes: SolidityNode 26. Query the transactions initiated by an account rpc getTransactionsFromThis ( Account ) returns ( TransactionList ) {} Nodes: SolidityNode 27. Query the transactions received by an account rpc getTransactionsToThis ( Account ) returns ( NumberMessage ) {} Nodes: SolidityNode 28. Stake TRX This interface has been deprecated, please use FreezeBalanceV2 to stake TRX to obtain resources. rpc FreezeBalance ( FreezeBalanceContract ) returns ( Transaction ) {} Nodes: FullNode 29. Unstake TRX Unstake the TRX staked during Stake1.0. rpc UnfreezeBalance ( UnfreezeBalanceContract ) returns ( Transaction ) {} Nodes: FullNode 30. Block producing reward redemption rpc WithdrawBalance ( WithdrawBalanceContract ) returns ( Transaction ) {} Nodes: FullNode 31. Unstake token balance rpc UnfreezeAsset ( UnfreezeAssetContract ) returns ( Transaction ) {} Nodes: FullNode 32. Query the next maintenance time rpc GetNextMaintenanceTime ( EmptyMessage ) returns ( NumberMessage ) {} Nodes: FullNode 33. Query the transaction fee & block information rpc GetTransactionInfoById ( BytesMessage ) returns ( TransactionInfo ) {} Nodes: SolidityNode 34. Query block information by block id rpc GetBlockById ( BytesMessage ) returns ( Block ) {} Nodes: FullNode 35. Update token information rpc UpdateAsset ( UpdateAssetContract ) returns ( Transaction ) {} Nodes: Fullnode Description: Token update can only be initiated by the token issuer to update token description, url, maximum bandwidth consumption by each account and total bandwidth consumption. 36. Query the list of all the tokens by pagination rpc GetPaginatedAssetIssueList ( PaginatedMessage ) returns ( AssetIssueList ) {} Nodes: FullNode and SolidityNode 37. Deploy a smart contract rpc DeployContract ( CreateSmartContract ) returns ( TransactionExtention ) {} Nodes: FullNode and SolidityNode 38. Trigger a smart contract rpc TriggerContract ( TriggerSmartContract ) returns ( TransactionExtention ) {} Nodes: FullNode 39. Create a shielded transaction rpc CreateShieldedTransaction ( PrivateParameters ) returns ( TransactionExtention ) {} Nodes: FullNode 40. Get a Merkle tree information of a note rpc GetMerkleTreeVoucherInfo ( OutputPointInfo ) returns ( IncrementalMerkleVoucherInfo ) {} Nodes: FullNode 41. Scan note by ivk rpc ScanNoteByIvk ( IvkDecryptParameters ) returns ( DecryptNotes ) {} Nodes: FullNode 42. Scan note by ovk rpc ScanNoteByOvk ( OvkDecryptParameters ) returns ( DecryptNotes ) {} Nodes: FullNode 43. Get spending key rpc GetSpendingKey ( EmptyMessage ) returns ( BytesMessage ) {} Nodes: FullNode 44. Get expanded spending key rpc GetExpandedSpendingKey ( BytesMessage ) returns ( ExpandedSpendingKeyMessage ) {} Nodes: FullNode 45. Get ak from ask rpc GetAkFromAsk ( BytesMessage ) returns ( BytesMessage ) {} Nodes: FullNode 46. Get nk from nsk rpc GetNkFromNsk ( BytesMessage ) returns ( BytesMessage ) {} Nodes: FullNode 47. Get incoming viewing key rpc GetIncomingViewingKey ( ViewingKeyMessage ) returns ( IncomingViewingKeyMessage ) {} Nodes: FullNode 48. Get diversifier rpc GetDiversifier ( EmptyMessage ) returns ( DiversifierMessage ) {} Nodes: FullNode 49. Get zen payment address rpc GetZenPaymentAddress ( IncomingViewingKeyDiversifierMessage ) returns ( PaymentAddressMessage ) {} Nodes: FullNode 50. Get rcm rpc GetRcm ( EmptyMessage ) returns ( BytesMessage ) {} Nodes: FullNode 51. Get a note status of is spent or not rpc IsSpend ( NoteParameters ) returns ( SpendResult ) {} Nodes: FullNode 52. Create a shielded transaction without using ask rpc CreateShieldedTransactionWithoutSpendAuthSig ( PrivateParametersWithoutAsk ) returns ( TransactionExtention ) {} Nodes: FullNode 53. Create a shielded transaction hash rpc GetShieldTransactionHash ( Transaction ) returns ( BytesMessage ) {} Nodes: FullNode 54. Create a signature for a shielded transaction rpc CreateSpendAuthSig ( SpendAuthSigParameters ) returns ( BytesMessage ) {} Nodes: FullNode 55. Create a shield nullifier rpc CreateShieldNullifier ( NfParameters ) returns ( BytesMessage ) {} Nodes: FullNode 56. Get new shielded address rpc GetNewShieldedAddress ( EmptyMessage ) returns ( ShieldedAddressInfo ){} Nodes: FullNode 57. Create shielded contract parameters rpc CreateShieldedContractParameters ( PrivateShieldedTRC20Parameters ) returns ( ShieldedTRC20Parameters ) {} Nodes: FullNode 58. Create shielded contract parameters without ask rpc CreateShieldedContractParametersWithoutAsk ( PrivateShieldedTRC20ParametersWithoutAsk ) returns ( ShieldedTRC20Parameters ) {} Nodes: FullNode 59. Scan shielded TRC20 notes by ivk rpc ScanShieldedTRC20NotesbyIvk ( IvkDecryptTRC20Parameters ) returns ( DecryptNotesTRC20 ) {} Nodes: FullNode, SolidityNode 60. Scan shielded TRC20 notes by ovk rpc ScanShieldedTRC20NotesbyOvk ( OvkDecryptTRC20Parameters ) returns ( DecryptNotesTRC20 ) {} Nodes: FullNode, SolidityNode 61. Get the status of shielded TRC20 note of spent or not rpc IsShieldedTRC20ContractNoteSpent ( NfTRC20Parameters ) returns ( NullifierResult ) {} Nodes: FullNode, SolidityNode 62. Get the trigger input for the shielded TRC20 rpc GetTriggerInputForShieldedTRC20Contract ( ShieldedTRC20TriggerContractParameters ) returns ( BytesMessage ) {} Nodes: FullNode 63. Create an market order rpc MarketSellAsset (MarketSellAssetContract) returns (TransactionExtention) {}; Nodes: FullNode 64. Cancel the order rpc MarketCancelOrder (MarketCancelOrderContract) returns (TransactionExtention) {}; Nodes: FullNode 65. Get all orders for the account rpc GetMarketOrderByAccount (BytesMessage) returns (MarketOrderList) {}; Nodes: FullNode 66. Get all trading pairs rpc GetMarketPairList (EmptyMessage) returns (MarketOrderPairList) {}; Nodes: FullNode 67. Get all orders for the trading pair rpc GetMarketOrderListByPair (MarketOrderPair) returns (MarketOrderList) {}; Nodes: FullNode 68. Get all prices for the trading pair rpc GetMarketPriceByPair (MarketOrderPair) returns (MarketPriceList) {}; Nodes: FullNode 69. Get order by id rpc GetMarketOrderById (BytesMessage) returns (MarketOrder) {}; Nodes: FullNode 70. perform a historical balance lookup rpc GetAccountBalance (AccountBalanceRequest) returns (AccountBalanceResponse){}; Nodes: FullNode 71. fetch all balance-changing transactions in a block rpc GetBlockBalanceTrace (BlockBalanceTrace.BlockIdentifier) returns (BlockBalanceTrace) {}; Nodes: FullNode 72. get the burn trx amount rpc GetBurnTrx (EmptyMessage) returns (NumberMessage) {}; Nodes: FullNode and SolidityNode 73. Freeze TRX rpc FreezeBalanceV2 ( FreezeBalanceV2Contract ) returns ( TransactionExtention ) {} Nodes: FullNode 74. UnFreeze TRX rpc UnfreezeBalanceV2 ( UnfreezeBalanceV2Contract ) returns ( TransactionExtention ) {} Nodes: FullNode 75. Withdraw Staked TRX rpc WithdrawExpireUnfreeze ( WithdrawExpireUnfreezeContract ) returns ( TransactionExtention ) {} Nodes: FullNode 76. Delegate Resource rpc DelegateResource ( DelegateResourceContract ) returns ( TransactionExtention ) {} Nodes: FullNode 77. UnDelegate Resource rpc UnDelegateResource ( UnDelegateResourceContract ) returns ( TransactionExtention ) {} Nodes: FullNode 78. Query transaction information in the pending pool rpc GetTransactionFromPending (BytesMessage) returns (Transaction) {}; Nodes: FullNode 79. Query the pending pool transaction id list rpc GetTransactionListFromPending (EmptyMessage) returns (TransactionIdList) {}; Nodes: FullNode 80. Query the size of the pending pool rpc GetPendingSize (EmptyMessage) returns (NumberMessage) {}; Nodes: FullNode 81. Cancel UnFreeze rpc CancelAllUnfreezeV2 ( CancelAllUnfreezeV2Contract ) returns ( TransactionExtention ) {} Nodes: FullNode 82. Get bandwidth unit price rpc GetBandwidthPrices ( EmptyMessage ) returns ( PricesResponseMessage ) {} Nodes: FullNode 83. Get energy unit price rpc GetEnergyPrices ( EmptyMessage ) returns ( PricesResponseMessage ) {} Nodes: FullNode 84. Get transaction memo fee rpc GetMemoFee ( EmptyMessage ) returns ( PricesResponseMessage ) {} Nodes: FullNodes","title":"RPC List"},{"location":"architecture/database/","text":"Database configuration \u00b6 Java-tron data storage supports LevelDB or RocksDB, and LevelDB is used by default. You can also choose RocksDB, which provides lots of configuration parameters, allowing nodes to be tuned according to their own machine configuration. The node database occupies less disk space than LevelDB. At the same time, RocksDB supports data backup during runtime, and the backup time only takes a few seconds. The following describes how to set the storage engine of the Java-tron node to RocksDB, and how to perform data conversion between leveldb and rocksdb. RocksDB \u00b6 Configuration \u00b6 Use RocksDB as the data storage engine, need to set db.engine to \"ROCKSDB\". Note: RocksDB only supports db.version=2 , yet does not supports db.version=1 The optimization parameters RocksDB support: Use RocksDB's data backup function \u00b6 Choose RocksDB to be the data storage engine, you can use its data backup function while running Note: FullNode can use data backup function. In order not to affect SuperNode's block producing performance, SuperNode does not support backup service, but SuperNode's backup service node can use this function. Convert LevelDB data to RocksDB data \u00b6 The data storage structure of LevelDB and RocksDB is not compatible, please make sure the node use the same type of data engine all the time. We provide data conversion script which can convert LevelDB data to RocksDB data. Usage: > cd /path/to/java-tron/source-code > ./gradlew build # build the source code > java -jar build/libs/DBConvert.jar # run data conversion command Note: If the node's data storage directory is self-defined, before run DBConvert.jar, you need to add the following parameters: src_db_path : specify LevelDB source directory, default output-directory/database dst_db_path : specify RocksDb source directory, default output-directory-dst/database Example, if you run the script like this: > nohup java -jar FullNode.jar -d your_database_dir /dev/null & then, you should run DBConvert.jar this way: > java -jar build/libs/DBConvert.jar your_database_dir/database output-directory-dst/database Note: You have to stop the running of the node, and then to run the data conversion script. If you do not want to stop the running of the node for too long, after node is shut down, you can copy leveldb's output-directory to the new directory, and then restart the node. Run DBConvert.jar in the previous directory of the new directory, and specify the parameters: src_db_path and dst_db_path . Example: > cp -rf output-directory /tmp/output-directory > cd /tmp > java -jar DBConvert.jar output-directory/database output-directory-dst/database All the whole data conversion process may take 10 hours. RocksDB vs LevelDB \u00b6 You can refer to the following documents for detailed information:: RocksDB vs LevelDB","title":"Database Configuration"},{"location":"architecture/database/#database-configuration","text":"Java-tron data storage supports LevelDB or RocksDB, and LevelDB is used by default. You can also choose RocksDB, which provides lots of configuration parameters, allowing nodes to be tuned according to their own machine configuration. The node database occupies less disk space than LevelDB. At the same time, RocksDB supports data backup during runtime, and the backup time only takes a few seconds. The following describes how to set the storage engine of the Java-tron node to RocksDB, and how to perform data conversion between leveldb and rocksdb.","title":"Database configuration"},{"location":"architecture/database/#rocksdb","text":"","title":"RocksDB"},{"location":"architecture/database/#configuration","text":"Use RocksDB as the data storage engine, need to set db.engine to \"ROCKSDB\". Note: RocksDB only supports db.version=2 , yet does not supports db.version=1 The optimization parameters RocksDB support:","title":"Configuration"},{"location":"architecture/database/#use-rocksdbs-data-backup-function","text":"Choose RocksDB to be the data storage engine, you can use its data backup function while running Note: FullNode can use data backup function. In order not to affect SuperNode's block producing performance, SuperNode does not support backup service, but SuperNode's backup service node can use this function.","title":"Use RocksDB's data backup function"},{"location":"architecture/database/#convert-leveldb-data-to-rocksdb-data","text":"The data storage structure of LevelDB and RocksDB is not compatible, please make sure the node use the same type of data engine all the time. We provide data conversion script which can convert LevelDB data to RocksDB data. Usage: > cd /path/to/java-tron/source-code > ./gradlew build # build the source code > java -jar build/libs/DBConvert.jar # run data conversion command Note: If the node's data storage directory is self-defined, before run DBConvert.jar, you need to add the following parameters: src_db_path : specify LevelDB source directory, default output-directory/database dst_db_path : specify RocksDb source directory, default output-directory-dst/database Example, if you run the script like this: > nohup java -jar FullNode.jar -d your_database_dir /dev/null & then, you should run DBConvert.jar this way: > java -jar build/libs/DBConvert.jar your_database_dir/database output-directory-dst/database Note: You have to stop the running of the node, and then to run the data conversion script. If you do not want to stop the running of the node for too long, after node is shut down, you can copy leveldb's output-directory to the new directory, and then restart the node. Run DBConvert.jar in the previous directory of the new directory, and specify the parameters: src_db_path and dst_db_path . Example: > cp -rf output-directory /tmp/output-directory > cd /tmp > java -jar DBConvert.jar output-directory/database output-directory-dst/database All the whole data conversion process may take 10 hours.","title":"Convert LevelDB data to RocksDB data"},{"location":"architecture/database/#rocksdb-vs-leveldb","text":"You can refer to the following documents for detailed information:: RocksDB vs LevelDB","title":"RocksDB vs LevelDB"},{"location":"architecture/event/","text":"Event Subscription \u00b6 Using Event Plugin for Event Subscription \u00b6 TIP \u00b6 The TIP: TIP-12:Tron event subscribes model . Event Type \u00b6 TRON Event Subscription supports 4 types of event: Transaction Event \u00b6 The parameters passed to Subscriber: transactionId: transaction hash blockHash: block hash blockNumber: block number energyUsage: energy usage energyFee: energy fee originEnergyUsage: origin energy usage energyUsageTotal: total energy usage total Block Event \u00b6 The parameters passed to Subscriber: blockHash: block hash blockNumber: block number transactionSize: the number of transactions in a block latestSolidifiedBlockNumber: the latest solidified block number transactionList: the transactions hash list Contract Event \u00b6 The parameters passed to Subscriber: transactionId: transaction id contractAddress: contract address callerAddress: contract caller address blockNumber: the number of the block contract related events recorded blockTimestamp: the block time stamp eventSignature: event signature topicMap: the map of topic in solidity language data: the data information in solidity language removed: 'true' means the log is removed Contract Log Event \u00b6 The parameters passed to Subscriber: transactionId: transaction hash contractAddress: contract address callerAddress: contract caller address blockNumber: the number of the block contract related events recorded blockTimestamp: the block time stamp contractTopics: the list of topic in solidity language data: the data information in solidity language removed: 'true' means the log is removed Contract Event and Contract Log Even support event filter function which includes: fromBlock: the start block number toBlock: the end block number contractAddress: contract adsresses list contractTopics: contract topics list Note Historical data query is not supported. New Features \u00b6 Supporting event plug-ins, kafka & mongodb plug-ins have been released, developers can also customize their own plug-ins according to their own needs. Supporting subscription of chain data, such as block, transaction, contract log, contract event and so on. For transaction events, developers can get information such as internal transactions, contract info and so on; for contract events, developers could configure the contract addresses list or contract topic list to receive the specified events, and event subscription has a very low latency. The deployed fullnode can receive event information immediately after the contract is executed. Event query service tron-eventquery, online Event query service provided. Developers can query trigger information in the last seven days through https, and the query address is https://api.tronex.io . Github project \u00b6 tronprotocol/event-plugin tronprotocol/tron-eventquery Event plugin \u00b6 Kafka deployment MongoDB deployment Event query \u00b6 Tron Event Query Service TronEventQuery is implemented with Tron's new event subscribe model. It uses same query interface with Tron-Grid. Users can also subscribe block trigger, transaction trigger, contract log trigger, and contract event trigger. TronEvent is independent of a particular branch of java-tron, the new event subscribes model will be released on version 3.5 of java-tron. For more information of tron event subscribe model, please refer to TIP-12 . Event query deployment Event query HTTP API Using Java-tron's Built-in Message Queue for Event Subscription \u00b6 TRON provides event subscription service. Developers can not only obtain on-chain events through event plugin, but also through Java-tron\u2019s built-in ZeroMQ message queue . The difference is that event plugin needs to be additionally deployed, which is used to implement event storage: developers can choose appropriate storage tools according to their needs, such as MongoDB, Kafka, etc., and the plugin help complete the storage of subscribed events. Java-tron's built-in ZeroMQ does not require additional deployment operations. Event subscribers can directly connect to the publisher's ip and port, set subscription topics, and receive subscribed events. However, this method does not provide event storage. Therefore, when developers want to subscribe to events directly from nodes for a short period of time, then using the built-in message queue will be a more appropriate choice. This article will introduce how to subscribe to events through Java-tron's built-in message queue in detail. Configure node \u00b6 To use the built-in ZeroMQ of the node for event subscription, you need to set the configuration item useNativeQueue to true in the node configuration file. event.subscribe = { native = { useNativeQueue = true // if true, use native message queue, else use event plugin. bindport = 5555 // bind port sendqueuelength = 1000 //max length of send queue } ...... topics = [ { triggerName = \"block\" // block trigger, the value can't be modified enable = true topic = \"block\" // plugin topic, the value could be modified }, ...... ] } native.useNativeQueue : true is to use the built-in message queue, false is to use the event plugin native.bindport : ZeroMQ publisher binding port. In this example, it is 5555 , so the publisher address that the subscriber should connect to is \"tcp://127.0.0.1:5555\" native.sendqueuelength : The length of the send queue, that is, when the subscriber receives messages slowly, the maximum number of messages published by the publisher that the TCP buffer can hold. if it exceeds, The message will be discarded if exceeds the capacity topics : Subscribed event type , including block type, transaction type, etc. Start node \u00b6 The event subscription service is disabled by default and needs to be enabled by adding the command line parameter --es . The start command of the node that enables the event subscription service is as follows: $ java -jar FullNode.jar --es Prepare event subscription script \u00b6 This article takes Nodejs as an example to illustrate how to subscribe to events. First, install the zeromq library: $ npm install zeromq@5 Then, write the subscriber code: // subscriber.js var zmq = require(\"zeromq\"), var sock = zmq.socket(\"sub\"); sock.connect(\"tcp://127.0.0.1:5555\"); sock.subscribe(\"block\"); console.log(\"Subscriber connected to port 5555\"); sock.on(\"message\", function(topic, message) { console.log( \"received a message related to:\", Buffer.from(topic).toString(), \", containing message:\", Buffer.from(message).toString() ); }); This example connects the subscriber to the node event publisher and subscribes to block events. Start subscriber \u00b6 Start command of Nodejs is as below: $ node subscriber.js > Subscriber connected to port 5555 When the node has a new block, the subscriber will receive block event, the output information is as follows: received a message related to: blockTrigger, containing message: {\"timeStamp\":1678343709000,\"triggerName\":\"blockTrigger\",\"blockNumber\":1361,\"blockHash\":\"00000000000005519b3995cd638753a862c812d1bda11de14bbfaa5ad3383280\",\"transactionSize\":0,\"latestSolidifiedBlockNumber\":1361,\"transactionList\":[]} received a message related to: blockTrigger, containing message: {\"timeStamp\":1678343712000,\"triggerName\":\"blockTrigger\",\"blockNumber\":1362,\"blockHash\":\"0000000000000552d53d1bdd9929e4533a983f14df8931ee9b3bf6d6c74a47b0\",\"transactionSize\":0,\"latestSolidifiedBlockNumber\":1362,\"transactionList\":[]}","title":"Event Subscription"},{"location":"architecture/event/#event-subscription","text":"","title":"Event Subscription"},{"location":"architecture/event/#using-event-plugin-for-event-subscription","text":"","title":"Using Event Plugin for Event Subscription"},{"location":"architecture/event/#tip","text":"The TIP: TIP-12:Tron event subscribes model .","title":"TIP"},{"location":"architecture/event/#event-type","text":"TRON Event Subscription supports 4 types of event:","title":"Event Type"},{"location":"architecture/event/#transaction-event","text":"The parameters passed to Subscriber: transactionId: transaction hash blockHash: block hash blockNumber: block number energyUsage: energy usage energyFee: energy fee originEnergyUsage: origin energy usage energyUsageTotal: total energy usage total","title":"Transaction Event"},{"location":"architecture/event/#block-event","text":"The parameters passed to Subscriber: blockHash: block hash blockNumber: block number transactionSize: the number of transactions in a block latestSolidifiedBlockNumber: the latest solidified block number transactionList: the transactions hash list","title":"Block Event"},{"location":"architecture/event/#contract-event","text":"The parameters passed to Subscriber: transactionId: transaction id contractAddress: contract address callerAddress: contract caller address blockNumber: the number of the block contract related events recorded blockTimestamp: the block time stamp eventSignature: event signature topicMap: the map of topic in solidity language data: the data information in solidity language removed: 'true' means the log is removed","title":"Contract Event"},{"location":"architecture/event/#contract-log-event","text":"The parameters passed to Subscriber: transactionId: transaction hash contractAddress: contract address callerAddress: contract caller address blockNumber: the number of the block contract related events recorded blockTimestamp: the block time stamp contractTopics: the list of topic in solidity language data: the data information in solidity language removed: 'true' means the log is removed Contract Event and Contract Log Even support event filter function which includes: fromBlock: the start block number toBlock: the end block number contractAddress: contract adsresses list contractTopics: contract topics list Note Historical data query is not supported.","title":"Contract Log Event"},{"location":"architecture/event/#new-features","text":"Supporting event plug-ins, kafka & mongodb plug-ins have been released, developers can also customize their own plug-ins according to their own needs. Supporting subscription of chain data, such as block, transaction, contract log, contract event and so on. For transaction events, developers can get information such as internal transactions, contract info and so on; for contract events, developers could configure the contract addresses list or contract topic list to receive the specified events, and event subscription has a very low latency. The deployed fullnode can receive event information immediately after the contract is executed. Event query service tron-eventquery, online Event query service provided. Developers can query trigger information in the last seven days through https, and the query address is https://api.tronex.io .","title":"New Features"},{"location":"architecture/event/#github-project","text":"tronprotocol/event-plugin tronprotocol/tron-eventquery","title":"Github project"},{"location":"architecture/event/#event-plugin","text":"Kafka deployment MongoDB deployment","title":"Event plugin"},{"location":"architecture/event/#event-query","text":"Tron Event Query Service TronEventQuery is implemented with Tron's new event subscribe model. It uses same query interface with Tron-Grid. Users can also subscribe block trigger, transaction trigger, contract log trigger, and contract event trigger. TronEvent is independent of a particular branch of java-tron, the new event subscribes model will be released on version 3.5 of java-tron. For more information of tron event subscribe model, please refer to TIP-12 . Event query deployment Event query HTTP API","title":"Event query"},{"location":"architecture/event/#using-java-trons-built-in-message-queue-for-event-subscription","text":"TRON provides event subscription service. Developers can not only obtain on-chain events through event plugin, but also through Java-tron\u2019s built-in ZeroMQ message queue . The difference is that event plugin needs to be additionally deployed, which is used to implement event storage: developers can choose appropriate storage tools according to their needs, such as MongoDB, Kafka, etc., and the plugin help complete the storage of subscribed events. Java-tron's built-in ZeroMQ does not require additional deployment operations. Event subscribers can directly connect to the publisher's ip and port, set subscription topics, and receive subscribed events. However, this method does not provide event storage. Therefore, when developers want to subscribe to events directly from nodes for a short period of time, then using the built-in message queue will be a more appropriate choice. This article will introduce how to subscribe to events through Java-tron's built-in message queue in detail.","title":"Using Java-tron's Built-in Message Queue for Event Subscription"},{"location":"architecture/event/#configure-node","text":"To use the built-in ZeroMQ of the node for event subscription, you need to set the configuration item useNativeQueue to true in the node configuration file. event.subscribe = { native = { useNativeQueue = true // if true, use native message queue, else use event plugin. bindport = 5555 // bind port sendqueuelength = 1000 //max length of send queue } ...... topics = [ { triggerName = \"block\" // block trigger, the value can't be modified enable = true topic = \"block\" // plugin topic, the value could be modified }, ...... ] } native.useNativeQueue : true is to use the built-in message queue, false is to use the event plugin native.bindport : ZeroMQ publisher binding port. In this example, it is 5555 , so the publisher address that the subscriber should connect to is \"tcp://127.0.0.1:5555\" native.sendqueuelength : The length of the send queue, that is, when the subscriber receives messages slowly, the maximum number of messages published by the publisher that the TCP buffer can hold. if it exceeds, The message will be discarded if exceeds the capacity topics : Subscribed event type , including block type, transaction type, etc.","title":"Configure node"},{"location":"architecture/event/#start-node","text":"The event subscription service is disabled by default and needs to be enabled by adding the command line parameter --es . The start command of the node that enables the event subscription service is as follows: $ java -jar FullNode.jar --es","title":"Start node"},{"location":"architecture/event/#prepare-event-subscription-script","text":"This article takes Nodejs as an example to illustrate how to subscribe to events. First, install the zeromq library: $ npm install zeromq@5 Then, write the subscriber code: // subscriber.js var zmq = require(\"zeromq\"), var sock = zmq.socket(\"sub\"); sock.connect(\"tcp://127.0.0.1:5555\"); sock.subscribe(\"block\"); console.log(\"Subscriber connected to port 5555\"); sock.on(\"message\", function(topic, message) { console.log( \"received a message related to:\", Buffer.from(topic).toString(), \", containing message:\", Buffer.from(message).toString() ); }); This example connects the subscriber to the node event publisher and subscribes to block events.","title":"Prepare event subscription script"},{"location":"architecture/event/#start-subscriber","text":"Start command of Nodejs is as below: $ node subscriber.js > Subscriber connected to port 5555 When the node has a new block, the subscriber will receive block event, the output information is as follows: received a message related to: blockTrigger, containing message: {\"timeStamp\":1678343709000,\"triggerName\":\"blockTrigger\",\"blockNumber\":1361,\"blockHash\":\"00000000000005519b3995cd638753a862c812d1bda11de14bbfaa5ad3383280\",\"transactionSize\":0,\"latestSolidifiedBlockNumber\":1361,\"transactionList\":[]} received a message related to: blockTrigger, containing message: {\"timeStamp\":1678343712000,\"triggerName\":\"blockTrigger\",\"blockNumber\":1362,\"blockHash\":\"0000000000000552d53d1bdd9929e4533a983f14df8931ee9b3bf6d6c74a47b0\",\"transactionSize\":0,\"latestSolidifiedBlockNumber\":1362,\"transactionList\":[]}","title":"Start subscriber"},{"location":"clients/tron-grid/","text":"TronGrid \u00b6 The up-to-date TronGrid API Documentation is at https://developers.tron.network/docs/tron-grid-intro . Introduction \u00b6 TronGrid provides TRON clients running in the cloud, so you don't have to run one yourself to work with TRON on your next project. TronGrid offers an easy to use hosted API, load balanced full nodes, secure and reliable developer tools with direct access to the TRON Network. TronGrid uses a set of NodeJS apps to talk with Redis and PostgreSQL to provide a simple, fast and reliable query interface for the Tron API. TronGrid supports 2 types of api: FullNode & SolidityNode api TronGrid supports all the FullNode and SolidityNode api calls, you only need to add the url: https://api.trongrid.io/ , like: https://api.trongrid.io/wallet/getnowblock TronGrid v3 (TG3) api version As this is the first iteration of the improved TronGrid, it starts with v1. Example: https://api.trongrid.io/v1 Parameters, Queries, & Return Values Addresses in TG3 can be passed in base58 or hex formats. Query parameters can be passed in camelCase or snake_case. All returned JSON properties will be in snake_case (at the first level at least). NB: In this document, we will primarily use base58 and snake_case formats. Account APIs \u00b6 1. Get Account Info By Address API: https://api.trongrid.io/v1/accounts/:address Params: address: The account\u2019s address in base58 or hex format (0x... and 41...) Options: only_confirmed Shows only the situation at latest confirmed block. true | false default false . Example: https://api.trongrid.io/v1/accounts/TLCuBEirVzB6V4menLZKw1jfBTFMZbuKq7?only_confirmed=false 2. Get Transactions By Account Address API: https://api.trongrid.io/v1/accounts/:address/transactions Params: address: The account\u2019s address. Options: only_confirmed Shows only confirmed. true | false default false . only_unconfirmed Shows only unconfirmed. true | false default false . only_to Only transaction to address. true | false default false . only_from Only transaction from address. true | false default false . limit The requested number of transaction per page. Default 20 . Max 200 . fingerprint The fingerprint of the last transaction returned by the previous page. order_by Pre sorts the results during the query. order_by=block_number,asc , order_by=block_timestamp,desc . min_block_timestamp The minimum transaction timestamp default 0 . max_block_timestamp The maximum transaction timestamp default now . Example: https://api.trongrid.io/v1/accounts/TLCuBEirVzB6V4menLZKw1jfBTFMZbuKq/transactions?only_to=true&only_from=true 3. Get Account Resources By Address API: https://api.trongrid.io/v1/accounts/:address/resources Params: address: The account\u2019s address. Example: https://api.trongrid.io/v1/accounts/TLCuBEirVzB6V4menLZKw1jfBTFMZbuKq/resources Asset APIs \u00b6 1. Get All Assets API: https://api.trongrid.io/v1/assets Options: order_by Sorts the results. Accepted fields: total_supply,asc | total_supply,desc , start_time,asc | start_time,desc , end_time,asc | end_time,desc , id,asc | id,desc . Example: order_by=total_supply,asc . 2. Get Assets By Identifier API: https://api.trongrid.io/v1/assets/:identifier Params: identifier: The identifier to be used to retrieve the asset. It can be the ID of the asset, or the issuer address. 3. Get Assets By Name API: https://api.trongrid.io/v1/assets/:name/list Params: name: The name of the asset. Options: limit The requested number of assets per page. Default 20 . Max 200 . When there is a pagination, the minimum limit is set to 20 . fingerprint The fingerprint of the last asset returned by the previous page. order_by Pre sorts the results during the query. order_by=total_supply,asc (starts from the rarest token). order_by=start_time,desc (starts from the most recent ICO). Block APIs \u00b6 1. Returns Events By Block Identifier API: https://api.trongrid.io/v1/blocks/:identifier/events Params: identifier: It can be either latest, a block number or a block id. Contract APIs \u00b6 1. Get Events By Contract Address API: https://api.trongrid.io/v1/contracts/:address/events Params: address: The address of the deployed contract. Options: only_confirmed Shows only confirmed. true | false default false . only_unconfirmed Shows only unconfirmed. true | false default false . event_name The name of the event. block_number The block number for which the events are required. min_block_timestamp The minimum block timestamp default 0 . max_block_timestamp The maximum block timestamp default now . limit For pagination. Limit 20. fingerprint The fingerprint of last event retrieved in the page. order_by Sort the events. Accepted values: block_timestamp,asc , block_timestamp,desc (default). 2. Get Transactions By Contract Address API: https://api.trongrid.io/v1/contracts/:address/transactions Params: address: The address of the deployed contract. Options: only_confirmed Shows only confirmed. true | false default false . only_unconfirmed Shows only unconfirmed. true | false default false . min_block_timestamp The minimum block timestamp default 0 . max_block_timestamp The maximum block timestamp default now . limit For pagination. Limit 20 . fingerprint The fingerprint of last event retrieved in the page. order_by Sort the events. Accepted values: block_timestamp,asc , block_timestamp,desc (default). Transaction APIs \u00b6 1. Get Events By Transaction ID API: https://api.trongrid.io/v1/transactions/:id/events Params: id: The id of the transaction. 2. Get Transaction By Transaction ID API: https://api.trongrid.io/v1/transactions/:id/events Params: id: The id of the transaction.","title":"TronGrid"},{"location":"clients/tron-grid/#trongrid","text":"The up-to-date TronGrid API Documentation is at https://developers.tron.network/docs/tron-grid-intro .","title":"TronGrid"},{"location":"clients/tron-grid/#introduction","text":"TronGrid provides TRON clients running in the cloud, so you don't have to run one yourself to work with TRON on your next project. TronGrid offers an easy to use hosted API, load balanced full nodes, secure and reliable developer tools with direct access to the TRON Network. TronGrid uses a set of NodeJS apps to talk with Redis and PostgreSQL to provide a simple, fast and reliable query interface for the Tron API. TronGrid supports 2 types of api: FullNode & SolidityNode api TronGrid supports all the FullNode and SolidityNode api calls, you only need to add the url: https://api.trongrid.io/ , like: https://api.trongrid.io/wallet/getnowblock TronGrid v3 (TG3) api version As this is the first iteration of the improved TronGrid, it starts with v1. Example: https://api.trongrid.io/v1 Parameters, Queries, & Return Values Addresses in TG3 can be passed in base58 or hex formats. Query parameters can be passed in camelCase or snake_case. All returned JSON properties will be in snake_case (at the first level at least). NB: In this document, we will primarily use base58 and snake_case formats.","title":"Introduction"},{"location":"clients/tron-grid/#account-apis","text":"1. Get Account Info By Address API: https://api.trongrid.io/v1/accounts/:address Params: address: The account\u2019s address in base58 or hex format (0x... and 41...) Options: only_confirmed Shows only the situation at latest confirmed block. true | false default false . Example: https://api.trongrid.io/v1/accounts/TLCuBEirVzB6V4menLZKw1jfBTFMZbuKq7?only_confirmed=false 2. Get Transactions By Account Address API: https://api.trongrid.io/v1/accounts/:address/transactions Params: address: The account\u2019s address. Options: only_confirmed Shows only confirmed. true | false default false . only_unconfirmed Shows only unconfirmed. true | false default false . only_to Only transaction to address. true | false default false . only_from Only transaction from address. true | false default false . limit The requested number of transaction per page. Default 20 . Max 200 . fingerprint The fingerprint of the last transaction returned by the previous page. order_by Pre sorts the results during the query. order_by=block_number,asc , order_by=block_timestamp,desc . min_block_timestamp The minimum transaction timestamp default 0 . max_block_timestamp The maximum transaction timestamp default now . Example: https://api.trongrid.io/v1/accounts/TLCuBEirVzB6V4menLZKw1jfBTFMZbuKq/transactions?only_to=true&only_from=true 3. Get Account Resources By Address API: https://api.trongrid.io/v1/accounts/:address/resources Params: address: The account\u2019s address. Example: https://api.trongrid.io/v1/accounts/TLCuBEirVzB6V4menLZKw1jfBTFMZbuKq/resources","title":"Account APIs"},{"location":"clients/tron-grid/#asset-apis","text":"1. Get All Assets API: https://api.trongrid.io/v1/assets Options: order_by Sorts the results. Accepted fields: total_supply,asc | total_supply,desc , start_time,asc | start_time,desc , end_time,asc | end_time,desc , id,asc | id,desc . Example: order_by=total_supply,asc . 2. Get Assets By Identifier API: https://api.trongrid.io/v1/assets/:identifier Params: identifier: The identifier to be used to retrieve the asset. It can be the ID of the asset, or the issuer address. 3. Get Assets By Name API: https://api.trongrid.io/v1/assets/:name/list Params: name: The name of the asset. Options: limit The requested number of assets per page. Default 20 . Max 200 . When there is a pagination, the minimum limit is set to 20 . fingerprint The fingerprint of the last asset returned by the previous page. order_by Pre sorts the results during the query. order_by=total_supply,asc (starts from the rarest token). order_by=start_time,desc (starts from the most recent ICO).","title":"Asset APIs"},{"location":"clients/tron-grid/#block-apis","text":"1. Returns Events By Block Identifier API: https://api.trongrid.io/v1/blocks/:identifier/events Params: identifier: It can be either latest, a block number or a block id.","title":"Block APIs"},{"location":"clients/tron-grid/#contract-apis","text":"1. Get Events By Contract Address API: https://api.trongrid.io/v1/contracts/:address/events Params: address: The address of the deployed contract. Options: only_confirmed Shows only confirmed. true | false default false . only_unconfirmed Shows only unconfirmed. true | false default false . event_name The name of the event. block_number The block number for which the events are required. min_block_timestamp The minimum block timestamp default 0 . max_block_timestamp The maximum block timestamp default now . limit For pagination. Limit 20. fingerprint The fingerprint of last event retrieved in the page. order_by Sort the events. Accepted values: block_timestamp,asc , block_timestamp,desc (default). 2. Get Transactions By Contract Address API: https://api.trongrid.io/v1/contracts/:address/transactions Params: address: The address of the deployed contract. Options: only_confirmed Shows only confirmed. true | false default false . only_unconfirmed Shows only unconfirmed. true | false default false . min_block_timestamp The minimum block timestamp default 0 . max_block_timestamp The maximum block timestamp default now . limit For pagination. Limit 20 . fingerprint The fingerprint of last event retrieved in the page. order_by Sort the events. Accepted values: block_timestamp,asc , block_timestamp,desc (default).","title":"Contract APIs"},{"location":"clients/tron-grid/#transaction-apis","text":"1. Get Events By Transaction ID API: https://api.trongrid.io/v1/transactions/:id/events Params: id: The id of the transaction. 2. Get Transaction By Transaction ID API: https://api.trongrid.io/v1/transactions/:id/events Params: id: The id of the transaction.","title":"Transaction APIs"},{"location":"clients/wallet-cli-command/","text":"Wallet Commands \u00b6 Below, please find all types of Wallet-Cli commands\uff1a Wallet Account AccountResource Transaction On-ChainInquire SmartContract TRC-10 Governance DEX Wallet \u00b6 Here are all the wallet related commands \uff1a RegisterWallet Login BackupWallet BackupWallet2Base64 ChangePassword ImportWallet ImportWalletByBase64 This section introduces commands related to wallet management. Let's start with registerwallet to get a new account. RegisterWallet \u00b6 To register your wallet, you need to set the wallet password and generate the address and private key. A .json keystore file will be generated under the path of wallet-cli/wallet . The file will be used for login and backupwallet later. wallet> RegisterWallet Please input password. password: Please input password again. password: Register a wallet successful, keystore file name is UTC--2022-06-27T07-37-47.601000000Z--TWyDBTHsWJFhgywWkTNW7vh7jSUxeBaiAw.json Login \u00b6 When we have a keystore file, we can start to login. After enter the command, choose the keystore file and enter the password. wallet> login use user defined config file in current dir The 1th keystore file name is UTC--2022-06-28T06-52-56.928000000Z--TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej.json The 2th keystore file name is .DS_Store The 3th keystore file name is UTC--2022-06-22T08-31-57.735000000Z--TBnPDbw99BLzPUZuW8Rrcc3RGGQT3cnSfF.json The 4th keystore file name is UTC--2022-04-06T09-43-20.710000000Z--TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8.json The 5th keystore file name is UTC--2022-04-07T09-03-38.307000000Z--TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE.json Please choose between 1 and 5 4 Please input your password. password: Login successful !!! BackupWallet \u00b6 This will Back up your wallet. You need to enter your wallet password to export the privat key in hex string format, such as: 721d63b074f18d41c147e04c952ec93467777a30b6f16745bc47a8eae5076545 wallet> backupwallet Please input your password. password: BackupWallet successful !! 721d63b074f18d41c147e04c952ec93467777a30b6f16745bc47a8eae5076545 BackupWallet2Base64 \u00b6 This will Back up your wallet, you need to enter your wallet password to export the private key in base64 format, as below ch1jsHTxjUHBR+BMlS7JNGd3ejC28WdFvEeo6uUHZUU= wallet> backupwallet Please input your password. password: BackupWallet successful !! ch1jsHTxjUHBR+BMlS7JNGd3ejC28WdFvEeo6uUHZUU = ChangePassword \u00b6 Modify the password of an account wallet> changepassword Please input old password. password: Please input new password. Please input password. password: Please input password again. password: The 1th keystore file name is .DS_Store The 2th keystore file name is UTC--2022-06-27T10-58-59.306000000Z--TBnPDbw99BLzPUZuW8Rrcc3RGGQT3cnSfF.json Please choose between 1 and 2 2 ChangePassword successful !! ImportWallet \u00b6 Import a wallet, you need to set a password first and then enter your hex string private key. wallet> importwallet Please input password. password: Please input password again. password: Please input private key. Max retry time:3 bd1ff0f4f852db45316bf08755bf6eee45d0678bfbf852a00020a13d42a1fb5b Import a wallet successful, keystore file name is UTC--2022-06-28T06-52-56.928000000Z--TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej.json ImportWalletByBase64 \u00b6 To import a wallet, you need to set a password first and then enter your private key in base64 format. wallet> importwalletbybase64 Please input password. password: Please input password again. password: Please input private key by base64. Max retry time:3 vR/w9PhS20Uxa/CHVb9u7kXQZ4v7+FKgACChPUKh+1s = Import a wallet successful, keystore file name is UTC--2022-06-28T06-51-56.154000000Z--TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej.json Account \u00b6 Here are all the account related commands \uff1a GenerateAddress GetAccount GetAddress GetBalance UpdateAccountPermission GenerateAddress \u00b6 Generate an address and print out the public (address) and private key wallet> generateaddress { \"address\" : \"TQAvi6bemLa1t1irdV1KuaSC5vKc2EswTj\" , \"privateKey\" : \"610a8a809114a96140e1cb040a7813afc74603e58c3d7824c3f68ccc642c297e\" } Note address and private key generated by this command would not be saved in wallet-cli. Keep properly if you would like to use them. GetAccount \u00b6 Get account information by an address wallet> getaccount [ address ] wallet> getaccount TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8 { \"address\" : \"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" , \"balance\" : 2665198240 , \"create_time\" : 1650363711000 , \"latest_opration_time\" : 1653578769000 , \"latest_consume_free_time\" : 1651228080000 , \"account_resource\" : { \"latest_consume_time_for_energy\" : 1653578769000 } , \"owner_permission\" : { \"permission_name\" : \"owner\" , \"threshold\" : 1 , \"keys\" : [ { \"address\" : \"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" , \"weight\" : 1 } ] } , \"active_permission\" : [ { \"type\" : \"Active\" , \"id\" : 2 , \"permission_name\" : \"active\" , \"threshold\" : 1 , \"operations\" : \"7fff1fc0033e3b00000000000000000000000000000000000000000000000000\" , \"keys\" : [ { \"address\" : \"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" , \"weight\" : 1 } ] } ] } GetAddress \u00b6 Get the address of the current account wallet> getaddress GetAddress successful !! address = TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8 GetBalance \u00b6 Get the TRX balance of the current account wallet> getbalance Balance = 2665198240 UpdateAccountPermission \u00b6 wallet>UpdateAccountPermission [ ownerAddress ] [ permissions ] This command is used to assign permissions to other accounts, is utilized for multi-signature transactions, which allows other users to access the account with paritcular permission in order to better manage it. There are three types of permissions: owner: access to the owner of account active: access to other features of accounts, and access that authorizes a certain feature. Block production authorization is not included if it's for witness purposes. witness: only for witness, block production authorization will be granted to one of the other users. NOTE the parameter Permission must written in JSON format and entered in line. If the owner accountis not SR, then do not assign witness permission. wallet> updateaccountpermission TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8 { \"owner_permission\" : { \"keys\" : [{ \"address\" : \"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" , \"weight\" :1 }] , \"threshold\" :1, \"type\" :0, \"permission_name\" : \"owner\" } , \"active_permissions\" : [{ \"operations\" : \"7fff1fc0033e0000000000000000000000000000000000000000000000000000\" , \"keys\" : [{ \"address\" : \"TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej\" , \"weight\" :1 } , { \"address\" : \"TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE\" , \"weight\" :1 }] , \"threshold\" :2, \"type\" :2, \"permission_name\" : \"active12323\" }]} { \"raw_data\" : { \"contract\" : [ { \"parameter\" : { \"value\" : { \"owner\" : { \"keys\" : [ { \"address\" : \"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" , \"weight\" :1 } ] , \"threshold\" :1, \"permission_name\" : \"owner\" } , \"owner_address\" : \"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" , \"actives\" : [ { \"operations\" : \"7fff1fc0033e0000000000000000000000000000000000000000000000000000\" , \"keys\" : [ { \"address\" : \"TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej\" , \"weight\" :1 } , { \"address\" : \"TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE\" , \"weight\" :1 } ] , \"threshold\" :2, \"type\" : \"Active\" , \"permission_name\" : \"active12323\" } ] } , \"type_url\" : \"type.googleapis.com/protocol.AccountPermissionUpdateContract\" } , \"type\" : \"AccountPermissionUpdateContract\" } ] , \"ref_block_bytes\" : \"4e88\" , \"ref_block_hash\" : \"11a47859be13f689\" , \"expiration\" :1656423231000, \"timestamp\" :1656423171818 } , \"raw_data_hex\" : \"0a024e88220811a47859be13f6894098dc92d49a305aee01082e12e9010a3c747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e4163636f756e745065726d697373696f6e557064617465436f6e747261637412a8010a1541babecec4d9f58f0df77f0728b9c53abb1f21d68412241a056f776e657220013a190a1541babecec4d9f58f0df77f0728b9c53abb1f21d6841001226908021a0b6163746976653132333233200232207fff1fc0033e00000000000000000000000000000000000000000000000000003a190a15410cfaec7164cbfe78dbb8d8fba7e23b4d745ed81310013a190a1541e8bd653015895947cec33d1670a88cf67ab277b9100170ea8d8fd49a30\" } before sign transaction hex string is 0a8d020a024e88220811a47859be13f6894098dc92d49a305aee01082e12e9010a3c747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e4163636f756e745065726d697373696f6e557064617465436f6e747261637412a8010a1541babecec4d9f58f0df77f0728b9c53abb1f21d68412241a056f776e657220013a190a1541babecec4d9f58f0df77f0728b9c53abb1f21d6841001226908021a0b6163746976653132333233200232207fff1fc0033e00000000000000000000000000000000000000000000000000003a190a15410cfaec7164cbfe78dbb8d8fba7e23b4d745ed81310013a190a1541e8bd653015895947cec33d1670a88cf67ab277b9100170ea8d8fd49a30 Please confirm and input your permission id, if input y or Y means default 0 , other non-numeric characters will cancel transaction. y Please choose your key for sign. The 1th keystore file name is UTC--2022-06-28T06-52-56.928000000Z--TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej.json The 2th keystore file name is .DS_Store The 3th keystore file name is UTC--2022-04-06T09-43-20.710000000Z--TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8.json The 4th keystore file name is UTC--2022-04-07T09-03-38.307000000Z--TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE.json Please choose between 1 and 4 3 Please input your password. password: after sign transaction hex string is 0a8d020a024e88220811a47859be13f6894096bcb5de9a305aee01082e12e9010a3c747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e4163636f756e745065726d697373696f6e557064617465436f6e747261637412a8010a1541babecec4d9f58f0df77f0728b9c53abb1f21d68412241a056f776e657220013a190a1541babecec4d9f58f0df77f0728b9c53abb1f21d6841001226908021a0b6163746976653132333233200232207fff1fc0033e00000000000000000000000000000000000000000000000000003a190a15410cfaec7164cbfe78dbb8d8fba7e23b4d745ed81310013a190a1541e8bd653015895947cec33d1670a88cf67ab277b9100170ea8d8fd49a301241881b00f8e8828d9347469fcbcec730093841c2363561243b7162a9669439266049ab82f20f97a136adc88feff0a4d5aa57b11f762eaa7e05105d27ec5d55a33900 txid is 3dce7f18f6cf6962c38904678947b3b32f9e94ba6460874679d8ed063bb1c0eb UpdateAccountPermission successful !!! AccountResource \u00b6 Here are all the account resource related commands \uff1a freezeBalance unfreezeBalance getDelegatedResource freezeBalanceV2 unfreezeBalanceV2 delegateResource unDelegateResource withdrawExpireUnfreeze getAvailableUnfreezeCount getCanWithdrawUnfreezeAmount getCanDelegatedMaxSize getDelegatedResourceV2 getDelegatedResourceAccountIndexV2 getAccountNet getAccountResource freezeBalance \u00b6 This interface has been deprecated, please use freezeBalanceV2 to stake TRX to obtain resources. wallet> freezeBalance [ OwnerAddress ] [ frozen_balance ] [ frozen_duration ] [ ResourceCode:0 BANDWIDTH, 1 ENERGY ] [ receiverAddress ] OwnerAddress is the address of the account that initiated the transaction, optional, default is the address of the login account. frozen_balance is the amount of frozen TRX, the unit is the smallest unit (Sun), the minimum is 1000000sun. frozen_duration is frozen duration, only be specified as 3 days, indicates that you can unfreeze after 3 days. ResourceCode indicates the type of the acquired resource\uff0c0 BANDWIDTH and 1 ENERGY. receiverAddress is the address that will receive the resource. ResourceCode and receiverAddress are optional parameters. If ResourceCode is not set\uff0cdefault is 0. If receiverAddress is not set, the TRX is frozen to obtain resources for its OwnerAddress use; if it is not empty, the acquired resources are used by receiverAddress. Example: wallet> freezeBalance TWyDBTHsWJFhgywWkTNW7vh7jSUxeBaiAw 1000000 3 1 TCrkRWJuHP4VgQF3xwLNBAjVVXvxRRGpbA { \"raw_data\" : { ... } , \"raw_data_hex\" : \"0a02a9b822081db2070d39d2316640c095dda19a305a70080b126c0a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e467265657a6542616c616e6365436f6e747261637412360a1541e65aca838a9e15dd81bd9532d2ad61300e58cf7110c0843d180350017a15411fafb1e96dfe4f609e2259bfaf8c77b60c535b9370c6c8d9a19a30\" } before sign transaction hex string is 0a8e010a02a9b822081db2070d39d2316640c095dda19a305a70080b126c0a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e467265657a6542616c616e6365436f6e747261637412360a1541e65aca838a9e15dd81bd9532d2ad61300e58cf7110c0843d180350017a15411fafb1e96dfe4f609e2259bfaf8c77b60c535b9370c6c8d9a19a30 Please confirm and input your permission id, if input y or Y means default 0 , other non-numeric characters will cancel transaction. y Please choose your key for sign. The 1th keystore file name is UTC--2022-06-22T08-21-05.158000000Z--TDQgNvjrE6RH749f8aFGyJqEEGyhV4BDEU.json The 2th keystore file name is UTC--2022-06-27T07-37-47.601000000Z--TWyDBTHsWJFhgywWkTNW7vh7jSUxeBaiAw.json Please choose between 1 and 2 2 Please input your password. password: after sign transaction hex string is 0a8e010a02a9b822081db2070d39d2316640e0f7ffab9a305a70080b126c0a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e467265657a6542616c616e6365436f6e747261637412360a1541e65aca838a9e15dd81bd9532d2ad61300e58cf7110c0843d180350017a15411fafb1e96dfe4f609e2259bfaf8c77b60c535b9370c6c8d9a19a301241c45742648e6970e01b242c9b6eca2549c8721b860ced71abd331b9fe925f3c0f184768e0d2e3b580ce787cc6f67d186a0d583226fdb69c2cc8cfc6ec42e389f600 txid is f45cb5ae425796a492d4a9ecac8d60fd48bf78dbcdbe1d92725047c5dfbffba2 FreezeBalance successful !!! unfreezeBalance \u00b6 unstake TRX which staked during stake1.o. wallet>unfreezeBalance [ OwnerAddress ] ResourceCode ( 0 BANDWIDTH,1 ENERGY,2 TRON_POWER ) [ receiverAddress ] OwnerAddress is the address of the account that initiated the transaction, optional, default is the address of the login account. ResourceCode indicates the type of the acquired resource\uff0c0 stands for BANDWIDTH and 1 stands for ENERGY. receiverAddress is the address that will receive the resource. wallet> unfreezebalance TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8 1 TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE { \"raw_data\":{ \"contract\":[ { \"parameter\":{ \"value\":{ \"resource\":\"ENERGY\", \"receiver_address\":\"TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE\", \"owner_address\":\"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" }, \"type_url\":\"type.googleapis.com/protocol.UnfreezeBalanceContract\" }, \"type\":\"UnfreezeBalanceContract\" } ], \"ref_block_bytes\":\"c8b7\", \"ref_block_hash\":\"8842722f2845274d\", \"expiration\":1656915213000, \"timestamp\":1656915154748 }, \"raw_data_hex\":\"0a02c8b722088842722f2845274d40c8f5debe9c305a6c080c12680a34747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e667265657a6542616c616e6365436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d68450017a1541e8bd653015895947cec33d1670a88cf67ab277b970bcaedbbe9c30\" } before sign transaction hex string is 0a8a010a02c8b722088842722f2845274d40c8f5debe9c305a6c080c12680a34747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e667265657a6542616c616e6365436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d68450017a1541e8bd653015895947cec33d1670a88cf67ab277b970bcaedbbe9c30 Please confirm and input your permission id, if input y or Y means default 0, other non-numeric characters will cancel transaction. y Please choose your key for sign. The 1th keystore file name is UTC--2022-06-28T06-52-56.928000000Z--TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej.json The 2th keystore file name is .DS_Store The 3th keystore file name is UTC--2022-04-06T09-43-20.710000000Z--TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8.json The 4th keystore file name is UTC--2022-04-07T09-03-38.307000000Z--TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE.json Please choose between 1 and 4 3 Please input your password. password: after sign transaction hex string is 0a8a010a02c8b722088842722f2845274d40e8dd81c99c305a6c080c12680a34747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e667265657a6542616c616e6365436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d68450017a1541e8bd653015895947cec33d1670a88cf67ab277b970bcaedbbe9c301241593a94650274df29619a6a6946258ea32a22f24a33445f943e3d72cd7d9b8ce7234d188f4bf3a6f0c90cb60af36fc77dc8d376afac9ed840f36dfd68c429fb7e00 txid is 3ea58b3ac2cb05868e70d40f58916312d927c40fd1e4c549554dc3e520c1efde UnfreezeBalance successful !!! getDelegatedResource \u00b6 wallet>getdelegatedresource [fromAddress] [toAddress] Get the information from the fromAddress , which is the resource owner's address, to the toAddress , which is the delegated address who is on behalf of the resource owner. wallet> getdelegatedresource TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8 TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE { \"delegatedResource\" : [ { \"from\" : \"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" , \"to\" : \"TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE\" , \"frozen_balance_for_energy\" : 1000000 , \"expire_time_for_energy\" : 1656660447000 } ] } freezeBalanceV2 \u00b6 Stake 2.0 API: Stake TRX to obtain TRON Power (voting rights) and bandwidth or energy. wallet> freezeBalanceV2 [ OwnerAddress ] frozen_balance ResourceCode ( 0 BANDWIDTH,1 ENERGY,2 TRON_POWER ) OwnerAddress is the address of the account that initiated the transaction, optional, default is the address of the login account. frozen_balance is the amount of frozen TRX, the unit is the smallest unit (Sun), the minimum is 1000000sun. ResourceCode indicates the type of the acquired resource\uff0c0 BANDWIDTH and 1 ENERGY. Example: wallet> freezeBalanceV2 1000000 1 { \"raw_data\" : { \"contract\" : [ { \"parameter\" : { \"value\" : { \"resource\" : \"ENERGY\" , \"frozen_balance\" :1000000, \"owner_address\" : \"TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM\" } , \"type_url\" : \"type.googleapis.com/protocol.FreezeBalanceV2Contract\" } , \"type\" : \"FreezeBalanceV2Contract\" } ] , \"ref_block_bytes\" : \"00bb\" , \"ref_block_hash\" : \"0c237850e9e3c216\" , \"expiration\" :1676620524000, \"timestamp\" :1676620465372 } , \"raw_data_hex\" : \"0a0200bb22080c237850e9e3c21640e0d3fbf2e5305a59083612550a34747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e467265657a6542616c616e63655632436f6e7472616374121d0a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca10c0843d180170dc89f8f2e530\" } before sign transaction hex string is 0a770a0200bb22080c237850e9e3c21640e0d3fbf2e5305a59083612550a34747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e467265657a6542616c616e63655632436f6e7472616374121d0a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca10c0843d180170dc89f8f2e530 Please confirm and input your permission id, if input y or Y means default 0 , other non-numeric characters will cancel transaction. y Please choose your key for sign. The 1th keystore file name is UTC--2023-02-17T02-53-57.163000000Z--THLJLytz6UHwpmDFi5RC43D44dmnh4ZTeL.json The 2th keystore file name is UTC--2023-02-17T07-40-47.121000000Z--TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM.json Please choose between 1 and 2 2 Please input your password. password: after sign transaction hex string is 0a770a0200bb22080c237850e9e3c21640dbb89efde5305a59083612550a34747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e467265657a6542616c616e63655632436f6e7472616374121d0a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca10c0843d180170dc89f8f2e53012419e46cc7b6706ee6a14a541df5f9c518fae9a71ac7a7cc484c48386eb0997a8ab10c41e09feb905c5cc370fe1d15968d22cec2fd2cdc5916adfd3a78c52f8d47000 txid is 1743aa098f5e10ac8b68ccbf0ca6b5f1364a63485e442e6cb03fd33e3331e3fb freezeBalanceV2 successful !!! unfreezeBalanceV2 \u00b6 Stake 2.0 API: Unstake TRX to release bandwidth and energy and at the same time TRON Power will be reclaimed and corresponding votes will be revoked. wallet> unfreezeBalanceV2 [ OwnerAddress ] unfreezeBalance ResourceCode ( 0 BANDWIDTH,1 ENERGY,2 TRON_POWER ) OwnerAddress is the address of the account that initiated the transaction, optional, default is the address of the login account. unfreezeBalance Amount of TRX to be unstaked. the unit is sun. ResourceCode indicates the type of the acquired resource\uff0c0 stands for BANDWIDTH and 1 stands for ENERGY. Example: wallet> unfreezeBalanceV2 1000000 1 { \"raw_data\" : { \"contract\" : [ { \"parameter\" : { \"value\" : { \"resource\" : \"ENERGY\" , \"owner_address\" : \"TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM\" , \"unfreeze_balance\" :1000000 } , \"type_url\" : \"type.googleapis.com/protocol.UnfreezeBalanceV2Contract\" } , \"type\" : \"UnfreezeBalanceV2Contract\" } ] , \"ref_block_bytes\" : \"0132\" , \"ref_block_hash\" : \"0772c1a1727e2ef0\" , \"expiration\" :1676620887000, \"timestamp\" :1676620829314 } , \"raw_data_hex\" : \"0a02013222080772c1a1727e2ef040d8e791f3e5305a5b083712570a36747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e667265657a6542616c616e63655632436f6e7472616374121d0a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca10c0843d18017082a58ef3e530\" } before sign transaction hex string is 0a790a02013222080772c1a1727e2ef040d8e791f3e5305a5b083712570a36747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e667265657a6542616c616e63655632436f6e7472616374121d0a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca10c0843d18017082a58ef3e530 Please confirm and input your permission id, if input y or Y means default 0 , other non-numeric characters will cancel transaction. y Please choose your key for sign. The 1th keystore file name is UTC--2023-02-17T02-53-57.163000000Z--THLJLytz6UHwpmDFi5RC43D44dmnh4ZTeL.json The 2th keystore file name is UTC--2023-02-17T07-40-47.121000000Z--TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM.json Please choose between 1 and 2 2 Please input your password. password: after sign transaction hex string is 0a790a02013222080772c1a1727e2ef040ecd2b4fde5305a5b083712570a36747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e667265657a6542616c616e63655632436f6e7472616374121d0a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca10c0843d18017082a58ef3e530124111bac22e9bc35e1a78c13796893e9f2b81dc99eb26d9ce7a95d0c6a0a9b5588739c52b999acd370b255d178f57bf2abef8881891f23e042ddf83c3551b8bd98e01 txid is f9e114347ea89c5d722d20226817bc41c8a39ea36be756ba216cf450ab3f1fb3 unfreezeBalanceV2 successful !!! delegateResource \u00b6 Stake 2.0 API: delegate bandwidth or energy resource to other address. wallet> delegateResource [ OwnerAddress ] balance ResourceCode ( 0 BANDWIDTH,1 ENERGY ) , ReceiverAddress [ lock ] OwnerAddress is the address of the account that initiated the transaction, optional, default is the address of the login account. balance Amount of TRX staked for resources to be delegated, unit is sun. ResourceCode Resource type, \"BANDWIDTH\" is 0, \"ENERGY\" is 1. ReceiverAddress Receiver address of resource to be delegated to. lock Whether it is locked, if it is set to true, the delegated resources cannot be undelegated within 3 days. When the lock time is not over, if the owner delegates the same type of resources using the lock to the same address, the lock time will be reset to 3 days. optional, default is 0, 0-lock, 1-unlock. Example: wallet> delegateResource 1000000 1 TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g 0 { \"raw_data\" : { \"contract\" : [ { \"parameter\" : { \"value\" : { \"balance\" :1000000, \"resource\" : \"ENERGY\" , \"receiver_address\" : \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\" , \"owner_address\" : \"TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM\" } , \"type_url\" : \"type.googleapis.com/protocol.DelegateResourceContract\" } , \"type\" : \"DelegateResourceContract\" } ] , \"ref_block_bytes\" : \"020c\" , \"ref_block_hash\" : \"54e32e95d11894f8\" , \"expiration\" :1676621547000, \"timestamp\" :1676621487525 } , \"raw_data_hex\" : \"0a02020c220854e32e95d11894f840f88bbaf3e5305a710839126d0a35747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e44656c65676174655265736f75726365436f6e747261637412340a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca100118c0843d221541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e70a5bbb6f3e530\" } before sign transaction hex string is 0a8f010a02020c220854e32e95d11894f840f88bbaf3e5305a710839126d0a35747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e44656c65676174655265736f75726365436f6e747261637412340a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca100118c0843d221541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e70a5bbb6f3e530 Please confirm and input your permission id, if input y or Y means default 0 , other non-numeric characters will cancel transaction. y Please choose your key for sign. The 1th keystore file name is UTC--2023-02-17T02-53-57.163000000Z--THLJLytz6UHwpmDFi5RC43D44dmnh4ZTeL.json The 2th keystore file name is UTC--2023-02-17T07-40-47.121000000Z--TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM.json Please choose between 1 and 2 2 Please input your password. password: after sign transaction hex string is 0a8f010a02020c220854e32e95d11894f84093e9dcfde5305a710839126d0a35747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e44656c65676174655265736f75726365436f6e747261637412340a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca100118c0843d221541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e70a5bbb6f3e5301241414de060e9c104bb45d745e22b7b7a30b4a89a2635c62aab152fff5d2f10b7443023a9aa487be86652b74974ff6a7d82d3dbf94cea9ac1e0a7e48e682175e3f601 txid is 0917002d0068dde7ad4ffe46e75303d11192e17bfa78934a5f867c5ae20720ec delegateResource successful !!! unDelegateResource \u00b6 Stake 2.0 API: undelegate resource. wallet> unDelegateResource [ OwnerAddress ] balance ResourceCode ( 0 BANDWIDTH,1 ENERGY ) , ReceiverAddress OwnerAddress is the address of the account that initiated the transaction, optional, default is the address of the login account. balance Amount of TRX staked for resource to be undelegated, unit is sun. ResourceCode Resource type, \"BANDWIDTH\" is 0, \"ENERGY\" is 1. ReceiverAddress Receiver address of resource to be delegated to. Example: wallet> unDelegateResource 1000000 1 TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g { \"raw_data\" : { \"contract\" : [ { \"parameter\" : { \"value\" : { \"balance\" :1000000, \"resource\" : \"ENERGY\" , \"receiver_address\" : \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\" , \"owner_address\" : \"TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM\" } , \"type_url\" : \"type.googleapis.com/protocol.UnDelegateResourceContract\" } , \"type\" : \"UnDelegateResourceContract\" } ] , \"ref_block_bytes\" : \"0251\" , \"ref_block_hash\" : \"68ac15256c213e71\" , \"expiration\" :1676621754000, \"timestamp\" :1676621695001 } , \"raw_data_hex\" : \"0a020251220868ac15256c213e714090ddc6f3e5305a73083a126f0a37747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e44656c65676174655265736f75726365436f6e747261637412340a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca100118c0843d221541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e709990c3f3e530\" } before sign transaction hex string is 0a91010a020251220868ac15256c213e714090ddc6f3e5305a73083a126f0a37747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e44656c65676174655265736f75726365436f6e747261637412340a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca100118c0843d221541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e709990c3f3e530 Please confirm and input your permission id, if input y or Y means default 0 , other non-numeric characters will cancel transaction. y Please choose your key for sign. The 1th keystore file name is UTC--2023-02-17T02-53-57.163000000Z--THLJLytz6UHwpmDFi5RC43D44dmnh4ZTeL.json The 2th keystore file name is UTC--2023-02-17T07-40-47.121000000Z--TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM.json Please choose between 1 and 2 2 Please input your password. password: after sign transaction hex string is 0a91010a020251220868ac15256c213e7140febde9fde5305a73083a126f0a37747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e44656c65676174655265736f75726365436f6e747261637412340a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca100118c0843d221541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e709990c3f3e530124102ebde16d1abaccd976f8ead4b5acf92b05f7d9796c28ca6a26b4e51442e638e5e33e598bb03732da24dc761a39b9d307c045b55323128dc9b07510ffc48933a01 txid is 537a3f4461ab55c705b77503bc42f469bfc22c0cb8588b8f3641ab40117ebfd8 unDelegateResource successful !!! withdrawExpireUnfreeze \u00b6 Stake 2.0 API: withdraw unfrozen balance. wallet> withdrawExpireUnfreeze [ OwnerAddress ] OwnerAddress is the address of the account that initiated the transaction, optional, default is the address of the login account. Example: wallet> withdrawExpireUnfreeze getavailableunfreezecount \u00b6 Stake 2.0 API: remaining times of executing unstake operation. wallet> getavailableunfreezecount [ OwnerAddress ] OwnerAddress is the address of the account that initiated the transaction, optional, default is the address of the login account. Example: wallet> GetAvailableUnfreezeCount { \"count\" : 30 } getcanwithdrawunfreezeamount \u00b6 Stake 2.0 API: query the withdrawable balance at the specified timestamp. wallet> getcanwithdrawunfreezeamount ownerAddress timestamp OwnerAddress is the address of the account that initiated the transaction, optional, default is the address of the login account. timestamp query cutoff timestamp, in milliseconds. Example: wallet> getcanwithdrawunfreezeamount 1776621695001 { \"amount\" : 4000000 } getcandelegatedmaxsize \u00b6 Stake 2.0 API: query the amount of delegatable resources share of the specified resource type for an address, unit is sun. wallet> getcandelegatedmaxsize ownerAddress type OwnerAddress is the address of the account that initiated the transaction, optional, default is the address of the login account. type resource type, 0 is bandwidth, 1 is energy Example: wallet> getcandelegatedmaxsize 1 { \"max_size\" : 11000000 } getdelegatedresourcev2 \u00b6 Stake 2.0 API\uff1aquery the detail of resource share delegated from fromAddress to toAddress. wallet> getdelegatedresourcev2 fromAddress toAddress fromAddress resource from address. toAddress resource to address. Example: wallet> getdelegatedresourcev2 TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g { \"delegatedResource\" : [ { \"from\" : \"TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM\" , \"to\" : \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\" , \"frozen_balance_for_bandwidth\" : 7000000 , \"frozen_balance_for_energy\" : 3000000 } ] } getdelegatedresourceaccountindexv2 \u00b6 Stake 2.0 API\uff1aquery the resource delegation index by an account. Two lists will return, one is the list of addresses the account has delegated its resources(toAddress), and the other is the list of addresses that have delegated resources to the account(fromAddress). wallet> getdelegatedresourceaccountindexv2 ownerAddress OwnerAddress account address. Example: wallet> getdelegatedresourceaccountindexv2 TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM { \"account\" : \"TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM\" , \"fromAccounts\" : [ \"TUznHJfHe6gdYY7gvWmf6bNZHuPHDZtowf\" ] , \"toAccounts\" : [ \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\" ] } GetAccountNet \u00b6 This command shows the usage of bandwidth for a certain account. wallet> getaccountnet TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8 { \"freeNetUsed\" : 262 , \"freeNetLimit\" : 1500 , \"TotalNetLimit\" : 43200000000 , \"TotalNetWeight\" : 8725123062 } GetAccountResource \u00b6 This command shows the usage of bandwidth and energy for a certain account. wallet> getaccountresource TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8 { \"freeNetUsed\" : 262 , \"freeNetLimit\" : 1500 , \"TotalNetLimit\" : 43200000000 , \"TotalNetWeight\" : 8725123062 , \"tronPowerLimit\" : 1 , \"TotalEnergyLimit\" : 90000000000 , \"TotalEnergyWeight\" : 328098231 } Transaction \u00b6 Here are all the transaction related commands \uff1a SendCoin AddTransactionSign BroadcastTransaction BackupWallet2Base64 GetTransactionApprovedList SendCoin \u00b6 > SendCoin [toAddress] [amount] Here is an example of multi-signed transaction. The accounts permission have assigned as in UpdateAccountPermission section, please check for reference. wallet> SendCoin TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE 10 { \"raw_data\" : { \"contract\" : [ \u00b7\u00b7\u00b7 \"raw_data_hex\" : \"0a029ca12208432ed1fe1357ff7f40c0c484f19a305a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d684121541e8bd653015895947cec33d1670a88cf67ab277b9180a708a8481f19a30\" } before sign transaction hex string is 0a83010a029ca12208432ed1fe1357ff7f40c0c484f19a305a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d684121541e8bd653015895947cec33d1670a88cf67ab277b9180a708a8481f19a30 Please confirm and input your permission id, if input y or Y means default 0 , other non-numeric characters will cancel transaction. 2 Please choose your key for sign. The 1th keystore file name is UTC--2022-06-28T06-52-56.928000000Z--TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej.json The 2th keystore file name is .DS_Store The 3th keystore file name is UTC--2022-04-06T09-43-20.710000000Z--TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8.json The 4th keystore file name is UTC--2022-04-07T09-03-38.307000000Z--TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE.json Please choose between 1 and 4 1 Please input your password. password: Current signWeight is: { \"result\" : { \"code\" : \"NOT_ENOUGH_PERMISSION\" } , \"approved_list\" : [ \"TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej\" ] , \"permission\" : { \"operations\" : \"7fff1fc0033e0000000000000000000000000000000000000000000000000000\" , \"keys\" : [ { \"address\" : \"TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej\" , \"weight\" :1 } , { \"address\" : \"TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE\" , \"weight\" :1 } ] , \"threshold\" :2, \"id\" :2, \"type\" : \"Active\" , \"permission_name\" : \"active12323\" } , \"current_weight\" :1, \"transaction\" : { \"result\" : { \"result\" :true } , \"txid\" : \"ece603ec8ad11578450dc8adf29dd9d9833e733c313fe16a947c8c768f1e4483\" , \"transaction\" : { \"signature\" : [ \"990001e909e638bbaa5de9b392121971d25cabde1391f5e164cd8a14608812df01a273e867c2329b8adb233599c5d353c435e789c777fd3e0b9fe83f0737a91101\" ] , \"txID\" : \"ece603ec8ad11578450dc8adf29dd9d9833e733c313fe16a947c8c768f1e4483\" , \"raw_data\" :\u00b7\u00b7\u00b7, \"raw_data_hex\" : \"0a029ca12208432ed1fe1357ff7f40a2b3a7fb9a305a67080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d684121541e8bd653015895947cec33d1670a88cf67ab277b9180a2802708a8481f19a30\" } } } Please confirm if continue add signature enter y or Y, else any other y Please choose your key for sign. The 1th keystore file name is UTC--2022-06-28T06-52-56.928000000Z--TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej.json The 2th keystore file name is .DS_Store The 3th keystore file name is UTC--2022-04-06T09-43-20.710000000Z--TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8.json The 4th keystore file name is UTC--2022-04-07T09-03-38.307000000Z--TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE.json Please choose between 1 and 4 4 Please input your password. password: after sign transaction hex string is 0a85010a029ca12208432ed1fe1357ff7f40a2b3a7fb9a305a67080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d684121541e8bd653015895947cec33d1670a88cf67ab277b9180a2802708a8481f19a301241990001e909e638bbaa5de9b392121971d25cabde1391f5e164cd8a14608812df01a273e867c2329b8adb233599c5d353c435e789c777fd3e0b9fe83f0737a91101124141ba3ffe9c7bb1ed184df8bf635d8c987982b2f4b22c447666ac82726f4a97cb2ef4d3fabd64137b8d59239bd7173c74264733ed140ccd04934a88c438de1cab00 txid is ece603ec8ad11578450dc8adf29dd9d9833e733c313fe16a947c8c768f1e4483 Send 10 Sun to TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE successful !! A permission_id is always required, it is \"0\" by default, which means this transaction only needed to be sign by owner. In the example above, we enter \"2\" to make a multi-signed transaction this time, needs the two accounts assigned actives permission in UpdateAccountPermission section above to sign this transaction. In the example, we picked the account TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej to sign first, after that, it asks you if want to add another sign ,enter y and pick the account TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE to finish multi-signing. The weight of each account is 1 and the granting threshold is 2. When the requirements are met, the transaction is done successfully! This is how multiple accounts user multi-signature when using the same cli. AddTransactionSign \u00b6 Use the instruction addTransactionSign according to the obtained transaction hex string if signing at multiple cli. wallet> addtransactionsign 0a83010a0241aa2208b2d2c13c86e8bd884098acb1cf9a305a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d684121541e8bd653015895947cec33d1670a88cf67ab277b9180a70e8e1adcf9a30 Please input permission id. 0 Please choose your key for sign. The 1th keystore file name is UTC--2022-06-28T06-52-56.928000000Z--TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej.json The 2th keystore file name is .DS_Store The 3th keystore file name is UTC--2022-04-06T09-43-20.710000000Z--TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8.json The 4th keystore file name is UTC--2022-04-07T09-03-38.307000000Z--TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE.json Please choose between 1 and 4 3 Please input your password. password: { \"signature\" : [ \"dbfe007bb44e8db164f4c0cf9b586a8d6a65f0612c4d9ec5350adeae6cd97c7874e7254bbf4156b545a90c34e48c8f28bdb5c8f9258514233b9201b2844d7f9201\" ] , \"txID\" : \"6e1d2460796f717b701e355734ac0e4e8b32e14c24ce569a60ad3f63afe46c87\" , \"raw_data\" : { \"contract\" : [ { \"parameter\" : { \"value\" : { \"amount\" :10, \"owner_address\" : \"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" , \"to_address\" : \"TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE\" } , \"type_url\" : \"type.googleapis.com/protocol.TransferContract\" } , \"type\" : \"TransferContract\" } ] , \"ref_block_bytes\" : \"41aa\" , \"ref_block_hash\" : \"b2d2c13c86e8bd88\" , \"expiration\" :1656434882649, \"timestamp\" :1656413188328 } , \"raw_data_hex\" : \"0a0241aa2208b2d2c13c86e8bd8840d9f0d9d99a305a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d684121541e8bd653015895947cec33d1670a88cf67ab277b9180a70e8e1adcf9a30\" } Transaction hex string is 0a83010a0241aa2208b2d2c13c86e8bd8840d9f0d9d99a305a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d684121541e8bd653015895947cec33d1670a88cf67ab277b9180a70e8e1adcf9a301241dbfe007bb44e8db164f4c0cf9b586a8d6a65f0612c4d9ec5350adeae6cd97c7874e7254bbf4156b545a90c34e48c8f28bdb5c8f9258514233b9201b2844d7f9201 After signing, the users will need to broadcast final transactions manually. BroadcastTransaction \u00b6 Broadcast the transaction, where the transaction is in hex string format. wallet> broadcasttransaction 0a83010a0241aa2208b2d2c13c86e8bd8840d9f0d9d99a305a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d684121541e8bd653015895947cec33d1670a88cf67ab277b9180a70e8e1adcf9a301241dbfe007bb44e8db164f4c0cf9b586a8d6a65f0612c4d9ec5350adeae6cd97c7874e7254bbf4156b545a90c34e48c8f28bdb5c8f9258514233b9201b2844d7f9201 BroadcastTransaction successful !!! GetTransactionApprovedList \u00b6 Get signature information according to transactions. wallet> getTransactionApprovedList 0a8c010a020318220860e195d3609c86614096eadec79d2d5a6e080112680a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412370a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18808084fea6dee11128027094bcb8bd9d2d1241c18ca91f1533ecdd83041eb0005683c4a39a2310ec60456b1f0075b4517443cf4f601a69788f001d4bc03872e892a5e25c618e38e7b81b8b1e69d07823625c2b0112413d61eb0f8868990cfa138b19878e607af957c37b51961d8be16168d7796675384e24043d121d01569895fcc7deb37648c59f538a8909115e64da167ff659c26101 { \"result\" : { } , \"approved_list\" : [ \"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" ] , \"transaction\" : { \"result\" : { \"result\" :true } , \"txid\" : \"6e1d2460796f717b701e355734ac0e4e8b32e14c24ce569a60ad3f63afe46c87\" , \"transaction\" : { \"signature\" : [ \"dbfe007bb44e8db164f4c0cf9b586a8d6a65f0612c4d9ec5350adeae6cd97c7874e7254bbf4156b545a90c34e48c8f28bdb5c8f9258514233b9201b2844d7f9201\" ] , \"txID\" : \"6e1d2460796f717b701e355734ac0e4e8b32e14c24ce569a60ad3f63afe46c87\" , \"raw_data\" : { \"contract\" : [ { \"parameter\" : { \"value\" : { \"amount\" :10, \"owner_address\" : \"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" , \"to_address\" : \"TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE\" } , \"type_url\" : \"type.googleapis.com/protocol.TransferContract\" } , \"type\" : \"TransferContract\" } ] , \"ref_block_bytes\" : \"41aa\" , \"ref_block_hash\" : \"b2d2c13c86e8bd88\" , \"expiration\" :1656434882649, \"timestamp\" :1656413188328 } , \"raw_data_hex\" : \"0a0241aa2208b2d2c13c86e8bd8840d9f0d9d99a305a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d684121541e8bd653015895947cec33d1670a88cf67ab277b9180a70e8e1adcf9a30\" } } } On-ChainInquire \u00b6 Here are all the on-chain inquire commands \uff1a GetNextMaintenanceTime ListNodes GetBlock GetBlockbyID GetBlockbyLatestNum GetBlockbyLimitNext GetTransactionbyID GetTransactionCountbyBlockNum GetTransactionInfobyID GetTransactionInfobyBlockNum GetTransactionSignWeight GetNextMaintenanceTime \u00b6 Get the start time of the next maintain period wallet> GetNextMaintenanceTime Next maintenance time is : 2022-06-29 16:40:00 ListNodes \u00b6 Get other peers' information wallet> listnodes IP::1.23.456.789 Port::12345 IP::2.345.67.89 Port::12345 IP::345.678.901.234 Port::12345 \u00b7\u00b7\u00b7 GetBlock \u00b6 Get the block by block height; if you do not pass the parameter, get the latest block wallet> getblock Get current block !!! { \"block_header\" : { \"raw_data\" : { \"number\" :27774469, \"txTrieRoot\" : \"0000000000000000000000000000000000000000000000000000000000000000\" , \"witness_address\" : \"TQuzjxWcqHSh1xDUw4wmMFmCcLjz4wSCBp\" , \"parentHash\" : \"0000000001a7ce048eb88d7c3c5e9c5f8e93a6cc568f47140e243d00d0f9280a\" , \"version\" :24, \"timestamp\" :1656919215000 } , \"witness_signature\" : \"3af25276891b1cf7f9f72e63ad956b50e5819fb3fa6f0b6393ed092e53a90a5438620b92b5d499e0068c6775b723e3c90677157b3e9f7b8933d1e863716145f500\" } } GetBlockbyID \u00b6 Get block based on blockID\uff08block hash\uff09 wallet> getblockbyid [blockID] wallet> getblockbyid 0000000001a7cd54ee2b302cfd443cccec78e55a31902d2e7ea47e737c1a5ede { \"block_header\" : { \"raw_data\" : { \"number\" :27774292, \"txTrieRoot\" : \"a60f8cb160d06d5279cb463925274e18fec37f0414c4d8fdc4fb2299ccb0a8bf\" , \"witness_address\" : \"TGsdxpHNJaxsVNFFdb4R6Rib1TsKGon2Wp\" , \"parentHash\" : \"0000000001a7cd53685867286b17fa0f2389e1d3026bea0a0019c5fc37f873cb\" , \"version\" :24, \"timestamp\" :1656918678000 } , \"witness_signature\" : \"a93db1a8d989c6637d587369de2872a008f14d1df8f0aaeda8a54c324a44c269367ea31daf623834fd6a4ef3f6150ab8d370adff1df6c0e8c96af9cf34408d5600\" } , \u00b7\u00b7\u00b7 GetBlockByLatestNum \u00b6 Get the latest n blocks, where 0 < n < 100 wallet> getblockbylatestnum [n] GetBlockByLimitNext \u00b6 Get the block in a set range by block height. startBlock is the starting block height, endBlock is the ending block height. wallet> GetBlockByLimitNext [startBlock, endBlock] wallet> getblockbylimitnext 27774670 27774674 [ { \"block_header\" : { \"raw_data\" : { \"number\" :27774670, \"txTrieRoot\" : \"0eb9ba48deda22fafa613c0aefa6d3e0b21261ad82a126ce99a6b80e8b68045c\" , \"witness_address\" : \"TVKfvNUMcZdZbxhPLb2CkQ4nyUUhvwhv1b\" , \"parentHash\" : \"0000000001a7cecd7a2cdc58fdfd2edbfeaeb530958879bf1a299cc30043cd0b\" , \"version\" :24, \"timestamp\" :1656919824000 } , \"witness_signature\" : \"ee6653289e24edd24d70f4975e12934573d6e798a2a5c5e26e0b13bc6d25138c49a0f55fb0e9a5c503622b5877811403577a5e278528293d05c5f0b9d5d5542401\" } , \u00b7\u00b7\u00b7 GetTransactionbyID \u00b6 Get transaction information based on transaction id (hash) wallet> GetTransactionById [transactionID] GetTransactionCountbyBlockNum \u00b6 Get how many transactions contains in a block based on block height, see below wallet> gettransactioncountbyblocknum 27633562 The block contains 4 transactions GetTransactionInfobyID \u00b6 Get transaction-info based on transaction id, generally used to check the result of a smart contract trigger wallet> gettransactioninfobyid 6e1d2460796f717b701e355734ac0e4e8b32e14c24ce569a60ad3f63afe46c87 { \"id\": \"6e1d2460796f717b701e355734ac0e4e8b32e14c24ce569a60ad3f63afe46c87\", \"blockNumber\": 27609041, \"blockTimeStamp\": 1656417906000, \"contractResult\": [ \"\" ], \"receipt\": { \"net_usage\": 265 } } GetTransactionInfobyBlockNum \u00b6 Get the list of transaction information in the block based on the block height wallet> gettransactioninfobyblocknum [blockNum] GetTransactionSignWeight \u00b6 Get the sign weight by transaction hex string. >getTransactionSignWeight 0a83010a0241aa2208b2d2c13c86e8bd8840d9f0d9d99a305a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d684121541e8bd653015895947cec33d1670a88cf67ab277b9180a70e8e1adcf9a301241dbfe007bb44e8db164f4c0cf9b586a8d6a65f0612c4d9ec5350adeae6cd97c7874e7254bbf4156b545a90c34e48c8f28bdb5c8f9258514233b9201b2844d7f9201 The information displays as follows: { \"result\":{ }, \"approved_list\":[ \"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" ], \"permission\":{ \"keys\":[ { \"address\":\"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\", \"weight\":1 } ], \"threshold\":1, \"permission_name\":\"owner\" }, \"current_weight\":1, \"transaction\":{ \"result\":{ \"result\":true }, \"txid\":\"6e1d2460796f717b701e355734ac0e4e8b32e14c24ce569a60ad3f63afe46c87\", \"transaction\":{ \"signature\":[ \"dbfe007bb44e8db164f4c0cf9b586a8d6a65f0612c4d9ec5350adeae6cd97c7874e7254bbf4156b545a90c34e48c8f28bdb5c8f9258514233b9201b2844d7f9201\" ], \u00b7\u00b7\u00b7 } } } SmartContract \u00b6 Below, please find all the commands for smart contract interactions: DeployContract TriggerContract TriggerConstantContract EstimateEnergy GetContract UpdateEnergyLimit UpdateSetting DeployContract \u00b6 wallet> DeployContract [ ownerAddress ] [ contractName ] [ ABI ] [ byteCode ] [ constructor ] [ params ] [ isHex ] [ fee_limit ] [ consume_user_resource_percent ] [ origin_energy_limit ] [ value ] [ token_value ] [ token_id ]( e.g: TRXTOKEN, use # if don't provided) library:address,...> OwnerAddress is the address of the account that initiated the transaction, optional, considered as the address of the login account by default. contractName is the name of smart contract. ABI is ABI code generated when compiling. byteCode is byte code generated when compiling. constructor , params , isHex These three parameters define the format of the bytecode, which determines the way to parse byteCode from parameters. fee_limit determines the limit of consumed TRX for each transaction. consume_user_resource_percent is the percentage of user consumed resource, in the range between [0, 100%]. origin_energy_limit is the most amount of developer energy consumed by triggering the contract once. value is the amount of trx transferred to the contract account. token_value is the number of TRC-10 token. token_id is TRC-10 Id. Example: wallet> deployContract normalcontract544 [{ \"constant\" :false, \"inputs\" : [{ \"name\" : \"i\" , \"type\" : \"uint256\" }] , \"name\" : \"findArgsByIndexTest\" , \"outputs\" : [{ \"name\" : \"z\" , \"type\" : \"uint256\" }] , \"payable\" :false, \"stateMutability\" : \"nonpayable\" , \"type\" : \"function\" }] 608060405234801561001057600080fd5b50610134806100206000396000f3006080604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663329000b58114610045575b600080fd5b34801561005157600080fd5b5061005d60043561006f565b60408051918252519081900360200190f35b604080516003808252608082019092526000916060919060208201838038833901905050905060018160008151811015156100a657fe5b602090810290910101528051600290829060019081106100c257fe5b602090810290910101528051600390829060029081106100de57fe5b6020908102909101015280518190849081106100f657fe5b906020019060200201519150509190505600a165627a7a72305820b24fc247fdaf3644b3c4c94fcee380aa610ed83415061ff9e65d7fa94a5a50a00029 # # false 1000000000 75 50000 0 0 # Get the result of the contract execution with the getTransactionInfoById command: wallet> getTransactionInfoById 4978dc64ff746ca208e51780cce93237ee444f598b24d5e9ce0da885fb3a3eb9 { \"id\" : \"8c1f57a5e53b15bb0a0a0a0d4740eda9c31fbdb6a63bc429ec2113a92e8ff361\" , \"fee\" : 6170500 , \"blockNumber\" : 1867 , \"blockTimeStamp\" : 1567499757000 , \"contractResult\" : [ \"6080604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663329000b58114610045575b600080fd5b34801561005157600080fd5b5061005d60043561006f565b60408051918252519081900360200190f35b604080516003808252608082019092526000916060919060208201838038833901905050905060018160008151811015156100a657fe5b602090810290910101528051600290829060019081106100c257fe5b602090810290910101528051600390829060029081106100de57fe5b6020908102909101015280518190849081106100f657fe5b906020019060200201519150509190505600a165627a7a72305820b24fc247fdaf3644b3c4c94fcee380aa610ed83415061ff9e65d7fa94a5a50a00029\" ] , \"contract_address\" : \"TJMKWmC6mwF1QVax8Sy2AcgT6MqaXmHEds\" , \"receipt\" : { \"energy_fee\" : 6170500 , \"energy_usage_total\" : 61705 , \"net_usage\" : 704 , \"result\" : \"SUCCESS\" } } TriggerContract \u00b6 The command is used to trigger smart contract that deployed. wallet> TriggerContract [ ownerAddress ] [ contractAddress ] [ method ] [ args ] [ isHex ] [ fee_limit ] [ value ] [ token_value ] [ token_id ] OwnerAddress The address of the account that initiated the transaction, optional, default value is the address of the login account. ContractAddress is the smart contarct address. method is the name of the function and parameters, please refer to the example below. args is a parameter for placeholding, pass '#' instead when method does not need extra parameters. isHex controls the format of the parameters method and args, whether they are in hex string or not. fee_limit is the most amount of trx allows for consumption. token_value indicate the number of TRC-10 token. token_id the TRC-10 token id, If not, use \u2018#\u2019 instead. Here is an example: wallet> triggerContract TGdtALTPZ1FWQcc5MW7aK3o1ASaookkJxG findArgsByIndexTest ( uint256 ) 0 false 1000000000 0 0 # Get the result of the contract execution with the getTransactionInfoById command, wallet> getTransactionInfoById 7d9c4e765ea53cf6749d8a89ac07d577141b93f83adc4015f0b266d8f5c2dec4 { \"id\" : \"de289f255aa2cdda95fbd430caf8fde3f9c989c544c4917cf1285a088115d0e8\" , \"fee\" : 8500 , \"blockNumber\" : 2076 , \"blockTimeStamp\" : 1567500396000 , \"contractResult\" : [ \"\" ] , \"contract_address\" : \"TJMKWmC6mwF1QVax8Sy2AcgT6MqaXmHEds\" , \"receipt\" : { \"energy_fee\" : 8500 , \"energy_usage_total\" : 85 , \"net_usage\" : 314 , \"result\" : \"REVERT\" } , \"result\" : \"FAILED\" , \"resMessage\" : \"REVERT opcode executed\" } TriggerConstantContract \u00b6 Invoke the readonly function (modified by the view or pure modifier) of a contract for contract data query; or Invoke the non-readonly function of a contract for predicting whether the transaction can be successfully executed or estimating the energy consumption. wallet> TriggerConstantContract ownerAddress(use # if you own) contractAddress method args isHex [value token_value token_id(e.g: TRXTOKEN, use # if don't provided)] ownerAddress Owner address that triggers the contract. If it is the login account, please input #. contractAddress Smart contract address. method Function call. args Parameters, if there is no parameter of method , please input #. isHex args is hex string or not\u3002 value TRX amount to be transferred. Optional, if no value, # can be inplaced. token_value TRC-10 token amount to be transferred. Optional, if no value, # can be inplaced. token_id TRC-10 token id to be transferred. Optional, if no value, # can be inplaced. Example: wallet> TriggerConstantContract TTGhREx2pDSxFX555NWz1YwGpiBVPvQA7e TVSvjZdyDSNocHm7dP3jvCmMNsCnMTPa5W transfer ( address,uint256 ) 0000000000000000000000002ce5de57373427f799cc0a3dd03b841322514a8c00000000000000000000000000000000000000000000000000038d7ea4c68000 true transfer ( address,uint256 ) :a9059cbb Execution result = { \"constant_result\" : [ \"0000000000000000000000000000000000000000000000000000000000000001\" ] , \"result\" : { \"result\" : true } , \"energy_used\" : 13253 , \"logs\" : [ { \"address\" : \"LUijWGF4iFrT7hV37Q2Q45DU5TUBvVZb7\" , \"topics\" : [ \"ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\" , \"000000000000000000000000bdc8ee51fdd1b1e01d71f836481828f88463c838\" , \"0000000000000000000000002ce5de57373427f799cc0a3dd03b841322514a8c\" ] , \"data\" : \"00000000000000000000000000000000000000000000000000038d7ea4c68000\" } ] } EstimateEnergy \u00b6 Estimate the energy required for the successful execution of smart contract transactions. But for FullNode, enabling the wallet/estimateEnergy API is optional. So please pay attention that when developers call wallet/estimateEnergy, if the error message shows that the node does not support this function when calling the new API (this node does not support estimate energy), it is recommended to continue using the wallet/triggerconstantcontract API to estimate energy consumption. wallet> EstimateEnergy ownerAddress contractAddress method args isHex [value token_value token_id] ownerAddress Owner address that triggers the contract. If it is the login account, please input #. contractAddress Smart contract address. method Function call. args Parameters, if there is no parameter of method , please input #. isHex args is hex string or not\u3002 value TRX amount to be transferred. Optional, if no value, # can be inplaced. token_value TRC-10 token amount to be transferred. Optional, if no value, # can be inplaced. token_id TRC-10 token id to be transferred. Optional, if no value, # can be inplaced. Example: wallet> EstimateEnergy TTGhREx2pDSxFX555NWz1YwGpiBVPvQA7e TVSvjZdyDSNocHm7dP3jvCmMNsCnMTPa5W transfer ( address,uint256 ) 0000000000000000000000002ce5de57373427f799cc0a3dd03b841322514a8c00000000000000000000000000000000000000000000000000038d7ea4c68000 true transfer ( address,uint256 ) :a9059cbb Estimate energy result = { \"result\" : { \"result\" : true } , \"energy_required\" : 14910 } GetContract \u00b6 Get the smart contract info by its address. wallet> GetContract [contractAddress] Example: wallet> GetContract TGdtALTPZ1FWQcc5MW7aK3o1ASaookkJxG { \"origin_address\" : \"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ\" , \"contract_address\" : \"TJMKWmC6mwF1QVax8Sy2AcgT6MqaXmHEds\" , \"abi\" : { \"entrys\" : [ { \"name\" : \"findArgsByIndexTest\" , \"inputs\" : [ { \"name\" : \"i\" , \"type\" : \"uint256\" } ] , \"outputs\" : [ { \"name\" : \"z\" , \"type\" : \"uint256\" } ] , \"type\" : \"Function\" , \"stateMutability\" : \"Nonpayable\" } ] } , \"bytecode\" : \"608060405234801561001057600080fd5b50610134806100206000396000f3006080604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663329000b58114610045575b600080fd5b34801561005157600080fd5b5061005d60043561006f565b60408051918252519081900360200190f35b604080516003808252608082019092526000916060919060208201838038833901905050905060018160008151811015156100a657fe5b602090810290910101528051600290829060019081106100c257fe5b602090810290910101528051600390829060029081106100de57fe5b6020908102909101015280518190849081106100f657fe5b906020019060200201519150509190505600a165627a7a72305820b24fc247fdaf3644b3c4c94fcee380aa610ed83415061ff9e65d7fa94a5a50a00029\" , \"consume_user_resource_percent\" : 75 , \"name\" : \"normalcontract544\" , \"origin_energy_limit\" : 50000 , \"code_hash\" : \"23423cece3b4866263c15357b358e5ac261c218693b862bcdb90fa792d5714e6\" } UpdateEnergyLimit \u00b6 Update parameter energy limit\uff0cparameter are the same as above. wallet> UpdateEnergyLimit [ ownerAddress ] [ contract_address ] [ energy_limit ] UpdateSetting \u00b6 Update parameter of energy consume percentage per user wallet> UpdateSetting [ ownerAddress ] contract_address consume_user_resource_percent TRC-10 \u00b6 Below, please find all the commands for TRC-10: AssetIssue UpdateAsset TransferAsset ParticipateAssetissue UnfreezeAsset ListAssetIssue GetAssetIssuebyAccount GetAssetIssuebyID GetAssetIssuebyName GetAssetIssueListbyName AssetIssue \u00b6 Each account is allowed to issue only ONE TRC-10 token. wallet> AssetIssue [ OwnerAddress ] [ AssetName ] [ AbbrName ] [ TotalSupply ] [ TrxNum ] [ AssetNum ] [ Precision ] [ StartDate ] [ EndDate ] [ Description Url ] [ FreeNetLimitPerAccount ] [ PublicFreeNetLimit ] [ FrozenAmount0 ] [ FrozenDays0 ] [ ... ] [ FrozenAmountN ] [ FrozenDaysN ] OwnerAddress (optional) is the address of the account which initiated the transaction. Default: the address of the login account. AssetName is the name of the issued TRC-10 token. AbbrName is the abbreviation of TRC-10 token you want to issue. TotalSupply is total issuing amount of TRC-10 token. TotalSupply = Account Balance of Issuer + All Frozen Token Amount Account Balance Of Issuer: balance at the time of issuance All Frozen Token Amount: Before asset transfer and the issuance TrxNum , AssetNum are two parameters determine the exchange rate when the token is issued. Exchange Rate = TrxNum / AssetNum AssetNum : Unit in the base unit of the issued token TrxNum : Unit in SUN (0.000001 TRX) Precision indicates how many decimal places there is. FreeNetLimitPerAccount determines the maximum amount of bandwidth each account is allowed to use. Token issuers can freeze TRX to obtain bandwidth (TransferAssetContract only) PublicFreeNetLimit is the maximum total amount of bandwidth which is allowed to use for all accounts. Token issuers can freeze TRX to obtain bandwidth (TransferAssetContract only) StartDate , EndDate is the start and end date of token issuance. Within this period time, other users can participate in token issuance. FrozenAmount0 , FrozenDays0 determines the amount and days of token freeze. FrozenAmount0 : Must be bigger than 0. FrozenDays0 : Must between 1 and 3652. Example: wallet> AssetIssue TestTRX TRX 75000000000000000 1 1 2 \"2019-10-02 15:10:00\" \"2020-07-11\" \"just for test121212\" www.test.com 100 100000 10000 10 10000 1 wallet> GetAssetIssueByAccount TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ # View published information { \"assetIssue\" : [ { \"owner_address\" : \"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ\" , \"name\" : \"TestTRX\" , \"abbr\" : \"TRX\" , \"total_supply\" : 75000000000000000 , \"frozen_supply\" : [ { \"frozen_amount\" : 10000 , \"frozen_days\" : 1 } , { \"frozen_amount\" : 10000 , \"frozen_days\" : 10 } ] , \"trx_num\" : 1 , \"precision\" : 2 , \"num\" : 1 , \"start_time\" : 1570000200000 , \"end_time\" : 1594396800000 , \"description\" : \"just for test121212\" , \"url\" : \"www.test.com\" , \"free_asset_net_limit\" : 100 , \"public_free_asset_net_limit\" : 100000 , \"id\" : \"1000001\" } ] } UpdateAsset \u00b6 wallet> UpdateAsset [OwnerAddress] [newLimit] [newPublicLimit] [description url] Specific meaning of the parameters are the same as they are in AssetIssue. Example: wallet> UpdateAsset 1000 1000000 \"change description\" www.changetest.com wallet> GetAssetIssueByAccount TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ # to check the modified information { \"assetIssue\" : [ { \"owner_address\" : \"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ\" , \"name\" : \"TestTRX\" , \"abbr\" : \"TRX\" , \"total_supply\" : 75000000000000000 , \"frozen_supply\" : [ { \"frozen_amount\" : 10000 , \"frozen_days\" : 1 } , { \"frozen_amount\" : 10000 , \"frozen_days\" : 10 } ] , \"trx_num\" : 1 , \"precision\" : 2 , \"num\" : 1 , \"start_time\" : 1570000200000 , \"end_time\" : 1594396800000 , \"description\" : \"change description\" , \"url\" : \"www.changetest.com\" , \"free_asset_net_limit\" : 1000 , \"public_free_asset_net_limit\" : 1000000 , \"id\" : \"1000001\" } ] } TransferAsset \u00b6 > TransferAsset [OwnerAddress] [ToAddress] [AssertID] [Amount] OwnerAddress (optional) is the address of the account which initiated the transaction. By default, the address of the login account. ToAddress is the address of the target account. AssertName is the TRC-10 token ID. Example: 1000001 Amount is the number of TRC10 token to transfer with. Example: wallet> TransferAsset TN3zfjYUmMFK3ZsHSsrdJoNRtGkQmZLBLz 1000001 1000 wallet> getaccount TN3zfjYUmMFK3ZsHSsrdJoNRtGkQmZLBLz # to check target account information after the transfer address: TN3zfjYUmMFK3ZsHSsrdJoNRtGkQmZLBLz assetV2 { id: 1000001 balance: 1000 latest_asset_operation_timeV2: null free_asset_net_usageV2: 0 } ParticipateAssetissue \u00b6 > ParticipateAssetIssue [OwnerAddress] [ToAddress] [AssetID] [Amount] OwnerAddress (optional) is the address of the account which initiated the transaction. Default: the address of the login account. ToAddress is the account address of TRC10 issuers. AssertName is the TRC-10 token ID. Example: 1000001 Amount is the number of TRC10 token to transfers with. The participation process must happen during the release of TRC10, otherwise an error may occur. Example: wallet> ParticipateAssetIssue TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ 1000001 1000 wallet> getaccount TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW # View remaining balance address: TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW assetV2 { id: 1000001 balance: 1000 latest_asset_operation_timeV2: null free_asset_net_usageV2: 0 } UnfreezeAsset \u00b6 To unfreeze all TRC10 token which are supposed to be unfrozen after the freezing period. wallet> unfreezeasset [OwnerAddress] ListAssetIssue \u00b6 Obtain all of the published TRC10 token information. wallet> listassetissue { \"assetIssue\" : [ { \"owner_address\" : \"TMWXhuxiT1KczhBxCseCDDsrhmpYGUcoA9\" , \"name\" : \"tronlink_token\" , \"abbr\" : \"tronlink_token\" , \"total_supply\" : 1000000000000000 , \"frozen_supply\" : [ { \"frozen_amount\" : 1 , \"frozen_days\" : 1 } ] , \"trx_num\" : 1 , \"precision\" : 6 , \"num\" : 1 , \"start_time\" : 1574757000000 , \"end_time\" : 1757595000000 , \"description\" : \"Description\" , \"url\" : \"https://blog.csdn.net/u010270891/article/details/82978260\" , \"free_asset_net_limit\" : 1000 , \"public_free_asset_net_limit\" : 2000 , \"id\" : \"1000001\" } , \u00b7\u00b7\u00b7 GetAssetIssuebyAccount \u00b6 Obtain TRC10 token information based on owner address. wallet> getassetissuebyaccount [owneraddress] wallet> getassetissuebyaccount TUwjpfqW7NG6BF3GCTrKy1aDvfchwSG4tN { \"assetIssue\" : [ { \"owner_address\" : \"TUwjpfqW7NG6BF3GCTrKy1aDvfchwSG4tN\" , \"name\" : \"h00966\" , \"abbr\" : \"h00966\" , \"total_supply\" : 100000000000 , \"trx_num\" : 1000000 , \"precision\" : 6 , \"num\" : 1000000 , \"start_time\" : 1656374400000 , \"end_time\" : 1656460800000 , \"description\" : \"Automated gaming platform. TRC10 token h0966. More info on website. TRC10 token h0966. More info on website. More info on website.\" , \"url\" : \"https://h00966.com\" , \"id\" : \"1004901\" } ] } GetAssetIssuebyID \u00b6 Obtain TRC10 token Information based on token ID. wallet> GetAssetIssueById 1004901 { \"owner_address\" : \"TUwjpfqW7NG6BF3GCTrKy1aDvfchwSG4tN\" , \"name\" : \"h00966\" , \"abbr\" : \"h00966\" , \"total_supply\" : 100000000000 , \"trx_num\" : 1000000 , \"precision\" : 6 , \"num\" : 1000000 , \"start_time\" : 1656374400000 , \"end_time\" : 1656460800000 , \"description\" : \"Automated gaming platform. TRC10 token h0966. More info on website.TRC10 token h0966. More info on website.More info on website.\" , \"url\" : \"https://h00966.com\" , \"id\" : \"1004901\" } GetAssetIssuebyName \u00b6 Obtain TRC10 token Information based on token names. wallet> GetAssetIssueByname h00966 { \"owner_address\" : \"TUwjpfqW7NG6BF3GCTrKy1aDvfchwSG4tN\" , \"name\" : \"h00966\" , \"abbr\" : \"h00966\" , \"total_supply\" : 100000000000 , \"trx_num\" : 1000000 , \"precision\" : 6 , \"num\" : 1000000 , \"start_time\" : 1656374400000 , \"end_time\" : 1656460800000 , \"description\" : \"Automated gaming platform. TRC10 token h0966. More info on website.TRC10 token h0966. More info on website.More info on website.\" , \"url\" : \"https://h00966.com\" , \"id\" : \"1004901\" } GetAssetIssueListbyName \u00b6 Obtain a list of TRC10 token information based on names. wallet> GetAssetIssueListByName ROFLOTOKEN { \"assetIssue\": [ { \"owner_address\": \"TLvQSVH9Hm7kxLFtTP228fN6pCrHmtVjpb\", \"name\": \"ROFLOTOKEN\", \"abbr\": \"roflotoken\", \"total_supply\": 10000000000000000, \"trx_num\": 1000000, \"precision\": 6, \"num\": 100000000, \"start_time\": 1656349200000, \"end_time\": 1656435600000, \"description\": \"roflotoken.com\", \"url\": \"https://haxibaibo.com/\", \"id\": \"1004898\" } ] } Governance \u00b6 Any proposal-related operations, except for viewing operations, must be performed by committee members. Please find all the commands for Governance: CreateProposal ApproveProposal DeleteProposal ListProposals ListProposalsPaginated GetProposal VoteWitness ListWitnesses GetBrokerage GetReward UpdateBrokerage CreatProposal \u00b6 Initiate a proposal with createProposal. wallet> createProposal [ OwnerAddress ] [ id0 ] [ value0 ] ... [ idN ] [ valueN ] OwnerAddress (optional) is the address of the account which initiated the transaction. By default, it is the address of the login account. id0 is the serial number of TRON Network Parameter. Of which, each one has a serial number corresponded. Please refer to http://tronscan.org/#/sr/committee . Value0 is the modified value. In the example, modification No.4 (modifying token issuance fee) costs 1000TRX as follows: wallet> createProposal 4 1000 wallet> listproposals # to check initiated proposal { \"proposals\" : [ { \"proposal_id\" : 1 , \"proposer_address\" : \"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ\" , \"parameters\" : [ { \"key\" : 4 , \"value\" : 1000 } ] , \"expiration_time\" : 1567498800000 , \"create_time\" : 1567498308000 } ] } The corresponding id is 1. ApproveProposal \u00b6 Approve or disapprove a proposal using approveProposal. wallet> approveProposal [ OwnerAddress ] [ id ] [ is_or_not_add_approval ] OwnerAddress (optional) is the address of the account which initiated the transaction. Default: the address of the login account. id is the ID of the initiated proposal. Example: 1. is_or_not_add_approval is true for approve; is false for disapprove. Example: wallet> ApproveProposal 1 true # in favor of the offer wallet> ApproveProposal 1 false # Cancel the approved proposal DeleteProposal \u00b6 wallet> deleteProposal [OwnerAddress] [proposalId] proposalId is the ID of the initiated proposal. Example: 1. The proposal must be canceled by the supernode that initiated the proposal. Example\uff1a wallet> DeleteProposal 1 ListProposals \u00b6 Obtain a list of initiated proposals wallet> listproposals { \"proposals\" : [ { \"proposal_id\" : 12732 , \"proposer_address\" : \"TQ4eBJna51sew13DBLd7YjEHHHW7fkNzc2\" , \"parameters\" : [ { \"key\" : 65 , \"value\" : 1 } , { \"key\" : 66 , \"value\" : 1 } , { \"key\" : 62 , \"value\" : 432000000 } ] , \"expiration_time\" : 1656491400000 , \"create_time\" : 1656490794000 , \"approvals\" : [ \"TQ4eBJna51sew13DBLd7YjEHHHW7fkNzc2\" ] , \"state\" : \"DISAPPROVED\" } , { \u00b7\u00b7\u00b7 ListProposalsPaginated \u00b6 Use the paging mode to obtain the initiated proposal. wallet> ListProposalsPaginated [offset] [limit] offset is the number of proposals you want to skip. limit is the number of proposals you want to be listed. By default, all proposals would be listed from proposal_id 1 to date. The parameter in the example below means you want to skip the first 33 proposals and list the 2 proposals right after that. wallet> listproposalspaginated 33 2 { \"proposals\" : [ { \"proposal_id\" : 34 , \"proposer_address\" : \"TEDguVMSsFw3HSizQXFK1BsrGWeuRMNN7t\" , \"parameters\" : [ { \"key\" : 1 , \"value\" : 9997000000 } ] , \"expiration_time\" : 1582381200000 , \"create_time\" : 1582380477000 , \"state\" : \"DISAPPROVED\" } , { \"proposal_id\" : 35 , \"proposer_address\" : \"TDkSQtBhZx7Ua8qvenM4zuH52u2BsYTwzc\" , \"parameters\" : [ { \"key\" : 1 , \"value\" : 9997000000 } ] , \"expiration_time\" : 1582381200000 , \"create_time\" : 1582380498000 , \"state\" : \"DISAPPROVED\" } ] } GetProposal \u00b6 Obtain proposal information based on the proposal ID. wallet> getproposal 34 { \"proposal_id\" : 34 , \"proposer_address\" : \"TEDguVMSsFw3HSizQXFK1BsrGWeuRMNN7t\" , \"parameters\" : [ { \"key\" : 1 , \"value\" : 9997000000 } ] , \"expiration_time\" : 1582381200000 , \"create_time\" : 1582380477000 , \"state\" : \"DISAPPROVED\" } VoteWitness \u00b6 Voting requires Tron Power, which can be obtained by freezing funds. wallet> votewitness [witness address] [Tron Power Amount] The share calculation method is: 1 unit of share can be obtained for every 1TRX frozen. After unfreezing, previous vote will expire. You can avoid the invalidation of the vote by re-freezing and voting. NOTE The TRON Network only records the status of your last vote, which means that each of your votes will overwrite all previous voting results. For example: wallet> freezeBalance 100000000 3 1 address # Freeze 10TRX and acquire 10 units of Tron Power wallet> votewitness [ witness1 ] 4 [ witness2 ] 6 # Cast 4 votes for witness1 and 6 votes for witness2 at the same time wallet> votewitness [ witness1 ] 10 # Voted 10 votes for witness1 The final result of the above command was 10 votes for witness1 and 0 vote for witness2. ListWitnesses \u00b6 Get all miner node information wallet> listwitnesses { \"witnesses\" : [ { \"address\" : \"TPffmvjxEcvZefQqS7QYvL1Der3uiguikE\" , \"voteCount\" : 324999518 , \"url\" : \"http://sr-26.com\" , \"totalProduced\" : 414028 , \"totalMissed\" : 20 , \"latestBlockNum\" : 27638663 , \"latestSlotNum\" : 552169224 , \"isJobs\" : true } , { \"address\" : \"TFFLWM7tmKiwGtbh2mcz2rBssoFjHjSShG\" , \"voteCount\" : 324759460 , \"url\" : \"http://sr-27.com\" , \"totalProduced\" : 414144 , \"totalMissed\" : 16 , \"latestBlockNum\" : 27638664 , \"latestSlotNum\" : 552169225 , \"isJobs\" : true } , \u00b7\u00b7\u00b7 GetBrokerage \u00b6 View the ratio of brokerage of the witness. After voting for the witness, you will receive the rewards. The witness has the right to decide the ratio of brokerage. The default ratio is 20%, and the witness can adjust it. By default, if a witness is rewarded, he will receive 20% of the whole rewards, and 80% of the rewards will be distributed to his voters. OwnerAddress is the address of the witness's account, it is a base58check type address. wallet> getbrokerage TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8 The brokerage is : 20 GetReward \u00b6 Query unclaimed reward. OwnerAddress is the address of the voter's account, it is a base58check type address. wallet> getreward TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8 The reward is : 0 UpdateBrokerage \u00b6 Update the ratio of brokerage, this command is usually used by a witness account. wallet> updateBrokerage [ OwnerAddress ] [ brokerage ] OwnerAddress is the address of the witness's account, it is a base58check type address. brokerage is the ratio of brokerage you want to update to, the limit of it: 0-100. For example: wallet> updateBrokerage TZ7U1WVBRLZ2umjizxqz3XfearEHhXKX7h 30 DEX \u00b6 The trading and price fluctuations of trading pairs are in accordance with the Bancor Agreement . Here are all the commands for DEX: ExchangeCreate ExchangeInject ExchangeTransaction ExchangeWithdraw ListExchanges ListExchangesPaginated MarketSellAsset MarketCancelOrder GetMarketOrderbyAccount GetMarketOrderbyID GetMarketPairList GetMarketOrderListbyPair GetMarketPricebyPair ExchangeCreate \u00b6 Create a trading pair wallet> exchangeCreate [ OwnerAddress ][ first_token_id ] [ first_token_balance ] [ second_token_id ] [ second_token_balance ] OwnerAddress is the address of the account which initiated the transaction. Considered as the login account by default. First_token_id , first_token_balance is the ID and amount of the first token. second_token_id , second_token_balance is the ID and amount of the second token. The ID is the ID of the issued TRC10 token. If it is TRX, the ID is \"\". The amount must be greater than 0, and less than 1,000,000,000,000,000. Example: wallet> exchangeCreate 1000001 10000 _ 10000 # Create trading pairs with the IDs of 1000001 and TRX, with amount 10000 for both. ExchangeInject \u00b6 Capital injection wallet> exchangeInject [OwnerAddress] [exchange_id] [token_id] [quant] OwnerAddress is the address of the account which initiated the transaction. Default: the address of the login account. exchange_id is the ID of the trading pair to be funded. token_id, quant is the token Id and quantity (unit in base unit) of capital injection. When conducting a capital injection, depending on its quantity (quant), a proportion of each token in the trading pair will be withdrawn from the account, and injected into the trading pair. Depending on the difference in the balance of the transaction, the same amount of money for the same token would vary. ExchangeTransaction \u00b6 Making transaction wallet> exchangeTransaction [ OwnerAddress ] [ exchange_id ] [ token_id ] [ quant ] [ expected ] OwnerAddress is the address of the account which initiated the transaction. Default: the address of the login account. exchange_id is the ID of the trading pair. token_id , quant is the ID and quantity of tokens being exchanged, equivalent to selling. expected is the expected quantity of another token. IT must be less than quant, or an error will be reported. Example\uff1a wallet> ExchangeTransaction 1 1000001 100 80 It is expected to acquire the 80 TRX by exchanging 1000001 from the trading pair ID of 1, and the amount is 100.(Equivalent to selling an amount of 100 tokenID - 1000001, at a price of 80 TRX, in trading pair ID - 1). ExchangeWithdraw \u00b6 wallet> exchangeWithdraw [OwnerAddress] [exchange_id] [token_id] [quant] OwnerAddress is the address of the account which initiated the transaction. Default: the address of the login account. Exchange_id is the ID of the trading pair to be withdrawn. Token_id , quant is token Id and quantity (unit in base unit) of capital withdrawal. When conducting a capital withdrawal, depending on its quantity (quant), a proportion of each token in the transaction pair is withdrawn from the trading pair, and injected into the account. Depending on the difference in the balance of the transaction, the same amount of money for the same token would vary. You may obtain information on trading pairs by the following commands, ListExchanges \u00b6 List trading pairs wallet> listexchanges { \"exchanges\" : [ { \"exchange_id\" : 14 , \"creator_address\" : \"TCjuQbm5yab7ENTYb7tbdAKaiNa9Lrj4mo\" , \"create_time\" : 1654154880000 , \"first_token_id\" : \"1004852\" , \"first_token_balance\" : 91 , \"second_token_id\" : \"_\" , \"second_token_balance\" : 110000000 } , { \"exchange_id\" : 13 , \"creator_address\" : \"TBpbKyKVUB1YLULrbhawUws69Gv33cmKDL\" , \"create_time\" : 1648004214000 , \"first_token_id\" : \"1000575\" , \"first_token_balance\" : 991 , \"second_token_id\" : \"1000184\" , \"second_token_balance\" : 1010 } , \u00b7\u00b7\u00b7 ListExchangesPaginated \u00b6 List trading pairs by page wallet> ListExchangesPaginated [offset] [limit] offset is the number of exchange pair you want to skip. limit is the number of exchange pair you want to be listed. The parameters in the example below means to skip the first 3 exchange pairs and show the next 2 exchange pairs. wallet> listexchangespaginated 3 2 { \"exchanges\" : [ { \"exchange_id\" : 4 , \"creator_address\" : \"TXmHTj3t5LXGvqGkr4jRNw7nf9GjquQ5yf\" , \"create_time\" : 1601458377000 , \"first_token_id\" : \"1000088\" , \"first_token_balance\" : 1 , \"second_token_id\" : \"_\" , \"second_token_balance\" : 1 } , { \"exchange_id\" : 5 , \"creator_address\" : \"TTJJvoPKGVKnbUBPVTn1Zi8o6k3EfFDXVS\" , \"create_time\" : 1602578613000 , \"first_token_id\" : \"1000091\" , \"first_token_balance\" : 456125 , \"second_token_id\" : \"_\" , \"second_token_balance\" : 106968111 } ] } MarketSellAsset \u00b6 Create an order to sell asset wallet> MarketSellAsset [ owner_address ] [ sell_token_id ] [ sell_token_quantity ] [ buy_token_id ] [ buy_token_quantity ] OwnerAddress is the address of the account that initiated the transaction. sell_token_id and sell_token_quantity are the ID and amount of the token want to sell. buy_token_id , buy_token_quantity determines the ID and amount of the token want to buy. Example: wallet> MarketSellAsset TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW 1000001 200 _ 100 Then we use the command getTransactionInfoById to check the result of the contract execution as below, wallet> getTransactionInfoById 10040f993cd9452b25bf367f38edadf11176355802baf61f3c49b96b4480d374 { \"id\" : \"10040f993cd9452b25bf367f38edadf11176355802baf61f3c49b96b4480d374\" , \"blockNumber\" : 669 , \"blockTimeStamp\" : 1578983493000 , \"contractResult\" : [ \"\" ] , \"receipt\" : { \"net_usage\" : 264 } } MarketCancelOrder \u00b6 This command cancels the order. wallet> MarketCancelOrder [ owner_address ] [ order_id ] owner_address is the account address who have created the order. order_id is the order id which want to cancel. Example: wallet> MarketCancelOrder TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW fc9c64dfd48ae58952e85f05ecb8ec87f55e19402493bb2df501ae9d2da75db0 Get the result of the contract execution with the getTransactionInfoById command: wallet> getTransactionInfoById b375787a098498623403c755b1399e82910385251b643811936d914c9f37bd27 { \"id\" : \"b375787a098498623403c755b1399e82910385251b643811936d914c9f37bd27\" , \"blockNumber\" : 1582 , \"blockTimeStamp\" : 1578986232000 , \"contractResult\" : [ \"\" ] , \"receipt\" : { \"net_usage\" : 283 } } GetMarketOrderbyAccount \u00b6 Use this command to get the order created by account(just include active status). wallet> GetMarketOrderByAccount [ ownerAddress ] ownerAddress is the address of the account that created market order. Example: wallet> GetMarketOrderByAccount TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW { \"orders\" : [ { \"order_id\" : \"fc9c64dfd48ae58952e85f05ecb8ec87f55e19402493bb2df501ae9d2da75db0\" , \"owner_address\" : \"TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW\" , \"create_time\" : 1578983490000 , \"sell_token_id\" : \"_\" , \"sell_token_quantity\" : 100 , \"buy_token_id\" : \"1000001\" , \"buy_token_quantity\" : 200 , \"sell_token_quantity_remain\" : 100 } ] } GetMarketOrderbyID \u00b6 Get the specific order by order_id wallet> GetMarketOrderById [ orderId ] Example: wallet> GetMarketOrderById fc9c64dfd48ae58952e85f05ecb8ec87f55e19402493bb2df501ae9d2da75db0 { \"order_id\" : \"fc9c64dfd48ae58952e85f05ecb8ec87f55e19402493bb2df501ae9d2da75db0\" , \"owner_address\" : \"TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW\" , \"create_time\" : 1578983490000 , \"sell_token_id\" : \"_\" , \"sell_token_quantity\" : 100 , \"buy_token_id\" : \"1000001\" , \"buy_token_quantity\" : 200 , } GetMarketPairList \u00b6 This command is to get market pair listed wallet> getmarketpairlist { \"orderPair\" : [ { \"sell_token_id\" : \"1000012\" , \"buy_token_id\" : \"_\" } , { \"sell_token_id\" : \"1000094\" , \"buy_token_id\" : \"1000095\" } , { \"sell_token_id\" : \"1000099\" , \"buy_token_id\" : \"1000100\" } , \u00b7\u00b7\u00b7 GetMarketOrderListbyPair \u00b6 This command is to get market order list by c pair, wallet> GetMarketOrderListByPair [ sell_token_id ] [ buy_token_id ] sell_token_id is the ID of the token want to sell. buy_token_id is the ID of the token want to buy. Example: wallet> GetMarketOrderListByPair _ 1000001 { \"orders\" : [ { \"order_id\" : \"fc9c64dfd48ae58952e85f05ecb8ec87f55e19402493bb2df501ae9d2da75db0\" , \"owner_address\" : \"TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW\" , \"create_time\" : 1578983490000 , \"sell_token_id\" : \"_\" , \"sell_token_quantity\" : 100 , \"buy_token_id\" : \"1000001\" , \"buy_token_quantity\" : 200 , \"sell_token_quantity_remain\" : 100 } ] } GetMarketPricebyPair \u00b6 Use this command to get market price by exchange pair. wallet> GetMarketPriceByPair [ sell_token_id ] [ buy_token_id ] sell_token_id is the ID of the token want to sell. buy_token_id is the ID of the token want to buy. Example: wallet> GetMarketPriceByPair _ 1000001 { \"sell_token_id\" : \"_\" , \"buy_token_id\" : \"1000001\" , \"prices\" : [ { \"sell_token_quantity\" : 100 , \"buy_token_quantity\" : 200 } ] }","title":"Wallet Commands"},{"location":"clients/wallet-cli-command/#wallet-commands","text":"Below, please find all types of Wallet-Cli commands\uff1a Wallet Account AccountResource Transaction On-ChainInquire SmartContract TRC-10 Governance DEX","title":"Wallet Commands"},{"location":"clients/wallet-cli-command/#wallet","text":"Here are all the wallet related commands \uff1a RegisterWallet Login BackupWallet BackupWallet2Base64 ChangePassword ImportWallet ImportWalletByBase64 This section introduces commands related to wallet management. Let's start with registerwallet to get a new account.","title":"Wallet"},{"location":"clients/wallet-cli-command/#registerwallet","text":"To register your wallet, you need to set the wallet password and generate the address and private key. A .json keystore file will be generated under the path of wallet-cli/wallet . The file will be used for login and backupwallet later. wallet> RegisterWallet Please input password. password: Please input password again. password: Register a wallet successful, keystore file name is UTC--2022-06-27T07-37-47.601000000Z--TWyDBTHsWJFhgywWkTNW7vh7jSUxeBaiAw.json","title":"RegisterWallet"},{"location":"clients/wallet-cli-command/#login","text":"When we have a keystore file, we can start to login. After enter the command, choose the keystore file and enter the password. wallet> login use user defined config file in current dir The 1th keystore file name is UTC--2022-06-28T06-52-56.928000000Z--TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej.json The 2th keystore file name is .DS_Store The 3th keystore file name is UTC--2022-06-22T08-31-57.735000000Z--TBnPDbw99BLzPUZuW8Rrcc3RGGQT3cnSfF.json The 4th keystore file name is UTC--2022-04-06T09-43-20.710000000Z--TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8.json The 5th keystore file name is UTC--2022-04-07T09-03-38.307000000Z--TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE.json Please choose between 1 and 5 4 Please input your password. password: Login successful !!!","title":"Login"},{"location":"clients/wallet-cli-command/#backupwallet","text":"This will Back up your wallet. You need to enter your wallet password to export the privat key in hex string format, such as: 721d63b074f18d41c147e04c952ec93467777a30b6f16745bc47a8eae5076545 wallet> backupwallet Please input your password. password: BackupWallet successful !! 721d63b074f18d41c147e04c952ec93467777a30b6f16745bc47a8eae5076545","title":"BackupWallet"},{"location":"clients/wallet-cli-command/#backupwallet2base64","text":"This will Back up your wallet, you need to enter your wallet password to export the private key in base64 format, as below ch1jsHTxjUHBR+BMlS7JNGd3ejC28WdFvEeo6uUHZUU= wallet> backupwallet Please input your password. password: BackupWallet successful !! ch1jsHTxjUHBR+BMlS7JNGd3ejC28WdFvEeo6uUHZUU =","title":"BackupWallet2Base64"},{"location":"clients/wallet-cli-command/#changepassword","text":"Modify the password of an account wallet> changepassword Please input old password. password: Please input new password. Please input password. password: Please input password again. password: The 1th keystore file name is .DS_Store The 2th keystore file name is UTC--2022-06-27T10-58-59.306000000Z--TBnPDbw99BLzPUZuW8Rrcc3RGGQT3cnSfF.json Please choose between 1 and 2 2 ChangePassword successful !!","title":"ChangePassword"},{"location":"clients/wallet-cli-command/#importwallet","text":"Import a wallet, you need to set a password first and then enter your hex string private key. wallet> importwallet Please input password. password: Please input password again. password: Please input private key. Max retry time:3 bd1ff0f4f852db45316bf08755bf6eee45d0678bfbf852a00020a13d42a1fb5b Import a wallet successful, keystore file name is UTC--2022-06-28T06-52-56.928000000Z--TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej.json","title":"ImportWallet"},{"location":"clients/wallet-cli-command/#importwalletbybase64","text":"To import a wallet, you need to set a password first and then enter your private key in base64 format. wallet> importwalletbybase64 Please input password. password: Please input password again. password: Please input private key by base64. Max retry time:3 vR/w9PhS20Uxa/CHVb9u7kXQZ4v7+FKgACChPUKh+1s = Import a wallet successful, keystore file name is UTC--2022-06-28T06-51-56.154000000Z--TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej.json","title":"ImportWalletByBase64"},{"location":"clients/wallet-cli-command/#account","text":"Here are all the account related commands \uff1a GenerateAddress GetAccount GetAddress GetBalance UpdateAccountPermission","title":"Account"},{"location":"clients/wallet-cli-command/#generateaddress","text":"Generate an address and print out the public (address) and private key wallet> generateaddress { \"address\" : \"TQAvi6bemLa1t1irdV1KuaSC5vKc2EswTj\" , \"privateKey\" : \"610a8a809114a96140e1cb040a7813afc74603e58c3d7824c3f68ccc642c297e\" } Note address and private key generated by this command would not be saved in wallet-cli. Keep properly if you would like to use them.","title":"GenerateAddress"},{"location":"clients/wallet-cli-command/#getaccount","text":"Get account information by an address wallet> getaccount [ address ] wallet> getaccount TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8 { \"address\" : \"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" , \"balance\" : 2665198240 , \"create_time\" : 1650363711000 , \"latest_opration_time\" : 1653578769000 , \"latest_consume_free_time\" : 1651228080000 , \"account_resource\" : { \"latest_consume_time_for_energy\" : 1653578769000 } , \"owner_permission\" : { \"permission_name\" : \"owner\" , \"threshold\" : 1 , \"keys\" : [ { \"address\" : \"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" , \"weight\" : 1 } ] } , \"active_permission\" : [ { \"type\" : \"Active\" , \"id\" : 2 , \"permission_name\" : \"active\" , \"threshold\" : 1 , \"operations\" : \"7fff1fc0033e3b00000000000000000000000000000000000000000000000000\" , \"keys\" : [ { \"address\" : \"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" , \"weight\" : 1 } ] } ] }","title":"GetAccount"},{"location":"clients/wallet-cli-command/#getaddress","text":"Get the address of the current account wallet> getaddress GetAddress successful !! address = TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8","title":"GetAddress"},{"location":"clients/wallet-cli-command/#getbalance","text":"Get the TRX balance of the current account wallet> getbalance Balance = 2665198240","title":"GetBalance"},{"location":"clients/wallet-cli-command/#updateaccountpermission","text":"wallet>UpdateAccountPermission [ ownerAddress ] [ permissions ] This command is used to assign permissions to other accounts, is utilized for multi-signature transactions, which allows other users to access the account with paritcular permission in order to better manage it. There are three types of permissions: owner: access to the owner of account active: access to other features of accounts, and access that authorizes a certain feature. Block production authorization is not included if it's for witness purposes. witness: only for witness, block production authorization will be granted to one of the other users. NOTE the parameter Permission must written in JSON format and entered in line. If the owner accountis not SR, then do not assign witness permission. wallet> updateaccountpermission TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8 { \"owner_permission\" : { \"keys\" : [{ \"address\" : \"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" , \"weight\" :1 }] , \"threshold\" :1, \"type\" :0, \"permission_name\" : \"owner\" } , \"active_permissions\" : [{ \"operations\" : \"7fff1fc0033e0000000000000000000000000000000000000000000000000000\" , \"keys\" : [{ \"address\" : \"TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej\" , \"weight\" :1 } , { \"address\" : \"TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE\" , \"weight\" :1 }] , \"threshold\" :2, \"type\" :2, \"permission_name\" : \"active12323\" }]} { \"raw_data\" : { \"contract\" : [ { \"parameter\" : { \"value\" : { \"owner\" : { \"keys\" : [ { \"address\" : \"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" , \"weight\" :1 } ] , \"threshold\" :1, \"permission_name\" : \"owner\" } , \"owner_address\" : \"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" , \"actives\" : [ { \"operations\" : \"7fff1fc0033e0000000000000000000000000000000000000000000000000000\" , \"keys\" : [ { \"address\" : \"TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej\" , \"weight\" :1 } , { \"address\" : \"TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE\" , \"weight\" :1 } ] , \"threshold\" :2, \"type\" : \"Active\" , \"permission_name\" : \"active12323\" } ] } , \"type_url\" : \"type.googleapis.com/protocol.AccountPermissionUpdateContract\" } , \"type\" : \"AccountPermissionUpdateContract\" } ] , \"ref_block_bytes\" : \"4e88\" , \"ref_block_hash\" : \"11a47859be13f689\" , \"expiration\" :1656423231000, \"timestamp\" :1656423171818 } , \"raw_data_hex\" : \"0a024e88220811a47859be13f6894098dc92d49a305aee01082e12e9010a3c747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e4163636f756e745065726d697373696f6e557064617465436f6e747261637412a8010a1541babecec4d9f58f0df77f0728b9c53abb1f21d68412241a056f776e657220013a190a1541babecec4d9f58f0df77f0728b9c53abb1f21d6841001226908021a0b6163746976653132333233200232207fff1fc0033e00000000000000000000000000000000000000000000000000003a190a15410cfaec7164cbfe78dbb8d8fba7e23b4d745ed81310013a190a1541e8bd653015895947cec33d1670a88cf67ab277b9100170ea8d8fd49a30\" } before sign transaction hex string is 0a8d020a024e88220811a47859be13f6894098dc92d49a305aee01082e12e9010a3c747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e4163636f756e745065726d697373696f6e557064617465436f6e747261637412a8010a1541babecec4d9f58f0df77f0728b9c53abb1f21d68412241a056f776e657220013a190a1541babecec4d9f58f0df77f0728b9c53abb1f21d6841001226908021a0b6163746976653132333233200232207fff1fc0033e00000000000000000000000000000000000000000000000000003a190a15410cfaec7164cbfe78dbb8d8fba7e23b4d745ed81310013a190a1541e8bd653015895947cec33d1670a88cf67ab277b9100170ea8d8fd49a30 Please confirm and input your permission id, if input y or Y means default 0 , other non-numeric characters will cancel transaction. y Please choose your key for sign. The 1th keystore file name is UTC--2022-06-28T06-52-56.928000000Z--TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej.json The 2th keystore file name is .DS_Store The 3th keystore file name is UTC--2022-04-06T09-43-20.710000000Z--TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8.json The 4th keystore file name is UTC--2022-04-07T09-03-38.307000000Z--TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE.json Please choose between 1 and 4 3 Please input your password. password: after sign transaction hex string is 0a8d020a024e88220811a47859be13f6894096bcb5de9a305aee01082e12e9010a3c747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e4163636f756e745065726d697373696f6e557064617465436f6e747261637412a8010a1541babecec4d9f58f0df77f0728b9c53abb1f21d68412241a056f776e657220013a190a1541babecec4d9f58f0df77f0728b9c53abb1f21d6841001226908021a0b6163746976653132333233200232207fff1fc0033e00000000000000000000000000000000000000000000000000003a190a15410cfaec7164cbfe78dbb8d8fba7e23b4d745ed81310013a190a1541e8bd653015895947cec33d1670a88cf67ab277b9100170ea8d8fd49a301241881b00f8e8828d9347469fcbcec730093841c2363561243b7162a9669439266049ab82f20f97a136adc88feff0a4d5aa57b11f762eaa7e05105d27ec5d55a33900 txid is 3dce7f18f6cf6962c38904678947b3b32f9e94ba6460874679d8ed063bb1c0eb UpdateAccountPermission successful !!!","title":"UpdateAccountPermission"},{"location":"clients/wallet-cli-command/#accountresource","text":"Here are all the account resource related commands \uff1a freezeBalance unfreezeBalance getDelegatedResource freezeBalanceV2 unfreezeBalanceV2 delegateResource unDelegateResource withdrawExpireUnfreeze getAvailableUnfreezeCount getCanWithdrawUnfreezeAmount getCanDelegatedMaxSize getDelegatedResourceV2 getDelegatedResourceAccountIndexV2 getAccountNet getAccountResource","title":"AccountResource"},{"location":"clients/wallet-cli-command/#freezebalance","text":"This interface has been deprecated, please use freezeBalanceV2 to stake TRX to obtain resources. wallet> freezeBalance [ OwnerAddress ] [ frozen_balance ] [ frozen_duration ] [ ResourceCode:0 BANDWIDTH, 1 ENERGY ] [ receiverAddress ] OwnerAddress is the address of the account that initiated the transaction, optional, default is the address of the login account. frozen_balance is the amount of frozen TRX, the unit is the smallest unit (Sun), the minimum is 1000000sun. frozen_duration is frozen duration, only be specified as 3 days, indicates that you can unfreeze after 3 days. ResourceCode indicates the type of the acquired resource\uff0c0 BANDWIDTH and 1 ENERGY. receiverAddress is the address that will receive the resource. ResourceCode and receiverAddress are optional parameters. If ResourceCode is not set\uff0cdefault is 0. If receiverAddress is not set, the TRX is frozen to obtain resources for its OwnerAddress use; if it is not empty, the acquired resources are used by receiverAddress. Example: wallet> freezeBalance TWyDBTHsWJFhgywWkTNW7vh7jSUxeBaiAw 1000000 3 1 TCrkRWJuHP4VgQF3xwLNBAjVVXvxRRGpbA { \"raw_data\" : { ... } , \"raw_data_hex\" : \"0a02a9b822081db2070d39d2316640c095dda19a305a70080b126c0a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e467265657a6542616c616e6365436f6e747261637412360a1541e65aca838a9e15dd81bd9532d2ad61300e58cf7110c0843d180350017a15411fafb1e96dfe4f609e2259bfaf8c77b60c535b9370c6c8d9a19a30\" } before sign transaction hex string is 0a8e010a02a9b822081db2070d39d2316640c095dda19a305a70080b126c0a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e467265657a6542616c616e6365436f6e747261637412360a1541e65aca838a9e15dd81bd9532d2ad61300e58cf7110c0843d180350017a15411fafb1e96dfe4f609e2259bfaf8c77b60c535b9370c6c8d9a19a30 Please confirm and input your permission id, if input y or Y means default 0 , other non-numeric characters will cancel transaction. y Please choose your key for sign. The 1th keystore file name is UTC--2022-06-22T08-21-05.158000000Z--TDQgNvjrE6RH749f8aFGyJqEEGyhV4BDEU.json The 2th keystore file name is UTC--2022-06-27T07-37-47.601000000Z--TWyDBTHsWJFhgywWkTNW7vh7jSUxeBaiAw.json Please choose between 1 and 2 2 Please input your password. password: after sign transaction hex string is 0a8e010a02a9b822081db2070d39d2316640e0f7ffab9a305a70080b126c0a32747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e467265657a6542616c616e6365436f6e747261637412360a1541e65aca838a9e15dd81bd9532d2ad61300e58cf7110c0843d180350017a15411fafb1e96dfe4f609e2259bfaf8c77b60c535b9370c6c8d9a19a301241c45742648e6970e01b242c9b6eca2549c8721b860ced71abd331b9fe925f3c0f184768e0d2e3b580ce787cc6f67d186a0d583226fdb69c2cc8cfc6ec42e389f600 txid is f45cb5ae425796a492d4a9ecac8d60fd48bf78dbcdbe1d92725047c5dfbffba2 FreezeBalance successful !!!","title":"freezeBalance"},{"location":"clients/wallet-cli-command/#unfreezebalance","text":"unstake TRX which staked during stake1.o. wallet>unfreezeBalance [ OwnerAddress ] ResourceCode ( 0 BANDWIDTH,1 ENERGY,2 TRON_POWER ) [ receiverAddress ] OwnerAddress is the address of the account that initiated the transaction, optional, default is the address of the login account. ResourceCode indicates the type of the acquired resource\uff0c0 stands for BANDWIDTH and 1 stands for ENERGY. receiverAddress is the address that will receive the resource. wallet> unfreezebalance TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8 1 TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE { \"raw_data\":{ \"contract\":[ { \"parameter\":{ \"value\":{ \"resource\":\"ENERGY\", \"receiver_address\":\"TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE\", \"owner_address\":\"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" }, \"type_url\":\"type.googleapis.com/protocol.UnfreezeBalanceContract\" }, \"type\":\"UnfreezeBalanceContract\" } ], \"ref_block_bytes\":\"c8b7\", \"ref_block_hash\":\"8842722f2845274d\", \"expiration\":1656915213000, \"timestamp\":1656915154748 }, \"raw_data_hex\":\"0a02c8b722088842722f2845274d40c8f5debe9c305a6c080c12680a34747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e667265657a6542616c616e6365436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d68450017a1541e8bd653015895947cec33d1670a88cf67ab277b970bcaedbbe9c30\" } before sign transaction hex string is 0a8a010a02c8b722088842722f2845274d40c8f5debe9c305a6c080c12680a34747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e667265657a6542616c616e6365436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d68450017a1541e8bd653015895947cec33d1670a88cf67ab277b970bcaedbbe9c30 Please confirm and input your permission id, if input y or Y means default 0, other non-numeric characters will cancel transaction. y Please choose your key for sign. The 1th keystore file name is UTC--2022-06-28T06-52-56.928000000Z--TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej.json The 2th keystore file name is .DS_Store The 3th keystore file name is UTC--2022-04-06T09-43-20.710000000Z--TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8.json The 4th keystore file name is UTC--2022-04-07T09-03-38.307000000Z--TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE.json Please choose between 1 and 4 3 Please input your password. password: after sign transaction hex string is 0a8a010a02c8b722088842722f2845274d40e8dd81c99c305a6c080c12680a34747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e667265657a6542616c616e6365436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d68450017a1541e8bd653015895947cec33d1670a88cf67ab277b970bcaedbbe9c301241593a94650274df29619a6a6946258ea32a22f24a33445f943e3d72cd7d9b8ce7234d188f4bf3a6f0c90cb60af36fc77dc8d376afac9ed840f36dfd68c429fb7e00 txid is 3ea58b3ac2cb05868e70d40f58916312d927c40fd1e4c549554dc3e520c1efde UnfreezeBalance successful !!!","title":"unfreezeBalance"},{"location":"clients/wallet-cli-command/#getdelegatedresource","text":"wallet>getdelegatedresource [fromAddress] [toAddress] Get the information from the fromAddress , which is the resource owner's address, to the toAddress , which is the delegated address who is on behalf of the resource owner. wallet> getdelegatedresource TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8 TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE { \"delegatedResource\" : [ { \"from\" : \"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" , \"to\" : \"TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE\" , \"frozen_balance_for_energy\" : 1000000 , \"expire_time_for_energy\" : 1656660447000 } ] }","title":"getDelegatedResource"},{"location":"clients/wallet-cli-command/#freezebalancev2","text":"Stake 2.0 API: Stake TRX to obtain TRON Power (voting rights) and bandwidth or energy. wallet> freezeBalanceV2 [ OwnerAddress ] frozen_balance ResourceCode ( 0 BANDWIDTH,1 ENERGY,2 TRON_POWER ) OwnerAddress is the address of the account that initiated the transaction, optional, default is the address of the login account. frozen_balance is the amount of frozen TRX, the unit is the smallest unit (Sun), the minimum is 1000000sun. ResourceCode indicates the type of the acquired resource\uff0c0 BANDWIDTH and 1 ENERGY. Example: wallet> freezeBalanceV2 1000000 1 { \"raw_data\" : { \"contract\" : [ { \"parameter\" : { \"value\" : { \"resource\" : \"ENERGY\" , \"frozen_balance\" :1000000, \"owner_address\" : \"TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM\" } , \"type_url\" : \"type.googleapis.com/protocol.FreezeBalanceV2Contract\" } , \"type\" : \"FreezeBalanceV2Contract\" } ] , \"ref_block_bytes\" : \"00bb\" , \"ref_block_hash\" : \"0c237850e9e3c216\" , \"expiration\" :1676620524000, \"timestamp\" :1676620465372 } , \"raw_data_hex\" : \"0a0200bb22080c237850e9e3c21640e0d3fbf2e5305a59083612550a34747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e467265657a6542616c616e63655632436f6e7472616374121d0a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca10c0843d180170dc89f8f2e530\" } before sign transaction hex string is 0a770a0200bb22080c237850e9e3c21640e0d3fbf2e5305a59083612550a34747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e467265657a6542616c616e63655632436f6e7472616374121d0a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca10c0843d180170dc89f8f2e530 Please confirm and input your permission id, if input y or Y means default 0 , other non-numeric characters will cancel transaction. y Please choose your key for sign. The 1th keystore file name is UTC--2023-02-17T02-53-57.163000000Z--THLJLytz6UHwpmDFi5RC43D44dmnh4ZTeL.json The 2th keystore file name is UTC--2023-02-17T07-40-47.121000000Z--TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM.json Please choose between 1 and 2 2 Please input your password. password: after sign transaction hex string is 0a770a0200bb22080c237850e9e3c21640dbb89efde5305a59083612550a34747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e467265657a6542616c616e63655632436f6e7472616374121d0a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca10c0843d180170dc89f8f2e53012419e46cc7b6706ee6a14a541df5f9c518fae9a71ac7a7cc484c48386eb0997a8ab10c41e09feb905c5cc370fe1d15968d22cec2fd2cdc5916adfd3a78c52f8d47000 txid is 1743aa098f5e10ac8b68ccbf0ca6b5f1364a63485e442e6cb03fd33e3331e3fb freezeBalanceV2 successful !!!","title":"freezeBalanceV2"},{"location":"clients/wallet-cli-command/#unfreezebalancev2","text":"Stake 2.0 API: Unstake TRX to release bandwidth and energy and at the same time TRON Power will be reclaimed and corresponding votes will be revoked. wallet> unfreezeBalanceV2 [ OwnerAddress ] unfreezeBalance ResourceCode ( 0 BANDWIDTH,1 ENERGY,2 TRON_POWER ) OwnerAddress is the address of the account that initiated the transaction, optional, default is the address of the login account. unfreezeBalance Amount of TRX to be unstaked. the unit is sun. ResourceCode indicates the type of the acquired resource\uff0c0 stands for BANDWIDTH and 1 stands for ENERGY. Example: wallet> unfreezeBalanceV2 1000000 1 { \"raw_data\" : { \"contract\" : [ { \"parameter\" : { \"value\" : { \"resource\" : \"ENERGY\" , \"owner_address\" : \"TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM\" , \"unfreeze_balance\" :1000000 } , \"type_url\" : \"type.googleapis.com/protocol.UnfreezeBalanceV2Contract\" } , \"type\" : \"UnfreezeBalanceV2Contract\" } ] , \"ref_block_bytes\" : \"0132\" , \"ref_block_hash\" : \"0772c1a1727e2ef0\" , \"expiration\" :1676620887000, \"timestamp\" :1676620829314 } , \"raw_data_hex\" : \"0a02013222080772c1a1727e2ef040d8e791f3e5305a5b083712570a36747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e667265657a6542616c616e63655632436f6e7472616374121d0a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca10c0843d18017082a58ef3e530\" } before sign transaction hex string is 0a790a02013222080772c1a1727e2ef040d8e791f3e5305a5b083712570a36747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e667265657a6542616c616e63655632436f6e7472616374121d0a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca10c0843d18017082a58ef3e530 Please confirm and input your permission id, if input y or Y means default 0 , other non-numeric characters will cancel transaction. y Please choose your key for sign. The 1th keystore file name is UTC--2023-02-17T02-53-57.163000000Z--THLJLytz6UHwpmDFi5RC43D44dmnh4ZTeL.json The 2th keystore file name is UTC--2023-02-17T07-40-47.121000000Z--TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM.json Please choose between 1 and 2 2 Please input your password. password: after sign transaction hex string is 0a790a02013222080772c1a1727e2ef040ecd2b4fde5305a5b083712570a36747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e667265657a6542616c616e63655632436f6e7472616374121d0a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca10c0843d18017082a58ef3e530124111bac22e9bc35e1a78c13796893e9f2b81dc99eb26d9ce7a95d0c6a0a9b5588739c52b999acd370b255d178f57bf2abef8881891f23e042ddf83c3551b8bd98e01 txid is f9e114347ea89c5d722d20226817bc41c8a39ea36be756ba216cf450ab3f1fb3 unfreezeBalanceV2 successful !!!","title":"unfreezeBalanceV2"},{"location":"clients/wallet-cli-command/#delegateresource","text":"Stake 2.0 API: delegate bandwidth or energy resource to other address. wallet> delegateResource [ OwnerAddress ] balance ResourceCode ( 0 BANDWIDTH,1 ENERGY ) , ReceiverAddress [ lock ] OwnerAddress is the address of the account that initiated the transaction, optional, default is the address of the login account. balance Amount of TRX staked for resources to be delegated, unit is sun. ResourceCode Resource type, \"BANDWIDTH\" is 0, \"ENERGY\" is 1. ReceiverAddress Receiver address of resource to be delegated to. lock Whether it is locked, if it is set to true, the delegated resources cannot be undelegated within 3 days. When the lock time is not over, if the owner delegates the same type of resources using the lock to the same address, the lock time will be reset to 3 days. optional, default is 0, 0-lock, 1-unlock. Example: wallet> delegateResource 1000000 1 TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g 0 { \"raw_data\" : { \"contract\" : [ { \"parameter\" : { \"value\" : { \"balance\" :1000000, \"resource\" : \"ENERGY\" , \"receiver_address\" : \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\" , \"owner_address\" : \"TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM\" } , \"type_url\" : \"type.googleapis.com/protocol.DelegateResourceContract\" } , \"type\" : \"DelegateResourceContract\" } ] , \"ref_block_bytes\" : \"020c\" , \"ref_block_hash\" : \"54e32e95d11894f8\" , \"expiration\" :1676621547000, \"timestamp\" :1676621487525 } , \"raw_data_hex\" : \"0a02020c220854e32e95d11894f840f88bbaf3e5305a710839126d0a35747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e44656c65676174655265736f75726365436f6e747261637412340a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca100118c0843d221541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e70a5bbb6f3e530\" } before sign transaction hex string is 0a8f010a02020c220854e32e95d11894f840f88bbaf3e5305a710839126d0a35747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e44656c65676174655265736f75726365436f6e747261637412340a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca100118c0843d221541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e70a5bbb6f3e530 Please confirm and input your permission id, if input y or Y means default 0 , other non-numeric characters will cancel transaction. y Please choose your key for sign. The 1th keystore file name is UTC--2023-02-17T02-53-57.163000000Z--THLJLytz6UHwpmDFi5RC43D44dmnh4ZTeL.json The 2th keystore file name is UTC--2023-02-17T07-40-47.121000000Z--TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM.json Please choose between 1 and 2 2 Please input your password. password: after sign transaction hex string is 0a8f010a02020c220854e32e95d11894f84093e9dcfde5305a710839126d0a35747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e44656c65676174655265736f75726365436f6e747261637412340a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca100118c0843d221541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e70a5bbb6f3e5301241414de060e9c104bb45d745e22b7b7a30b4a89a2635c62aab152fff5d2f10b7443023a9aa487be86652b74974ff6a7d82d3dbf94cea9ac1e0a7e48e682175e3f601 txid is 0917002d0068dde7ad4ffe46e75303d11192e17bfa78934a5f867c5ae20720ec delegateResource successful !!!","title":"delegateResource"},{"location":"clients/wallet-cli-command/#undelegateresource","text":"Stake 2.0 API: undelegate resource. wallet> unDelegateResource [ OwnerAddress ] balance ResourceCode ( 0 BANDWIDTH,1 ENERGY ) , ReceiverAddress OwnerAddress is the address of the account that initiated the transaction, optional, default is the address of the login account. balance Amount of TRX staked for resource to be undelegated, unit is sun. ResourceCode Resource type, \"BANDWIDTH\" is 0, \"ENERGY\" is 1. ReceiverAddress Receiver address of resource to be delegated to. Example: wallet> unDelegateResource 1000000 1 TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g { \"raw_data\" : { \"contract\" : [ { \"parameter\" : { \"value\" : { \"balance\" :1000000, \"resource\" : \"ENERGY\" , \"receiver_address\" : \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\" , \"owner_address\" : \"TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM\" } , \"type_url\" : \"type.googleapis.com/protocol.UnDelegateResourceContract\" } , \"type\" : \"UnDelegateResourceContract\" } ] , \"ref_block_bytes\" : \"0251\" , \"ref_block_hash\" : \"68ac15256c213e71\" , \"expiration\" :1676621754000, \"timestamp\" :1676621695001 } , \"raw_data_hex\" : \"0a020251220868ac15256c213e714090ddc6f3e5305a73083a126f0a37747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e44656c65676174655265736f75726365436f6e747261637412340a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca100118c0843d221541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e709990c3f3e530\" } before sign transaction hex string is 0a91010a020251220868ac15256c213e714090ddc6f3e5305a73083a126f0a37747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e44656c65676174655265736f75726365436f6e747261637412340a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca100118c0843d221541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e709990c3f3e530 Please confirm and input your permission id, if input y or Y means default 0 , other non-numeric characters will cancel transaction. y Please choose your key for sign. The 1th keystore file name is UTC--2023-02-17T02-53-57.163000000Z--THLJLytz6UHwpmDFi5RC43D44dmnh4ZTeL.json The 2th keystore file name is UTC--2023-02-17T07-40-47.121000000Z--TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM.json Please choose between 1 and 2 2 Please input your password. password: after sign transaction hex string is 0a91010a020251220868ac15256c213e7140febde9fde5305a73083a126f0a37747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e556e44656c65676174655265736f75726365436f6e747261637412340a1541ce8a0cf0c16d48bcf22825f6053248df653c89ca100118c0843d221541fd49eda0f23ff7ec1d03b52c3a45991c24cd440e709990c3f3e530124102ebde16d1abaccd976f8ead4b5acf92b05f7d9796c28ca6a26b4e51442e638e5e33e598bb03732da24dc761a39b9d307c045b55323128dc9b07510ffc48933a01 txid is 537a3f4461ab55c705b77503bc42f469bfc22c0cb8588b8f3641ab40117ebfd8 unDelegateResource successful !!!","title":"unDelegateResource"},{"location":"clients/wallet-cli-command/#withdrawexpireunfreeze","text":"Stake 2.0 API: withdraw unfrozen balance. wallet> withdrawExpireUnfreeze [ OwnerAddress ] OwnerAddress is the address of the account that initiated the transaction, optional, default is the address of the login account. Example: wallet> withdrawExpireUnfreeze","title":"withdrawExpireUnfreeze"},{"location":"clients/wallet-cli-command/#getavailableunfreezecount","text":"Stake 2.0 API: remaining times of executing unstake operation. wallet> getavailableunfreezecount [ OwnerAddress ] OwnerAddress is the address of the account that initiated the transaction, optional, default is the address of the login account. Example: wallet> GetAvailableUnfreezeCount { \"count\" : 30 }","title":"getavailableunfreezecount"},{"location":"clients/wallet-cli-command/#getcanwithdrawunfreezeamount","text":"Stake 2.0 API: query the withdrawable balance at the specified timestamp. wallet> getcanwithdrawunfreezeamount ownerAddress timestamp OwnerAddress is the address of the account that initiated the transaction, optional, default is the address of the login account. timestamp query cutoff timestamp, in milliseconds. Example: wallet> getcanwithdrawunfreezeamount 1776621695001 { \"amount\" : 4000000 }","title":"getcanwithdrawunfreezeamount"},{"location":"clients/wallet-cli-command/#getcandelegatedmaxsize","text":"Stake 2.0 API: query the amount of delegatable resources share of the specified resource type for an address, unit is sun. wallet> getcandelegatedmaxsize ownerAddress type OwnerAddress is the address of the account that initiated the transaction, optional, default is the address of the login account. type resource type, 0 is bandwidth, 1 is energy Example: wallet> getcandelegatedmaxsize 1 { \"max_size\" : 11000000 }","title":"getcandelegatedmaxsize"},{"location":"clients/wallet-cli-command/#getdelegatedresourcev2","text":"Stake 2.0 API\uff1aquery the detail of resource share delegated from fromAddress to toAddress. wallet> getdelegatedresourcev2 fromAddress toAddress fromAddress resource from address. toAddress resource to address. Example: wallet> getdelegatedresourcev2 TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g { \"delegatedResource\" : [ { \"from\" : \"TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM\" , \"to\" : \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\" , \"frozen_balance_for_bandwidth\" : 7000000 , \"frozen_balance_for_energy\" : 3000000 } ] }","title":"getdelegatedresourcev2"},{"location":"clients/wallet-cli-command/#getdelegatedresourceaccountindexv2","text":"Stake 2.0 API\uff1aquery the resource delegation index by an account. Two lists will return, one is the list of addresses the account has delegated its resources(toAddress), and the other is the list of addresses that have delegated resources to the account(fromAddress). wallet> getdelegatedresourceaccountindexv2 ownerAddress OwnerAddress account address. Example: wallet> getdelegatedresourceaccountindexv2 TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM { \"account\" : \"TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM\" , \"fromAccounts\" : [ \"TUznHJfHe6gdYY7gvWmf6bNZHuPHDZtowf\" ] , \"toAccounts\" : [ \"TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g\" ] }","title":"getdelegatedresourceaccountindexv2"},{"location":"clients/wallet-cli-command/#getaccountnet","text":"This command shows the usage of bandwidth for a certain account. wallet> getaccountnet TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8 { \"freeNetUsed\" : 262 , \"freeNetLimit\" : 1500 , \"TotalNetLimit\" : 43200000000 , \"TotalNetWeight\" : 8725123062 }","title":"GetAccountNet"},{"location":"clients/wallet-cli-command/#getaccountresource","text":"This command shows the usage of bandwidth and energy for a certain account. wallet> getaccountresource TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8 { \"freeNetUsed\" : 262 , \"freeNetLimit\" : 1500 , \"TotalNetLimit\" : 43200000000 , \"TotalNetWeight\" : 8725123062 , \"tronPowerLimit\" : 1 , \"TotalEnergyLimit\" : 90000000000 , \"TotalEnergyWeight\" : 328098231 }","title":"GetAccountResource"},{"location":"clients/wallet-cli-command/#transaction","text":"Here are all the transaction related commands \uff1a SendCoin AddTransactionSign BroadcastTransaction BackupWallet2Base64 GetTransactionApprovedList","title":"Transaction"},{"location":"clients/wallet-cli-command/#sendcoin","text":"> SendCoin [toAddress] [amount] Here is an example of multi-signed transaction. The accounts permission have assigned as in UpdateAccountPermission section, please check for reference. wallet> SendCoin TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE 10 { \"raw_data\" : { \"contract\" : [ \u00b7\u00b7\u00b7 \"raw_data_hex\" : \"0a029ca12208432ed1fe1357ff7f40c0c484f19a305a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d684121541e8bd653015895947cec33d1670a88cf67ab277b9180a708a8481f19a30\" } before sign transaction hex string is 0a83010a029ca12208432ed1fe1357ff7f40c0c484f19a305a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d684121541e8bd653015895947cec33d1670a88cf67ab277b9180a708a8481f19a30 Please confirm and input your permission id, if input y or Y means default 0 , other non-numeric characters will cancel transaction. 2 Please choose your key for sign. The 1th keystore file name is UTC--2022-06-28T06-52-56.928000000Z--TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej.json The 2th keystore file name is .DS_Store The 3th keystore file name is UTC--2022-04-06T09-43-20.710000000Z--TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8.json The 4th keystore file name is UTC--2022-04-07T09-03-38.307000000Z--TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE.json Please choose between 1 and 4 1 Please input your password. password: Current signWeight is: { \"result\" : { \"code\" : \"NOT_ENOUGH_PERMISSION\" } , \"approved_list\" : [ \"TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej\" ] , \"permission\" : { \"operations\" : \"7fff1fc0033e0000000000000000000000000000000000000000000000000000\" , \"keys\" : [ { \"address\" : \"TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej\" , \"weight\" :1 } , { \"address\" : \"TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE\" , \"weight\" :1 } ] , \"threshold\" :2, \"id\" :2, \"type\" : \"Active\" , \"permission_name\" : \"active12323\" } , \"current_weight\" :1, \"transaction\" : { \"result\" : { \"result\" :true } , \"txid\" : \"ece603ec8ad11578450dc8adf29dd9d9833e733c313fe16a947c8c768f1e4483\" , \"transaction\" : { \"signature\" : [ \"990001e909e638bbaa5de9b392121971d25cabde1391f5e164cd8a14608812df01a273e867c2329b8adb233599c5d353c435e789c777fd3e0b9fe83f0737a91101\" ] , \"txID\" : \"ece603ec8ad11578450dc8adf29dd9d9833e733c313fe16a947c8c768f1e4483\" , \"raw_data\" :\u00b7\u00b7\u00b7, \"raw_data_hex\" : \"0a029ca12208432ed1fe1357ff7f40a2b3a7fb9a305a67080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d684121541e8bd653015895947cec33d1670a88cf67ab277b9180a2802708a8481f19a30\" } } } Please confirm if continue add signature enter y or Y, else any other y Please choose your key for sign. The 1th keystore file name is UTC--2022-06-28T06-52-56.928000000Z--TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej.json The 2th keystore file name is .DS_Store The 3th keystore file name is UTC--2022-04-06T09-43-20.710000000Z--TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8.json The 4th keystore file name is UTC--2022-04-07T09-03-38.307000000Z--TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE.json Please choose between 1 and 4 4 Please input your password. password: after sign transaction hex string is 0a85010a029ca12208432ed1fe1357ff7f40a2b3a7fb9a305a67080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d684121541e8bd653015895947cec33d1670a88cf67ab277b9180a2802708a8481f19a301241990001e909e638bbaa5de9b392121971d25cabde1391f5e164cd8a14608812df01a273e867c2329b8adb233599c5d353c435e789c777fd3e0b9fe83f0737a91101124141ba3ffe9c7bb1ed184df8bf635d8c987982b2f4b22c447666ac82726f4a97cb2ef4d3fabd64137b8d59239bd7173c74264733ed140ccd04934a88c438de1cab00 txid is ece603ec8ad11578450dc8adf29dd9d9833e733c313fe16a947c8c768f1e4483 Send 10 Sun to TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE successful !! A permission_id is always required, it is \"0\" by default, which means this transaction only needed to be sign by owner. In the example above, we enter \"2\" to make a multi-signed transaction this time, needs the two accounts assigned actives permission in UpdateAccountPermission section above to sign this transaction. In the example, we picked the account TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej to sign first, after that, it asks you if want to add another sign ,enter y and pick the account TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE to finish multi-signing. The weight of each account is 1 and the granting threshold is 2. When the requirements are met, the transaction is done successfully! This is how multiple accounts user multi-signature when using the same cli.","title":"SendCoin"},{"location":"clients/wallet-cli-command/#addtransactionsign","text":"Use the instruction addTransactionSign according to the obtained transaction hex string if signing at multiple cli. wallet> addtransactionsign 0a83010a0241aa2208b2d2c13c86e8bd884098acb1cf9a305a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d684121541e8bd653015895947cec33d1670a88cf67ab277b9180a70e8e1adcf9a30 Please input permission id. 0 Please choose your key for sign. The 1th keystore file name is UTC--2022-06-28T06-52-56.928000000Z--TB9qhqbev6DpX8mxdf3zDdtSQ6GC6Vb6Ej.json The 2th keystore file name is .DS_Store The 3th keystore file name is UTC--2022-04-06T09-43-20.710000000Z--TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8.json The 4th keystore file name is UTC--2022-04-07T09-03-38.307000000Z--TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE.json Please choose between 1 and 4 3 Please input your password. password: { \"signature\" : [ \"dbfe007bb44e8db164f4c0cf9b586a8d6a65f0612c4d9ec5350adeae6cd97c7874e7254bbf4156b545a90c34e48c8f28bdb5c8f9258514233b9201b2844d7f9201\" ] , \"txID\" : \"6e1d2460796f717b701e355734ac0e4e8b32e14c24ce569a60ad3f63afe46c87\" , \"raw_data\" : { \"contract\" : [ { \"parameter\" : { \"value\" : { \"amount\" :10, \"owner_address\" : \"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" , \"to_address\" : \"TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE\" } , \"type_url\" : \"type.googleapis.com/protocol.TransferContract\" } , \"type\" : \"TransferContract\" } ] , \"ref_block_bytes\" : \"41aa\" , \"ref_block_hash\" : \"b2d2c13c86e8bd88\" , \"expiration\" :1656434882649, \"timestamp\" :1656413188328 } , \"raw_data_hex\" : \"0a0241aa2208b2d2c13c86e8bd8840d9f0d9d99a305a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d684121541e8bd653015895947cec33d1670a88cf67ab277b9180a70e8e1adcf9a30\" } Transaction hex string is 0a83010a0241aa2208b2d2c13c86e8bd8840d9f0d9d99a305a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d684121541e8bd653015895947cec33d1670a88cf67ab277b9180a70e8e1adcf9a301241dbfe007bb44e8db164f4c0cf9b586a8d6a65f0612c4d9ec5350adeae6cd97c7874e7254bbf4156b545a90c34e48c8f28bdb5c8f9258514233b9201b2844d7f9201 After signing, the users will need to broadcast final transactions manually.","title":"AddTransactionSign"},{"location":"clients/wallet-cli-command/#broadcasttransaction","text":"Broadcast the transaction, where the transaction is in hex string format. wallet> broadcasttransaction 0a83010a0241aa2208b2d2c13c86e8bd8840d9f0d9d99a305a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d684121541e8bd653015895947cec33d1670a88cf67ab277b9180a70e8e1adcf9a301241dbfe007bb44e8db164f4c0cf9b586a8d6a65f0612c4d9ec5350adeae6cd97c7874e7254bbf4156b545a90c34e48c8f28bdb5c8f9258514233b9201b2844d7f9201 BroadcastTransaction successful !!!","title":"BroadcastTransaction"},{"location":"clients/wallet-cli-command/#gettransactionapprovedlist","text":"Get signature information according to transactions. wallet> getTransactionApprovedList 0a8c010a020318220860e195d3609c86614096eadec79d2d5a6e080112680a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412370a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18808084fea6dee11128027094bcb8bd9d2d1241c18ca91f1533ecdd83041eb0005683c4a39a2310ec60456b1f0075b4517443cf4f601a69788f001d4bc03872e892a5e25c618e38e7b81b8b1e69d07823625c2b0112413d61eb0f8868990cfa138b19878e607af957c37b51961d8be16168d7796675384e24043d121d01569895fcc7deb37648c59f538a8909115e64da167ff659c26101 { \"result\" : { } , \"approved_list\" : [ \"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" ] , \"transaction\" : { \"result\" : { \"result\" :true } , \"txid\" : \"6e1d2460796f717b701e355734ac0e4e8b32e14c24ce569a60ad3f63afe46c87\" , \"transaction\" : { \"signature\" : [ \"dbfe007bb44e8db164f4c0cf9b586a8d6a65f0612c4d9ec5350adeae6cd97c7874e7254bbf4156b545a90c34e48c8f28bdb5c8f9258514233b9201b2844d7f9201\" ] , \"txID\" : \"6e1d2460796f717b701e355734ac0e4e8b32e14c24ce569a60ad3f63afe46c87\" , \"raw_data\" : { \"contract\" : [ { \"parameter\" : { \"value\" : { \"amount\" :10, \"owner_address\" : \"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" , \"to_address\" : \"TXBpeye7UQ4dDZEnmGDv4vX37mBYDo1tUE\" } , \"type_url\" : \"type.googleapis.com/protocol.TransferContract\" } , \"type\" : \"TransferContract\" } ] , \"ref_block_bytes\" : \"41aa\" , \"ref_block_hash\" : \"b2d2c13c86e8bd88\" , \"expiration\" :1656434882649, \"timestamp\" :1656413188328 } , \"raw_data_hex\" : \"0a0241aa2208b2d2c13c86e8bd8840d9f0d9d99a305a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d684121541e8bd653015895947cec33d1670a88cf67ab277b9180a70e8e1adcf9a30\" } } }","title":"GetTransactionApprovedList"},{"location":"clients/wallet-cli-command/#on-chaininquire","text":"Here are all the on-chain inquire commands \uff1a GetNextMaintenanceTime ListNodes GetBlock GetBlockbyID GetBlockbyLatestNum GetBlockbyLimitNext GetTransactionbyID GetTransactionCountbyBlockNum GetTransactionInfobyID GetTransactionInfobyBlockNum GetTransactionSignWeight","title":"On-ChainInquire"},{"location":"clients/wallet-cli-command/#getnextmaintenancetime","text":"Get the start time of the next maintain period wallet> GetNextMaintenanceTime Next maintenance time is : 2022-06-29 16:40:00","title":"GetNextMaintenanceTime"},{"location":"clients/wallet-cli-command/#listnodes","text":"Get other peers' information wallet> listnodes IP::1.23.456.789 Port::12345 IP::2.345.67.89 Port::12345 IP::345.678.901.234 Port::12345 \u00b7\u00b7\u00b7","title":"ListNodes"},{"location":"clients/wallet-cli-command/#getblock","text":"Get the block by block height; if you do not pass the parameter, get the latest block wallet> getblock Get current block !!! { \"block_header\" : { \"raw_data\" : { \"number\" :27774469, \"txTrieRoot\" : \"0000000000000000000000000000000000000000000000000000000000000000\" , \"witness_address\" : \"TQuzjxWcqHSh1xDUw4wmMFmCcLjz4wSCBp\" , \"parentHash\" : \"0000000001a7ce048eb88d7c3c5e9c5f8e93a6cc568f47140e243d00d0f9280a\" , \"version\" :24, \"timestamp\" :1656919215000 } , \"witness_signature\" : \"3af25276891b1cf7f9f72e63ad956b50e5819fb3fa6f0b6393ed092e53a90a5438620b92b5d499e0068c6775b723e3c90677157b3e9f7b8933d1e863716145f500\" } }","title":"GetBlock"},{"location":"clients/wallet-cli-command/#getblockbyid","text":"Get block based on blockID\uff08block hash\uff09 wallet> getblockbyid [blockID] wallet> getblockbyid 0000000001a7cd54ee2b302cfd443cccec78e55a31902d2e7ea47e737c1a5ede { \"block_header\" : { \"raw_data\" : { \"number\" :27774292, \"txTrieRoot\" : \"a60f8cb160d06d5279cb463925274e18fec37f0414c4d8fdc4fb2299ccb0a8bf\" , \"witness_address\" : \"TGsdxpHNJaxsVNFFdb4R6Rib1TsKGon2Wp\" , \"parentHash\" : \"0000000001a7cd53685867286b17fa0f2389e1d3026bea0a0019c5fc37f873cb\" , \"version\" :24, \"timestamp\" :1656918678000 } , \"witness_signature\" : \"a93db1a8d989c6637d587369de2872a008f14d1df8f0aaeda8a54c324a44c269367ea31daf623834fd6a4ef3f6150ab8d370adff1df6c0e8c96af9cf34408d5600\" } , \u00b7\u00b7\u00b7","title":"GetBlockbyID"},{"location":"clients/wallet-cli-command/#getblockbylatestnum","text":"Get the latest n blocks, where 0 < n < 100 wallet> getblockbylatestnum [n]","title":"GetBlockByLatestNum"},{"location":"clients/wallet-cli-command/#getblockbylimitnext","text":"Get the block in a set range by block height. startBlock is the starting block height, endBlock is the ending block height. wallet> GetBlockByLimitNext [startBlock, endBlock] wallet> getblockbylimitnext 27774670 27774674 [ { \"block_header\" : { \"raw_data\" : { \"number\" :27774670, \"txTrieRoot\" : \"0eb9ba48deda22fafa613c0aefa6d3e0b21261ad82a126ce99a6b80e8b68045c\" , \"witness_address\" : \"TVKfvNUMcZdZbxhPLb2CkQ4nyUUhvwhv1b\" , \"parentHash\" : \"0000000001a7cecd7a2cdc58fdfd2edbfeaeb530958879bf1a299cc30043cd0b\" , \"version\" :24, \"timestamp\" :1656919824000 } , \"witness_signature\" : \"ee6653289e24edd24d70f4975e12934573d6e798a2a5c5e26e0b13bc6d25138c49a0f55fb0e9a5c503622b5877811403577a5e278528293d05c5f0b9d5d5542401\" } , \u00b7\u00b7\u00b7","title":"GetBlockByLimitNext"},{"location":"clients/wallet-cli-command/#gettransactionbyid","text":"Get transaction information based on transaction id (hash) wallet> GetTransactionById [transactionID]","title":"GetTransactionbyID"},{"location":"clients/wallet-cli-command/#gettransactioncountbyblocknum","text":"Get how many transactions contains in a block based on block height, see below wallet> gettransactioncountbyblocknum 27633562 The block contains 4 transactions","title":"GetTransactionCountbyBlockNum"},{"location":"clients/wallet-cli-command/#gettransactioninfobyid","text":"Get transaction-info based on transaction id, generally used to check the result of a smart contract trigger wallet> gettransactioninfobyid 6e1d2460796f717b701e355734ac0e4e8b32e14c24ce569a60ad3f63afe46c87 { \"id\": \"6e1d2460796f717b701e355734ac0e4e8b32e14c24ce569a60ad3f63afe46c87\", \"blockNumber\": 27609041, \"blockTimeStamp\": 1656417906000, \"contractResult\": [ \"\" ], \"receipt\": { \"net_usage\": 265 } }","title":"GetTransactionInfobyID"},{"location":"clients/wallet-cli-command/#gettransactioninfobyblocknum","text":"Get the list of transaction information in the block based on the block height wallet> gettransactioninfobyblocknum [blockNum]","title":"GetTransactionInfobyBlockNum"},{"location":"clients/wallet-cli-command/#gettransactionsignweight","text":"Get the sign weight by transaction hex string. >getTransactionSignWeight 0a83010a0241aa2208b2d2c13c86e8bd8840d9f0d9d99a305a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a1541babecec4d9f58f0df77f0728b9c53abb1f21d684121541e8bd653015895947cec33d1670a88cf67ab277b9180a70e8e1adcf9a301241dbfe007bb44e8db164f4c0cf9b586a8d6a65f0612c4d9ec5350adeae6cd97c7874e7254bbf4156b545a90c34e48c8f28bdb5c8f9258514233b9201b2844d7f9201 The information displays as follows: { \"result\":{ }, \"approved_list\":[ \"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\" ], \"permission\":{ \"keys\":[ { \"address\":\"TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8\", \"weight\":1 } ], \"threshold\":1, \"permission_name\":\"owner\" }, \"current_weight\":1, \"transaction\":{ \"result\":{ \"result\":true }, \"txid\":\"6e1d2460796f717b701e355734ac0e4e8b32e14c24ce569a60ad3f63afe46c87\", \"transaction\":{ \"signature\":[ \"dbfe007bb44e8db164f4c0cf9b586a8d6a65f0612c4d9ec5350adeae6cd97c7874e7254bbf4156b545a90c34e48c8f28bdb5c8f9258514233b9201b2844d7f9201\" ], \u00b7\u00b7\u00b7 } } }","title":"GetTransactionSignWeight"},{"location":"clients/wallet-cli-command/#smartcontract","text":"Below, please find all the commands for smart contract interactions: DeployContract TriggerContract TriggerConstantContract EstimateEnergy GetContract UpdateEnergyLimit UpdateSetting","title":"SmartContract"},{"location":"clients/wallet-cli-command/#deploycontract","text":"wallet> DeployContract [ ownerAddress ] [ contractName ] [ ABI ] [ byteCode ] [ constructor ] [ params ] [ isHex ] [ fee_limit ] [ consume_user_resource_percent ] [ origin_energy_limit ] [ value ] [ token_value ] [ token_id ]( e.g: TRXTOKEN, use # if don't provided) library:address,...> OwnerAddress is the address of the account that initiated the transaction, optional, considered as the address of the login account by default. contractName is the name of smart contract. ABI is ABI code generated when compiling. byteCode is byte code generated when compiling. constructor , params , isHex These three parameters define the format of the bytecode, which determines the way to parse byteCode from parameters. fee_limit determines the limit of consumed TRX for each transaction. consume_user_resource_percent is the percentage of user consumed resource, in the range between [0, 100%]. origin_energy_limit is the most amount of developer energy consumed by triggering the contract once. value is the amount of trx transferred to the contract account. token_value is the number of TRC-10 token. token_id is TRC-10 Id. Example: wallet> deployContract normalcontract544 [{ \"constant\" :false, \"inputs\" : [{ \"name\" : \"i\" , \"type\" : \"uint256\" }] , \"name\" : \"findArgsByIndexTest\" , \"outputs\" : [{ \"name\" : \"z\" , \"type\" : \"uint256\" }] , \"payable\" :false, \"stateMutability\" : \"nonpayable\" , \"type\" : \"function\" }] 608060405234801561001057600080fd5b50610134806100206000396000f3006080604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663329000b58114610045575b600080fd5b34801561005157600080fd5b5061005d60043561006f565b60408051918252519081900360200190f35b604080516003808252608082019092526000916060919060208201838038833901905050905060018160008151811015156100a657fe5b602090810290910101528051600290829060019081106100c257fe5b602090810290910101528051600390829060029081106100de57fe5b6020908102909101015280518190849081106100f657fe5b906020019060200201519150509190505600a165627a7a72305820b24fc247fdaf3644b3c4c94fcee380aa610ed83415061ff9e65d7fa94a5a50a00029 # # false 1000000000 75 50000 0 0 # Get the result of the contract execution with the getTransactionInfoById command: wallet> getTransactionInfoById 4978dc64ff746ca208e51780cce93237ee444f598b24d5e9ce0da885fb3a3eb9 { \"id\" : \"8c1f57a5e53b15bb0a0a0a0d4740eda9c31fbdb6a63bc429ec2113a92e8ff361\" , \"fee\" : 6170500 , \"blockNumber\" : 1867 , \"blockTimeStamp\" : 1567499757000 , \"contractResult\" : [ \"6080604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663329000b58114610045575b600080fd5b34801561005157600080fd5b5061005d60043561006f565b60408051918252519081900360200190f35b604080516003808252608082019092526000916060919060208201838038833901905050905060018160008151811015156100a657fe5b602090810290910101528051600290829060019081106100c257fe5b602090810290910101528051600390829060029081106100de57fe5b6020908102909101015280518190849081106100f657fe5b906020019060200201519150509190505600a165627a7a72305820b24fc247fdaf3644b3c4c94fcee380aa610ed83415061ff9e65d7fa94a5a50a00029\" ] , \"contract_address\" : \"TJMKWmC6mwF1QVax8Sy2AcgT6MqaXmHEds\" , \"receipt\" : { \"energy_fee\" : 6170500 , \"energy_usage_total\" : 61705 , \"net_usage\" : 704 , \"result\" : \"SUCCESS\" } }","title":"DeployContract"},{"location":"clients/wallet-cli-command/#triggercontract","text":"The command is used to trigger smart contract that deployed. wallet> TriggerContract [ ownerAddress ] [ contractAddress ] [ method ] [ args ] [ isHex ] [ fee_limit ] [ value ] [ token_value ] [ token_id ] OwnerAddress The address of the account that initiated the transaction, optional, default value is the address of the login account. ContractAddress is the smart contarct address. method is the name of the function and parameters, please refer to the example below. args is a parameter for placeholding, pass '#' instead when method does not need extra parameters. isHex controls the format of the parameters method and args, whether they are in hex string or not. fee_limit is the most amount of trx allows for consumption. token_value indicate the number of TRC-10 token. token_id the TRC-10 token id, If not, use \u2018#\u2019 instead. Here is an example: wallet> triggerContract TGdtALTPZ1FWQcc5MW7aK3o1ASaookkJxG findArgsByIndexTest ( uint256 ) 0 false 1000000000 0 0 # Get the result of the contract execution with the getTransactionInfoById command, wallet> getTransactionInfoById 7d9c4e765ea53cf6749d8a89ac07d577141b93f83adc4015f0b266d8f5c2dec4 { \"id\" : \"de289f255aa2cdda95fbd430caf8fde3f9c989c544c4917cf1285a088115d0e8\" , \"fee\" : 8500 , \"blockNumber\" : 2076 , \"blockTimeStamp\" : 1567500396000 , \"contractResult\" : [ \"\" ] , \"contract_address\" : \"TJMKWmC6mwF1QVax8Sy2AcgT6MqaXmHEds\" , \"receipt\" : { \"energy_fee\" : 8500 , \"energy_usage_total\" : 85 , \"net_usage\" : 314 , \"result\" : \"REVERT\" } , \"result\" : \"FAILED\" , \"resMessage\" : \"REVERT opcode executed\" }","title":"TriggerContract"},{"location":"clients/wallet-cli-command/#triggerconstantcontract","text":"Invoke the readonly function (modified by the view or pure modifier) of a contract for contract data query; or Invoke the non-readonly function of a contract for predicting whether the transaction can be successfully executed or estimating the energy consumption. wallet> TriggerConstantContract ownerAddress(use # if you own) contractAddress method args isHex [value token_value token_id(e.g: TRXTOKEN, use # if don't provided)] ownerAddress Owner address that triggers the contract. If it is the login account, please input #. contractAddress Smart contract address. method Function call. args Parameters, if there is no parameter of method , please input #. isHex args is hex string or not\u3002 value TRX amount to be transferred. Optional, if no value, # can be inplaced. token_value TRC-10 token amount to be transferred. Optional, if no value, # can be inplaced. token_id TRC-10 token id to be transferred. Optional, if no value, # can be inplaced. Example: wallet> TriggerConstantContract TTGhREx2pDSxFX555NWz1YwGpiBVPvQA7e TVSvjZdyDSNocHm7dP3jvCmMNsCnMTPa5W transfer ( address,uint256 ) 0000000000000000000000002ce5de57373427f799cc0a3dd03b841322514a8c00000000000000000000000000000000000000000000000000038d7ea4c68000 true transfer ( address,uint256 ) :a9059cbb Execution result = { \"constant_result\" : [ \"0000000000000000000000000000000000000000000000000000000000000001\" ] , \"result\" : { \"result\" : true } , \"energy_used\" : 13253 , \"logs\" : [ { \"address\" : \"LUijWGF4iFrT7hV37Q2Q45DU5TUBvVZb7\" , \"topics\" : [ \"ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\" , \"000000000000000000000000bdc8ee51fdd1b1e01d71f836481828f88463c838\" , \"0000000000000000000000002ce5de57373427f799cc0a3dd03b841322514a8c\" ] , \"data\" : \"00000000000000000000000000000000000000000000000000038d7ea4c68000\" } ] }","title":"TriggerConstantContract"},{"location":"clients/wallet-cli-command/#estimateenergy","text":"Estimate the energy required for the successful execution of smart contract transactions. But for FullNode, enabling the wallet/estimateEnergy API is optional. So please pay attention that when developers call wallet/estimateEnergy, if the error message shows that the node does not support this function when calling the new API (this node does not support estimate energy), it is recommended to continue using the wallet/triggerconstantcontract API to estimate energy consumption. wallet> EstimateEnergy ownerAddress contractAddress method args isHex [value token_value token_id] ownerAddress Owner address that triggers the contract. If it is the login account, please input #. contractAddress Smart contract address. method Function call. args Parameters, if there is no parameter of method , please input #. isHex args is hex string or not\u3002 value TRX amount to be transferred. Optional, if no value, # can be inplaced. token_value TRC-10 token amount to be transferred. Optional, if no value, # can be inplaced. token_id TRC-10 token id to be transferred. Optional, if no value, # can be inplaced. Example: wallet> EstimateEnergy TTGhREx2pDSxFX555NWz1YwGpiBVPvQA7e TVSvjZdyDSNocHm7dP3jvCmMNsCnMTPa5W transfer ( address,uint256 ) 0000000000000000000000002ce5de57373427f799cc0a3dd03b841322514a8c00000000000000000000000000000000000000000000000000038d7ea4c68000 true transfer ( address,uint256 ) :a9059cbb Estimate energy result = { \"result\" : { \"result\" : true } , \"energy_required\" : 14910 }","title":"EstimateEnergy"},{"location":"clients/wallet-cli-command/#getcontract","text":"Get the smart contract info by its address. wallet> GetContract [contractAddress] Example: wallet> GetContract TGdtALTPZ1FWQcc5MW7aK3o1ASaookkJxG { \"origin_address\" : \"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ\" , \"contract_address\" : \"TJMKWmC6mwF1QVax8Sy2AcgT6MqaXmHEds\" , \"abi\" : { \"entrys\" : [ { \"name\" : \"findArgsByIndexTest\" , \"inputs\" : [ { \"name\" : \"i\" , \"type\" : \"uint256\" } ] , \"outputs\" : [ { \"name\" : \"z\" , \"type\" : \"uint256\" } ] , \"type\" : \"Function\" , \"stateMutability\" : \"Nonpayable\" } ] } , \"bytecode\" : \"608060405234801561001057600080fd5b50610134806100206000396000f3006080604052600436106100405763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663329000b58114610045575b600080fd5b34801561005157600080fd5b5061005d60043561006f565b60408051918252519081900360200190f35b604080516003808252608082019092526000916060919060208201838038833901905050905060018160008151811015156100a657fe5b602090810290910101528051600290829060019081106100c257fe5b602090810290910101528051600390829060029081106100de57fe5b6020908102909101015280518190849081106100f657fe5b906020019060200201519150509190505600a165627a7a72305820b24fc247fdaf3644b3c4c94fcee380aa610ed83415061ff9e65d7fa94a5a50a00029\" , \"consume_user_resource_percent\" : 75 , \"name\" : \"normalcontract544\" , \"origin_energy_limit\" : 50000 , \"code_hash\" : \"23423cece3b4866263c15357b358e5ac261c218693b862bcdb90fa792d5714e6\" }","title":"GetContract"},{"location":"clients/wallet-cli-command/#updateenergylimit","text":"Update parameter energy limit\uff0cparameter are the same as above. wallet> UpdateEnergyLimit [ ownerAddress ] [ contract_address ] [ energy_limit ]","title":"UpdateEnergyLimit"},{"location":"clients/wallet-cli-command/#updatesetting","text":"Update parameter of energy consume percentage per user wallet> UpdateSetting [ ownerAddress ] contract_address consume_user_resource_percent","title":"UpdateSetting"},{"location":"clients/wallet-cli-command/#trc-10","text":"Below, please find all the commands for TRC-10: AssetIssue UpdateAsset TransferAsset ParticipateAssetissue UnfreezeAsset ListAssetIssue GetAssetIssuebyAccount GetAssetIssuebyID GetAssetIssuebyName GetAssetIssueListbyName","title":"TRC-10"},{"location":"clients/wallet-cli-command/#assetissue","text":"Each account is allowed to issue only ONE TRC-10 token. wallet> AssetIssue [ OwnerAddress ] [ AssetName ] [ AbbrName ] [ TotalSupply ] [ TrxNum ] [ AssetNum ] [ Precision ] [ StartDate ] [ EndDate ] [ Description Url ] [ FreeNetLimitPerAccount ] [ PublicFreeNetLimit ] [ FrozenAmount0 ] [ FrozenDays0 ] [ ... ] [ FrozenAmountN ] [ FrozenDaysN ] OwnerAddress (optional) is the address of the account which initiated the transaction. Default: the address of the login account. AssetName is the name of the issued TRC-10 token. AbbrName is the abbreviation of TRC-10 token you want to issue. TotalSupply is total issuing amount of TRC-10 token. TotalSupply = Account Balance of Issuer + All Frozen Token Amount Account Balance Of Issuer: balance at the time of issuance All Frozen Token Amount: Before asset transfer and the issuance TrxNum , AssetNum are two parameters determine the exchange rate when the token is issued. Exchange Rate = TrxNum / AssetNum AssetNum : Unit in the base unit of the issued token TrxNum : Unit in SUN (0.000001 TRX) Precision indicates how many decimal places there is. FreeNetLimitPerAccount determines the maximum amount of bandwidth each account is allowed to use. Token issuers can freeze TRX to obtain bandwidth (TransferAssetContract only) PublicFreeNetLimit is the maximum total amount of bandwidth which is allowed to use for all accounts. Token issuers can freeze TRX to obtain bandwidth (TransferAssetContract only) StartDate , EndDate is the start and end date of token issuance. Within this period time, other users can participate in token issuance. FrozenAmount0 , FrozenDays0 determines the amount and days of token freeze. FrozenAmount0 : Must be bigger than 0. FrozenDays0 : Must between 1 and 3652. Example: wallet> AssetIssue TestTRX TRX 75000000000000000 1 1 2 \"2019-10-02 15:10:00\" \"2020-07-11\" \"just for test121212\" www.test.com 100 100000 10000 10 10000 1 wallet> GetAssetIssueByAccount TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ # View published information { \"assetIssue\" : [ { \"owner_address\" : \"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ\" , \"name\" : \"TestTRX\" , \"abbr\" : \"TRX\" , \"total_supply\" : 75000000000000000 , \"frozen_supply\" : [ { \"frozen_amount\" : 10000 , \"frozen_days\" : 1 } , { \"frozen_amount\" : 10000 , \"frozen_days\" : 10 } ] , \"trx_num\" : 1 , \"precision\" : 2 , \"num\" : 1 , \"start_time\" : 1570000200000 , \"end_time\" : 1594396800000 , \"description\" : \"just for test121212\" , \"url\" : \"www.test.com\" , \"free_asset_net_limit\" : 100 , \"public_free_asset_net_limit\" : 100000 , \"id\" : \"1000001\" } ] }","title":"AssetIssue"},{"location":"clients/wallet-cli-command/#updateasset","text":"wallet> UpdateAsset [OwnerAddress] [newLimit] [newPublicLimit] [description url] Specific meaning of the parameters are the same as they are in AssetIssue. Example: wallet> UpdateAsset 1000 1000000 \"change description\" www.changetest.com wallet> GetAssetIssueByAccount TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ # to check the modified information { \"assetIssue\" : [ { \"owner_address\" : \"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ\" , \"name\" : \"TestTRX\" , \"abbr\" : \"TRX\" , \"total_supply\" : 75000000000000000 , \"frozen_supply\" : [ { \"frozen_amount\" : 10000 , \"frozen_days\" : 1 } , { \"frozen_amount\" : 10000 , \"frozen_days\" : 10 } ] , \"trx_num\" : 1 , \"precision\" : 2 , \"num\" : 1 , \"start_time\" : 1570000200000 , \"end_time\" : 1594396800000 , \"description\" : \"change description\" , \"url\" : \"www.changetest.com\" , \"free_asset_net_limit\" : 1000 , \"public_free_asset_net_limit\" : 1000000 , \"id\" : \"1000001\" } ] }","title":"UpdateAsset"},{"location":"clients/wallet-cli-command/#transferasset","text":"> TransferAsset [OwnerAddress] [ToAddress] [AssertID] [Amount] OwnerAddress (optional) is the address of the account which initiated the transaction. By default, the address of the login account. ToAddress is the address of the target account. AssertName is the TRC-10 token ID. Example: 1000001 Amount is the number of TRC10 token to transfer with. Example: wallet> TransferAsset TN3zfjYUmMFK3ZsHSsrdJoNRtGkQmZLBLz 1000001 1000 wallet> getaccount TN3zfjYUmMFK3ZsHSsrdJoNRtGkQmZLBLz # to check target account information after the transfer address: TN3zfjYUmMFK3ZsHSsrdJoNRtGkQmZLBLz assetV2 { id: 1000001 balance: 1000 latest_asset_operation_timeV2: null free_asset_net_usageV2: 0 }","title":"TransferAsset"},{"location":"clients/wallet-cli-command/#participateassetissue","text":"> ParticipateAssetIssue [OwnerAddress] [ToAddress] [AssetID] [Amount] OwnerAddress (optional) is the address of the account which initiated the transaction. Default: the address of the login account. ToAddress is the account address of TRC10 issuers. AssertName is the TRC-10 token ID. Example: 1000001 Amount is the number of TRC10 token to transfers with. The participation process must happen during the release of TRC10, otherwise an error may occur. Example: wallet> ParticipateAssetIssue TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ 1000001 1000 wallet> getaccount TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW # View remaining balance address: TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW assetV2 { id: 1000001 balance: 1000 latest_asset_operation_timeV2: null free_asset_net_usageV2: 0 }","title":"ParticipateAssetissue"},{"location":"clients/wallet-cli-command/#unfreezeasset","text":"To unfreeze all TRC10 token which are supposed to be unfrozen after the freezing period. wallet> unfreezeasset [OwnerAddress]","title":"UnfreezeAsset"},{"location":"clients/wallet-cli-command/#listassetissue","text":"Obtain all of the published TRC10 token information. wallet> listassetissue { \"assetIssue\" : [ { \"owner_address\" : \"TMWXhuxiT1KczhBxCseCDDsrhmpYGUcoA9\" , \"name\" : \"tronlink_token\" , \"abbr\" : \"tronlink_token\" , \"total_supply\" : 1000000000000000 , \"frozen_supply\" : [ { \"frozen_amount\" : 1 , \"frozen_days\" : 1 } ] , \"trx_num\" : 1 , \"precision\" : 6 , \"num\" : 1 , \"start_time\" : 1574757000000 , \"end_time\" : 1757595000000 , \"description\" : \"Description\" , \"url\" : \"https://blog.csdn.net/u010270891/article/details/82978260\" , \"free_asset_net_limit\" : 1000 , \"public_free_asset_net_limit\" : 2000 , \"id\" : \"1000001\" } , \u00b7\u00b7\u00b7","title":"ListAssetIssue"},{"location":"clients/wallet-cli-command/#getassetissuebyaccount","text":"Obtain TRC10 token information based on owner address. wallet> getassetissuebyaccount [owneraddress] wallet> getassetissuebyaccount TUwjpfqW7NG6BF3GCTrKy1aDvfchwSG4tN { \"assetIssue\" : [ { \"owner_address\" : \"TUwjpfqW7NG6BF3GCTrKy1aDvfchwSG4tN\" , \"name\" : \"h00966\" , \"abbr\" : \"h00966\" , \"total_supply\" : 100000000000 , \"trx_num\" : 1000000 , \"precision\" : 6 , \"num\" : 1000000 , \"start_time\" : 1656374400000 , \"end_time\" : 1656460800000 , \"description\" : \"Automated gaming platform. TRC10 token h0966. More info on website. TRC10 token h0966. More info on website. More info on website.\" , \"url\" : \"https://h00966.com\" , \"id\" : \"1004901\" } ] }","title":"GetAssetIssuebyAccount"},{"location":"clients/wallet-cli-command/#getassetissuebyid","text":"Obtain TRC10 token Information based on token ID. wallet> GetAssetIssueById 1004901 { \"owner_address\" : \"TUwjpfqW7NG6BF3GCTrKy1aDvfchwSG4tN\" , \"name\" : \"h00966\" , \"abbr\" : \"h00966\" , \"total_supply\" : 100000000000 , \"trx_num\" : 1000000 , \"precision\" : 6 , \"num\" : 1000000 , \"start_time\" : 1656374400000 , \"end_time\" : 1656460800000 , \"description\" : \"Automated gaming platform. TRC10 token h0966. More info on website.TRC10 token h0966. More info on website.More info on website.\" , \"url\" : \"https://h00966.com\" , \"id\" : \"1004901\" }","title":"GetAssetIssuebyID"},{"location":"clients/wallet-cli-command/#getassetissuebyname","text":"Obtain TRC10 token Information based on token names. wallet> GetAssetIssueByname h00966 { \"owner_address\" : \"TUwjpfqW7NG6BF3GCTrKy1aDvfchwSG4tN\" , \"name\" : \"h00966\" , \"abbr\" : \"h00966\" , \"total_supply\" : 100000000000 , \"trx_num\" : 1000000 , \"precision\" : 6 , \"num\" : 1000000 , \"start_time\" : 1656374400000 , \"end_time\" : 1656460800000 , \"description\" : \"Automated gaming platform. TRC10 token h0966. More info on website.TRC10 token h0966. More info on website.More info on website.\" , \"url\" : \"https://h00966.com\" , \"id\" : \"1004901\" }","title":"GetAssetIssuebyName"},{"location":"clients/wallet-cli-command/#getassetissuelistbyname","text":"Obtain a list of TRC10 token information based on names. wallet> GetAssetIssueListByName ROFLOTOKEN { \"assetIssue\": [ { \"owner_address\": \"TLvQSVH9Hm7kxLFtTP228fN6pCrHmtVjpb\", \"name\": \"ROFLOTOKEN\", \"abbr\": \"roflotoken\", \"total_supply\": 10000000000000000, \"trx_num\": 1000000, \"precision\": 6, \"num\": 100000000, \"start_time\": 1656349200000, \"end_time\": 1656435600000, \"description\": \"roflotoken.com\", \"url\": \"https://haxibaibo.com/\", \"id\": \"1004898\" } ] }","title":"GetAssetIssueListbyName"},{"location":"clients/wallet-cli-command/#governance","text":"Any proposal-related operations, except for viewing operations, must be performed by committee members. Please find all the commands for Governance: CreateProposal ApproveProposal DeleteProposal ListProposals ListProposalsPaginated GetProposal VoteWitness ListWitnesses GetBrokerage GetReward UpdateBrokerage","title":"Governance"},{"location":"clients/wallet-cli-command/#creatproposal","text":"Initiate a proposal with createProposal. wallet> createProposal [ OwnerAddress ] [ id0 ] [ value0 ] ... [ idN ] [ valueN ] OwnerAddress (optional) is the address of the account which initiated the transaction. By default, it is the address of the login account. id0 is the serial number of TRON Network Parameter. Of which, each one has a serial number corresponded. Please refer to http://tronscan.org/#/sr/committee . Value0 is the modified value. In the example, modification No.4 (modifying token issuance fee) costs 1000TRX as follows: wallet> createProposal 4 1000 wallet> listproposals # to check initiated proposal { \"proposals\" : [ { \"proposal_id\" : 1 , \"proposer_address\" : \"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ\" , \"parameters\" : [ { \"key\" : 4 , \"value\" : 1000 } ] , \"expiration_time\" : 1567498800000 , \"create_time\" : 1567498308000 } ] } The corresponding id is 1.","title":"CreatProposal"},{"location":"clients/wallet-cli-command/#approveproposal","text":"Approve or disapprove a proposal using approveProposal. wallet> approveProposal [ OwnerAddress ] [ id ] [ is_or_not_add_approval ] OwnerAddress (optional) is the address of the account which initiated the transaction. Default: the address of the login account. id is the ID of the initiated proposal. Example: 1. is_or_not_add_approval is true for approve; is false for disapprove. Example: wallet> ApproveProposal 1 true # in favor of the offer wallet> ApproveProposal 1 false # Cancel the approved proposal","title":"ApproveProposal"},{"location":"clients/wallet-cli-command/#deleteproposal","text":"wallet> deleteProposal [OwnerAddress] [proposalId] proposalId is the ID of the initiated proposal. Example: 1. The proposal must be canceled by the supernode that initiated the proposal. Example\uff1a wallet> DeleteProposal 1","title":"DeleteProposal"},{"location":"clients/wallet-cli-command/#listproposals","text":"Obtain a list of initiated proposals wallet> listproposals { \"proposals\" : [ { \"proposal_id\" : 12732 , \"proposer_address\" : \"TQ4eBJna51sew13DBLd7YjEHHHW7fkNzc2\" , \"parameters\" : [ { \"key\" : 65 , \"value\" : 1 } , { \"key\" : 66 , \"value\" : 1 } , { \"key\" : 62 , \"value\" : 432000000 } ] , \"expiration_time\" : 1656491400000 , \"create_time\" : 1656490794000 , \"approvals\" : [ \"TQ4eBJna51sew13DBLd7YjEHHHW7fkNzc2\" ] , \"state\" : \"DISAPPROVED\" } , { \u00b7\u00b7\u00b7","title":"ListProposals"},{"location":"clients/wallet-cli-command/#listproposalspaginated","text":"Use the paging mode to obtain the initiated proposal. wallet> ListProposalsPaginated [offset] [limit] offset is the number of proposals you want to skip. limit is the number of proposals you want to be listed. By default, all proposals would be listed from proposal_id 1 to date. The parameter in the example below means you want to skip the first 33 proposals and list the 2 proposals right after that. wallet> listproposalspaginated 33 2 { \"proposals\" : [ { \"proposal_id\" : 34 , \"proposer_address\" : \"TEDguVMSsFw3HSizQXFK1BsrGWeuRMNN7t\" , \"parameters\" : [ { \"key\" : 1 , \"value\" : 9997000000 } ] , \"expiration_time\" : 1582381200000 , \"create_time\" : 1582380477000 , \"state\" : \"DISAPPROVED\" } , { \"proposal_id\" : 35 , \"proposer_address\" : \"TDkSQtBhZx7Ua8qvenM4zuH52u2BsYTwzc\" , \"parameters\" : [ { \"key\" : 1 , \"value\" : 9997000000 } ] , \"expiration_time\" : 1582381200000 , \"create_time\" : 1582380498000 , \"state\" : \"DISAPPROVED\" } ] }","title":"ListProposalsPaginated"},{"location":"clients/wallet-cli-command/#getproposal","text":"Obtain proposal information based on the proposal ID. wallet> getproposal 34 { \"proposal_id\" : 34 , \"proposer_address\" : \"TEDguVMSsFw3HSizQXFK1BsrGWeuRMNN7t\" , \"parameters\" : [ { \"key\" : 1 , \"value\" : 9997000000 } ] , \"expiration_time\" : 1582381200000 , \"create_time\" : 1582380477000 , \"state\" : \"DISAPPROVED\" }","title":"GetProposal"},{"location":"clients/wallet-cli-command/#votewitness","text":"Voting requires Tron Power, which can be obtained by freezing funds. wallet> votewitness [witness address] [Tron Power Amount] The share calculation method is: 1 unit of share can be obtained for every 1TRX frozen. After unfreezing, previous vote will expire. You can avoid the invalidation of the vote by re-freezing and voting. NOTE The TRON Network only records the status of your last vote, which means that each of your votes will overwrite all previous voting results. For example: wallet> freezeBalance 100000000 3 1 address # Freeze 10TRX and acquire 10 units of Tron Power wallet> votewitness [ witness1 ] 4 [ witness2 ] 6 # Cast 4 votes for witness1 and 6 votes for witness2 at the same time wallet> votewitness [ witness1 ] 10 # Voted 10 votes for witness1 The final result of the above command was 10 votes for witness1 and 0 vote for witness2.","title":"VoteWitness"},{"location":"clients/wallet-cli-command/#listwitnesses","text":"Get all miner node information wallet> listwitnesses { \"witnesses\" : [ { \"address\" : \"TPffmvjxEcvZefQqS7QYvL1Der3uiguikE\" , \"voteCount\" : 324999518 , \"url\" : \"http://sr-26.com\" , \"totalProduced\" : 414028 , \"totalMissed\" : 20 , \"latestBlockNum\" : 27638663 , \"latestSlotNum\" : 552169224 , \"isJobs\" : true } , { \"address\" : \"TFFLWM7tmKiwGtbh2mcz2rBssoFjHjSShG\" , \"voteCount\" : 324759460 , \"url\" : \"http://sr-27.com\" , \"totalProduced\" : 414144 , \"totalMissed\" : 16 , \"latestBlockNum\" : 27638664 , \"latestSlotNum\" : 552169225 , \"isJobs\" : true } , \u00b7\u00b7\u00b7","title":"ListWitnesses"},{"location":"clients/wallet-cli-command/#getbrokerage","text":"View the ratio of brokerage of the witness. After voting for the witness, you will receive the rewards. The witness has the right to decide the ratio of brokerage. The default ratio is 20%, and the witness can adjust it. By default, if a witness is rewarded, he will receive 20% of the whole rewards, and 80% of the rewards will be distributed to his voters. OwnerAddress is the address of the witness's account, it is a base58check type address. wallet> getbrokerage TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8 The brokerage is : 20","title":"GetBrokerage"},{"location":"clients/wallet-cli-command/#getreward","text":"Query unclaimed reward. OwnerAddress is the address of the voter's account, it is a base58check type address. wallet> getreward TSzdGHnhYnQKFF4LKrRLztkjYAvbNoxnQ8 The reward is : 0","title":"GetReward"},{"location":"clients/wallet-cli-command/#updatebrokerage","text":"Update the ratio of brokerage, this command is usually used by a witness account. wallet> updateBrokerage [ OwnerAddress ] [ brokerage ] OwnerAddress is the address of the witness's account, it is a base58check type address. brokerage is the ratio of brokerage you want to update to, the limit of it: 0-100. For example: wallet> updateBrokerage TZ7U1WVBRLZ2umjizxqz3XfearEHhXKX7h 30","title":"UpdateBrokerage"},{"location":"clients/wallet-cli-command/#dex","text":"The trading and price fluctuations of trading pairs are in accordance with the Bancor Agreement . Here are all the commands for DEX: ExchangeCreate ExchangeInject ExchangeTransaction ExchangeWithdraw ListExchanges ListExchangesPaginated MarketSellAsset MarketCancelOrder GetMarketOrderbyAccount GetMarketOrderbyID GetMarketPairList GetMarketOrderListbyPair GetMarketPricebyPair","title":"DEX"},{"location":"clients/wallet-cli-command/#exchangecreate","text":"Create a trading pair wallet> exchangeCreate [ OwnerAddress ][ first_token_id ] [ first_token_balance ] [ second_token_id ] [ second_token_balance ] OwnerAddress is the address of the account which initiated the transaction. Considered as the login account by default. First_token_id , first_token_balance is the ID and amount of the first token. second_token_id , second_token_balance is the ID and amount of the second token. The ID is the ID of the issued TRC10 token. If it is TRX, the ID is \"\". The amount must be greater than 0, and less than 1,000,000,000,000,000. Example: wallet> exchangeCreate 1000001 10000 _ 10000 # Create trading pairs with the IDs of 1000001 and TRX, with amount 10000 for both.","title":"ExchangeCreate"},{"location":"clients/wallet-cli-command/#exchangeinject","text":"Capital injection wallet> exchangeInject [OwnerAddress] [exchange_id] [token_id] [quant] OwnerAddress is the address of the account which initiated the transaction. Default: the address of the login account. exchange_id is the ID of the trading pair to be funded. token_id, quant is the token Id and quantity (unit in base unit) of capital injection. When conducting a capital injection, depending on its quantity (quant), a proportion of each token in the trading pair will be withdrawn from the account, and injected into the trading pair. Depending on the difference in the balance of the transaction, the same amount of money for the same token would vary.","title":"ExchangeInject"},{"location":"clients/wallet-cli-command/#exchangetransaction","text":"Making transaction wallet> exchangeTransaction [ OwnerAddress ] [ exchange_id ] [ token_id ] [ quant ] [ expected ] OwnerAddress is the address of the account which initiated the transaction. Default: the address of the login account. exchange_id is the ID of the trading pair. token_id , quant is the ID and quantity of tokens being exchanged, equivalent to selling. expected is the expected quantity of another token. IT must be less than quant, or an error will be reported. Example\uff1a wallet> ExchangeTransaction 1 1000001 100 80 It is expected to acquire the 80 TRX by exchanging 1000001 from the trading pair ID of 1, and the amount is 100.(Equivalent to selling an amount of 100 tokenID - 1000001, at a price of 80 TRX, in trading pair ID - 1).","title":"ExchangeTransaction"},{"location":"clients/wallet-cli-command/#exchangewithdraw","text":"wallet> exchangeWithdraw [OwnerAddress] [exchange_id] [token_id] [quant] OwnerAddress is the address of the account which initiated the transaction. Default: the address of the login account. Exchange_id is the ID of the trading pair to be withdrawn. Token_id , quant is token Id and quantity (unit in base unit) of capital withdrawal. When conducting a capital withdrawal, depending on its quantity (quant), a proportion of each token in the transaction pair is withdrawn from the trading pair, and injected into the account. Depending on the difference in the balance of the transaction, the same amount of money for the same token would vary. You may obtain information on trading pairs by the following commands,","title":"ExchangeWithdraw"},{"location":"clients/wallet-cli-command/#listexchanges","text":"List trading pairs wallet> listexchanges { \"exchanges\" : [ { \"exchange_id\" : 14 , \"creator_address\" : \"TCjuQbm5yab7ENTYb7tbdAKaiNa9Lrj4mo\" , \"create_time\" : 1654154880000 , \"first_token_id\" : \"1004852\" , \"first_token_balance\" : 91 , \"second_token_id\" : \"_\" , \"second_token_balance\" : 110000000 } , { \"exchange_id\" : 13 , \"creator_address\" : \"TBpbKyKVUB1YLULrbhawUws69Gv33cmKDL\" , \"create_time\" : 1648004214000 , \"first_token_id\" : \"1000575\" , \"first_token_balance\" : 991 , \"second_token_id\" : \"1000184\" , \"second_token_balance\" : 1010 } , \u00b7\u00b7\u00b7","title":"ListExchanges"},{"location":"clients/wallet-cli-command/#listexchangespaginated","text":"List trading pairs by page wallet> ListExchangesPaginated [offset] [limit] offset is the number of exchange pair you want to skip. limit is the number of exchange pair you want to be listed. The parameters in the example below means to skip the first 3 exchange pairs and show the next 2 exchange pairs. wallet> listexchangespaginated 3 2 { \"exchanges\" : [ { \"exchange_id\" : 4 , \"creator_address\" : \"TXmHTj3t5LXGvqGkr4jRNw7nf9GjquQ5yf\" , \"create_time\" : 1601458377000 , \"first_token_id\" : \"1000088\" , \"first_token_balance\" : 1 , \"second_token_id\" : \"_\" , \"second_token_balance\" : 1 } , { \"exchange_id\" : 5 , \"creator_address\" : \"TTJJvoPKGVKnbUBPVTn1Zi8o6k3EfFDXVS\" , \"create_time\" : 1602578613000 , \"first_token_id\" : \"1000091\" , \"first_token_balance\" : 456125 , \"second_token_id\" : \"_\" , \"second_token_balance\" : 106968111 } ] }","title":"ListExchangesPaginated"},{"location":"clients/wallet-cli-command/#marketsellasset","text":"Create an order to sell asset wallet> MarketSellAsset [ owner_address ] [ sell_token_id ] [ sell_token_quantity ] [ buy_token_id ] [ buy_token_quantity ] OwnerAddress is the address of the account that initiated the transaction. sell_token_id and sell_token_quantity are the ID and amount of the token want to sell. buy_token_id , buy_token_quantity determines the ID and amount of the token want to buy. Example: wallet> MarketSellAsset TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW 1000001 200 _ 100 Then we use the command getTransactionInfoById to check the result of the contract execution as below, wallet> getTransactionInfoById 10040f993cd9452b25bf367f38edadf11176355802baf61f3c49b96b4480d374 { \"id\" : \"10040f993cd9452b25bf367f38edadf11176355802baf61f3c49b96b4480d374\" , \"blockNumber\" : 669 , \"blockTimeStamp\" : 1578983493000 , \"contractResult\" : [ \"\" ] , \"receipt\" : { \"net_usage\" : 264 } }","title":"MarketSellAsset"},{"location":"clients/wallet-cli-command/#marketcancelorder","text":"This command cancels the order. wallet> MarketCancelOrder [ owner_address ] [ order_id ] owner_address is the account address who have created the order. order_id is the order id which want to cancel. Example: wallet> MarketCancelOrder TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW fc9c64dfd48ae58952e85f05ecb8ec87f55e19402493bb2df501ae9d2da75db0 Get the result of the contract execution with the getTransactionInfoById command: wallet> getTransactionInfoById b375787a098498623403c755b1399e82910385251b643811936d914c9f37bd27 { \"id\" : \"b375787a098498623403c755b1399e82910385251b643811936d914c9f37bd27\" , \"blockNumber\" : 1582 , \"blockTimeStamp\" : 1578986232000 , \"contractResult\" : [ \"\" ] , \"receipt\" : { \"net_usage\" : 283 } }","title":"MarketCancelOrder"},{"location":"clients/wallet-cli-command/#getmarketorderbyaccount","text":"Use this command to get the order created by account(just include active status). wallet> GetMarketOrderByAccount [ ownerAddress ] ownerAddress is the address of the account that created market order. Example: wallet> GetMarketOrderByAccount TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW { \"orders\" : [ { \"order_id\" : \"fc9c64dfd48ae58952e85f05ecb8ec87f55e19402493bb2df501ae9d2da75db0\" , \"owner_address\" : \"TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW\" , \"create_time\" : 1578983490000 , \"sell_token_id\" : \"_\" , \"sell_token_quantity\" : 100 , \"buy_token_id\" : \"1000001\" , \"buy_token_quantity\" : 200 , \"sell_token_quantity_remain\" : 100 } ] }","title":"GetMarketOrderbyAccount"},{"location":"clients/wallet-cli-command/#getmarketorderbyid","text":"Get the specific order by order_id wallet> GetMarketOrderById [ orderId ] Example: wallet> GetMarketOrderById fc9c64dfd48ae58952e85f05ecb8ec87f55e19402493bb2df501ae9d2da75db0 { \"order_id\" : \"fc9c64dfd48ae58952e85f05ecb8ec87f55e19402493bb2df501ae9d2da75db0\" , \"owner_address\" : \"TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW\" , \"create_time\" : 1578983490000 , \"sell_token_id\" : \"_\" , \"sell_token_quantity\" : 100 , \"buy_token_id\" : \"1000001\" , \"buy_token_quantity\" : 200 , }","title":"GetMarketOrderbyID"},{"location":"clients/wallet-cli-command/#getmarketpairlist","text":"This command is to get market pair listed wallet> getmarketpairlist { \"orderPair\" : [ { \"sell_token_id\" : \"1000012\" , \"buy_token_id\" : \"_\" } , { \"sell_token_id\" : \"1000094\" , \"buy_token_id\" : \"1000095\" } , { \"sell_token_id\" : \"1000099\" , \"buy_token_id\" : \"1000100\" } , \u00b7\u00b7\u00b7","title":"GetMarketPairList"},{"location":"clients/wallet-cli-command/#getmarketorderlistbypair","text":"This command is to get market order list by c pair, wallet> GetMarketOrderListByPair [ sell_token_id ] [ buy_token_id ] sell_token_id is the ID of the token want to sell. buy_token_id is the ID of the token want to buy. Example: wallet> GetMarketOrderListByPair _ 1000001 { \"orders\" : [ { \"order_id\" : \"fc9c64dfd48ae58952e85f05ecb8ec87f55e19402493bb2df501ae9d2da75db0\" , \"owner_address\" : \"TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW\" , \"create_time\" : 1578983490000 , \"sell_token_id\" : \"_\" , \"sell_token_quantity\" : 100 , \"buy_token_id\" : \"1000001\" , \"buy_token_quantity\" : 200 , \"sell_token_quantity_remain\" : 100 } ] }","title":"GetMarketOrderListbyPair"},{"location":"clients/wallet-cli-command/#getmarketpricebypair","text":"Use this command to get market price by exchange pair. wallet> GetMarketPriceByPair [ sell_token_id ] [ buy_token_id ] sell_token_id is the ID of the token want to sell. buy_token_id is the ID of the token want to buy. Example: wallet> GetMarketPriceByPair _ 1000001 { \"sell_token_id\" : \"_\" , \"buy_token_id\" : \"1000001\" , \"prices\" : [ { \"sell_token_quantity\" : 100 , \"buy_token_quantity\" : 200 } ] }","title":"GetMarketPricebyPair"},{"location":"clients/wallet-cli/","text":"What is Wallet-CLI? \u00b6 Wallet-Cli is an interactive command-line wallet that supports the TRON network for signing and broadcasting transactions in a secure local environment, as well as access to on-chain data. Wallet-Cli supports key management, you can import the private key into the wallet, Wallet-Cli will encrypt your private key with a symmetric encryption algorithm and store it in a keystore file. Wallet-Cli does not store on-chain data locally. It uses gRPC to communicate with a Java-tron node. You need to configure the Java-tron node to be linked in the configuration file. The following figure shows the process of the use of Wallet-Cli to sign and broadcast when transferring TRX: The user first runs the Login command to unlock the wallet, and then runs the SendCoin command to send TRX, Wallet-Cli will build and sign the transaction locally, and then call the BroadcastTransaction gRPC API of the Java-tron node to broadcast the transaction to the network. After the broadcast is successful, the Java-tron node will return the transaction hash to Wallet-Cli, and Wallet-Cli will display the transaction hash to the user. Install and run: Wallet-Cli","title":"What is Wallet-CLI"},{"location":"clients/wallet-cli/#what-is-wallet-cli","text":"Wallet-Cli is an interactive command-line wallet that supports the TRON network for signing and broadcasting transactions in a secure local environment, as well as access to on-chain data. Wallet-Cli supports key management, you can import the private key into the wallet, Wallet-Cli will encrypt your private key with a symmetric encryption algorithm and store it in a keystore file. Wallet-Cli does not store on-chain data locally. It uses gRPC to communicate with a Java-tron node. You need to configure the Java-tron node to be linked in the configuration file. The following figure shows the process of the use of Wallet-Cli to sign and broadcast when transferring TRX: The user first runs the Login command to unlock the wallet, and then runs the SendCoin command to send TRX, Wallet-Cli will build and sign the transaction locally, and then call the BroadcastTransaction gRPC API of the Java-tron node to broadcast the transaction to the network. After the broadcast is successful, the Java-tron node will return the transaction hash to Wallet-Cli, and Wallet-Cli will display the transaction hash to the user. Install and run: Wallet-Cli","title":"What is Wallet-CLI?"},{"location":"contracts/compiler/","text":"Compiler \u00b6 Tools \u00b6 1. TronIDE Support the build, debug, run, etc. for solidity language written smart contract. http://www.tronide.io 2. TronBox Support the build, deploy, transplant, etc. for solidity language written smart contract. https://developers.tron.network/reference/what-is-tronbox 3. TronWeb Provide http api service for the usage of smart contract. https://developers.tron.network/docs/tronweb-1 4. TronGrid Provide smart contract event query service. https://developers.tron.network/docs/trongrid Development \u00b6 First you can use TronStudio to write, build and debug the smart contract. After you finish the development of the contract, you can copy it to SimpleWebCompiler to compile to get ABI and ByteCode. We provide a simple data read/write smart contract code example to demonstrate: pragma solidity ^0.4.0; contract DataStore { mapping(uint256 => uint256) data; function set(uint256 key, uint256 value) public { data[key] = value; } function get(uint256 key) view public returns (uint256 value) { value = data[key]; } } ** Start a Private Net ** Make sure the fullnode code has been deployed locally, you can check if 'Produce block successfully' log appears in FullNode/logs/tron.log ** Develop a Smart Contract ** Copy the code example above to remix to debug. ** Compile in SimpleWebCompiler for ABI and ByteCode ** Copy the code example above to SimpleWebCompiler to get ABI and ByteCode. Because TRON's compiler is a little different from Ethereum, so you can not get ABI and ByteCode by using Remix. But it will soon be supported. ** Using Wallet-cli to Deploy ** Download Wallet-Cli and build shell # download source code git clone https://github.com/tronprotocol/wallet-cli cd wallet-cli # build ./gradlew build cd build/libs Note: You need to change the node ip and port in config.conf start wallet-cli java -jar wallet-cli.jar after started, you can use command lines to operate: importwallet login getbalance deploy contract Shell # contract deployment command DeployContract contractName ABI byteCode constructor params isHex fee_limit consume_user_resource_percent # parameters contract_name: Contract name ABI: ABI from SimpleWebCompiler bytecode: ByteCode from SimpleWebCompiler constructor: When deploy contract, this will be called. If is needed, write as constructor(uint256,string). If not, just write # params: The parameters of the constructor, use ',' to split, like 1, \"test\", if no constructor, just write # fee_limit: The TRX consumption limit for the deployment, unit is SUN(1 SUN = 10^-6 TRX) consume_user_resource_percent: Consume user's resource percentage. It should be an integer between [0, 100]. if 0, means it does not consume user's resource until the developer's resource has been used up value: The amount of TRX transfer to the contract when deploy library: If the contract contains library, you need to specify the library address # example deploycontract DataStore [{\"constant\":false,\"inputs\":[{\"name\":\"key\",\"type\":\"uint256\"},{\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"key\",\"type\":\"uint256\"}],\"name\":\"get\",\"outputs\":[{\"name\":\"value\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}] 608060405234801561001057600080fd5b5060de8061001f6000396000f30060806040526004361060485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631ab06ee58114604d5780639507d39a146067575b600080fd5b348015605857600080fd5b506065600435602435608e565b005b348015607257600080fd5b50607c60043560a0565b60408051918252519081900360200190f35b60009182526020829052604090912055565b600090815260208190526040902054905600a165627a7a72305820fdfe832221d60dd582b4526afa20518b98c2e1cb0054653053a844cf265b25040029 # # false 1000000 30 0 If it is deployed successfully, it will return 'Deploy the contract successfully' get the contract address Your smart contract address will be: # in this example Your smart contract address will be: TTWq4vMEYB2yibAbPV7gQ4mrqTyX92fha6 call the contract to store data, query data Shell # call contract command triggercontract # parameters contract_address: Contract address, like TTWq4vMEYB2yibAbPV7gQ4mrqTyX92fha6 method: The method called, like set(uint256,uint256) or fool(), use ',' to split the parameters. Do not leave space between parameters args: The parameters passed to the method called, use ',' to split the parameters. Do not leave space between parameters is_hex: whether the input parameters is Hex, false or true fee_limit: The TRX consumption limit for the trigger, unit is SUN(1 SUN = 10^-6 TRX) value: The amount of TRX transfer to the contract when trigger # trigger example ## set mapping 1->1 triggercontract TTWq4vMEYB2yibAbPV7gQ4mrqTyX92fha6 set(uint256,uint256) 1,1 false 1000000 0000000000000000000000000000000000000000000000000000000000000000 ## get mapping key = 1 triggercontract TTWq4vMEYB2yibAbPV7gQ4mrqTyX92fha6 get(uint256) 1 false 1000000 0000000000000000000000000000000000000000000000000000000000000000 If the function called is constant or view, wallet-cli will return the result directly. If it contains library, before deploy the contract you need to deploy the library first. After you deploy library, you can get the library address, then fill the address in library:address,library:address,... # for instance, using remix to get the bytecode of the contract, like: 608060405234801561001057600080fd5b5061013f806100206000396000f300608060405260043610610041576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063f75dac5a14610046575b600080fd5b34801561005257600080fd5b5061005b610071565b6040518082815260200191505060405180910390f35b600073__browser/oneLibrary.sol.Math3__________<\\b>634f2be91f6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b1580156100d357600080fd5b505af41580156100e7573d6000803e3d6000fd5b505050506040513d60208110156100fd57600080fd5b81019080805190602001909291905050509050905600a165627a7a7230582052333e136f236d95e9d0b59c4490a39e25dd3a3dcdc16285820ee0a7508eb8690029 The address of the library deployed before is: TSEJ29gnBkxQZR3oDdLdeQtQQykpVLSk54 When you deploy, you need to use browser/oneLibrary.sol.Math3:TSEJ29gnBkxQZR3oDdLdeQtQQykpVLSk54 as the parameter of deploycontract.","title":"Dapp Development Tool"},{"location":"contracts/compiler/#compiler","text":"","title":"Compiler"},{"location":"contracts/compiler/#tools","text":"","title":"Tools"},{"location":"contracts/compiler/#development","text":"First you can use TronStudio to write, build and debug the smart contract. After you finish the development of the contract, you can copy it to SimpleWebCompiler to compile to get ABI and ByteCode. We provide a simple data read/write smart contract code example to demonstrate: pragma solidity ^0.4.0; contract DataStore { mapping(uint256 => uint256) data; function set(uint256 key, uint256 value) public { data[key] = value; } function get(uint256 key) view public returns (uint256 value) { value = data[key]; } } ** Start a Private Net ** Make sure the fullnode code has been deployed locally, you can check if 'Produce block successfully' log appears in FullNode/logs/tron.log ** Develop a Smart Contract ** Copy the code example above to remix to debug. ** Compile in SimpleWebCompiler for ABI and ByteCode ** Copy the code example above to SimpleWebCompiler to get ABI and ByteCode. Because TRON's compiler is a little different from Ethereum, so you can not get ABI and ByteCode by using Remix. But it will soon be supported. ** Using Wallet-cli to Deploy ** Download Wallet-Cli and build shell # download source code git clone https://github.com/tronprotocol/wallet-cli cd wallet-cli # build ./gradlew build cd build/libs Note: You need to change the node ip and port in config.conf start wallet-cli java -jar wallet-cli.jar after started, you can use command lines to operate: importwallet login getbalance deploy contract Shell # contract deployment command DeployContract contractName ABI byteCode constructor params isHex fee_limit consume_user_resource_percent # parameters contract_name: Contract name ABI: ABI from SimpleWebCompiler bytecode: ByteCode from SimpleWebCompiler constructor: When deploy contract, this will be called. If is needed, write as constructor(uint256,string). If not, just write # params: The parameters of the constructor, use ',' to split, like 1, \"test\", if no constructor, just write # fee_limit: The TRX consumption limit for the deployment, unit is SUN(1 SUN = 10^-6 TRX) consume_user_resource_percent: Consume user's resource percentage. It should be an integer between [0, 100]. if 0, means it does not consume user's resource until the developer's resource has been used up value: The amount of TRX transfer to the contract when deploy library: If the contract contains library, you need to specify the library address # example deploycontract DataStore [{\"constant\":false,\"inputs\":[{\"name\":\"key\",\"type\":\"uint256\"},{\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"key\",\"type\":\"uint256\"}],\"name\":\"get\",\"outputs\":[{\"name\":\"value\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}] 608060405234801561001057600080fd5b5060de8061001f6000396000f30060806040526004361060485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631ab06ee58114604d5780639507d39a146067575b600080fd5b348015605857600080fd5b506065600435602435608e565b005b348015607257600080fd5b50607c60043560a0565b60408051918252519081900360200190f35b60009182526020829052604090912055565b600090815260208190526040902054905600a165627a7a72305820fdfe832221d60dd582b4526afa20518b98c2e1cb0054653053a844cf265b25040029 # # false 1000000 30 0 If it is deployed successfully, it will return 'Deploy the contract successfully' get the contract address Your smart contract address will be: # in this example Your smart contract address will be: TTWq4vMEYB2yibAbPV7gQ4mrqTyX92fha6 call the contract to store data, query data Shell # call contract command triggercontract # parameters contract_address: Contract address, like TTWq4vMEYB2yibAbPV7gQ4mrqTyX92fha6 method: The method called, like set(uint256,uint256) or fool(), use ',' to split the parameters. Do not leave space between parameters args: The parameters passed to the method called, use ',' to split the parameters. Do not leave space between parameters is_hex: whether the input parameters is Hex, false or true fee_limit: The TRX consumption limit for the trigger, unit is SUN(1 SUN = 10^-6 TRX) value: The amount of TRX transfer to the contract when trigger # trigger example ## set mapping 1->1 triggercontract TTWq4vMEYB2yibAbPV7gQ4mrqTyX92fha6 set(uint256,uint256) 1,1 false 1000000 0000000000000000000000000000000000000000000000000000000000000000 ## get mapping key = 1 triggercontract TTWq4vMEYB2yibAbPV7gQ4mrqTyX92fha6 get(uint256) 1 false 1000000 0000000000000000000000000000000000000000000000000000000000000000 If the function called is constant or view, wallet-cli will return the result directly. If it contains library, before deploy the contract you need to deploy the library first. After you deploy library, you can get the library address, then fill the address in library:address,library:address,... # for instance, using remix to get the bytecode of the contract, like: 608060405234801561001057600080fd5b5061013f806100206000396000f300608060405260043610610041576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063f75dac5a14610046575b600080fd5b34801561005257600080fd5b5061005b610071565b6040518082815260200191505060405180910390f35b600073__browser/oneLibrary.sol.Math3__________<\\b>634f2be91f6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b1580156100d357600080fd5b505af41580156100e7573d6000803e3d6000fd5b505050506040513d60208110156100fd57600080fd5b81019080805190602001909291905050509050905600a165627a7a7230582052333e136f236d95e9d0b59c4490a39e25dd3a3dcdc16285820ee0a7508eb8690029 The address of the library deployed before is: TSEJ29gnBkxQZR3oDdLdeQtQQykpVLSk54 When you deploy, you need to use browser/oneLibrary.sol.Math3:TSEJ29gnBkxQZR3oDdLdeQtQQykpVLSk54 as the parameter of deploycontract.","title":"Development"},{"location":"contracts/contract/","text":"Contract \u00b6 Smart Contract Introduction \u00b6 Smart contract is a computerized transaction protocol that automatically implements its terms. Smart contract is the same as common contract, they all define the terms and rules related to the participants. Once the contract is started, it can runs in the way it is designed. TRON smart contract support Solidity language in (Ethereum). Currently recommend Solidity language version is 0.4.24 ~ 0.4.25. Write a smart contract, then build the smart contract and deploy it to TRON network. When the smart contract is triggered, the corresponding function will be executed automatically. Smart Contract Features \u00b6 TRON virtual machine is based on Ethereum solidity language, it also has TRON's own features. 1. Smart Contract \u00b6 TRON VM is compatible with Ethereum's smart contract, using protobuf to define the content of the contract: message SmartContract { message ABI { message Entry { enum EntryType { UnknownEntryType = 0 ; Constructor = 1 ; Function = 2 ; Event = 3 ; Fallback = 4 ; Receive = 5 ; Error = 6 ; } message Param { bool indexed = 1 ; string name = 2 ; string type = 3 ; } enum StateMutabilityType { UnknownMutabilityType = 0 ; Pure = 1 ; View = 2 ; Nonpayable = 3 ; Payable = 4 ; } bool anonymous = 1 ; bool constant = 2 ; string name = 3 ; repeated Param inputs = 4 ; repeated Param outputs = 5 ; EntryType type = 6 ; bool payable = 7 ; StateMutabilityType stateMutability = 8 ; } repeated Entry entrys = 1 ; } bytes origin_address = 1 ; bytes contract_address = 2 ; ABI abi = 3 ; bytes bytecode = 4 ; int64 call_value = 5 ; int64 consume_user_resource_percent = 6 ; string name = 7 ; int64 origin_energy_limit = 8 ; bytes code_hash = 9 ; bytes trx_hash = 10 ; } origin_address: smart contract creator address contract_address: smart contract address abi: the api information of the all the function of the smart contract bytecode: smart contract byte code call_value: TRX transferred into smart contract while call the contract consume_user_resource_percent: resource consumption percentage set by the developer name: smart contract name origin_energy_limit: energy consumption of the developer limit in one call, must greater than 0. For the old contracts, if this parameter is not set, it will be set 0, developer can use updateEnergyLimit api to update this parameter (must greater than 0) Through other two grpc message types CreateSmartContract and TriggerSmartContract to create and use smart contract. 2. The Usage of the Function of Smart Contract \u00b6 constant function and inconstant function There are two types of function according to whether any change will be made to the properties on the chain: constant function and inconstant function Constant function uses view/pure/constant to decorate, will return the result on the node it is called and not be broadcasted in the form of a transaction Inconstant function will be broadcasted in the form of a transaction while be called, the function will change the data on the chain, such as transfer, changing the value of the internal variables of contracts, etc. Note: If you use create command inside a contract (CREATE instruction), even use view/pure/constant to decorate the dynamically created contract function, this function will still be treated as inconstant function, be dealt in the form of transaction. message calls Message calls can call the functions of other contracts, also can transfer TRX to the accounts of contract and none-contract. Like the common TRON triggercontract, Message calls have initiator, recipient, data, transfer amount, fees and return attributes. Every message call can generate a new one recursively. Contract can define the distribution of the remaining energy in the internal message call. If it comes with OutOfEnergyException in the internal message call, it will return false, but not error. In the meanwhile, only the gas sent with the internal message call will be consumed, if energy is not specified in call.value(energy), all the remaining energy will be used. delegate call/call code/library There is a special type of message call, delegate call. The difference with common message call is the code of the target address will be run in the context of the contract that initiates the call, msg.sender and msg.value remain unchanged. This means a contract can dynamically loadcode from another address while running. Storage, current address and balance all point to the contract that initiates the call, only the code is get from the address being called. This gives Solidity the ability to achieve the 'lib' function: the reusable code lib can be put in the storage of a contract to implement complex data structure library. CREATE command This command will create a new contract with a new address. The only difference with Ethereum is the newly generated TRON address used the smart contract creation transaction id and the hash of nonce called combined. Different from Ethereum, the definition of nonce is the contract sequence number of the creation of the root call. Even there are many CREATE commands calls, contract number in sequence from 1. Refer to the source code for more detail. Note: Different from creating a contract by grpc's deploycontract, contract created by CREATE command does not store contract abi. built-in function and built-in function attribute (Since Odyssey-v3.1.1, TVM built-in function is not supported temporarily) 1)TVM is compatible with solidity language's transfer format, including: - accompany with constructor to call transfer - accompany with internal function to call transfer - use transfer/send/call/callcode/delegatecall to call transfer Note: TRON's smart contract is different from TRON's system contract, if the transfer to address does not exist it can not create an account by smart contract transfer. 2)Different accounts vote for SuperNode (Since Odyssey-v3.1.1, TVM built-in function is not supported temporarily) 3)SuperNode gets all the reward (Since Odyssey-v3.1.1, TVM built-in function is not supported temporarily) 4)SuperNode approves or disapproves the proposal (Since Odyssey-v3.1.1, TVM built-in function is not supported temporarily) 5)SuperNode proposes a proposal (Since Odyssey-v3.1.1, TVM built-in function is not supported temporarily) 6)SuperNode deletes a proposal (Since Odyssey-v3.1.1, TVM built-in function is not supported temporarily) 7)TRON byte address converts to solidity address (Since Odyssey-v3.1.1, TVM built-in function is not supported temporarily) 8)TRON string address converts to solidity address (Since Odyssey-v3.1.1, TVM built-in function is not supported temporarily) 9)Send token to target address (Since Odyssey-v3.1.1, TVM built-in function is not supported temporarily) 10)Query token amount of target address (Since Odyssey-v3.1.1, TVM built-in function is not supported temporarily) 11)Compatible with all the built-in functions of Ethereum Note: Ethereum's RIPEMD160 function is not recommended, because the return of TRON is a hash result based on TRON's sha256, not an accurate Ethereum RIPEMD160. 3. Contract Address Using in Solidity Language \u00b6 Ethereum VM address is 20 bytes, but TRON's VM address is 21 bytes. address conversion Need to convert TRON's address while using in solidity (recommended): /** * @dev convert uint256 (HexString add 0x at beginning) tron address to solidity address type * @param tronAddress uint256 tronAddress, begin with 0x, followed by HexString * @return Solidity address type */ function convertFromTronInt(uint256 tronAddress) public view returns(address){ return address(tronAddress); } This is similar with the grammar of the conversion from other types converted to address type in Ethereum. address judgement Solidity has address constant judgement, if using 21 bytes address the compiler will throw out an error, so you should use 20 bytes address, like: function compareAddress(address tronAddress) public view returns (uint256){ // if (tronAddress == 0x41ca35b7d915458ef540ade6068dfe2f44e8fa733c) { // compile error if (tronAddress == 0xca35b7d915458ef540ade6068dfe2f44e8fa733c) { // right return 1; } else { return 0; } } But if you are using wallet-cli, you can use 21 bytes address, like 0000000000000000000041ca35b7d915458ef540ade6068dfe2f44e8fa733c variable assignment Solidity has address constant assignment, if using 21 bytes address the compiler will throw out an error, so you should use 20 bytes address, like: function assignAddress() public view { // address newAddress = 0x41ca35b7d915458ef540ade6068dfe2f44e8fa733c; // compile error address newAddress = 0xca35b7d915458ef540ade6068dfe2f44e8fa733c; // do something } If you want to use TRON address of string type (TLLM21wteSPs4hKjbxgmH1L6poyMjeTbHm) please refer to (2-4-7,2-4-8). 4. The Special Constants Differ from Ethereum \u00b6 Currency Like solidity supports ETH, TRON VM supports trx and sun, 1 trx = 1000000 sun, case sensitive, only support lower case. tron-studio supports trx and sun, remix does not support trx and sun. We recommend to use tron-studio instead of remix to build TRON smart contract. Block block.blockhash (uint blockNumber) returns (bytes32): specified block hash, can only apply to the latest 256 blocks and current block excluded block.coinbase (address): SuperNode address that produced the current block block.difficulty (uint): current block difficulty, not recommended, set 0 block.gaslimit (uint): current block gas limit, not supported, set 0 block.number (uint): current block number block.timestamp (uint): current block timestamp gasleft() returns (uint256): remaining gas msg.data (bytes): complete call data msg.gas (uint): remaining gas - since 0.4.21, not recommended, replaced by gesleft() msg.sender (address): message sender (current call) msg.sig (bytes4): first 4 bytes of call data (function identifier) msg.value (uint): the amount of SUN send with message now (uint): current block timestamp (block.timestamp) tx.gasprice (uint): the gas price of transaction, not recommended, set 0 tx.origin (address): transaction initiator Each command of smart contract consume system resource while running, we use 'Energy' as the unit of the consumption of the resource.","title":"Smart Contract"},{"location":"contracts/contract/#contract","text":"","title":"Contract"},{"location":"contracts/contract/#smart-contract-introduction","text":"Smart contract is a computerized transaction protocol that automatically implements its terms. Smart contract is the same as common contract, they all define the terms and rules related to the participants. Once the contract is started, it can runs in the way it is designed. TRON smart contract support Solidity language in (Ethereum). Currently recommend Solidity language version is 0.4.24 ~ 0.4.25. Write a smart contract, then build the smart contract and deploy it to TRON network. When the smart contract is triggered, the corresponding function will be executed automatically.","title":"Smart Contract Introduction"},{"location":"contracts/contract/#smart-contract-features","text":"TRON virtual machine is based on Ethereum solidity language, it also has TRON's own features.","title":"Smart Contract Features"},{"location":"contracts/contract/#1-smart-contract","text":"TRON VM is compatible with Ethereum's smart contract, using protobuf to define the content of the contract: message SmartContract { message ABI { message Entry { enum EntryType { UnknownEntryType = 0 ; Constructor = 1 ; Function = 2 ; Event = 3 ; Fallback = 4 ; Receive = 5 ; Error = 6 ; } message Param { bool indexed = 1 ; string name = 2 ; string type = 3 ; } enum StateMutabilityType { UnknownMutabilityType = 0 ; Pure = 1 ; View = 2 ; Nonpayable = 3 ; Payable = 4 ; } bool anonymous = 1 ; bool constant = 2 ; string name = 3 ; repeated Param inputs = 4 ; repeated Param outputs = 5 ; EntryType type = 6 ; bool payable = 7 ; StateMutabilityType stateMutability = 8 ; } repeated Entry entrys = 1 ; } bytes origin_address = 1 ; bytes contract_address = 2 ; ABI abi = 3 ; bytes bytecode = 4 ; int64 call_value = 5 ; int64 consume_user_resource_percent = 6 ; string name = 7 ; int64 origin_energy_limit = 8 ; bytes code_hash = 9 ; bytes trx_hash = 10 ; } origin_address: smart contract creator address contract_address: smart contract address abi: the api information of the all the function of the smart contract bytecode: smart contract byte code call_value: TRX transferred into smart contract while call the contract consume_user_resource_percent: resource consumption percentage set by the developer name: smart contract name origin_energy_limit: energy consumption of the developer limit in one call, must greater than 0. For the old contracts, if this parameter is not set, it will be set 0, developer can use updateEnergyLimit api to update this parameter (must greater than 0) Through other two grpc message types CreateSmartContract and TriggerSmartContract to create and use smart contract.","title":"1. Smart Contract"},{"location":"contracts/contract/#2-the-usage-of-the-function-of-smart-contract","text":"constant function and inconstant function There are two types of function according to whether any change will be made to the properties on the chain: constant function and inconstant function Constant function uses view/pure/constant to decorate, will return the result on the node it is called and not be broadcasted in the form of a transaction Inconstant function will be broadcasted in the form of a transaction while be called, the function will change the data on the chain, such as transfer, changing the value of the internal variables of contracts, etc. Note: If you use create command inside a contract (CREATE instruction), even use view/pure/constant to decorate the dynamically created contract function, this function will still be treated as inconstant function, be dealt in the form of transaction. message calls Message calls can call the functions of other contracts, also can transfer TRX to the accounts of contract and none-contract. Like the common TRON triggercontract, Message calls have initiator, recipient, data, transfer amount, fees and return attributes. Every message call can generate a new one recursively. Contract can define the distribution of the remaining energy in the internal message call. If it comes with OutOfEnergyException in the internal message call, it will return false, but not error. In the meanwhile, only the gas sent with the internal message call will be consumed, if energy is not specified in call.value(energy), all the remaining energy will be used. delegate call/call code/library There is a special type of message call, delegate call. The difference with common message call is the code of the target address will be run in the context of the contract that initiates the call, msg.sender and msg.value remain unchanged. This means a contract can dynamically loadcode from another address while running. Storage, current address and balance all point to the contract that initiates the call, only the code is get from the address being called. This gives Solidity the ability to achieve the 'lib' function: the reusable code lib can be put in the storage of a contract to implement complex data structure library. CREATE command This command will create a new contract with a new address. The only difference with Ethereum is the newly generated TRON address used the smart contract creation transaction id and the hash of nonce called combined. Different from Ethereum, the definition of nonce is the contract sequence number of the creation of the root call. Even there are many CREATE commands calls, contract number in sequence from 1. Refer to the source code for more detail. Note: Different from creating a contract by grpc's deploycontract, contract created by CREATE command does not store contract abi. built-in function and built-in function attribute (Since Odyssey-v3.1.1, TVM built-in function is not supported temporarily) 1)TVM is compatible with solidity language's transfer format, including: - accompany with constructor to call transfer - accompany with internal function to call transfer - use transfer/send/call/callcode/delegatecall to call transfer Note: TRON's smart contract is different from TRON's system contract, if the transfer to address does not exist it can not create an account by smart contract transfer. 2)Different accounts vote for SuperNode (Since Odyssey-v3.1.1, TVM built-in function is not supported temporarily) 3)SuperNode gets all the reward (Since Odyssey-v3.1.1, TVM built-in function is not supported temporarily) 4)SuperNode approves or disapproves the proposal (Since Odyssey-v3.1.1, TVM built-in function is not supported temporarily) 5)SuperNode proposes a proposal (Since Odyssey-v3.1.1, TVM built-in function is not supported temporarily) 6)SuperNode deletes a proposal (Since Odyssey-v3.1.1, TVM built-in function is not supported temporarily) 7)TRON byte address converts to solidity address (Since Odyssey-v3.1.1, TVM built-in function is not supported temporarily) 8)TRON string address converts to solidity address (Since Odyssey-v3.1.1, TVM built-in function is not supported temporarily) 9)Send token to target address (Since Odyssey-v3.1.1, TVM built-in function is not supported temporarily) 10)Query token amount of target address (Since Odyssey-v3.1.1, TVM built-in function is not supported temporarily) 11)Compatible with all the built-in functions of Ethereum Note: Ethereum's RIPEMD160 function is not recommended, because the return of TRON is a hash result based on TRON's sha256, not an accurate Ethereum RIPEMD160.","title":"2. The Usage of the Function of Smart Contract"},{"location":"contracts/contract/#3-contract-address-using-in-solidity-language","text":"Ethereum VM address is 20 bytes, but TRON's VM address is 21 bytes. address conversion Need to convert TRON's address while using in solidity (recommended): /** * @dev convert uint256 (HexString add 0x at beginning) tron address to solidity address type * @param tronAddress uint256 tronAddress, begin with 0x, followed by HexString * @return Solidity address type */ function convertFromTronInt(uint256 tronAddress) public view returns(address){ return address(tronAddress); } This is similar with the grammar of the conversion from other types converted to address type in Ethereum. address judgement Solidity has address constant judgement, if using 21 bytes address the compiler will throw out an error, so you should use 20 bytes address, like: function compareAddress(address tronAddress) public view returns (uint256){ // if (tronAddress == 0x41ca35b7d915458ef540ade6068dfe2f44e8fa733c) { // compile error if (tronAddress == 0xca35b7d915458ef540ade6068dfe2f44e8fa733c) { // right return 1; } else { return 0; } } But if you are using wallet-cli, you can use 21 bytes address, like 0000000000000000000041ca35b7d915458ef540ade6068dfe2f44e8fa733c variable assignment Solidity has address constant assignment, if using 21 bytes address the compiler will throw out an error, so you should use 20 bytes address, like: function assignAddress() public view { // address newAddress = 0x41ca35b7d915458ef540ade6068dfe2f44e8fa733c; // compile error address newAddress = 0xca35b7d915458ef540ade6068dfe2f44e8fa733c; // do something } If you want to use TRON address of string type (TLLM21wteSPs4hKjbxgmH1L6poyMjeTbHm) please refer to (2-4-7,2-4-8).","title":"3. Contract Address Using in Solidity Language"},{"location":"contracts/contract/#4-the-special-constants-differ-from-ethereum","text":"Currency Like solidity supports ETH, TRON VM supports trx and sun, 1 trx = 1000000 sun, case sensitive, only support lower case. tron-studio supports trx and sun, remix does not support trx and sun. We recommend to use tron-studio instead of remix to build TRON smart contract. Block block.blockhash (uint blockNumber) returns (bytes32): specified block hash, can only apply to the latest 256 blocks and current block excluded block.coinbase (address): SuperNode address that produced the current block block.difficulty (uint): current block difficulty, not recommended, set 0 block.gaslimit (uint): current block gas limit, not supported, set 0 block.number (uint): current block number block.timestamp (uint): current block timestamp gasleft() returns (uint256): remaining gas msg.data (bytes): complete call data msg.gas (uint): remaining gas - since 0.4.21, not recommended, replaced by gesleft() msg.sender (address): message sender (current call) msg.sig (bytes4): first 4 bytes of call data (function identifier) msg.value (uint): the amount of SUN send with message now (uint): current block timestamp (block.timestamp) tx.gasprice (uint): the gas price of transaction, not recommended, set 0 tx.origin (address): transaction initiator Each command of smart contract consume system resource while running, we use 'Energy' as the unit of the consumption of the resource.","title":"4. The Special Constants Differ from Ethereum"},{"location":"contracts/trc20/","text":"TRC-20 \u00b6 TRC\u200c-20 is a technical standard used for smart contracts on the TRON blockchain for implementing tokens with the TRON Virtual Machine (TVM). It is fully compatible to ERC\u200c-20. Implementation Rules \u00b6 3 Optional Items Token Name string public constant name = \u201cTRONEuropeRewardCoin\u201d; Token Abbreviation string public constant symbol = \u201cTERC\u201d; Token Precision uint8 public constant decimals = 6; 6 Required Items contract TRC20 { function totalSupply() constant returns (uint theTotalSupply); function balanceOf(address _owner) constant returns (uint balance); function transfer(address _to, uint _value) returns (bool success); function transferFrom(address _from, address _to, uint _value) returns (bool success); function approve(address _spender, uint _value) returns (bool success); function allowance(address _owner, address _spender) constant returns (uint remaining); event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); } totalSupply() This function returns the total supply of the token. balanceOf() This function returns the token balance of the specific account. transfer() This function is used to transfer an amount of tokens from the smart contract to a specific address. approve() This function is used to authorize the third party (like a DAPP smart contract) to transfer token from the token owner\u2019s account. transferFrom() This function is used to allow the third party to transfer token from an owner account to a receiver account. The owner account must be approved to be called by the third party. allowance() This function is used to query the remaining amount of tokens the third party can transfer. 2 Event Functions When token is successfully transferred, it has to trigger Transfer Event. event Transfer(address indexed _from, address indexed _to, uint256 _value) When approval() is successfully called, it has to trigger Approval Event. event Approval(address indexed _owner, address indexed _spender, uint256 _value) Example \u00b6 pragma solidity ^0.4.16; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } contract TokenTRC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constructor function * * Initializes contract with initial supply tokens to the creator of the contract */ function TokenTRC20( uint256 initialSupply, string tokenName, string tokenSymbol ) public { totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens name = tokenName; // Set the name for display purposes symbol = tokenSymbol; // Set the symbol for display purposes } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value >= balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; emit Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` on behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens on your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply emit Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance totalSupply -= _value; // Update totalSupply emit Burn(_from, _value); return true; } }","title":"TRC-20"},{"location":"contracts/trc20/#trc-20","text":"TRC\u200c-20 is a technical standard used for smart contracts on the TRON blockchain for implementing tokens with the TRON Virtual Machine (TVM). It is fully compatible to ERC\u200c-20.","title":"TRC-20"},{"location":"contracts/trc20/#implementation-rules","text":"3 Optional Items Token Name string public constant name = \u201cTRONEuropeRewardCoin\u201d; Token Abbreviation string public constant symbol = \u201cTERC\u201d; Token Precision uint8 public constant decimals = 6; 6 Required Items contract TRC20 { function totalSupply() constant returns (uint theTotalSupply); function balanceOf(address _owner) constant returns (uint balance); function transfer(address _to, uint _value) returns (bool success); function transferFrom(address _from, address _to, uint _value) returns (bool success); function approve(address _spender, uint _value) returns (bool success); function allowance(address _owner, address _spender) constant returns (uint remaining); event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); } totalSupply() This function returns the total supply of the token. balanceOf() This function returns the token balance of the specific account. transfer() This function is used to transfer an amount of tokens from the smart contract to a specific address. approve() This function is used to authorize the third party (like a DAPP smart contract) to transfer token from the token owner\u2019s account. transferFrom() This function is used to allow the third party to transfer token from an owner account to a receiver account. The owner account must be approved to be called by the third party. allowance() This function is used to query the remaining amount of tokens the third party can transfer. 2 Event Functions When token is successfully transferred, it has to trigger Transfer Event. event Transfer(address indexed _from, address indexed _to, uint256 _value) When approval() is successfully called, it has to trigger Approval Event. event Approval(address indexed _owner, address indexed _spender, uint256 _value)","title":"Implementation Rules"},{"location":"contracts/trc20/#example","text":"pragma solidity ^0.4.16; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } contract TokenTRC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constructor function * * Initializes contract with initial supply tokens to the creator of the contract */ function TokenTRC20( uint256 initialSupply, string tokenName, string tokenSymbol ) public { totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens name = tokenName; // Set the name for display purposes symbol = tokenSymbol; // Set the symbol for display purposes } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value >= balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; emit Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` on behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens on your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply emit Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance totalSupply -= _value; // Update totalSupply emit Burn(_from, _value); return true; } }","title":"Example"},{"location":"contracts/tvm/","text":"TRON Virtual Machine (TVM) \u00b6 TRON Virtual Machine (TVM) is a lightweight, Turing complete virtual machine developed for the TRON's ecosystem. Its goal is to provide millions of global developers with a custom-built blockchain system that is efficient, convenient, stable, secure and scalable. TVM can connect seamlessly with existing development ecosystem and supports DPoS. TVM is able to be compatible with EVM environment in the beginning, so that instead of learning a new programming language, developers can develop, debug and compile smart contracts in a Remix environment with Solidity and other languages. Once you\u2019ve built and uploaded your smart contract to TRON\u2019s mainnet, it will be executed on the TVM of the SR node to be isolated from external connections. Furthermore, TVM employs the concept of Bandwidth. Different from the gas mechanism on Ethereum\u2019s EVM, operations of transaction or smart contracts on TVM are free, with no tokens consumed. Technically, executable computation capacity on TVM is not restricted by total holding of tokens. Features of TVM \u00b6 1. Lightweight TVM adopts a lightweight architecture with the aim of reducing resource consumption to guarantee system performance. 2. Stability and security With a meticulous design paradigm and fine-grained underlying operation code, TVM can guarantee the preciseness of every step of a computation, diminishing ambiguity to the largest extent. Out of security reasons, transfers and smart contract running cost only bandwidth points, not TRX, which exempts TRON from being attacked similarly to Ethereum for its mode of gas consumption. Stability of bandwidth consumption is achieved while the cost of each computational step is fixed. 3. Compatibility Currently, TVM is compatible with EVM and will be with more mainstream VMs in the future. Thereby, all smart contracts on EVM are executable on TVM. By connecting seamlessly to existing development ecosystem, higher efficiency can be achieved by developers. Needless to learn a new programming language, they can use mainstream programming languages for smart contract such as Solidity to develop, debug and compile smart contracts in the Remix environment, which greatly reduces development costs. 4. Developer-friendly Thanks to TVM\u2019s bandwidth setup, developments costs are reduced and developers can focus on the logic of their contract code. TVM also offers all-in-one interfaces for contract deployment, triggering and viewing, for the convenience of developers. The following interfaces are available in Tron Wallet-CLI: deploycontract(password, contractAddress, ABI, code, data, value) triggercontract(password, contractAddress, selector, data, value) getcontract(contractAddress) Developers can call these interfaces to deploy, trigger or check smart contracts. How TVM Works \u00b6 The above flowchart shows how TVM works: Compilation of Tron smart contract\u2192execution and computing engines of VM\u2192Interoperation service layer for external interfaces. Put simply, the flow is as follows: + Currently, TVM is compatible mainly with Solidity. The compiler translates Solidity smart contract into bytecode readable and executable on TVM. + A virtual machine processes data through opcode, which is equivalent to operating a logic of a stack-based finite state machine. + TVM accesses blockchain data and invoke External Data Interface through the Interoperation layer. Future Development of TVM \u00b6 1. More developer-friendly debugging tools Tron will be committed to the development of optimized debugging tools and the establishment of standardized symbol and data format, for improved developer efficiency. 2. Fulfillment of diversified processing demands Different from gas consumption mechanism for every transaction on EVM, there is no charge on TVM. Each operation only occupies bandwidth, which will be released within a certain amount of time after completion of transaction. It takes developers very little to develop smart contracts with more complex logic. It is our belief that besides being used for digital asset transactions, smart contracts could also be suitably applied to areas such as game development, financial risk modeling and scientific computing. The design of TVM inherently supports multi-scenario tasks, and further optimizations of processing speed, response time, and floating point compatibility. 3. Improvement of Just-In-Time (JIT) compilation speed and integration of WebAssembly Improving JIT compilation speed is conducive to faster interpretation and optimized compilation of local code. Meanwhile, Tron is planning to further optimize its TVM based on WebAssembly (WASM). WebAssembly, spearheaded by Apple, Google, Microsoft and Mozilla, is designed to break bottlenecks of current Web browsers and can be generated through compiling C/C++ and other programming languages. Integrating WASM, TVM will be able to provide high performance and high throughput for blockchain to cope with complex scenarios. Usage Guide to TVM \u00b6 1. Compile contract Contract compilation address: https://remix.ethereum.org 2. Get ABI and bytecode pragma solidity^0.4.11; contract Tron { uint256 tron; constructor() public { } function set(uint256 number) public returns(bool){ tron = number; return true; } } ABI: [{\u201cconstant\":false,\"inputs\":[{\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}] ByteCode: 608060405234801561001057600080fd5b5060c48061001f6000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360fe47b1146044575b600080fd5b348015604f57600080fd5b50606c600480360381019080803590602001909291905050506086565b604051808215151515815260200191505060405180910390f35b600081600081905550600190509190505600a165627a7a723058209791df3f67e9af451c35d7ae55bda5e352764f6a38ea23fa850b1c1fe1bc72e90029 3. Deploy contract Wallet-cli-vm branch: https://github.com/tronprotocol/wallet-cli/tree/wallet-cli-vm Java-tron-vm branch: https://github.com/tronprotocol/java-tron/tree/develop_vm Password: password of client-end wallet ContractAddress: customized contract address (in Tron\u2019s required format) ABI: interface description Data: parameters of the initial function Value: reserved field deploycontract(Password, ContractAddress, ABI, Code, Data, Value) 4. Invoke contract Selector: function selector Data: parameters triggercontract(Password, ContractAddress, Selector, Data, Value) 5. Check contract getcontract(ContractAddress) The above is an introduction of Tron Virtual Machine and a guide to deployment. We welcome everyone to check out TVM and give us your thoughts and suggestions. We will continue to perfect and update TVM for optimal performance on TRON mainnet.","title":"TRON Virtual Machine (TVM)"},{"location":"contracts/tvm/#tron-virtual-machine-tvm","text":"TRON Virtual Machine (TVM) is a lightweight, Turing complete virtual machine developed for the TRON's ecosystem. Its goal is to provide millions of global developers with a custom-built blockchain system that is efficient, convenient, stable, secure and scalable. TVM can connect seamlessly with existing development ecosystem and supports DPoS. TVM is able to be compatible with EVM environment in the beginning, so that instead of learning a new programming language, developers can develop, debug and compile smart contracts in a Remix environment with Solidity and other languages. Once you\u2019ve built and uploaded your smart contract to TRON\u2019s mainnet, it will be executed on the TVM of the SR node to be isolated from external connections. Furthermore, TVM employs the concept of Bandwidth. Different from the gas mechanism on Ethereum\u2019s EVM, operations of transaction or smart contracts on TVM are free, with no tokens consumed. Technically, executable computation capacity on TVM is not restricted by total holding of tokens.","title":"TRON Virtual Machine (TVM)"},{"location":"contracts/tvm/#features-of-tvm","text":"1. Lightweight TVM adopts a lightweight architecture with the aim of reducing resource consumption to guarantee system performance. 2. Stability and security With a meticulous design paradigm and fine-grained underlying operation code, TVM can guarantee the preciseness of every step of a computation, diminishing ambiguity to the largest extent. Out of security reasons, transfers and smart contract running cost only bandwidth points, not TRX, which exempts TRON from being attacked similarly to Ethereum for its mode of gas consumption. Stability of bandwidth consumption is achieved while the cost of each computational step is fixed. 3. Compatibility Currently, TVM is compatible with EVM and will be with more mainstream VMs in the future. Thereby, all smart contracts on EVM are executable on TVM. By connecting seamlessly to existing development ecosystem, higher efficiency can be achieved by developers. Needless to learn a new programming language, they can use mainstream programming languages for smart contract such as Solidity to develop, debug and compile smart contracts in the Remix environment, which greatly reduces development costs. 4. Developer-friendly Thanks to TVM\u2019s bandwidth setup, developments costs are reduced and developers can focus on the logic of their contract code. TVM also offers all-in-one interfaces for contract deployment, triggering and viewing, for the convenience of developers. The following interfaces are available in Tron Wallet-CLI: deploycontract(password, contractAddress, ABI, code, data, value) triggercontract(password, contractAddress, selector, data, value) getcontract(contractAddress) Developers can call these interfaces to deploy, trigger or check smart contracts.","title":"Features of TVM"},{"location":"contracts/tvm/#how-tvm-works","text":"The above flowchart shows how TVM works: Compilation of Tron smart contract\u2192execution and computing engines of VM\u2192Interoperation service layer for external interfaces. Put simply, the flow is as follows: + Currently, TVM is compatible mainly with Solidity. The compiler translates Solidity smart contract into bytecode readable and executable on TVM. + A virtual machine processes data through opcode, which is equivalent to operating a logic of a stack-based finite state machine. + TVM accesses blockchain data and invoke External Data Interface through the Interoperation layer.","title":"How TVM Works"},{"location":"contracts/tvm/#future-development-of-tvm","text":"1. More developer-friendly debugging tools Tron will be committed to the development of optimized debugging tools and the establishment of standardized symbol and data format, for improved developer efficiency. 2. Fulfillment of diversified processing demands Different from gas consumption mechanism for every transaction on EVM, there is no charge on TVM. Each operation only occupies bandwidth, which will be released within a certain amount of time after completion of transaction. It takes developers very little to develop smart contracts with more complex logic. It is our belief that besides being used for digital asset transactions, smart contracts could also be suitably applied to areas such as game development, financial risk modeling and scientific computing. The design of TVM inherently supports multi-scenario tasks, and further optimizations of processing speed, response time, and floating point compatibility. 3. Improvement of Just-In-Time (JIT) compilation speed and integration of WebAssembly Improving JIT compilation speed is conducive to faster interpretation and optimized compilation of local code. Meanwhile, Tron is planning to further optimize its TVM based on WebAssembly (WASM). WebAssembly, spearheaded by Apple, Google, Microsoft and Mozilla, is designed to break bottlenecks of current Web browsers and can be generated through compiling C/C++ and other programming languages. Integrating WASM, TVM will be able to provide high performance and high throughput for blockchain to cope with complex scenarios.","title":"Future Development of TVM"},{"location":"contracts/tvm/#usage-guide-to-tvm","text":"1. Compile contract Contract compilation address: https://remix.ethereum.org 2. Get ABI and bytecode pragma solidity^0.4.11; contract Tron { uint256 tron; constructor() public { } function set(uint256 number) public returns(bool){ tron = number; return true; } } ABI: [{\u201cconstant\":false,\"inputs\":[{\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"set\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"}] ByteCode: 608060405234801561001057600080fd5b5060c48061001f6000396000f300608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806360fe47b1146044575b600080fd5b348015604f57600080fd5b50606c600480360381019080803590602001909291905050506086565b604051808215151515815260200191505060405180910390f35b600081600081905550600190509190505600a165627a7a723058209791df3f67e9af451c35d7ae55bda5e352764f6a38ea23fa850b1c1fe1bc72e90029 3. Deploy contract Wallet-cli-vm branch: https://github.com/tronprotocol/wallet-cli/tree/wallet-cli-vm Java-tron-vm branch: https://github.com/tronprotocol/java-tron/tree/develop_vm Password: password of client-end wallet ContractAddress: customized contract address (in Tron\u2019s required format) ABI: interface description Data: parameters of the initial function Value: reserved field deploycontract(Password, ContractAddress, ABI, Code, Data, Value) 4. Invoke contract Selector: function selector Data: parameters triggercontract(Password, ContractAddress, Selector, Data, Value) 5. Check contract getcontract(ContractAddress) The above is an introduction of Tron Virtual Machine and a guide to deployment. We welcome everyone to check out TVM and give us your thoughts and suggestions. We will continue to perfect and update TVM for optimal performance on TRON mainnet.","title":"Usage Guide to TVM"},{"location":"developers/advanced-configuration/","text":"Advanced Configurations \u00b6 we provide some configuration items for LevelDB and gRPC in config.conf file, for fine-grained performance tuning. You may custom these items only if you have deep understanding on them, otherwise keep them as default. LevelDB \u00b6 You can custom LevelDB options in the storage part of config.conf , which looks like: storage { # Directory for storing persistent data db.directory = \"database\", index.directory = \"index\", # You can custom these 14 databases' configs: # account, account-index, asset-issue, block, block-index, # block_KDB, peers, properties, recent-block, trans, # utxo, votes, witness, witness_schedule. # Otherwise, db configs will remain default and data will be stored in # the path of \"output-directory\" or which is set by \"-d\" (\"--output-directory\"). # Attention: name is a required field that must be set !!! properties = [ { name = \"account\", path = \"/path/to/account\", // relative or absolute path createIfMissing = true, paranoidChecks = true, verifyChecksums = true, compressionType = 1, // 0 - no compression, 1 - compressed with snappy blockSize = 4096, // 4 KB = 4 * 1024 B writeBufferSize = 10485760, // 10 MB = 10 * 1024 * 1024 B cacheSize = 10485760, // 10 MB = 10 * 1024 * 1024 B maxOpenFiles = 100 } ] } As shown in the example above, the data of database account will be stored in the path of /path/to/account/database while the index be stored in /path/to/account/index . And, the example also shows our default value of LevelDB options from createIfMissing to maxOpenFiles . You can just refer to the docs of LevelDB to figure out details of these options. gRPC \u00b6 You can custom gPRC options in the node.rpc part of config.conf , which looks like: node { rpc { port = 50051 # Number of gRPC thread, default availableProcessors / 2 # thread = 16 # The maximum number of concurrent calls permitted for each incoming connection # maxConcurrentCallsPerConnection = # The HTTP/2 flow control window, default 1MB # flowControlWindow = # Connection being idle for longer than which will be gracefully terminated maxConnectionIdleInMillis = 60000 # Connection lasting longer than which will be gracefully terminated # maxConnectionAgeInMillis = # The maximum message size allowed to be received on the server, default 4MB # maxMessageSize = # The maximum size of header list allowed to be received, default 8192 # maxHeaderListSize = } } backup \u00b6 You can custom backup options in the node.backup part of config.conf , which looks like: node.backup { # my priority, each member should use different priority priority = # members should use same port port = # peer's ip list, can't contain mine members = [] } policy: 1. the one which synchronized first will become master. 2. if synchronization is completed at the same time, the one which with big priority will become master. E.g. create backups for node A(192.168.0.100) and node B(192.168.0.100 ): node A's configuration: node.backup { priority = 8 port = 10001 members = [ \"192.168.0.101\" ] } node B's configuration: node.backup { priority = 5 port = 10001 members = [ \"192.168.0.100\" ] } You may refer to the source code of io.grpc.netty.NettyServerBuilder class to see details or just make a decision according to the brief comments above.","title":"Advanced Configurations"},{"location":"developers/advanced-configuration/#advanced-configurations","text":"we provide some configuration items for LevelDB and gRPC in config.conf file, for fine-grained performance tuning. You may custom these items only if you have deep understanding on them, otherwise keep them as default.","title":"Advanced Configurations"},{"location":"developers/advanced-configuration/#leveldb","text":"You can custom LevelDB options in the storage part of config.conf , which looks like: storage { # Directory for storing persistent data db.directory = \"database\", index.directory = \"index\", # You can custom these 14 databases' configs: # account, account-index, asset-issue, block, block-index, # block_KDB, peers, properties, recent-block, trans, # utxo, votes, witness, witness_schedule. # Otherwise, db configs will remain default and data will be stored in # the path of \"output-directory\" or which is set by \"-d\" (\"--output-directory\"). # Attention: name is a required field that must be set !!! properties = [ { name = \"account\", path = \"/path/to/account\", // relative or absolute path createIfMissing = true, paranoidChecks = true, verifyChecksums = true, compressionType = 1, // 0 - no compression, 1 - compressed with snappy blockSize = 4096, // 4 KB = 4 * 1024 B writeBufferSize = 10485760, // 10 MB = 10 * 1024 * 1024 B cacheSize = 10485760, // 10 MB = 10 * 1024 * 1024 B maxOpenFiles = 100 } ] } As shown in the example above, the data of database account will be stored in the path of /path/to/account/database while the index be stored in /path/to/account/index . And, the example also shows our default value of LevelDB options from createIfMissing to maxOpenFiles . You can just refer to the docs of LevelDB to figure out details of these options.","title":"LevelDB"},{"location":"developers/advanced-configuration/#grpc","text":"You can custom gPRC options in the node.rpc part of config.conf , which looks like: node { rpc { port = 50051 # Number of gRPC thread, default availableProcessors / 2 # thread = 16 # The maximum number of concurrent calls permitted for each incoming connection # maxConcurrentCallsPerConnection = # The HTTP/2 flow control window, default 1MB # flowControlWindow = # Connection being idle for longer than which will be gracefully terminated maxConnectionIdleInMillis = 60000 # Connection lasting longer than which will be gracefully terminated # maxConnectionAgeInMillis = # The maximum message size allowed to be received on the server, default 4MB # maxMessageSize = # The maximum size of header list allowed to be received, default 8192 # maxHeaderListSize = } }","title":"gRPC"},{"location":"developers/advanced-configuration/#backup","text":"You can custom backup options in the node.backup part of config.conf , which looks like: node.backup { # my priority, each member should use different priority priority = # members should use same port port = # peer's ip list, can't contain mine members = [] } policy: 1. the one which synchronized first will become master. 2. if synchronization is completed at the same time, the one which with big priority will become master. E.g. create backups for node A(192.168.0.100) and node B(192.168.0.100 ): node A's configuration: node.backup { priority = 8 port = 10001 members = [ \"192.168.0.101\" ] } node B's configuration: node.backup { priority = 5 port = 10001 members = [ \"192.168.0.100\" ] } You may refer to the source code of io.grpc.netty.NettyServerBuilder class to see details or just make a decision according to the brief comments above.","title":"backup"},{"location":"developers/archive-manifest/","text":"Leveldb Startup Optimization Plugins \u00b6 Introduction \u00b6 With the operation of levelDB, manifest file will continue to grow, huge manifest file not only affects the node startup speed, but also may cause the problem of system exit with continuous memory growth. For this reason, leveldb startup optimization plugin is introduced since GreatVoyage-v4.3.0(Bacon) , which optimizes the file size of manifest and the startup process of LevelDB, reduces the memory occupation and improves the node startup speed. Remember stop the FullNode process before any operation. This tool provides the ability to reformat the manifest according to the current database . For more design details, please refer to: TIP298 . Usage \u00b6 Options For Plug-in \u00b6 -b | --batch-size : [ int ] specify the batch manifest size,default\uff1a80000. -d | --database-directory : [ string ] Specify the database directory to be processed,default\uff1aoutput-directory/database. -m | --manifest-size : [ int ] Specify the minimum required manifest file size \uff0cunit:M\uff0cdefault\uff1a0. -h | --help : [ bool ] for usage help\uff0cdefault\uff1afalse. How to get \u00b6 build by yourself. Under java-tron, execute . /gradlew build , you can get Toolkit.jar under build/libs/ . Download directly. Links Use Steps \u00b6 Stop the FullNode service. Execute the Toolkit command. Start the FullNode service. Note: Step ii is not required every time, but it is recommended to run it every time to optimize the experience. How to use \u00b6 After FullNode runs, the default database directory: output-directory , the optimization plugin will work with the output-directory/database directory. Developers can choose one of the following two ways according to actual situation. Use it Independently \u00b6 1.Stop the FullNode service \u00b6 Use kill -15 to shutdown the FullNode.jar . Query the pid: ps -ef |grep FullNode.jar |grep -v grep |awk '{print $2}' 2.Execute the Toolkit command \u00b6 # Full command java -jar Toolkit.jar [ -b batchSize ] [ -d databaseDirectory ] [ -m manifestSize ] [ -h ] # examples java -jar Toolkit.jar #1. use default settings java -jar Toolkit.jar -d /tmp/db/database #2. Specify the database directory as /tmp/db/database java -jar Toolkit.jar -b 64000 #3. Specify the batch size to 64000 when optimizing Manifest java -jar Toolkit.jar -m 128 #4. Specify optimization only when Manifest exceeds 128M After the command is executed, archive.log will be generated in the ./logs directory, you can see the result. Note: After the command is executed\uff0cIf successful, the log will display something similar to the following, and will run generally within 120s, depending on how long the FullNode service keeps running, and if it fails there will be a corresponding error message [main] [archive](ArchiveManifest.java:144) DatabaseDirectory:output-directory/database, maxManifestSize:0, maxBatchSize:80000,database reopen use 80 seconds total. 3.Start the FullNode service \u00b6 #FullNode nohup java -Xmx24g -XX:+UseConcMarkSweepGC -jar FullNode.jar -c main_net_config.conf /dev/null & #SR Node nohup java -Xmx24g -XX:+UseConcMarkSweepGC -jar FullNode.jar -p private key --witness -c main_net_config.conf /dev/null & Integrated startup script \u00b6 #!/bin/bash APP = $1 MANIFEST_OPT = $2 ALL_OPT = $* NEED_REBUILD = 0 if [[ $1 == '--rewrite--manifest' ]] ; then APP = '' NEED_REBUILD = 1 elif [[ $2 == '--rewrite--manifest' ]] ; then NEED_REBUILD = 1 fi rebuildManifest () { if [[ $NEED_REBUILD == 1 ]] ; then buildManifest fi } buildManifest () { ARCHIVE_JAR = 'Toolkit.jar' java -jar $ARCHIVE_JAR $ALL_OPT if [ $? == 0 ] ; then echo 'rebuild manifest success' else echo 'rebuild manifest fail, log in logs/archive.log' fi } APP = ${ APP :- \"FullNode\" } START_OPT = ` echo ${ @: 2 } ` JAR_NAME = \" $APP .jar\" MAX_STOP_TIME = 60 MEM_OPT = '' checkpid () { pid = ` ps -ef | grep $JAR_NAME | grep -v grep | awk '{print $2}' ` return $pid } checkPath (){ path = 'output-directory/database' flag = 1 for p in ${ ALL_OPT } do if [[ $flag == 0 ]] ; then path = ` echo $p ` break fi if [[ $p == '-d' || $p == '--database-directory' ]] ; then path = '' flag = 0 fi done if [[ -z \" ${ path } \" ]] ; then echo '-d /path or --database-directory /path' return 1 fi if [[ -d ${ path } ]] ; then return 0 else echo $path 'not exist' return 1 fi } stopService () { count = 1 while [ $count -le $MAX_STOP_TIME ] ; do checkpid if [ $pid ] ; then kill -15 $pid sleep 1 else echo \"java-tron stop\" return fi count = $ [ $count +1 ] if [ $count -eq $MAX_STOP_TIME ] ; then kill -9 $pid sleep 1 fi done } startService () { echo ` date ` >> start.log total = 16 *1024*1024 xmx = ` echo \" $total /1024/1024*0.6\" | bc | awk -F. '{print $1\"g\"}' ` directmem = ` echo \" $total /1024/1024*0.1\" | bc | awk -F. '{print $1\"g\"}' ` logtime = ` date +%Y-%m-%d_%H-%M-%S ` export LD_PRELOAD = \"/usr/lib64/libtcmalloc.so\" nohup java -Xms $xmx -Xmx $xmx -XX:+UseConcMarkSweepGC -XX:+PrintGCDetails -Xloggc:./gc.log \\ -XX:+PrintGCDateStamps -XX:+CMSParallelRemarkEnabled -XX:ReservedCodeCacheSize = 256m -XX:+UseCodeCacheFlushing \\ $MEM_OPT -XX:MaxDirectMemorySize = $directmem -XX:+HeapDumpOnOutOfMemoryError -jar $JAR_NAME $START_OPT -c config.conf >> start.log 2 > & 1 & pid = ` ps -ef | grep $JAR_NAME | grep -v grep | awk '{print $2}' ` echo \"start java-tron with pid $pid on $HOSTNAME \" } #1.Stop the FullNode service stopService checkPath #2.Execute the Toolkit plugin if [[ 0 == $? ]] ; then rebuildManifest else exit -1 fi sleep 5 # Start the FullNode service startService example Note: Save above script as start.sh, In the above script the --rewrite--manifest argument is fixed in the first or second argument. OPTIONS --rewrite--manifest enable leveldb startup optimization plugins\uff0cThe above plug-in option `-d -m -b -h` will take effect iff this option(--rewrite--manifest) is turned on # Full command ./start.sh [ FullNode | SolidityNode ] [ --rewrite--manifest ] [ -b batchSize ] [ -d databaseDirectory ] [ -m manifestSize ] # examples ./start.sh #1. Start the FullNode.jar service without the plugin ./start.sh SolidityNode #2. Start the SolidityNode.jar service without the plugin ./start.sh FullNode --rewrite--manifest #3. Execute the optimization plugin with default settings and start the FullNode.jar service ./start.sh --rewrite--manifest -d /tmp/db/database #4. Specify the database directory as /tmp/db/database, execute the optimization plugin, and start the FullNode.jar service ./start.sh --rewrite--manifest -b 64000 #5. Specify the batch size to 64000 when optimizing Manifest, and start the FullNode.jar service ./start.sh --rewrite--manifest -m 128 #6. Specify that optimization is performed only when the Manifest exceeds 128M, and start the FullNode.jar service","title":"Leveldb Startup Optimization Plugins"},{"location":"developers/archive-manifest/#leveldb-startup-optimization-plugins","text":"","title":"Leveldb Startup Optimization Plugins"},{"location":"developers/archive-manifest/#introduction","text":"With the operation of levelDB, manifest file will continue to grow, huge manifest file not only affects the node startup speed, but also may cause the problem of system exit with continuous memory growth. For this reason, leveldb startup optimization plugin is introduced since GreatVoyage-v4.3.0(Bacon) , which optimizes the file size of manifest and the startup process of LevelDB, reduces the memory occupation and improves the node startup speed. Remember stop the FullNode process before any operation. This tool provides the ability to reformat the manifest according to the current database . For more design details, please refer to: TIP298 .","title":"Introduction"},{"location":"developers/archive-manifest/#usage","text":"","title":"Usage"},{"location":"developers/archive-manifest/#options-for-plug-in","text":"-b | --batch-size : [ int ] specify the batch manifest size,default\uff1a80000. -d | --database-directory : [ string ] Specify the database directory to be processed,default\uff1aoutput-directory/database. -m | --manifest-size : [ int ] Specify the minimum required manifest file size \uff0cunit:M\uff0cdefault\uff1a0. -h | --help : [ bool ] for usage help\uff0cdefault\uff1afalse.","title":"Options For Plug-in"},{"location":"developers/archive-manifest/#how-to-get","text":"build by yourself. Under java-tron, execute . /gradlew build , you can get Toolkit.jar under build/libs/ . Download directly. Links","title":"How to get"},{"location":"developers/archive-manifest/#use-steps","text":"Stop the FullNode service. Execute the Toolkit command. Start the FullNode service. Note: Step ii is not required every time, but it is recommended to run it every time to optimize the experience.","title":"Use Steps"},{"location":"developers/archive-manifest/#how-to-use","text":"After FullNode runs, the default database directory: output-directory , the optimization plugin will work with the output-directory/database directory. Developers can choose one of the following two ways according to actual situation.","title":"How to use"},{"location":"developers/archive-manifest/#use-it-independently","text":"","title":"Use it Independently"},{"location":"developers/archive-manifest/#1stop-the-fullnode-service","text":"Use kill -15 to shutdown the FullNode.jar . Query the pid: ps -ef |grep FullNode.jar |grep -v grep |awk '{print $2}'","title":"1.Stop the FullNode service"},{"location":"developers/archive-manifest/#2execute-the-toolkit-command","text":"# Full command java -jar Toolkit.jar [ -b batchSize ] [ -d databaseDirectory ] [ -m manifestSize ] [ -h ] # examples java -jar Toolkit.jar #1. use default settings java -jar Toolkit.jar -d /tmp/db/database #2. Specify the database directory as /tmp/db/database java -jar Toolkit.jar -b 64000 #3. Specify the batch size to 64000 when optimizing Manifest java -jar Toolkit.jar -m 128 #4. Specify optimization only when Manifest exceeds 128M After the command is executed, archive.log will be generated in the ./logs directory, you can see the result. Note: After the command is executed\uff0cIf successful, the log will display something similar to the following, and will run generally within 120s, depending on how long the FullNode service keeps running, and if it fails there will be a corresponding error message [main] [archive](ArchiveManifest.java:144) DatabaseDirectory:output-directory/database, maxManifestSize:0, maxBatchSize:80000,database reopen use 80 seconds total.","title":"2.Execute the Toolkit command"},{"location":"developers/archive-manifest/#3start-the-fullnode-service","text":"#FullNode nohup java -Xmx24g -XX:+UseConcMarkSweepGC -jar FullNode.jar -c main_net_config.conf /dev/null & #SR Node nohup java -Xmx24g -XX:+UseConcMarkSweepGC -jar FullNode.jar -p private key --witness -c main_net_config.conf /dev/null &","title":"3.Start the FullNode service"},{"location":"developers/archive-manifest/#integrated-startup-script","text":"#!/bin/bash APP = $1 MANIFEST_OPT = $2 ALL_OPT = $* NEED_REBUILD = 0 if [[ $1 == '--rewrite--manifest' ]] ; then APP = '' NEED_REBUILD = 1 elif [[ $2 == '--rewrite--manifest' ]] ; then NEED_REBUILD = 1 fi rebuildManifest () { if [[ $NEED_REBUILD == 1 ]] ; then buildManifest fi } buildManifest () { ARCHIVE_JAR = 'Toolkit.jar' java -jar $ARCHIVE_JAR $ALL_OPT if [ $? == 0 ] ; then echo 'rebuild manifest success' else echo 'rebuild manifest fail, log in logs/archive.log' fi } APP = ${ APP :- \"FullNode\" } START_OPT = ` echo ${ @: 2 } ` JAR_NAME = \" $APP .jar\" MAX_STOP_TIME = 60 MEM_OPT = '' checkpid () { pid = ` ps -ef | grep $JAR_NAME | grep -v grep | awk '{print $2}' ` return $pid } checkPath (){ path = 'output-directory/database' flag = 1 for p in ${ ALL_OPT } do if [[ $flag == 0 ]] ; then path = ` echo $p ` break fi if [[ $p == '-d' || $p == '--database-directory' ]] ; then path = '' flag = 0 fi done if [[ -z \" ${ path } \" ]] ; then echo '-d /path or --database-directory /path' return 1 fi if [[ -d ${ path } ]] ; then return 0 else echo $path 'not exist' return 1 fi } stopService () { count = 1 while [ $count -le $MAX_STOP_TIME ] ; do checkpid if [ $pid ] ; then kill -15 $pid sleep 1 else echo \"java-tron stop\" return fi count = $ [ $count +1 ] if [ $count -eq $MAX_STOP_TIME ] ; then kill -9 $pid sleep 1 fi done } startService () { echo ` date ` >> start.log total = 16 *1024*1024 xmx = ` echo \" $total /1024/1024*0.6\" | bc | awk -F. '{print $1\"g\"}' ` directmem = ` echo \" $total /1024/1024*0.1\" | bc | awk -F. '{print $1\"g\"}' ` logtime = ` date +%Y-%m-%d_%H-%M-%S ` export LD_PRELOAD = \"/usr/lib64/libtcmalloc.so\" nohup java -Xms $xmx -Xmx $xmx -XX:+UseConcMarkSweepGC -XX:+PrintGCDetails -Xloggc:./gc.log \\ -XX:+PrintGCDateStamps -XX:+CMSParallelRemarkEnabled -XX:ReservedCodeCacheSize = 256m -XX:+UseCodeCacheFlushing \\ $MEM_OPT -XX:MaxDirectMemorySize = $directmem -XX:+HeapDumpOnOutOfMemoryError -jar $JAR_NAME $START_OPT -c config.conf >> start.log 2 > & 1 & pid = ` ps -ef | grep $JAR_NAME | grep -v grep | awk '{print $2}' ` echo \"start java-tron with pid $pid on $HOSTNAME \" } #1.Stop the FullNode service stopService checkPath #2.Execute the Toolkit plugin if [[ 0 == $? ]] ; then rebuildManifest else exit -1 fi sleep 5 # Start the FullNode service startService example Note: Save above script as start.sh, In the above script the --rewrite--manifest argument is fixed in the first or second argument. OPTIONS --rewrite--manifest enable leveldb startup optimization plugins\uff0cThe above plug-in option `-d -m -b -h` will take effect iff this option(--rewrite--manifest) is turned on # Full command ./start.sh [ FullNode | SolidityNode ] [ --rewrite--manifest ] [ -b batchSize ] [ -d databaseDirectory ] [ -m manifestSize ] # examples ./start.sh #1. Start the FullNode.jar service without the plugin ./start.sh SolidityNode #2. Start the SolidityNode.jar service without the plugin ./start.sh FullNode --rewrite--manifest #3. Execute the optimization plugin with default settings and start the FullNode.jar service ./start.sh --rewrite--manifest -d /tmp/db/database #4. Specify the database directory as /tmp/db/database, execute the optimization plugin, and start the FullNode.jar service ./start.sh --rewrite--manifest -b 64000 #5. Specify the batch size to 64000 when optimizing Manifest, and start the FullNode.jar service ./start.sh --rewrite--manifest -m 128 #6. Specify that optimization is performed only when the Manifest exceeds 128M, and start the FullNode.jar service","title":"Integrated startup script"},{"location":"developers/code-structure/","text":"Java-tron Core Modules \u00b6 Code Structure \u00b6 Java-tron is a TRON network client developed based on the Java language. It implements all the functions mentioned in the TRON white paper, including consensus mechanism, cryptography, database, TVM virtual machine, network management, etc. We can run a TRON node by starting Java-tron. In this article, we will describe the code structure of Java-tron in detail, and introduce the functions of its various modules, to facilitate the subsequent code analysis and development of developers. Java-tron adopts a modular code structure; the code structure is clear and easy to maintain and expand. Currently Java-tron is divided into 7 modules: protocol , common , chainbase , consensus , actuator , crypto , framework , the following introduces the functions of each module and its code organization. protocol \u00b6 For a distributed network such as blockchain, a concise and efficient data interaction protocol is very important. The protocol module defines: Inter-node communication protocol Communication protocol between modules within the node Agreement for Services Provided Externally The above protocols adopt the Google Protobuf data exchange format. Compared with JSON and XML, the Google Protobuf format is more efficient and flexible and can be compiled by the ProtoBuf compiler to generate language-specific serialization and deserialization source code for the defined protocol files. Protobuf is the basis for java-tron to achieve cross-language and cross-platform. protocol module's source code is located at: https://github.com/tronprotocol/java-tron/tree/develop/protocol , its directory structure is as follows: |-- protos |-- api | |-- api.proto | |-- zksnark.proto |-- core |-- Discover.proto |-- Tron.proto |-- TronInventoryItems.proto |-- contract protos/api/ - The gRPC interface and data structure provided by the Java-tron node externally protos/core/ - Data structure for communication between nodes and between modules within nodes Discover.proto - Node discovers related data structures TronInventoryItems.proto - Data structure related to block transferring between nodes contract/ - Contract related data structures Tron.proto - Other important data structures, including accounts, blocks, transactions, resources, super representatives, voting, and proposals... common \u00b6 The common module encapsulates common components and tools, such as exception handling, metrics monitoring tools, etc which make it easy to use by other modules. common module's source code is located at: https://github.com/tronprotocol/java-tron/tree/develop/common , its directory structure is as follows: |-- /common/src/main/java/org/tron |-- common | |-- args | |-- config | |-- entity | |-- logsfilter | |-- overlay | |-- parameter | |-- prometheus | |-- runtime | |-- setting | |-- utils |-- core |-- config |-- db |-- db2 |-- exception common/prometheus - Prometheus metrics monitoring common/utils - The wrapper class of basic data type core/config - Node configuration related classes core/exception - All exception handling related classes chainbase \u00b6 Chainbase is a database module. For probabilistic consensus algorithms such as PoW, PoS and DPoS, situations of switching to a new chain, however unlikely, are inevitable. Because of this, chainbase defines an interface standard supporting databases that can roll back. This interface requires databases to have a state rollback mechanism, a checkpoint-based disaster tolerant mechanism and so on. In addition, the chainbase module features a well-designed abstract interface. Any database that implements the interface can be used for underlying storage on the blockchain, granting more flexibility to developers. LevelDB and RocksDB are two default implementations. chainbase module's source code is located at: https://github.com/tronprotocol/java-tron/tree/develop/chainbase , its directory structure is as follows: |-- chainbase.src.main.java.org.tron |-- common | |-- bloom | |-- error | |-- overlay | |-- runtime | |-- storage | | |-- leveldb | | |-- rocksdb | |-- utils | |-- zksnark |-- core |-- actuator |-- capsule |-- db | |-- RevokingDatabase.java | |-- TronStoreWithRevoking.java | |-- ...... |-- db2 | |-- common | |-- core | |-- SnapshotManager.java | |-- ...... |-- net |-- service |-- store common/ - Common components, such as exception handling, tools, etc storage/leveldb/ Implemented the use of LevelDB as the underlying storage database storage/rocksdb/ Implemented the use of RocksDB as the underlying storage database core/ - The core code of the chainbase module capsule/ The encapsulation class of each data structure, such as AccountCapsule, BlockCapsule, etc. AccountCapsule is the encapsulation class of Account data structure, which provides modification and query of account data; BlockCapsule is the encapsulation class of Block data structure, which provides modification and query of block data. store/ Various databases, such as AccountStore , ProposalStore , etc. AccountStore is the account database, the database name is account , which stores all account information in the TRON network; ProposalStore is the proposal database, and the database name is proposal , which stores all the proposal information in the TRON network. db/ and db2/ Implemented rollbackable databases, including two rollbackable databases: AbstractRevokingStore located in the db/ directory and SnapshotManager located in the db2/ directory. Compared with AbstractRevokingStore , SnapshotManager has a more stable data rollback function and supports the extension of the underlying database. Therefore, Java-tron uses SnapshotManager to roll back the database. Several important interfaces and implementation classes are as follows: RevokingDatabase.java - It is the interface of the database container, used to manage all rollbackable databases, SnapshotManager is an implementation of this interface TronStoreWithRevoking.java - It is the base class that supports rollbackable databases. All rollbackable databases are their implementations, such as BlockStore , TransactionStore , etc consensus \u00b6 The consensus mechanism is a crucial module in blockchains. Common ones are PoW, PoS, DPoS and PBFT, etc. While Paxos, Raft, etc, are applied to consortium blockchains and other trusted networks. The consensus mechanism should match the business scenario. For instance, PoW is not suitable for real-time games that are sensitive to consensus efficiency, while PBFT can make an optimized choice for exchanges demanding high real-time capability. In this sense, a replaceable consensus is a creative innovation and an essential link in building application-specific blockchains. Even star blockchain programs like Cosmos SDK are still at a stage where the application layer provides developers with limited autonomy and the consensus at the base level is subject to Tendermint. Therefore, the ultimate goal of the consensus module is to make consensus switch as easy as configuring parameters for application developers. consensus module's source code is located at: https://github.com/tronprotocol/java-tron/tree/develop/consensus , its directory structure is as follows: |-- consensus/src/main/java/org/tron/consensus |-- Consensus.java |-- ConsensusDelegate.java |-- base | |-- ConsensusInterface.java | |-- ...... |-- dpos |-- pbft consensus module divides the consensus process into several important parts that are defined in ConsensusInterface : start - start the consensus service with customizable startup parameters stop - stop the consensus service receiveBlock - define the consensus logic of receiving blocks validBlock - define the consensus logic of validating blocks applyBlock - define the consensus logic of processing blocks Currently, Java-tron implements DPOS consensus and PBFT consensus based on the ConsensusInterface interface, which is located in the dpos/ and pbft/ directories respectively. Developers can also implement the ConsensusInterface interface according to their own business needs to customize the consensus mechanism. actuator \u00b6 Ethereum was the first to introduce the virtual machine and define the smart contract. However, smart contracts are constrained in terms of their functions and not flexible enough to accommodate the needs of complex applications. This is one of the reasons why java-tron supports the creation of a chain of applications. For the reasons mentioned, java-tron includes a separate module, Actuator, offering application developers a brand new way of development. They can choose to implant their application codes into a chain instead of running them on virtual machines. Actuator is the executor of transactions, while applications can be viewed as a cluster of different types of transactions, each of which is executed by a corresponding actuator. actuator module's source code is located at: https://github.com/tronprotocol/java-tron/tree/develop/actuator , its directory structure is as follows: |-- actuator/src/main/java/org/tron/core |-- actuator | |-- AbstractActuator.java | |-- ActuatorCreator.java | |-- ActuatorFactory.java | |-- TransferActuator.java | |-- VMActuator.java | |-- ...... |-- utils |-- vm actuator/ - The executors of various types of transactions in the TRON network which define the processing logic of different types of transactions. For example, TransferActuator is the processing class for transferring TRX, and FreezeBalanceV2Actuator is the processing class for staking TRX to obtain resource utils/ - tools needed to execute transaction vm/ - TRON virtual machine related code Actuator module defines the Actuator interface, which includes 4 different methods: execute - execute specific actions of transactions, such as state modification, communication between modules, logic execution, etc. validate - validate authenticity of transactions getOwnerAddress - acquire the address of transaction initiators calcFee - define the logic of calculating transaction fees Depending on their businesses, developers may set up Actuator accordingly and customize the processing of different types of transactions. crypto \u00b6 Crypto is a relatively independent module, but it is also a very important module. Data security in Java-tron is almost entirely guaranteed by this module. Currently, SM2 and ECKey encryption algorithms are supported. crypto module's source code is located at: https://github.com/tronprotocol/java-tron/tree/develop/crypto , its directory structure is as follows: |-- crypto/src/main/java/org/tron/common/crypto |-- Blake2bfMessageDigest.java |-- ECKey.java |-- Hash.java |-- SignInterface.java |-- SignUtils.java |-- SignatureInterface.java |-- cryptohash |-- jce |-- sm2 |-- zksnark sm2 and jce - Provide SM2 and ECKey encryption algorithm and signature algorithm zksnark - Provide a zero-knowledge proof algorithm framework \u00b6 The framework is the core module of java-tron and the entrance of the node. The framework module is responsible for the initialization of each module and business logic. The framework module includes the services provided externally, the node discovery and node management process related to the P2P network, and the block broadcasting and processing procedures. framework module's source code is located at: https://github.com/tronprotocol/java-tron/tree/develop/framework , its directory structure is as follows: |-- framework/src/main/java/org/tron |-- common | |-- application | |-- backup | |-- logsfilter | |-- net | |-- overlay | | |-- client | | |-- discover | | |-- message | | |-- server | |-- runtime | |-- zksnark |-- core | |-- Wallet.java | |-- capsule | |-- config | |-- consensus | |-- db | |-- metrics | |-- net | |-- services | |-- trie | |-- zen |-- keystore |-- program | |-- FullNode.java |-- tool program/FullNode.java - It is the entry point of the program and initializes external HTTP, gRPC and json-rpc interface services core/services - Defines the externally provided services, its subdirectory http/ contains all http interface processing classes, json-rpc/ contains all json-rpc interface processing classes common/overlay/discover - Node discovery logic common/overlay/server - Node management and block synchronization logic among nodes core/net - Message processing, its subdirectory /service is transaction and block broadcasting, block fetching and synchronization logic core/db/Manager.java - Transaction and block verification and processing logic Summary \u00b6 This article mainly introduces the code structure of Java-tron, as well as the function, location and directory structure of each functional module. Through this article, you will have a general understanding of the overall structure and key interfaces of Java-tron, which is helpful for subsequent code analysis and development. ChainBase \u00b6 Introduction \u00b6 As we all know, the blockchain is essentially a non-tamperable distributed ledger, which is very suitable for solving the problem of trust. In reality, blockchain is often used for bookkeeping and transactions. For example, many applications use BTC, ETH, TRX, and other cryptos to carry out economic activities to ensure the openness and transparency of funds. The realization of such an immutable distributed ledger is a very complex system engineering, involving many technical fields: such as p2p networks, smart contracts, databases, cryptography, consensus mechanisms, etc. Among them, the database is the basis of the underlying storage, and various blockchain teams are exploring the design and optimization of the database level. The database module of Java-tron is also called the ChainBase module. This article mainly introduces some background knowledge and shows developers the implementation details of the ChainBase module by introducing logic such as transaction processing, state rollback, and data persistence. Prerequisites \u00b6 The database is an important part of the blockchain system. It stores all the data on the blockchain and is the basis for the normal operation of the blockchain system. Each fullnode stores a full amount of data, including block data, state data, etc. Java-tron uses the Account model to save the user's account state. Account Models \u00b6 There are currently two mainstream account models, UTXO Account Model The UTXO model is stateless, makes it easier to process transactions concurrently, and has better privacy, but it is not programming-friendly. In the Account Model, user data is stored in the corresponding account, and smart contracts are also stored in the account in the form of code. This model is more intuitive and easier for developers to understand. For programmability, flexibility, and other considerations, java-tron adopts the Account Model. Consensus \u00b6 The current mainstream consensus is PoW, PoS, DPoS, etc. PoW is proof of work, all nodes participate in the calculation of an expected hash result, and the node that first calculates the result has the right to produce a block, but as the computing power continues to increase, the energy consumption required to calculate the hash is also increasing. Moreover, large mining farms monopolize most of the computing power, which also goes against the original intention of decentralization. To solve the problems faced by PoW, some people proposed PoS (Proof of Stake), which is simply understood as the more coins that the node holds, the greater the probability of obtaining the right to produce blocks, but this will lead to monopoly problems as well. In order to improve, DPoS (Delegated Proof of Stake) is proposed: the decentralization feature is guaranteed by the elected super representative, and the super representative is responsible for the block production in turn to improve the efficiency. Java-tron currently adopts the DPoS consensus mechanism. To learn more, please refer to Delegated Proof of Stake . Persistent Storage \u00b6 There are certain differences between blockchain and traditional Internet business. The blockchain does not have particularly complex processing logic at the database level, but there are a large number of key-value read and write operations in the blockchain so there are higher requirements for data read and write performance. Based on this consideration, java-tron uses LevelDB as the underlying data storage by default, and java-tron has a good architecture design. The interface-oriented programming mode makes the chainbase module have better scalability. All databases implemented the chainbase interface can be used as the underlying storage engine of java-tron. For example, in the chainbase v2 version, a database implementation based on RocksDB is provided. Transaction Validation \u00b6 As we all know, the blockchain mainly stores transaction data. Before introducing the chainbase module, you need to understand the transaction processing logic in java-tron. The transaction will be distributed to each node through network broadcast. After receiving the transaction, the node will first validate the signature of the transaction. If successful, the transaction needs to be pre-executed to determine whether the transaction is legal. Note: The specific implementation of java-tron deviates from the above figure, and for the sake of convenience, this article collectively refers to the FullNode and SR as the nodes. For example, to process a transfer transaction: user A transfers 100 TRX to user B, and it needs to validate whether user A has enough balance to make the transfer. The account library in the database stores the account information of all users, including the user's balance information. How to judge whether this transfer transaction is legal? The logic of java-tron is: when a transaction is received from the network, the transaction operation will be executed immediately, that is, the account information will be modified in the local database: (accountA - 100TRX, accountB + 100TRX). If this operation can be executed successfully, it means that the transaction is legal at least in the current state, and can be packed into the block. Glossary \u00b6 SR\uff1a Super Representative, is responsible for block production. FullNode\uff1a stores all block data, is responsible for transactions, block broadcasting and validation, and provides query services. TRX\uff1a TRON native token. State Rollback \u00b6 Above we mentioned that java-tron validates whether the transaction is legal through pre-execution, but what we need to know is that the transaction is successfully validated on a certain node does not mean that the transaction has been successfully chained because the transaction has not been packed into the consensus blocks, there is a risk of being rolled back. The consensus of java-tron follows a principle: that is, the transactions in the blocks that are approved by more than 2/3 of the SRs are the ones that are really successful on the chain. can also be understood as below, transactions are packed into a block the block is approved by more than 2/3 of the SRs A transaction that satisfies the above two points is a successful transaction on the chain. A transaction in java-tron is finally confirmed through three stages, transaction validating transaction packing into the block block being accepted and applied This also leads to a problem: in the implementation of java-tron, if a node validates the transaction, its database state changes accordingly. If the transaction is not packed into the block yet or the block it is packed into has not been approved by more than 2/3 of SR, the state of this node will be inconsistent with the state of the entire network. Therefore, except for the processing transaction data in blocks approved by more than 2/3 SRs, all other data state changes resulting from transaction processing may need to be rolled back. There are three kinds of scenarios in total: after receiving a new block, roll back the state changes generated by transaction validation after producing a block, roll back the state changes generated by transaction validation if a forked takes place, roll back the state changes generated by the transactions of the blocks in the forked chain The data state changes caused by these three scenarios may need to be rolled back and the following section explains why. Rollback after Receiving a New Block \u00b6 When receiving a new block, the node needs to roll back to the state at the end of the previous block and roll back all transactions validated afterward. As shown below, If the account balance of accountA is 100 at the block height is 1000, the node receives and validates a transaction 't1', in which accountA transfers 100TRX to accountB. After receiving the new block1001, the block contains a transaction 't2', in which accountA transfers 50TRX to accountC. In theory, t2 has been packed into the block, and the priority is higher than t1. However, if no operation is done, the validation of t2 will fail because accountA does not have enough balance. Therefore, after receiving the new block 1001, the state change generated by transaction t1 needs to be rolled back. Rollback after Producing a New Block \u00b6 First of all, readers may have a question: the validated transaction can be directly packed into the block, and it will not change the database state. Why is there a change in the database state? Because java-tron does a secondary validation of the transaction when it is packed into the block. The secondary validation is due to the timeliness of the transaction. Still taking the above figure as an example, it can be seen from the figure, that after 1001 is received, the transaction t1 was rolled back, and the balance of accountA was deducted by 50. And then, it was the node's turn to produce a block, but t1 had become an illegal transaction at this time because the balance in accountA was not enough to transfer 100 TRX, it is not advisable to directly pack t1 into the block. So the transaction needs to be validated again, which is why the transaction needs to be validated twice when producing a block. After the block is packed successfully, the node will broadcast the block to the network and apply the block locally. And the logic of applying will re-check the transactions in the block. So after the block is packed, a rollback operation still needs to be performed. Rollback when Forking \u00b6 This is the last rollback situation, and the blockchain will inevitably fork, especially the blockchain system based on DPoS with a faster block production speed that is more prone to fork. java-tron maintains a data structure in memory as below, Java-tron holds all blocks that have not reached consensus recently. When a forked chain occurs, according to the longest chain principle: if the block height of the forked chain is greater than the current main chain block height, the forked chain needs to be switched to the main chain. Part of the blocks on the previous main chain needs to roll back up to their common parent blocks when switching, and then apply new main chain blocks sequentially from the parent block. As shown in the figure, fork A in the dark part was originally the main chain. Because the height of fork B continues to grow and eventually exceeds the height of A, it is necessary to roll back the data in those three blocks with heights 1003, 1002, and 1001 in fork A. Then apply fork blocks 1001', 1002', 1003', and 1004' in B in sequence. State Rollback Implementation \u00b6 This chapter explains receiving and validating transactions, block production, validating and saving blocks from the perspective of code, to further analyze the chainbase module of java-tron. If there is no further declaration, the default description is dedicated to all the Fullnode (including SR). Receiving Transactions \u00b6 After the node receives a transaction, it puts the transaction into the local pushTransactionQueue cache queue by calling the pushTransaction(final TransactionCapsule trx) function of the manager class and validates the transaction at the same time. And the return of this method is sort of elegant: if validation is successful, \u2018true' is returned for the transaction sent by the user to the node through the API, if the transaction validation fails, an exception will be returned to the user; for transactions received from other nodes through the network, exceptions will only be recorded locally After the transaction validation is successful, the transactions without problems will be put into the pendingTransactionQueue, and the pendingTransactionQueue is responsible for providing the transaction set when producing blocks. If the node is an SR node, when producing a block, it will take out all or part of it from the pendingTransactionQueue (depending on how many transactions are in the pendingTransactionQueue) to generate a block. Rollback when Receiving Blocks \u00b6 A node would receive transactions broadcasted from other nodes before receiving a new block, the transactions need to be validated to determine whether they can be executed correctly. Validation means that the state needs to be changed, and a successful validation does not mean that the transaction will be finally executed, and it will be considered successful after packing into a block and the block become solidified. This step can be considered to filter out those obviously wrong transactions in advance. This is just validation. When a new block arrives, the state changed by transaction validations should be rolled back. Only the state changed when applying new blocks will not be rolled back. When rolling back, java-tron move the transactions in the pendingTransactionQueue to rePushTransactions, and clear the pendingTransactionQueue, see the figure for a detailed explanation. Why does the pendingTransactionQueue need to be emptied after a new block arrives? First of all, it is clear that the pendingTransactionQueue queue is responsible for providing transaction data when generating blocks, that is to say, it stores validated transactions that can be directly packed into blocks. Since the new block will also change the account state, those validated transactions in pendingTransactionQueue may not pass the validation after applying the new block (the simplest example: a transaction in the new block is that accountA spends a part of the token, resulting in a transaction amount of accountA in the queue that is not enough to pay ). After the transaction is moved to rePushTransactions, a background thread will be responsible for re-validating the transaction in the queue. If nothing is wrong, it will be put into the pendingTransactionQueue again to provide data for block production. There is a session object in Java-Tron. A session represents the change in the state of a block. The session object is mainly used for rollback. For example,rolling back the state to the state of the previous block needs to be operated throughout the session, as shown in the following figure, In the above figure, you can see that there are many different types of databases in persistent storage. These data are jointly organized into a complete blockchain. For example, blocks are stored in khasodb and blockStore, and account information is stored in accountStore... The node maintains a session chain table, which stores the change information corresponding to the block/transaction, and the node can roll back through the change information. In the above figure, session1 is the status change of the current highest block. When a transaction is received, a new session2 will be generated. Each transaction that comes later will generate a temporary tmpSession, and after the transaction is validated, the tmpSession corresponded will be merged to session2. Before a new block is received again, all status changes generated by transaction validation will be saved in session2. When a new block arrives, directly execute the reset method of the session2 to roll back the state to the previous block. Rollback when Producing Blocks \u00b6 SR needs to roll back before producing blocks. The reasons are more complicated. Let's consider a scenario first: The pendingTransactionQueue stores the currently validated transactions, so when an SR node produces a block, it only needs to directly pack the transactions in the pendingTransactionQueue into the block, and then roll back the state to the state of the previous block after packing. However, there is a problem with this scheme: if the SR node has just received and applied a new block, the pendingTransactionQueue will be cleared. At this time, it is the turn of the SR to pack the block, but there is no transaction in pendingTransactionQueue. Therefore, the real implementation is that not only reads transactions from pendingTransactionQueue when generating blocks but also reads transactions from rePushTransactions and puts them into blocks if there are few transactions in pendingTransactionQueue. The above analysis shows that transactions in rePushTransactions may not be possible to pass the validation, so the transactions need to be validated again. Due to this validation logic, the state needs to be rolled back before the block is produced. In the process of producing the block, the transaction will be validated again, so there will be a state change, but this is just block production, and the block needs to be broadcast as well, and those blocks who received the broadcast will actually change the state, so the state changes incurred by block production also need to be rolled back. As shown in the figure above, when the block production is completed, session2\" needs to be rolled back. Block Solidity \u00b6 Java-tron adopts the DPoS consensus mechanism. The DPoS of java-tron is to vote for 27 nodes as block producers (also known as SR), SR has the right and obligation to produce blocks, and blocks approved by more than 2/3 of SR are considered to reach a consensus. These blocks, which are no longer rolled back are called solidified blocks. Only solidified blocks can be written to the database. SnapshotManager in Java-Tron is the key entry to the storage module, holds references to all current business databases, and stores database references in a list. Each database instance supports adding a new layer of state set on its own called SnapshotImpl. It is an in-memory hashmap, multiple SnapshotImpl are associated in the form of a linked list, and one SnapshotImpl retains the data modification (in-merging or merging) involved in one state change, and SnapshotImpl is independent of each other. They are separated through this data structure, as shown in the following figure, The SnapshotRoot in the above figure is the encapsulation class for the persistent database, which is responsible for storing the solidified data. In the previous chapters, we talked about sessions. A session represents the changes of state in a block. In fact, a session contains the SnapshotImpl corresponding to each database. For example, all SnapshotImpl in the layer of block 5 in the above figure together constitutes the changes of block 5 to the entire database. The changes generated after the node receives a new block will not be directly stored in the persistent storage (SnapshotRoot), but will first be stored in snapshotImpl. Each block received corresponds to a snapshotImpl. Continuously receiving blocks will lead to more and more snapshotImpl. When will they be written to persistent storage? There are two variables in SnapshotManager: 'size' and 'maxSize'. Here we simply understand 'size' as how many layers of snapshotImpl are there currently in memory, and 'maxSize' represents the difference between the height of the current solidified block and the latest block. This is obvious. If 'size' > 'maxSize', it means that the blocks corresponding to the first (size-maxSize) snapshotImpl are already solidified blocks, they can be placed on the disk, and then the snapshotImpl will be merged into the persistent storage. This ensures that snapshotImpl does not occupy too much memory, and also ensures that the solidified block can be persisted in time. Atomicity \u00b6 The database storage of Java-tron is slightly different from other public chains. For example, the Ethereum persistence layer uses only one database instance, and different types of data in Ethereum are distinguished by prefixes and stored in one database instance. However, Java-Tron currently stores data of different business types in its own database instances. The two implementations have their own advantages. A single instance is easy to maintain and can be written uniformly, but the disadvantages are also obvious. For example, the amount of data in a single database continues to grow over time, and frequent access to some business databases may drag down the read-and-write performance of other businesses. Multi-instance does not have the problem of the mutual influence of each business data read and write, and can configure different parameters according to their respective data volume and performance requirements to maximize performance, and can also independently split the database with a large amount of data. Alleviate data bloat problems. But there is a serious problem with multiple database instances: there is no native tool to support atomic writes among multiple database instances. In order to ensure the atomic writing of multiple database instances, Java-Tron has added a checkpoint mechanism, which writes the changed data to the checkpoint uniformly before the multiple instances are placed on the disk. If an accident occurs in writing to multiple database instances, the changed data will be recovered from the checkpoint when the service is restarted to ensure the atomicity of writing. The process of writing the snapshotImpl of the solidified block to the database in the previous section mainly includes two steps, create a checkpoint place snapshotImpl on disk The operation of creating a checkpoint is more critical. A checkpoint is to persistently store the snapshotImpl in memory that needs to be written to the database in a tmp database (currently, the underlying implementation is leveldb and rocksdb). After the checkpoint is successfully created, the snapshotImpl will place on the disk. If the machine is down while placing, it will first search for the existence of tmp checkpoint data when the node restart. And if so, the data in the checkpoint will be played back to snapshotRoot. A checkpoint data structure, Checkpoint stores all data of a state change in one database. Different types of data are distinguished by prefixes. In order to ensure that all changed data can be placed on disk this time, the bottom layer of the database calls writeBatch() when writing. This solution can be summarized as, the atomicity of writes cannot be guaranteed among multiple database instances, but a single database (most mainstream databases) supports atomic writes the data set that needs to be guaranteed to be written atomically is first written to a temporary database by atomic writing, and then the data is written to different database instances; if an accident occurs, it can be recovered through the data of the temporary database Summary \u00b6 This article analyzes the implementation details of rollback and database writing in the chainbase module through the processing flow of transactions and blocks and also analyzes the principle of atomic writing among multiple instances of the database to prevent database damage caused by accidental downtime. We hope that reading this article can help developers to further understand and develop the java-tron database. Network \u00b6 Overview \u00b6 P2P is a distributed network in which participants in the network share a part of the hardware resources they own, such as processing power, storage capacity, network connection capacity, printers, etc. These shared resources need to be provided services and content by the network, which can be accessed by other peers directly without going through an intermediate entity. Participants in this network are both providers and acquirers of service and content. Different from the traditional Client/Server central server structure, the status of each node in the P2P network is equal. While serving as a client, each node can also serve as a server to provide services to other nodes, which greatly improves the utilization of resources. Blockchain Network \u00b6 P2P is the network layer in the blockchain structure. The main purpose of the network layer is to realize information broadcast, verification and communication between nodes. The blockchain network is essentially a P2P network, and each node can both receive and generate information. Nodes keep communication by maintaining common blockchain data. As the foundation of the blockchain, the P2P network brings the following advantages to the blockchain: Prevent single-point attack High fault tolerance Better compatibility and scalability TRON Network \u00b6 The architecture diagram of TRON is as follows: As the most fundamental module of TRON, the P2P network directly determines the stability of the entire blockchain network. The network module can be divided into the following four parts according to the function: Node Discovery Node Connection Block Synchronization Block and Transaction Broadcast Below will separately introduce these four functional parts. Node Discovery \u00b6 Node discovery is the first step for nodes to access the blockchain network. The blockchain network is a structured P2P network which organizes all nodes in an orderly manner, such as forming a ring network or a tree-like network. Structured networks are generally implemented based on the DHT (Distributed Hash Table) algorithm. Specific implementation algorithms include Chord, Pastry, CAN, Kademlia and so on. The TRON network uses the Kademlia algorithm. Kademlia Algorithm \u00b6 Kademlia is an implementation of Distributed Hash Table (DHT), it is the core routing technology in the decentralized P2P network and can quickly find target nodes in the network without a central server. For a detailed introduction to the algorithm, please refer to Kademlia . Kademlia Implementation by TRON \u00b6 The main points of the Kademlia algorithm implemented by TRON are as follows: Node ID: Randomly generated 512bit ID Node Distance: The node distance is obtained through the XOR operation of two nodes' ID. The formula is: Node distance = 256 - the number of leading 0s in the node ID XOR result , if the calculation result is negative, the distance is equal to 0. K-Bucket: The node routing table. According to the distance between the nodes, the remote nodes are divided into different buckets. The remote nodes with the same distance as the current node are recorded in the same bucket, and each bucket can accommodate up to 16 nodes. According to the calculation formula of node distance, it can be seen that the Kademlia algorithm implemented by TRON maintains a total of 256 buckets. The node discovery protocol of TRON includes the following four UDP messages: DISCOVER_PING - used to detect if a node is online DISCOVER_PONG - used in response to DISCOVER_PING message DISCOVER_FIND_NODE - used to find other nodes closest to the target node DISCOVER_NEIGHBORS - used in response to DISCOVER_FIND_NODE message, will return one or more nodes, up to 16 Initialize K-Buckets \u00b6 After the node is started, it will read the seed nodes configured in the node configuration file and the peer nodes recorded in the database, and then send DISCOVER_PING message to them respectively. If the reply message DISCOVER_PONG from a peer is received, and at the condition that the K bucket is not full, it will then write the peer node into the K bucket; But if the corresponding bucket has already been full (that is the bucket has reached 16 nodes), it will challenge to the earliest node in the bucket. If the challenge is successful, the old node will be deleted, and the new node will be added to the K bucket. That is the K bucket initialization process, then the node discovery process is performed. Send DISCOVER_FIND_NODE to Find More Nodes \u00b6 The node discovery service will start two scheduled tasks ( DiscoverTask and RefreshTask ) to periodically perform the node discovery process to update k buckets. DiscoverTask is to discover more nodes that are closer to myself. It is executed every 30s. The execution flow is as follows: RefreshTask is to expand the local k-bucket by random node ID, that is, to find nodes that are closer to the random node ID. It is executed every 7.2s. The execution process is as follows: The node discovery algorithm used in DiscoverTask and RefreshTask will be executed 8 rounds in one call, and each round sends DISCOVER_FIND_NODE message to the 3 nodes closest to the target node ID in the K bucket, and waits for a reply. Receive Neighbors' Messages and Update K Bucket \u00b6 When the local node receives the DISCOVER_NEIGHBORS message replied by the remote node, it will send the DISCOVER_PING message to the received neighbor node in turn, and then if it receives the reply message DISCOVER_PONG , it will judge whether the corresponding K-bucket is full, if the K-bucket is not full, it will add the new node to the K bucket, if the K bucket is full, it will challenge one of the nodes, if the challenge is successful (send a DISCOVER_PING message to the old node, if it fails to receive the reply message DISCOVER_PONG , the challenge is successful, otherwise the challenge fails), the old node will be deleted from the K bucket, and the new node will be added to the K bucket. Nodes periodically perform node discovery tasks, continuously update K-buckets, and build their own node routing tables. The next step is to establish a connection with nodes. Node Connection \u00b6 Before understanding how to establish a TCP connection between nodes, we need to first understand the peer node type. Peer Node Management \u00b6 The local node needs to manage and classify peer nodes for efficient and stable node connection. Remote nodes can be divided into the following categories: Active nodes: specified in the configuration file. After the system starts, it will actively establish connections with the nodes. If the connection fails to be established, it will retry in each scheduled TCP connection task. Passive nodes: specified in the configuration file. The local node will passively accept connections from them. Trust nodes: specified in the configuration file, both Active nodes and Passive nodes are trusted nodes. When receiving a connection request from a trusted node, some other condition checks are skipped and the request is accepted directly. BadNodes: When an abnormal protocol packet is received, the sending node will be added to the badNodes list, valid for 1 hour. When a connection request from badNodes is received, the request will be rejected directly RecentlyDisconnectedNodes: When a connection is disconnected, the peer node will be added to the recentlyDisconnectedNodes list, valid for 30s, when a connection request from recentlyDisconnectedNodes is received, the request will be rejected directly Establish TCP Connection with Peers \u00b6 After the node is started, a scheduled task poolLoopExecutor will be created to establish a TCP connection with nodes. It will select nodes and establish connections with them. The working process is as follows: The TCP connection can be mainly divided into two steps: first, determine the node list which the node will establish a connection with. The list needs to contain the active nodes that have not successfully established a connection, and then calculate the number of connections that also need to be established, and filter out the nodes from discovered neighbors according to the node filtering strategy , then score and sort them according to the node scoring strategy , and the corresponding number of nodes with the highest score is added to the request list. Finally, TCP connections are established with the nodes in the request list. Node Filtering Strategy \u00b6 When establishing a node connection, it is necessary to filter out the following types of nodes and determine whether the node's own connection number has reached the maximum value. Myself Nodes in the recentlyDisconnectedNodes list Nodes in badNodes list Nodes that have already established a connection The number of connections established with the node IP has already reached the upper limit (maxConnectionsWithSameIp) But for trusted nodes, some filtering policies are ignored and connections are always established. Node Scoring Strategy \u00b6 The node score is used to determine the priority of nodes to establish a connection. The higher the score, the higher the priority. Scoring dimensions include: Packet loss rate: The lower the packet loss rate, the better the communication quality. The score is inversely proportional to the packet loss rate. The highest score is 100 and the lowest is 0. Network delay: The smaller the network delay, the better the network quality. The score is inversely proportional to the average network latency. The highest score is 20 and the lowest is 0. TCP traffic: The larger the TCP traffic, the more active the communication. The score is proportional to the TCP traffic, with a maximum score of 20 and a minimum of 0 Disconnection times: The fewer disconnection times, the more stable the node is. The score is inversely proportional to the number of disconnections. The score is 10 times the number of disconnections. Handshake: Nodes that have been handshake successfully before indicate that they have the same blockchain information, so it is preferred to establish a connection with them. When the number of successful Handshakes is greater than 0, the Handshake score is 20, otherwise, the score is 0. Penalty state: A node in the Penalty state has a score of 0 and does not participate in scoring in other dimensions. The following situations will be regarded as in the Penalty state: Node disconnection time is less than 60s The node is in the badNodes list Inconsistent blockchain information When calculating the node score, first determine whether the node is in the Penalty state, if so, the score is counted as 0, otherwise, the node score is the sum of the scores of each dimension. Handshake \u00b6 After the TCP connection is successfully established, the node that actively initiates the TCP connection request will send a handshake message P2P_HELLO to the neighbor node, in order to confirm whether the blockchain information between the nodes is consistent and whether it is necessary to initiate the block synchronization process. When the neighbor node receives P2P_HELLO , it will compare with the local information, such as checking whether the p2p version and the genesis block information are consistent. If all the check conditions are passed, it will reply to the P2P_HELLO message, and then perform the block synchronization or broadcast; otherwise, it will disconnect the connection. Channel Keep-Alive \u00b6 Channel keep-alive is accomplished through P2P_PING , P2P_PONG TCP messages. When a node establishes a TCP connection with a neighbor node and handshakes successfully, the node will open a thread pingTask for the connection and periodically send P2P_PING messages to maintain the TCP connection, which is scheduled every 10s. If the P2P_PONG message replied is not received within the timeout period, the connection will be terminated. Block Synchronization \u00b6 After completing the handshake with the peer node, if the peer node's blockchain is longer than the local blockchain, the block synchronization process syncService.startSync will be triggered according to the longest chain principle. The message interaction during the synchronization process is as follows: Node A sends an SYNC_BLOCK_CHAIN message to peer node B to announce the blockchain summary information of the local chain. After the peer node B receives it, it calculates the list of missing blocks of node A, and sends the lost block ID list to node A through the BLOCK_CHAIN_INVENTORY message, carrying a maximum of 2000 block ids at a time. After node A receives the BLOCK_CHAIN_INVENTORY message, it gets the missing block id, and sends a FETCH_INV_DATA message to node B asynchronously to request the missing block, up to 100 blocks at a time. If there are still blocks that need to be synchronized (that is, the remain_num in the BLOCK_CHAIN_INVENTORY message is greater than 0), a new round of block synchronization process will be triggered. After node B receives the FETCH_INV_DATA message from node A, it sends the block to node A through the BLOCK message. After node A receives the BLOCK message, it asynchronously processes the block. Blockchain Summary and List of Missing Blocks \u00b6 Below will take several different block synchronization scenarios as examples to illustrate the generation of the blockchain summary and the lost block ID list. Blockchain summary: an ordered list of block IDs, including the highest solidified block, the highest non-solidified block, and the blocks corresponding to the dichotomy. List of missing blocks: The neighbor node compares its own chain with the received blockchain summary, determines the missing blocks list of peers, and returns a set of consecutive block IDs and the number of remaining blocks. Normal Synchronization Scene \u00b6 The height of the local header block is 1018, and the height of the solidified block is 1000. The two nodes have just established a connection, so the height of the common block is 0. The local blockchain summary of node A obtained by the dichotomy is 1000, 1010, 1015, 1017, and 1018. After node B receives the blockchain summary of node A, combined with the local chain, it can produce the list of blocks that node A lacks: 1018, 1019, 1020, and 1021. Then, node A requests to synchronize blocks 1019, 1020, and 1021 according to the list of missing blocks. Chain-Switching Scene \u00b6 The head block height of the local main chain is 1018, and the height of the solidified block is 1000. The two nodes have just established a connection, so the height of the common block is 0. The local blockchain summary of node A obtained by the dichotomy is 1000, 1010, 1015, 1017, and 1018. After node B receives the chain summary of node A, it finds that the local main chain is not the same as the main chain of node A, compares the chain summary of node A and finds that the common block height is 1015, then it computes the list of blocks that node A lacks are 1015, 1016', 1017', 1018', and 1019'. Then, node A requests to synchronize blocks 1018' and 1019' according to the list of missing blocks. In another switching chain scenario, the height of the local main chain header block is 1018, the height of the solidified block is 1000, and the common block is 1017', which is located on the fork chain. The local blockchain summary of node A obtained by the dichotomy is 1000, 1009, 1014, 1016', and 1017'. After node B receives the chain summary of node A, combined with the local chain, it can produce the list of blocks that node A lacks 1017', 1018', and 1019'. Then, node A requests to synchronize blocks 1018', and 1019' according to the list of missing blocks. Block and Transaction Broadcast \u00b6 When the super representative node produces a new block, or the fullnode receives a new transaction initiated by the user, the transaction & block broadcasting process will be initiated. When a node receives a new block or new transaction, it will forward the corresponding block or transaction, and the forwarding process is the same as that of broadcasting. The message interaction is shown in the following figure: The types of messages involved include: INVENTORY - broadcast list: list of block or transaction ids FETCH_INV_DATA - the list data that the node needs to get: block or transaction id list BLOCK - block data TRXS - transaction data Node A sends the transaction or block to be broadcast to Node B via the INVENTORY list message. After node B receives the INVENTORY list message, it needs to check the status of the peer node, and if it can receive the message, it puts the blocks/transactions in the list into the \"to be fetched queue\" invToFetch . If it is a block list, it will also trigger the \"get block & transaction task\" immediately to send a FETCH_INV_DATA message to node A to get the block & transaction. After node A receives the FETCH_INV_DATA message, it will check whether an \"INVENTORY\" message has been sent to the peer. If it has been sent, it will send a transaction or block message to node B according to the list data. After node B receives the transaction or block message, it processes the message and triggers the forwarding process. Summary \u00b6 This article introduces the implementation details related to the P2P network, the lowest level module of TRON, including node discovery, node connection, block synchronization, and the process of block and transaction broadcasting. I hope that reading this article can help developers to further understand and develop java-tron network-related modules.","title":"Core Modules"},{"location":"developers/code-structure/#java-tron-core-modules","text":"","title":"Java-tron Core Modules"},{"location":"developers/code-structure/#code-structure","text":"Java-tron is a TRON network client developed based on the Java language. It implements all the functions mentioned in the TRON white paper, including consensus mechanism, cryptography, database, TVM virtual machine, network management, etc. We can run a TRON node by starting Java-tron. In this article, we will describe the code structure of Java-tron in detail, and introduce the functions of its various modules, to facilitate the subsequent code analysis and development of developers. Java-tron adopts a modular code structure; the code structure is clear and easy to maintain and expand. Currently Java-tron is divided into 7 modules: protocol , common , chainbase , consensus , actuator , crypto , framework , the following introduces the functions of each module and its code organization.","title":"Code Structure"},{"location":"developers/code-structure/#protocol","text":"For a distributed network such as blockchain, a concise and efficient data interaction protocol is very important. The protocol module defines: Inter-node communication protocol Communication protocol between modules within the node Agreement for Services Provided Externally The above protocols adopt the Google Protobuf data exchange format. Compared with JSON and XML, the Google Protobuf format is more efficient and flexible and can be compiled by the ProtoBuf compiler to generate language-specific serialization and deserialization source code for the defined protocol files. Protobuf is the basis for java-tron to achieve cross-language and cross-platform. protocol module's source code is located at: https://github.com/tronprotocol/java-tron/tree/develop/protocol , its directory structure is as follows: |-- protos |-- api | |-- api.proto | |-- zksnark.proto |-- core |-- Discover.proto |-- Tron.proto |-- TronInventoryItems.proto |-- contract protos/api/ - The gRPC interface and data structure provided by the Java-tron node externally protos/core/ - Data structure for communication between nodes and between modules within nodes Discover.proto - Node discovers related data structures TronInventoryItems.proto - Data structure related to block transferring between nodes contract/ - Contract related data structures Tron.proto - Other important data structures, including accounts, blocks, transactions, resources, super representatives, voting, and proposals...","title":"protocol"},{"location":"developers/code-structure/#common","text":"The common module encapsulates common components and tools, such as exception handling, metrics monitoring tools, etc which make it easy to use by other modules. common module's source code is located at: https://github.com/tronprotocol/java-tron/tree/develop/common , its directory structure is as follows: |-- /common/src/main/java/org/tron |-- common | |-- args | |-- config | |-- entity | |-- logsfilter | |-- overlay | |-- parameter | |-- prometheus | |-- runtime | |-- setting | |-- utils |-- core |-- config |-- db |-- db2 |-- exception common/prometheus - Prometheus metrics monitoring common/utils - The wrapper class of basic data type core/config - Node configuration related classes core/exception - All exception handling related classes","title":"common"},{"location":"developers/code-structure/#chainbase","text":"Chainbase is a database module. For probabilistic consensus algorithms such as PoW, PoS and DPoS, situations of switching to a new chain, however unlikely, are inevitable. Because of this, chainbase defines an interface standard supporting databases that can roll back. This interface requires databases to have a state rollback mechanism, a checkpoint-based disaster tolerant mechanism and so on. In addition, the chainbase module features a well-designed abstract interface. Any database that implements the interface can be used for underlying storage on the blockchain, granting more flexibility to developers. LevelDB and RocksDB are two default implementations. chainbase module's source code is located at: https://github.com/tronprotocol/java-tron/tree/develop/chainbase , its directory structure is as follows: |-- chainbase.src.main.java.org.tron |-- common | |-- bloom | |-- error | |-- overlay | |-- runtime | |-- storage | | |-- leveldb | | |-- rocksdb | |-- utils | |-- zksnark |-- core |-- actuator |-- capsule |-- db | |-- RevokingDatabase.java | |-- TronStoreWithRevoking.java | |-- ...... |-- db2 | |-- common | |-- core | |-- SnapshotManager.java | |-- ...... |-- net |-- service |-- store common/ - Common components, such as exception handling, tools, etc storage/leveldb/ Implemented the use of LevelDB as the underlying storage database storage/rocksdb/ Implemented the use of RocksDB as the underlying storage database core/ - The core code of the chainbase module capsule/ The encapsulation class of each data structure, such as AccountCapsule, BlockCapsule, etc. AccountCapsule is the encapsulation class of Account data structure, which provides modification and query of account data; BlockCapsule is the encapsulation class of Block data structure, which provides modification and query of block data. store/ Various databases, such as AccountStore , ProposalStore , etc. AccountStore is the account database, the database name is account , which stores all account information in the TRON network; ProposalStore is the proposal database, and the database name is proposal , which stores all the proposal information in the TRON network. db/ and db2/ Implemented rollbackable databases, including two rollbackable databases: AbstractRevokingStore located in the db/ directory and SnapshotManager located in the db2/ directory. Compared with AbstractRevokingStore , SnapshotManager has a more stable data rollback function and supports the extension of the underlying database. Therefore, Java-tron uses SnapshotManager to roll back the database. Several important interfaces and implementation classes are as follows: RevokingDatabase.java - It is the interface of the database container, used to manage all rollbackable databases, SnapshotManager is an implementation of this interface TronStoreWithRevoking.java - It is the base class that supports rollbackable databases. All rollbackable databases are their implementations, such as BlockStore , TransactionStore , etc","title":"chainbase"},{"location":"developers/code-structure/#consensus","text":"The consensus mechanism is a crucial module in blockchains. Common ones are PoW, PoS, DPoS and PBFT, etc. While Paxos, Raft, etc, are applied to consortium blockchains and other trusted networks. The consensus mechanism should match the business scenario. For instance, PoW is not suitable for real-time games that are sensitive to consensus efficiency, while PBFT can make an optimized choice for exchanges demanding high real-time capability. In this sense, a replaceable consensus is a creative innovation and an essential link in building application-specific blockchains. Even star blockchain programs like Cosmos SDK are still at a stage where the application layer provides developers with limited autonomy and the consensus at the base level is subject to Tendermint. Therefore, the ultimate goal of the consensus module is to make consensus switch as easy as configuring parameters for application developers. consensus module's source code is located at: https://github.com/tronprotocol/java-tron/tree/develop/consensus , its directory structure is as follows: |-- consensus/src/main/java/org/tron/consensus |-- Consensus.java |-- ConsensusDelegate.java |-- base | |-- ConsensusInterface.java | |-- ...... |-- dpos |-- pbft consensus module divides the consensus process into several important parts that are defined in ConsensusInterface : start - start the consensus service with customizable startup parameters stop - stop the consensus service receiveBlock - define the consensus logic of receiving blocks validBlock - define the consensus logic of validating blocks applyBlock - define the consensus logic of processing blocks Currently, Java-tron implements DPOS consensus and PBFT consensus based on the ConsensusInterface interface, which is located in the dpos/ and pbft/ directories respectively. Developers can also implement the ConsensusInterface interface according to their own business needs to customize the consensus mechanism.","title":"consensus"},{"location":"developers/code-structure/#actuator","text":"Ethereum was the first to introduce the virtual machine and define the smart contract. However, smart contracts are constrained in terms of their functions and not flexible enough to accommodate the needs of complex applications. This is one of the reasons why java-tron supports the creation of a chain of applications. For the reasons mentioned, java-tron includes a separate module, Actuator, offering application developers a brand new way of development. They can choose to implant their application codes into a chain instead of running them on virtual machines. Actuator is the executor of transactions, while applications can be viewed as a cluster of different types of transactions, each of which is executed by a corresponding actuator. actuator module's source code is located at: https://github.com/tronprotocol/java-tron/tree/develop/actuator , its directory structure is as follows: |-- actuator/src/main/java/org/tron/core |-- actuator | |-- AbstractActuator.java | |-- ActuatorCreator.java | |-- ActuatorFactory.java | |-- TransferActuator.java | |-- VMActuator.java | |-- ...... |-- utils |-- vm actuator/ - The executors of various types of transactions in the TRON network which define the processing logic of different types of transactions. For example, TransferActuator is the processing class for transferring TRX, and FreezeBalanceV2Actuator is the processing class for staking TRX to obtain resource utils/ - tools needed to execute transaction vm/ - TRON virtual machine related code Actuator module defines the Actuator interface, which includes 4 different methods: execute - execute specific actions of transactions, such as state modification, communication between modules, logic execution, etc. validate - validate authenticity of transactions getOwnerAddress - acquire the address of transaction initiators calcFee - define the logic of calculating transaction fees Depending on their businesses, developers may set up Actuator accordingly and customize the processing of different types of transactions.","title":"actuator"},{"location":"developers/code-structure/#crypto","text":"Crypto is a relatively independent module, but it is also a very important module. Data security in Java-tron is almost entirely guaranteed by this module. Currently, SM2 and ECKey encryption algorithms are supported. crypto module's source code is located at: https://github.com/tronprotocol/java-tron/tree/develop/crypto , its directory structure is as follows: |-- crypto/src/main/java/org/tron/common/crypto |-- Blake2bfMessageDigest.java |-- ECKey.java |-- Hash.java |-- SignInterface.java |-- SignUtils.java |-- SignatureInterface.java |-- cryptohash |-- jce |-- sm2 |-- zksnark sm2 and jce - Provide SM2 and ECKey encryption algorithm and signature algorithm zksnark - Provide a zero-knowledge proof algorithm","title":"crypto"},{"location":"developers/code-structure/#framework","text":"The framework is the core module of java-tron and the entrance of the node. The framework module is responsible for the initialization of each module and business logic. The framework module includes the services provided externally, the node discovery and node management process related to the P2P network, and the block broadcasting and processing procedures. framework module's source code is located at: https://github.com/tronprotocol/java-tron/tree/develop/framework , its directory structure is as follows: |-- framework/src/main/java/org/tron |-- common | |-- application | |-- backup | |-- logsfilter | |-- net | |-- overlay | | |-- client | | |-- discover | | |-- message | | |-- server | |-- runtime | |-- zksnark |-- core | |-- Wallet.java | |-- capsule | |-- config | |-- consensus | |-- db | |-- metrics | |-- net | |-- services | |-- trie | |-- zen |-- keystore |-- program | |-- FullNode.java |-- tool program/FullNode.java - It is the entry point of the program and initializes external HTTP, gRPC and json-rpc interface services core/services - Defines the externally provided services, its subdirectory http/ contains all http interface processing classes, json-rpc/ contains all json-rpc interface processing classes common/overlay/discover - Node discovery logic common/overlay/server - Node management and block synchronization logic among nodes core/net - Message processing, its subdirectory /service is transaction and block broadcasting, block fetching and synchronization logic core/db/Manager.java - Transaction and block verification and processing logic","title":"framework"},{"location":"developers/code-structure/#summary","text":"This article mainly introduces the code structure of Java-tron, as well as the function, location and directory structure of each functional module. Through this article, you will have a general understanding of the overall structure and key interfaces of Java-tron, which is helpful for subsequent code analysis and development.","title":"Summary"},{"location":"developers/code-structure/#chainbase_1","text":"","title":"ChainBase"},{"location":"developers/code-structure/#introduction","text":"As we all know, the blockchain is essentially a non-tamperable distributed ledger, which is very suitable for solving the problem of trust. In reality, blockchain is often used for bookkeeping and transactions. For example, many applications use BTC, ETH, TRX, and other cryptos to carry out economic activities to ensure the openness and transparency of funds. The realization of such an immutable distributed ledger is a very complex system engineering, involving many technical fields: such as p2p networks, smart contracts, databases, cryptography, consensus mechanisms, etc. Among them, the database is the basis of the underlying storage, and various blockchain teams are exploring the design and optimization of the database level. The database module of Java-tron is also called the ChainBase module. This article mainly introduces some background knowledge and shows developers the implementation details of the ChainBase module by introducing logic such as transaction processing, state rollback, and data persistence.","title":"Introduction"},{"location":"developers/code-structure/#prerequisites","text":"The database is an important part of the blockchain system. It stores all the data on the blockchain and is the basis for the normal operation of the blockchain system. Each fullnode stores a full amount of data, including block data, state data, etc. Java-tron uses the Account model to save the user's account state.","title":"Prerequisites"},{"location":"developers/code-structure/#account-models","text":"There are currently two mainstream account models, UTXO Account Model The UTXO model is stateless, makes it easier to process transactions concurrently, and has better privacy, but it is not programming-friendly. In the Account Model, user data is stored in the corresponding account, and smart contracts are also stored in the account in the form of code. This model is more intuitive and easier for developers to understand. For programmability, flexibility, and other considerations, java-tron adopts the Account Model.","title":"Account Models"},{"location":"developers/code-structure/#consensus_1","text":"The current mainstream consensus is PoW, PoS, DPoS, etc. PoW is proof of work, all nodes participate in the calculation of an expected hash result, and the node that first calculates the result has the right to produce a block, but as the computing power continues to increase, the energy consumption required to calculate the hash is also increasing. Moreover, large mining farms monopolize most of the computing power, which also goes against the original intention of decentralization. To solve the problems faced by PoW, some people proposed PoS (Proof of Stake), which is simply understood as the more coins that the node holds, the greater the probability of obtaining the right to produce blocks, but this will lead to monopoly problems as well. In order to improve, DPoS (Delegated Proof of Stake) is proposed: the decentralization feature is guaranteed by the elected super representative, and the super representative is responsible for the block production in turn to improve the efficiency. Java-tron currently adopts the DPoS consensus mechanism. To learn more, please refer to Delegated Proof of Stake .","title":"Consensus"},{"location":"developers/code-structure/#persistent-storage","text":"There are certain differences between blockchain and traditional Internet business. The blockchain does not have particularly complex processing logic at the database level, but there are a large number of key-value read and write operations in the blockchain so there are higher requirements for data read and write performance. Based on this consideration, java-tron uses LevelDB as the underlying data storage by default, and java-tron has a good architecture design. The interface-oriented programming mode makes the chainbase module have better scalability. All databases implemented the chainbase interface can be used as the underlying storage engine of java-tron. For example, in the chainbase v2 version, a database implementation based on RocksDB is provided.","title":"Persistent Storage"},{"location":"developers/code-structure/#transaction-validation","text":"As we all know, the blockchain mainly stores transaction data. Before introducing the chainbase module, you need to understand the transaction processing logic in java-tron. The transaction will be distributed to each node through network broadcast. After receiving the transaction, the node will first validate the signature of the transaction. If successful, the transaction needs to be pre-executed to determine whether the transaction is legal. Note: The specific implementation of java-tron deviates from the above figure, and for the sake of convenience, this article collectively refers to the FullNode and SR as the nodes. For example, to process a transfer transaction: user A transfers 100 TRX to user B, and it needs to validate whether user A has enough balance to make the transfer. The account library in the database stores the account information of all users, including the user's balance information. How to judge whether this transfer transaction is legal? The logic of java-tron is: when a transaction is received from the network, the transaction operation will be executed immediately, that is, the account information will be modified in the local database: (accountA - 100TRX, accountB + 100TRX). If this operation can be executed successfully, it means that the transaction is legal at least in the current state, and can be packed into the block.","title":"Transaction Validation"},{"location":"developers/code-structure/#glossary","text":"SR\uff1a Super Representative, is responsible for block production. FullNode\uff1a stores all block data, is responsible for transactions, block broadcasting and validation, and provides query services. TRX\uff1a TRON native token.","title":"Glossary"},{"location":"developers/code-structure/#state-rollback","text":"Above we mentioned that java-tron validates whether the transaction is legal through pre-execution, but what we need to know is that the transaction is successfully validated on a certain node does not mean that the transaction has been successfully chained because the transaction has not been packed into the consensus blocks, there is a risk of being rolled back. The consensus of java-tron follows a principle: that is, the transactions in the blocks that are approved by more than 2/3 of the SRs are the ones that are really successful on the chain. can also be understood as below, transactions are packed into a block the block is approved by more than 2/3 of the SRs A transaction that satisfies the above two points is a successful transaction on the chain. A transaction in java-tron is finally confirmed through three stages, transaction validating transaction packing into the block block being accepted and applied This also leads to a problem: in the implementation of java-tron, if a node validates the transaction, its database state changes accordingly. If the transaction is not packed into the block yet or the block it is packed into has not been approved by more than 2/3 of SR, the state of this node will be inconsistent with the state of the entire network. Therefore, except for the processing transaction data in blocks approved by more than 2/3 SRs, all other data state changes resulting from transaction processing may need to be rolled back. There are three kinds of scenarios in total: after receiving a new block, roll back the state changes generated by transaction validation after producing a block, roll back the state changes generated by transaction validation if a forked takes place, roll back the state changes generated by the transactions of the blocks in the forked chain The data state changes caused by these three scenarios may need to be rolled back and the following section explains why.","title":"State Rollback"},{"location":"developers/code-structure/#rollback-after-receiving-a-new-block","text":"When receiving a new block, the node needs to roll back to the state at the end of the previous block and roll back all transactions validated afterward. As shown below, If the account balance of accountA is 100 at the block height is 1000, the node receives and validates a transaction 't1', in which accountA transfers 100TRX to accountB. After receiving the new block1001, the block contains a transaction 't2', in which accountA transfers 50TRX to accountC. In theory, t2 has been packed into the block, and the priority is higher than t1. However, if no operation is done, the validation of t2 will fail because accountA does not have enough balance. Therefore, after receiving the new block 1001, the state change generated by transaction t1 needs to be rolled back.","title":"Rollback after Receiving a New Block"},{"location":"developers/code-structure/#rollback-after-producing-a-new-block","text":"First of all, readers may have a question: the validated transaction can be directly packed into the block, and it will not change the database state. Why is there a change in the database state? Because java-tron does a secondary validation of the transaction when it is packed into the block. The secondary validation is due to the timeliness of the transaction. Still taking the above figure as an example, it can be seen from the figure, that after 1001 is received, the transaction t1 was rolled back, and the balance of accountA was deducted by 50. And then, it was the node's turn to produce a block, but t1 had become an illegal transaction at this time because the balance in accountA was not enough to transfer 100 TRX, it is not advisable to directly pack t1 into the block. So the transaction needs to be validated again, which is why the transaction needs to be validated twice when producing a block. After the block is packed successfully, the node will broadcast the block to the network and apply the block locally. And the logic of applying will re-check the transactions in the block. So after the block is packed, a rollback operation still needs to be performed.","title":"Rollback after Producing a New Block"},{"location":"developers/code-structure/#rollback-when-forking","text":"This is the last rollback situation, and the blockchain will inevitably fork, especially the blockchain system based on DPoS with a faster block production speed that is more prone to fork. java-tron maintains a data structure in memory as below, Java-tron holds all blocks that have not reached consensus recently. When a forked chain occurs, according to the longest chain principle: if the block height of the forked chain is greater than the current main chain block height, the forked chain needs to be switched to the main chain. Part of the blocks on the previous main chain needs to roll back up to their common parent blocks when switching, and then apply new main chain blocks sequentially from the parent block. As shown in the figure, fork A in the dark part was originally the main chain. Because the height of fork B continues to grow and eventually exceeds the height of A, it is necessary to roll back the data in those three blocks with heights 1003, 1002, and 1001 in fork A. Then apply fork blocks 1001', 1002', 1003', and 1004' in B in sequence.","title":"Rollback when Forking"},{"location":"developers/code-structure/#state-rollback-implementation","text":"This chapter explains receiving and validating transactions, block production, validating and saving blocks from the perspective of code, to further analyze the chainbase module of java-tron. If there is no further declaration, the default description is dedicated to all the Fullnode (including SR).","title":"State Rollback Implementation"},{"location":"developers/code-structure/#receiving-transactions","text":"After the node receives a transaction, it puts the transaction into the local pushTransactionQueue cache queue by calling the pushTransaction(final TransactionCapsule trx) function of the manager class and validates the transaction at the same time. And the return of this method is sort of elegant: if validation is successful, \u2018true' is returned for the transaction sent by the user to the node through the API, if the transaction validation fails, an exception will be returned to the user; for transactions received from other nodes through the network, exceptions will only be recorded locally After the transaction validation is successful, the transactions without problems will be put into the pendingTransactionQueue, and the pendingTransactionQueue is responsible for providing the transaction set when producing blocks. If the node is an SR node, when producing a block, it will take out all or part of it from the pendingTransactionQueue (depending on how many transactions are in the pendingTransactionQueue) to generate a block.","title":"Receiving Transactions"},{"location":"developers/code-structure/#rollback-when-receiving-blocks","text":"A node would receive transactions broadcasted from other nodes before receiving a new block, the transactions need to be validated to determine whether they can be executed correctly. Validation means that the state needs to be changed, and a successful validation does not mean that the transaction will be finally executed, and it will be considered successful after packing into a block and the block become solidified. This step can be considered to filter out those obviously wrong transactions in advance. This is just validation. When a new block arrives, the state changed by transaction validations should be rolled back. Only the state changed when applying new blocks will not be rolled back. When rolling back, java-tron move the transactions in the pendingTransactionQueue to rePushTransactions, and clear the pendingTransactionQueue, see the figure for a detailed explanation. Why does the pendingTransactionQueue need to be emptied after a new block arrives? First of all, it is clear that the pendingTransactionQueue queue is responsible for providing transaction data when generating blocks, that is to say, it stores validated transactions that can be directly packed into blocks. Since the new block will also change the account state, those validated transactions in pendingTransactionQueue may not pass the validation after applying the new block (the simplest example: a transaction in the new block is that accountA spends a part of the token, resulting in a transaction amount of accountA in the queue that is not enough to pay ). After the transaction is moved to rePushTransactions, a background thread will be responsible for re-validating the transaction in the queue. If nothing is wrong, it will be put into the pendingTransactionQueue again to provide data for block production. There is a session object in Java-Tron. A session represents the change in the state of a block. The session object is mainly used for rollback. For example,rolling back the state to the state of the previous block needs to be operated throughout the session, as shown in the following figure, In the above figure, you can see that there are many different types of databases in persistent storage. These data are jointly organized into a complete blockchain. For example, blocks are stored in khasodb and blockStore, and account information is stored in accountStore... The node maintains a session chain table, which stores the change information corresponding to the block/transaction, and the node can roll back through the change information. In the above figure, session1 is the status change of the current highest block. When a transaction is received, a new session2 will be generated. Each transaction that comes later will generate a temporary tmpSession, and after the transaction is validated, the tmpSession corresponded will be merged to session2. Before a new block is received again, all status changes generated by transaction validation will be saved in session2. When a new block arrives, directly execute the reset method of the session2 to roll back the state to the previous block.","title":"Rollback when Receiving Blocks"},{"location":"developers/code-structure/#rollback-when-producing-blocks","text":"SR needs to roll back before producing blocks. The reasons are more complicated. Let's consider a scenario first: The pendingTransactionQueue stores the currently validated transactions, so when an SR node produces a block, it only needs to directly pack the transactions in the pendingTransactionQueue into the block, and then roll back the state to the state of the previous block after packing. However, there is a problem with this scheme: if the SR node has just received and applied a new block, the pendingTransactionQueue will be cleared. At this time, it is the turn of the SR to pack the block, but there is no transaction in pendingTransactionQueue. Therefore, the real implementation is that not only reads transactions from pendingTransactionQueue when generating blocks but also reads transactions from rePushTransactions and puts them into blocks if there are few transactions in pendingTransactionQueue. The above analysis shows that transactions in rePushTransactions may not be possible to pass the validation, so the transactions need to be validated again. Due to this validation logic, the state needs to be rolled back before the block is produced. In the process of producing the block, the transaction will be validated again, so there will be a state change, but this is just block production, and the block needs to be broadcast as well, and those blocks who received the broadcast will actually change the state, so the state changes incurred by block production also need to be rolled back. As shown in the figure above, when the block production is completed, session2\" needs to be rolled back.","title":"Rollback when Producing Blocks"},{"location":"developers/code-structure/#block-solidity","text":"Java-tron adopts the DPoS consensus mechanism. The DPoS of java-tron is to vote for 27 nodes as block producers (also known as SR), SR has the right and obligation to produce blocks, and blocks approved by more than 2/3 of SR are considered to reach a consensus. These blocks, which are no longer rolled back are called solidified blocks. Only solidified blocks can be written to the database. SnapshotManager in Java-Tron is the key entry to the storage module, holds references to all current business databases, and stores database references in a list. Each database instance supports adding a new layer of state set on its own called SnapshotImpl. It is an in-memory hashmap, multiple SnapshotImpl are associated in the form of a linked list, and one SnapshotImpl retains the data modification (in-merging or merging) involved in one state change, and SnapshotImpl is independent of each other. They are separated through this data structure, as shown in the following figure, The SnapshotRoot in the above figure is the encapsulation class for the persistent database, which is responsible for storing the solidified data. In the previous chapters, we talked about sessions. A session represents the changes of state in a block. In fact, a session contains the SnapshotImpl corresponding to each database. For example, all SnapshotImpl in the layer of block 5 in the above figure together constitutes the changes of block 5 to the entire database. The changes generated after the node receives a new block will not be directly stored in the persistent storage (SnapshotRoot), but will first be stored in snapshotImpl. Each block received corresponds to a snapshotImpl. Continuously receiving blocks will lead to more and more snapshotImpl. When will they be written to persistent storage? There are two variables in SnapshotManager: 'size' and 'maxSize'. Here we simply understand 'size' as how many layers of snapshotImpl are there currently in memory, and 'maxSize' represents the difference between the height of the current solidified block and the latest block. This is obvious. If 'size' > 'maxSize', it means that the blocks corresponding to the first (size-maxSize) snapshotImpl are already solidified blocks, they can be placed on the disk, and then the snapshotImpl will be merged into the persistent storage. This ensures that snapshotImpl does not occupy too much memory, and also ensures that the solidified block can be persisted in time.","title":"Block Solidity"},{"location":"developers/code-structure/#atomicity","text":"The database storage of Java-tron is slightly different from other public chains. For example, the Ethereum persistence layer uses only one database instance, and different types of data in Ethereum are distinguished by prefixes and stored in one database instance. However, Java-Tron currently stores data of different business types in its own database instances. The two implementations have their own advantages. A single instance is easy to maintain and can be written uniformly, but the disadvantages are also obvious. For example, the amount of data in a single database continues to grow over time, and frequent access to some business databases may drag down the read-and-write performance of other businesses. Multi-instance does not have the problem of the mutual influence of each business data read and write, and can configure different parameters according to their respective data volume and performance requirements to maximize performance, and can also independently split the database with a large amount of data. Alleviate data bloat problems. But there is a serious problem with multiple database instances: there is no native tool to support atomic writes among multiple database instances. In order to ensure the atomic writing of multiple database instances, Java-Tron has added a checkpoint mechanism, which writes the changed data to the checkpoint uniformly before the multiple instances are placed on the disk. If an accident occurs in writing to multiple database instances, the changed data will be recovered from the checkpoint when the service is restarted to ensure the atomicity of writing. The process of writing the snapshotImpl of the solidified block to the database in the previous section mainly includes two steps, create a checkpoint place snapshotImpl on disk The operation of creating a checkpoint is more critical. A checkpoint is to persistently store the snapshotImpl in memory that needs to be written to the database in a tmp database (currently, the underlying implementation is leveldb and rocksdb). After the checkpoint is successfully created, the snapshotImpl will place on the disk. If the machine is down while placing, it will first search for the existence of tmp checkpoint data when the node restart. And if so, the data in the checkpoint will be played back to snapshotRoot. A checkpoint data structure, Checkpoint stores all data of a state change in one database. Different types of data are distinguished by prefixes. In order to ensure that all changed data can be placed on disk this time, the bottom layer of the database calls writeBatch() when writing. This solution can be summarized as, the atomicity of writes cannot be guaranteed among multiple database instances, but a single database (most mainstream databases) supports atomic writes the data set that needs to be guaranteed to be written atomically is first written to a temporary database by atomic writing, and then the data is written to different database instances; if an accident occurs, it can be recovered through the data of the temporary database","title":"Atomicity"},{"location":"developers/code-structure/#summary_1","text":"This article analyzes the implementation details of rollback and database writing in the chainbase module through the processing flow of transactions and blocks and also analyzes the principle of atomic writing among multiple instances of the database to prevent database damage caused by accidental downtime. We hope that reading this article can help developers to further understand and develop the java-tron database.","title":"Summary"},{"location":"developers/code-structure/#network","text":"","title":"Network"},{"location":"developers/code-structure/#overview","text":"P2P is a distributed network in which participants in the network share a part of the hardware resources they own, such as processing power, storage capacity, network connection capacity, printers, etc. These shared resources need to be provided services and content by the network, which can be accessed by other peers directly without going through an intermediate entity. Participants in this network are both providers and acquirers of service and content. Different from the traditional Client/Server central server structure, the status of each node in the P2P network is equal. While serving as a client, each node can also serve as a server to provide services to other nodes, which greatly improves the utilization of resources.","title":"Overview"},{"location":"developers/code-structure/#blockchain-network","text":"P2P is the network layer in the blockchain structure. The main purpose of the network layer is to realize information broadcast, verification and communication between nodes. The blockchain network is essentially a P2P network, and each node can both receive and generate information. Nodes keep communication by maintaining common blockchain data. As the foundation of the blockchain, the P2P network brings the following advantages to the blockchain: Prevent single-point attack High fault tolerance Better compatibility and scalability","title":"Blockchain Network"},{"location":"developers/code-structure/#tron-network","text":"The architecture diagram of TRON is as follows: As the most fundamental module of TRON, the P2P network directly determines the stability of the entire blockchain network. The network module can be divided into the following four parts according to the function: Node Discovery Node Connection Block Synchronization Block and Transaction Broadcast Below will separately introduce these four functional parts.","title":"TRON Network"},{"location":"developers/code-structure/#node-discovery","text":"Node discovery is the first step for nodes to access the blockchain network. The blockchain network is a structured P2P network which organizes all nodes in an orderly manner, such as forming a ring network or a tree-like network. Structured networks are generally implemented based on the DHT (Distributed Hash Table) algorithm. Specific implementation algorithms include Chord, Pastry, CAN, Kademlia and so on. The TRON network uses the Kademlia algorithm.","title":"Node Discovery"},{"location":"developers/code-structure/#kademlia-algorithm","text":"Kademlia is an implementation of Distributed Hash Table (DHT), it is the core routing technology in the decentralized P2P network and can quickly find target nodes in the network without a central server. For a detailed introduction to the algorithm, please refer to Kademlia .","title":"Kademlia Algorithm"},{"location":"developers/code-structure/#kademlia-implementation-by-tron","text":"The main points of the Kademlia algorithm implemented by TRON are as follows: Node ID: Randomly generated 512bit ID Node Distance: The node distance is obtained through the XOR operation of two nodes' ID. The formula is: Node distance = 256 - the number of leading 0s in the node ID XOR result , if the calculation result is negative, the distance is equal to 0. K-Bucket: The node routing table. According to the distance between the nodes, the remote nodes are divided into different buckets. The remote nodes with the same distance as the current node are recorded in the same bucket, and each bucket can accommodate up to 16 nodes. According to the calculation formula of node distance, it can be seen that the Kademlia algorithm implemented by TRON maintains a total of 256 buckets. The node discovery protocol of TRON includes the following four UDP messages: DISCOVER_PING - used to detect if a node is online DISCOVER_PONG - used in response to DISCOVER_PING message DISCOVER_FIND_NODE - used to find other nodes closest to the target node DISCOVER_NEIGHBORS - used in response to DISCOVER_FIND_NODE message, will return one or more nodes, up to 16","title":"Kademlia Implementation by TRON"},{"location":"developers/code-structure/#initialize-k-buckets","text":"After the node is started, it will read the seed nodes configured in the node configuration file and the peer nodes recorded in the database, and then send DISCOVER_PING message to them respectively. If the reply message DISCOVER_PONG from a peer is received, and at the condition that the K bucket is not full, it will then write the peer node into the K bucket; But if the corresponding bucket has already been full (that is the bucket has reached 16 nodes), it will challenge to the earliest node in the bucket. If the challenge is successful, the old node will be deleted, and the new node will be added to the K bucket. That is the K bucket initialization process, then the node discovery process is performed.","title":"Initialize K-Buckets"},{"location":"developers/code-structure/#send-discover_find_node-to-find-more-nodes","text":"The node discovery service will start two scheduled tasks ( DiscoverTask and RefreshTask ) to periodically perform the node discovery process to update k buckets. DiscoverTask is to discover more nodes that are closer to myself. It is executed every 30s. The execution flow is as follows: RefreshTask is to expand the local k-bucket by random node ID, that is, to find nodes that are closer to the random node ID. It is executed every 7.2s. The execution process is as follows: The node discovery algorithm used in DiscoverTask and RefreshTask will be executed 8 rounds in one call, and each round sends DISCOVER_FIND_NODE message to the 3 nodes closest to the target node ID in the K bucket, and waits for a reply.","title":"Send DISCOVER_FIND_NODE to Find More Nodes"},{"location":"developers/code-structure/#receive-neighbors-messages-and-update-k-bucket","text":"When the local node receives the DISCOVER_NEIGHBORS message replied by the remote node, it will send the DISCOVER_PING message to the received neighbor node in turn, and then if it receives the reply message DISCOVER_PONG , it will judge whether the corresponding K-bucket is full, if the K-bucket is not full, it will add the new node to the K bucket, if the K bucket is full, it will challenge one of the nodes, if the challenge is successful (send a DISCOVER_PING message to the old node, if it fails to receive the reply message DISCOVER_PONG , the challenge is successful, otherwise the challenge fails), the old node will be deleted from the K bucket, and the new node will be added to the K bucket. Nodes periodically perform node discovery tasks, continuously update K-buckets, and build their own node routing tables. The next step is to establish a connection with nodes.","title":"Receive Neighbors' Messages and Update K Bucket"},{"location":"developers/code-structure/#node-connection","text":"Before understanding how to establish a TCP connection between nodes, we need to first understand the peer node type.","title":"Node Connection"},{"location":"developers/code-structure/#peer-node-management","text":"The local node needs to manage and classify peer nodes for efficient and stable node connection. Remote nodes can be divided into the following categories: Active nodes: specified in the configuration file. After the system starts, it will actively establish connections with the nodes. If the connection fails to be established, it will retry in each scheduled TCP connection task. Passive nodes: specified in the configuration file. The local node will passively accept connections from them. Trust nodes: specified in the configuration file, both Active nodes and Passive nodes are trusted nodes. When receiving a connection request from a trusted node, some other condition checks are skipped and the request is accepted directly. BadNodes: When an abnormal protocol packet is received, the sending node will be added to the badNodes list, valid for 1 hour. When a connection request from badNodes is received, the request will be rejected directly RecentlyDisconnectedNodes: When a connection is disconnected, the peer node will be added to the recentlyDisconnectedNodes list, valid for 30s, when a connection request from recentlyDisconnectedNodes is received, the request will be rejected directly","title":"Peer Node Management"},{"location":"developers/code-structure/#establish-tcp-connection-with-peers","text":"After the node is started, a scheduled task poolLoopExecutor will be created to establish a TCP connection with nodes. It will select nodes and establish connections with them. The working process is as follows: The TCP connection can be mainly divided into two steps: first, determine the node list which the node will establish a connection with. The list needs to contain the active nodes that have not successfully established a connection, and then calculate the number of connections that also need to be established, and filter out the nodes from discovered neighbors according to the node filtering strategy , then score and sort them according to the node scoring strategy , and the corresponding number of nodes with the highest score is added to the request list. Finally, TCP connections are established with the nodes in the request list.","title":"Establish TCP Connection with Peers"},{"location":"developers/code-structure/#node-filtering-strategy","text":"When establishing a node connection, it is necessary to filter out the following types of nodes and determine whether the node's own connection number has reached the maximum value. Myself Nodes in the recentlyDisconnectedNodes list Nodes in badNodes list Nodes that have already established a connection The number of connections established with the node IP has already reached the upper limit (maxConnectionsWithSameIp) But for trusted nodes, some filtering policies are ignored and connections are always established.","title":"Node Filtering Strategy"},{"location":"developers/code-structure/#node-scoring-strategy","text":"The node score is used to determine the priority of nodes to establish a connection. The higher the score, the higher the priority. Scoring dimensions include: Packet loss rate: The lower the packet loss rate, the better the communication quality. The score is inversely proportional to the packet loss rate. The highest score is 100 and the lowest is 0. Network delay: The smaller the network delay, the better the network quality. The score is inversely proportional to the average network latency. The highest score is 20 and the lowest is 0. TCP traffic: The larger the TCP traffic, the more active the communication. The score is proportional to the TCP traffic, with a maximum score of 20 and a minimum of 0 Disconnection times: The fewer disconnection times, the more stable the node is. The score is inversely proportional to the number of disconnections. The score is 10 times the number of disconnections. Handshake: Nodes that have been handshake successfully before indicate that they have the same blockchain information, so it is preferred to establish a connection with them. When the number of successful Handshakes is greater than 0, the Handshake score is 20, otherwise, the score is 0. Penalty state: A node in the Penalty state has a score of 0 and does not participate in scoring in other dimensions. The following situations will be regarded as in the Penalty state: Node disconnection time is less than 60s The node is in the badNodes list Inconsistent blockchain information When calculating the node score, first determine whether the node is in the Penalty state, if so, the score is counted as 0, otherwise, the node score is the sum of the scores of each dimension.","title":"Node Scoring Strategy"},{"location":"developers/code-structure/#handshake","text":"After the TCP connection is successfully established, the node that actively initiates the TCP connection request will send a handshake message P2P_HELLO to the neighbor node, in order to confirm whether the blockchain information between the nodes is consistent and whether it is necessary to initiate the block synchronization process. When the neighbor node receives P2P_HELLO , it will compare with the local information, such as checking whether the p2p version and the genesis block information are consistent. If all the check conditions are passed, it will reply to the P2P_HELLO message, and then perform the block synchronization or broadcast; otherwise, it will disconnect the connection.","title":"Handshake"},{"location":"developers/code-structure/#channel-keep-alive","text":"Channel keep-alive is accomplished through P2P_PING , P2P_PONG TCP messages. When a node establishes a TCP connection with a neighbor node and handshakes successfully, the node will open a thread pingTask for the connection and periodically send P2P_PING messages to maintain the TCP connection, which is scheduled every 10s. If the P2P_PONG message replied is not received within the timeout period, the connection will be terminated.","title":"Channel Keep-Alive"},{"location":"developers/code-structure/#block-synchronization","text":"After completing the handshake with the peer node, if the peer node's blockchain is longer than the local blockchain, the block synchronization process syncService.startSync will be triggered according to the longest chain principle. The message interaction during the synchronization process is as follows: Node A sends an SYNC_BLOCK_CHAIN message to peer node B to announce the blockchain summary information of the local chain. After the peer node B receives it, it calculates the list of missing blocks of node A, and sends the lost block ID list to node A through the BLOCK_CHAIN_INVENTORY message, carrying a maximum of 2000 block ids at a time. After node A receives the BLOCK_CHAIN_INVENTORY message, it gets the missing block id, and sends a FETCH_INV_DATA message to node B asynchronously to request the missing block, up to 100 blocks at a time. If there are still blocks that need to be synchronized (that is, the remain_num in the BLOCK_CHAIN_INVENTORY message is greater than 0), a new round of block synchronization process will be triggered. After node B receives the FETCH_INV_DATA message from node A, it sends the block to node A through the BLOCK message. After node A receives the BLOCK message, it asynchronously processes the block.","title":"Block Synchronization"},{"location":"developers/code-structure/#blockchain-summary-and-list-of-missing-blocks","text":"Below will take several different block synchronization scenarios as examples to illustrate the generation of the blockchain summary and the lost block ID list. Blockchain summary: an ordered list of block IDs, including the highest solidified block, the highest non-solidified block, and the blocks corresponding to the dichotomy. List of missing blocks: The neighbor node compares its own chain with the received blockchain summary, determines the missing blocks list of peers, and returns a set of consecutive block IDs and the number of remaining blocks.","title":"Blockchain Summary and List of Missing Blocks"},{"location":"developers/code-structure/#normal-synchronization-scene","text":"The height of the local header block is 1018, and the height of the solidified block is 1000. The two nodes have just established a connection, so the height of the common block is 0. The local blockchain summary of node A obtained by the dichotomy is 1000, 1010, 1015, 1017, and 1018. After node B receives the blockchain summary of node A, combined with the local chain, it can produce the list of blocks that node A lacks: 1018, 1019, 1020, and 1021. Then, node A requests to synchronize blocks 1019, 1020, and 1021 according to the list of missing blocks.","title":"Normal Synchronization Scene"},{"location":"developers/code-structure/#chain-switching-scene","text":"The head block height of the local main chain is 1018, and the height of the solidified block is 1000. The two nodes have just established a connection, so the height of the common block is 0. The local blockchain summary of node A obtained by the dichotomy is 1000, 1010, 1015, 1017, and 1018. After node B receives the chain summary of node A, it finds that the local main chain is not the same as the main chain of node A, compares the chain summary of node A and finds that the common block height is 1015, then it computes the list of blocks that node A lacks are 1015, 1016', 1017', 1018', and 1019'. Then, node A requests to synchronize blocks 1018' and 1019' according to the list of missing blocks. In another switching chain scenario, the height of the local main chain header block is 1018, the height of the solidified block is 1000, and the common block is 1017', which is located on the fork chain. The local blockchain summary of node A obtained by the dichotomy is 1000, 1009, 1014, 1016', and 1017'. After node B receives the chain summary of node A, combined with the local chain, it can produce the list of blocks that node A lacks 1017', 1018', and 1019'. Then, node A requests to synchronize blocks 1018', and 1019' according to the list of missing blocks.","title":"Chain-Switching Scene"},{"location":"developers/code-structure/#block-and-transaction-broadcast","text":"When the super representative node produces a new block, or the fullnode receives a new transaction initiated by the user, the transaction & block broadcasting process will be initiated. When a node receives a new block or new transaction, it will forward the corresponding block or transaction, and the forwarding process is the same as that of broadcasting. The message interaction is shown in the following figure: The types of messages involved include: INVENTORY - broadcast list: list of block or transaction ids FETCH_INV_DATA - the list data that the node needs to get: block or transaction id list BLOCK - block data TRXS - transaction data Node A sends the transaction or block to be broadcast to Node B via the INVENTORY list message. After node B receives the INVENTORY list message, it needs to check the status of the peer node, and if it can receive the message, it puts the blocks/transactions in the list into the \"to be fetched queue\" invToFetch . If it is a block list, it will also trigger the \"get block & transaction task\" immediately to send a FETCH_INV_DATA message to node A to get the block & transaction. After node A receives the FETCH_INV_DATA message, it will check whether an \"INVENTORY\" message has been sent to the peer. If it has been sent, it will send a transaction or block message to node B according to the list data. After node B receives the transaction or block message, it processes the message and triggers the forwarding process.","title":"Block and Transaction Broadcast"},{"location":"developers/code-structure/#summary_2","text":"This article introduces the implementation details related to the P2P network, the lowest level module of TRON, including node discovery, node connection, block synchronization, and the process of block and transaction broadcasting. I hope that reading this article can help developers to further understand and develop java-tron network-related modules.","title":"Summary"},{"location":"developers/contribution/","text":"How to contribute \u00b6 Getting Started as TRON Community Developers \u00b6 TRON is a global, open-source platform for decentralized applications. Thank you for considering to help out with the source code! We welcome contributions from anyone on the internet, and are grateful for even the smallest of fixes! GitHub is used to track issues and contribute code, suggestions, feature requests or documentation. If you'd like to contribute to TRON, please fork, fix, commit and send a pull request (PR) for the maintainers to review and merge into the main base. If you wish to submit more complex changes though, please check up with the core developers first on our channel to ensure those changes are in line with the general philosophy of the project and/or get some early feedback which can make both your efforts much lighter as well as our review and merge procedures quick and simple. Your PR will be reviewed according to the Code Review Guidelines. We encourage a PR early approach, meaning you create the PR the earliest even without the fix/feature. This will let core developers and other volunteers know you picked up an issue. These early PRs should indicate 'in progress' status. ** Developer Community ** java-tron gitter channel This channel is for TRON network issues. wallet-cli gitter channel This channel is for the client of TRON network issues. documentation gitter channel This channel is for TRON docunentation issues. tips gitter channel This channel is for TRON improment proposal issues. Check TRON Incentives Policy Submitting a TIP \u00b6 Please check Submitting a TIP Coding java-tron \u00b6 Please check Coding java-tron Reporting Vulnerabilities \u00b6 We think highly of all the security bugs in the TRON project seriously. Thank you for improving the security of TRON project. We really appreciate your efforts and responsible disclosure. We will make every effort to acknowledge your contributions. Report security bugs at https://hackerone.com/tronfoundation A developer from the core devs will follow up the issue. Firstly, we will confirm the bug and determine the affected versions. Secondly, we will try to find any potential similar bugs. Then we will do the fix and prepare for the release. After the initial reply to your report is sent, we will try to keep you informed on the progress towards the fix. The core devs may ask you for additional information or guidance. If you have suggestions on how this process could be improved, please submit a pull request. Writing Documentation \u00b6 There are two documentation repositories: documentation-en is the English version. documentation-zh is the Chinese version. We use MkDocs to build documentation project. Documentation source files are written in Markdown, and configured with a single YAML configuration file. You can edit or add a documentation file in /docs/ folder.","title":"How to contribute"},{"location":"developers/contribution/#how-to-contribute","text":"","title":"How to contribute"},{"location":"developers/contribution/#getting-started-as-tron-community-developers","text":"TRON is a global, open-source platform for decentralized applications. Thank you for considering to help out with the source code! We welcome contributions from anyone on the internet, and are grateful for even the smallest of fixes! GitHub is used to track issues and contribute code, suggestions, feature requests or documentation. If you'd like to contribute to TRON, please fork, fix, commit and send a pull request (PR) for the maintainers to review and merge into the main base. If you wish to submit more complex changes though, please check up with the core developers first on our channel to ensure those changes are in line with the general philosophy of the project and/or get some early feedback which can make both your efforts much lighter as well as our review and merge procedures quick and simple. Your PR will be reviewed according to the Code Review Guidelines. We encourage a PR early approach, meaning you create the PR the earliest even without the fix/feature. This will let core developers and other volunteers know you picked up an issue. These early PRs should indicate 'in progress' status. ** Developer Community ** java-tron gitter channel This channel is for TRON network issues. wallet-cli gitter channel This channel is for the client of TRON network issues. documentation gitter channel This channel is for TRON docunentation issues. tips gitter channel This channel is for TRON improment proposal issues. Check TRON Incentives Policy","title":"Getting Started as TRON Community Developers"},{"location":"developers/contribution/#submitting-a-tip","text":"Please check Submitting a TIP","title":"Submitting a TIP"},{"location":"developers/contribution/#coding-java-tron","text":"Please check Coding java-tron","title":"Coding java-tron"},{"location":"developers/contribution/#reporting-vulnerabilities","text":"We think highly of all the security bugs in the TRON project seriously. Thank you for improving the security of TRON project. We really appreciate your efforts and responsible disclosure. We will make every effort to acknowledge your contributions. Report security bugs at https://hackerone.com/tronfoundation A developer from the core devs will follow up the issue. Firstly, we will confirm the bug and determine the affected versions. Secondly, we will try to find any potential similar bugs. Then we will do the fix and prepare for the release. After the initial reply to your report is sent, we will try to keep you informed on the progress towards the fix. The core devs may ask you for additional information or guidance. If you have suggestions on how this process could be improved, please submit a pull request.","title":"Reporting Vulnerabilities"},{"location":"developers/contribution/#writing-documentation","text":"There are two documentation repositories: documentation-en is the English version. documentation-zh is the Chinese version. We use MkDocs to build documentation project. Documentation source files are written in Markdown, and configured with a single YAML configuration file. You can edit or add a documentation file in /docs/ folder.","title":"Writing Documentation"},{"location":"developers/demo/","text":"Development Example \u00b6 This article will take adding a new setPeer HTTP interface as an example to illustrate how to participate in the development of Java-tron. Before developing, please configure the InteliJ IDE development environment . Sometimes Java-tron nodes may not be able to connect to peers due to network reasons, if you can add trusted nodes while the node is running, this will allow the node to connect to the peer even if the node discovery function is not working. Fork Java-tron Repository \u00b6 Fork a new repository from the https://github.com/tronprotocol/java-tron project to your personal repository, and then use the following command Clone the code locally: $ git clone https://github.com/yourname/java-tron.git $ git remote add upstream https://github.com/tronprotocol/java-tron.git Sync Repository \u00b6 Before developing new features, please synchronize your fork repository with the upstream repository. $ git fetch upstream $ git checkout develop $ git merge upstream/develop --no-ff Create New Branch \u00b6 Pull a new branch from the develop branch of your own repository for local development, please refer to branch naming convention . In this example, the name of the new branch is: feature/ add-new-http-demo . $ git checkout -b feature/add-new-http-demo develop Code Development \u00b6 Open the Java-tron project in IDEA. Create a new servlet file in the java-tron/framework/src/main/java/org/tron/core/services/http directory to process HTTP requests: SetPeerServlet.java, the file should contain two functions doGet and doPost . doGet is used to handle http get requests and doPost is used to handle http post requests. If one of these types of requests is not supported, the method content can be empty. @Component @Slf4j ( topic = \"API\" ) public class SetPeerServlet extends HttpServlet { protected void doGet ( HttpServletRequest request , HttpServletResponse response ) {} protected void doPost ( HttpServletRequest request , HttpServletResponse response ) {} } In this example, the setPeer request should be sent by post, so you need to add processing logic in the doPost method, and the content of the doGet method keeps empty. The processing logic of the doPost method is: Get the incoming parameters Add peer information to the list of trusted nodes through the addPeer method Return the processing result of addPeer to the front-end user @Component @Slf4j ( topic = \"API\" ) public class SetPeerServlet extends HttpServlet { @Autowired private ChannelManager channelManager ; protected void doPost ( HttpServletRequest request , HttpServletResponse response ) { try { PostParams params = PostParams . getPostParams ( request ); JSONObject jsonObject = JSONObject . parseObject ( params . getParams ()); String peerIpPort = String . valueOf ( jsonObject . get ( \"peer\" )); boolean res = addPeer ( peerIpPort ); if ( res ) { response . getWriter (). println ( \"Success to set trusted peer:\" + peerIpPort ); } else { response . getWriter (). println ( \"Fail to set the trusted peer:\" + peerIpPort ); } } catch ( Exception e ) { logger . error ( \"Exception occurs when setting peer: {}\" , e . getMessage ()); try { response . getWriter (). println ( Util . printErrorMsg ( e )); } catch ( IOException ioe ) { logger . error ( \"IOException occurs when setting peer: {}\" , ioe . getMessage ()); } } } ...... } Put the processing logic of adding trust nodes in the addPeer method, which not only makes the code logic clearer, but also easier to test. The logic of the addPeer method is: Check the parameters the user entered to ensure that the node ip and port are not empty Construct node information through Node.instanceOf(peerIP) Make sure that the added trust node is not self Add the node to the trusted node list boolean addPeer ( String peerIP ) { try { if ( peerIP != \"\" ) { Node node = Node . instanceOf ( peerIP ); if ( ! ( CommonParameter . PARAMETER . nodeDiscoveryBindIp . equals ( node . getHost ()) || CommonParameter . PARAMETER . nodeExternalIp . equals ( node . getHost ()) || Constant . LOCAL_HOST . equals ( node . getHost ())) || CommonParameter . PARAMETER . nodeListenPort != node . getPort ()) { InetAddress address = new InetSocketAddress ( node . getHost (), node . getPort ()). getAddress (); channelManager . getTrustNodes (). put ( address , node ); return true ; } } } catch ( Exception e ) { logger . error ( \"addPeer error - {}\" , e . getMessage ()); } return false ; } } After completing the implementation of SetPeerServlet, you also need to register it in the node HTTP API service, FullNodeHttpApiService is the registration entry for the node HTTP API. Call the context.addServlet method in the start function of the FullNodeHttpApiService class to register the SetPeerServlet to the service. The name of the HTTP interface is defined as /wallet/setpeer . public class FullNodeHttpApiService implements Service { ...... @Autowired private SetPeerServlet setPeerServlet ; ....... @Override public void start () { ...... context . addServlet ( new ServletHolder ( setPeerServlet ), \"/wallet/setpeer\" ); ....... } } Then you can debug the above code, start the Java-tron node in IDEA, and interact with the node through the below Curl command in the terminal: $ curl --location --request POST 'http://127.0.0.1:16667/wallet/setpeer' \\ --header 'Content-Type: application/json' \\ --data-raw '{ \"peer\":\"192.163.3.2:16667\" }' Return: Success to set trusted peer:192.163.3.2:16667 At this point, the code development is complete, and then you need to write unit tests for the changes. For simple changes, unit tests can be written after the development code is completed, but for larger changes, it is recommended to write unit tests at the same time as development. Write Unit Test \u00b6 The unit test of the Java-tron project is based on the JUnit framework. For the usage of JUnit, please refer to JUnit official website . The following is a brief introduction to the Java-tron unit test case specification and common annotations. Java-tron Unit Test Cases Writing Specification \u00b6 When writing Java-tron unit test cases, please follow the below guidelines: All test classes should be placed in the test directory, and the package of the test class should be consistent with the package structure of the tested code. Generally, use Test as the suffix of a class name The test method must be decorated with @Test and it must be public void type. Generally, test is used as the prefix of the method name Each test method in the test class must be independently testable, and there must be no dependencies between methods Common Annotations \u00b6 The following are descriptions of some commonly used annotations. For other annotations, please refer to JUnit official website documentation . @Test - transforms a normal method into a test method @Ignore - the decorated test method will be ignored by the test runner @BeforeClass - the method will be executed before all methods, static method (only executed once globally, and it is the first running one) @AfterClass - the method will be executed after all methods, static methods ( only executed once globally, and it will be the last running one) @Before - it will be executed once before each test method @After - it will be executed once after each test method The Composition Of The Unit Test Class \u00b6 A unit test class should contain the following three parts: @Before or @BeforeClass decorated function, used for initialization before test case execution @After or @BeforeClass decorated function, used to process data cleaning after the test case execution Test method decorated by @Test public class demoTest { @Before public void init () { // Initialization work before test case execution } @After public void destroy () { // Destroy work after test case execution } @Test public void testDemoMethod () { } } For this example in the article, a new file should be created in the framework/src/test/java/org/tron/core/services/http/ directory: SetPeerServletTest.java used to write test cases. public class SetPeerServletTest { private static TronApplicationContext context ; private static Application appT ; public static ChannelManager channelManager ; @Before public void init () { Args . setParam ( new String [] {}, Constant . TEST_CONF ); context = new TronApplicationContext ( DefaultConfig . class ); channelManager = context . getBean ( ChannelManager . class ); appT = ApplicationFactory . create ( context ); appT . initServices ( Args . getInstance ()); appT . startServices (); appT . startup (); } @After public void destroy () { Args . clearParam (); appT . shutdownServices (); appT . shutdown (); } @Test public void testAddPeer () { SetPeerServlet setPeerServlet = new SetPeerServlet (); Assert . assertFalse ( setPeerServlet . addPeer ( \"127.0.0.1\" )); } } Code Style Check \u00b6 Check the modified files one by one, and select Check Current File in the right-click menu. If there are code style problems, please modify them one by one according to the prompts. Fix the code style warning in the picture, and then check the file again until there is no warning. Commit Code \u00b6 Submit the code after development complete, please refer to the commit specification . git add . git commit -m 'add a new http api setpeer' Push the new branch to the personal remote repository: git push origin feature/add-new-http-demo Submit Pull Request \u00b6 Submit a pull request (PR) from your repository to tronprotocol/java-tron .","title":"Development Example"},{"location":"developers/demo/#development-example","text":"This article will take adding a new setPeer HTTP interface as an example to illustrate how to participate in the development of Java-tron. Before developing, please configure the InteliJ IDE development environment . Sometimes Java-tron nodes may not be able to connect to peers due to network reasons, if you can add trusted nodes while the node is running, this will allow the node to connect to the peer even if the node discovery function is not working.","title":"Development Example"},{"location":"developers/demo/#fork-java-tron-repository","text":"Fork a new repository from the https://github.com/tronprotocol/java-tron project to your personal repository, and then use the following command Clone the code locally: $ git clone https://github.com/yourname/java-tron.git $ git remote add upstream https://github.com/tronprotocol/java-tron.git","title":"Fork Java-tron Repository"},{"location":"developers/demo/#sync-repository","text":"Before developing new features, please synchronize your fork repository with the upstream repository. $ git fetch upstream $ git checkout develop $ git merge upstream/develop --no-ff","title":"Sync Repository"},{"location":"developers/demo/#create-new-branch","text":"Pull a new branch from the develop branch of your own repository for local development, please refer to branch naming convention . In this example, the name of the new branch is: feature/ add-new-http-demo . $ git checkout -b feature/add-new-http-demo develop","title":"Create New Branch"},{"location":"developers/demo/#code-development","text":"Open the Java-tron project in IDEA. Create a new servlet file in the java-tron/framework/src/main/java/org/tron/core/services/http directory to process HTTP requests: SetPeerServlet.java, the file should contain two functions doGet and doPost . doGet is used to handle http get requests and doPost is used to handle http post requests. If one of these types of requests is not supported, the method content can be empty. @Component @Slf4j ( topic = \"API\" ) public class SetPeerServlet extends HttpServlet { protected void doGet ( HttpServletRequest request , HttpServletResponse response ) {} protected void doPost ( HttpServletRequest request , HttpServletResponse response ) {} } In this example, the setPeer request should be sent by post, so you need to add processing logic in the doPost method, and the content of the doGet method keeps empty. The processing logic of the doPost method is: Get the incoming parameters Add peer information to the list of trusted nodes through the addPeer method Return the processing result of addPeer to the front-end user @Component @Slf4j ( topic = \"API\" ) public class SetPeerServlet extends HttpServlet { @Autowired private ChannelManager channelManager ; protected void doPost ( HttpServletRequest request , HttpServletResponse response ) { try { PostParams params = PostParams . getPostParams ( request ); JSONObject jsonObject = JSONObject . parseObject ( params . getParams ()); String peerIpPort = String . valueOf ( jsonObject . get ( \"peer\" )); boolean res = addPeer ( peerIpPort ); if ( res ) { response . getWriter (). println ( \"Success to set trusted peer:\" + peerIpPort ); } else { response . getWriter (). println ( \"Fail to set the trusted peer:\" + peerIpPort ); } } catch ( Exception e ) { logger . error ( \"Exception occurs when setting peer: {}\" , e . getMessage ()); try { response . getWriter (). println ( Util . printErrorMsg ( e )); } catch ( IOException ioe ) { logger . error ( \"IOException occurs when setting peer: {}\" , ioe . getMessage ()); } } } ...... } Put the processing logic of adding trust nodes in the addPeer method, which not only makes the code logic clearer, but also easier to test. The logic of the addPeer method is: Check the parameters the user entered to ensure that the node ip and port are not empty Construct node information through Node.instanceOf(peerIP) Make sure that the added trust node is not self Add the node to the trusted node list boolean addPeer ( String peerIP ) { try { if ( peerIP != \"\" ) { Node node = Node . instanceOf ( peerIP ); if ( ! ( CommonParameter . PARAMETER . nodeDiscoveryBindIp . equals ( node . getHost ()) || CommonParameter . PARAMETER . nodeExternalIp . equals ( node . getHost ()) || Constant . LOCAL_HOST . equals ( node . getHost ())) || CommonParameter . PARAMETER . nodeListenPort != node . getPort ()) { InetAddress address = new InetSocketAddress ( node . getHost (), node . getPort ()). getAddress (); channelManager . getTrustNodes (). put ( address , node ); return true ; } } } catch ( Exception e ) { logger . error ( \"addPeer error - {}\" , e . getMessage ()); } return false ; } } After completing the implementation of SetPeerServlet, you also need to register it in the node HTTP API service, FullNodeHttpApiService is the registration entry for the node HTTP API. Call the context.addServlet method in the start function of the FullNodeHttpApiService class to register the SetPeerServlet to the service. The name of the HTTP interface is defined as /wallet/setpeer . public class FullNodeHttpApiService implements Service { ...... @Autowired private SetPeerServlet setPeerServlet ; ....... @Override public void start () { ...... context . addServlet ( new ServletHolder ( setPeerServlet ), \"/wallet/setpeer\" ); ....... } } Then you can debug the above code, start the Java-tron node in IDEA, and interact with the node through the below Curl command in the terminal: $ curl --location --request POST 'http://127.0.0.1:16667/wallet/setpeer' \\ --header 'Content-Type: application/json' \\ --data-raw '{ \"peer\":\"192.163.3.2:16667\" }' Return: Success to set trusted peer:192.163.3.2:16667 At this point, the code development is complete, and then you need to write unit tests for the changes. For simple changes, unit tests can be written after the development code is completed, but for larger changes, it is recommended to write unit tests at the same time as development.","title":"Code Development"},{"location":"developers/demo/#write-unit-test","text":"The unit test of the Java-tron project is based on the JUnit framework. For the usage of JUnit, please refer to JUnit official website . The following is a brief introduction to the Java-tron unit test case specification and common annotations.","title":"Write Unit Test"},{"location":"developers/demo/#java-tron-unit-test-cases-writing-specification","text":"When writing Java-tron unit test cases, please follow the below guidelines: All test classes should be placed in the test directory, and the package of the test class should be consistent with the package structure of the tested code. Generally, use Test as the suffix of a class name The test method must be decorated with @Test and it must be public void type. Generally, test is used as the prefix of the method name Each test method in the test class must be independently testable, and there must be no dependencies between methods","title":"Java-tron Unit Test Cases Writing Specification"},{"location":"developers/demo/#common-annotations","text":"The following are descriptions of some commonly used annotations. For other annotations, please refer to JUnit official website documentation . @Test - transforms a normal method into a test method @Ignore - the decorated test method will be ignored by the test runner @BeforeClass - the method will be executed before all methods, static method (only executed once globally, and it is the first running one) @AfterClass - the method will be executed after all methods, static methods ( only executed once globally, and it will be the last running one) @Before - it will be executed once before each test method @After - it will be executed once after each test method","title":"Common Annotations"},{"location":"developers/demo/#the-composition-of-the-unit-test-class","text":"A unit test class should contain the following three parts: @Before or @BeforeClass decorated function, used for initialization before test case execution @After or @BeforeClass decorated function, used to process data cleaning after the test case execution Test method decorated by @Test public class demoTest { @Before public void init () { // Initialization work before test case execution } @After public void destroy () { // Destroy work after test case execution } @Test public void testDemoMethod () { } } For this example in the article, a new file should be created in the framework/src/test/java/org/tron/core/services/http/ directory: SetPeerServletTest.java used to write test cases. public class SetPeerServletTest { private static TronApplicationContext context ; private static Application appT ; public static ChannelManager channelManager ; @Before public void init () { Args . setParam ( new String [] {}, Constant . TEST_CONF ); context = new TronApplicationContext ( DefaultConfig . class ); channelManager = context . getBean ( ChannelManager . class ); appT = ApplicationFactory . create ( context ); appT . initServices ( Args . getInstance ()); appT . startServices (); appT . startup (); } @After public void destroy () { Args . clearParam (); appT . shutdownServices (); appT . shutdown (); } @Test public void testAddPeer () { SetPeerServlet setPeerServlet = new SetPeerServlet (); Assert . assertFalse ( setPeerServlet . addPeer ( \"127.0.0.1\" )); } }","title":"The Composition Of The Unit Test Class"},{"location":"developers/demo/#code-style-check","text":"Check the modified files one by one, and select Check Current File in the right-click menu. If there are code style problems, please modify them one by one according to the prompts. Fix the code style warning in the picture, and then check the file again until there is no warning.","title":"Code Style Check"},{"location":"developers/demo/#commit-code","text":"Submit the code after development complete, please refer to the commit specification . git add . git commit -m 'add a new http api setpeer' Push the new branch to the personal remote repository: git push origin feature/add-new-http-demo","title":"Commit Code"},{"location":"developers/demo/#submit-pull-request","text":"Submit a pull request (PR) from your repository to tronprotocol/java-tron .","title":"Submit Pull Request"},{"location":"developers/deployment/","text":"Deployment \u00b6 Premise \u00b6 Create separate directories for fullnode and soliditynode NOTE: SolidityNode is deprecated. Now a FullNode supports all RPCs of a SolidityNode. New developers should deploy FullNode only. /deploy/fullnode /deploy/soliditynode Create two folders for fullnode and soliditynode. Clone the latest master branch of https://github.com/tronprotocol/java-tron and extract it to /deploy/java-tron Make sure you have the proper dependencies. JDK 1.8 (JDK 1.9+ is not supported yet) On Linux Ubuntu system (e.g. Ubuntu 16.04.4 LTS), ensure that the machine has Oracle JDK 8 , instead of having Open JDK 8 in the system. If you are building the source code by using Open JDK 8 , you will get Build Failed result. Open UDP ports for connection to the network MINIMUM 2 CPU Cores Deployment Guide \u00b6 1. Build the java-tron project cd /deploy/java-tron ./gradlew build 2. Copy the FullNode.jar and SolidityNode.jar along with configuration files into the respective directories download your needed configuration file from https://github.com/tronprotocol/TronDeployment. main_net_config.conf is the configuration for MainNet, and test_net_config.conf is the configuration for TestNet. please rename the configuration file to `config.conf` and use this config.conf to start FullNode and SolidityNode. cp build/libs/FullNode.jar ../fullnode cp build/libs/SolidityNode.jar ../soliditynode 3. You can now run your FullNode using the following command java -jar FullNode.jar -c config.conf // make sure that your config.conf is downloaded from https://github.com/tronprotocol/TronDeployment 4. Configure the SolidityNode configuration file You need to edit config.conf to connect to your local FullNode. Change trustNode in node to local 127.0.0.1:50051 , which is the default rpc port. Set listen.port to any number within the range of 1024-65535. Please don't use any ports between 0-1024 since you'll most likely hit conflicts with other system services. Also change rpc port to 50052 or something to avoid conflicts. Please forward the UDP port 18888 for FullNode. rpc { port = 50052 } 5. You can now run your SolidityNode using the following command\uff1a java -jar SolidityNode.jar -c config.conf //make sure that your config.conf is downloaded from https://github.com/tronprotocol/TronDeployment 6. Running a Super Representative Node for mainnet java -jar FullNode.jar -p your private key --witness -c your config.conf(Example\uff1a/data/java-tron/config.conf) Example: java -jar FullNode.jar -p 650950B193DDDDB35B6E48912DD28F7AB0E7140C1BFDEFD493348F02295BD812 --witness -c /data/java-tron/config.conf This is similar to running a private testnet, except that the IPs in the config.conf are officially declared by TRON. 7. Running a Super Representative Node for private testnet You should modify the config.conf: Replace existing entry in genesis.block.witnesses with your address Replace existing entry in seed.node ip.list with your ip list The first Super Node start, needSyncCheck should be set false Set p2pversion to 61 cd build/libs java -jar FullNode.jar -p your private key --witness -c your config.conf (Example\uff1a/data/java-tron/config.conf) Example: java -jar FullNode.jar -p 650950B193DDDDB35B6E48912DD28F7AB0E7140C1BFDEFD493348F02295BD812 --witness -c /data/java-tron/config.conf Logging and Network Connection Verification \u00b6 Logs for both nodes are located in /deploy/\\*/logs/tron.log . Use tail -f /logs/tron.log/ to follow along with the block syncing. You should see something similar to this in your logs for block synchronization: FullNode 12:00:57.658 INFO [pool-7-thread-1] [o.t.c.n.n.NodeImpl](NodeImpl.java:830) Success handle block Num:236610,ID:0000000000039c427569efa27cc2493c1fff243cc1515aa6665c617c45d2e1bf SolidityNode 12:00:40.691 INFO [pool-17-thread-1] [o.t.p.SolidityNode](SolidityNode.java:88) sync solidity block, lastSolidityBlockNum:209671, remoteLastSolidityBlockNum:211823 Stop Node Gracefully \u00b6 Create file stop.sh\uff0cuse kill -15 to close FullNode.jar(or SolidityNode.jar). You need to modify pid= ps -ef |grep FullNode.jar |grep -v grep |awk '{print $2}' to find the correct pid. #!/bin/bash while true; do pid=`ps -ef |grep FullNode.jar |grep -v grep |awk '{print $2}'` if [ -n \"$pid\" ]; then kill -15 $pid echo \"The java-tron process is exiting, it may take some time, forcing the exit may cause damage to the database, please wait patiently...\" sleep 1 else echo \"java-tron killed successfully!\" break fi done FullNode and SolidityNode Fast Deployment \u00b6 Download fast deployment script, run the script according to different types of node. Scope of use This script could be used on Linux/MacOS, but not on Windows. Just Support FullNode and SolidityNode. Download and run script wget https://raw.githubusercontent.com/tronprotocol/TronDeployment/master/deploy_tron.sh -O deploy_tron.sh Parameter Illustration bash deploy_tron.sh --app [ FullNode | SolidityNode ] --net [ mainnet | testnet | privatenet ] --db [ keep | remove | backup ] --heap-size --app Optional, Running application. The default node is Fullnode and it could be FullNode or SolidityNode. --net Optional, Connecting network. The default network is mainnet and it could be mainnet, testnet. --db Optional, The way of data processing could be keep, remove and backup. Default is keep. If you launch two different networks, like from mainnet to testnet or from testnet to mainnet, you need to delete database. --trust-node Optional, It only works when deploying SolidityNode. Default is 127 .0.0.1:50051. The specified gRPC service of Fullnode, like 127 .0.0.1:50051 or 13 .125.249.129:50051. --rpc-port Optional, Port of grpc. Default is 50051 . If you deploy SolidityNode and FullNode on the same host\uff0cyou need to configure different ports. --commit Optional, commitid of project. --branch Optional, branch of project. Mainnet default is latest release and Testnet default is master. --heap-size Optional, jvm option: Xmx. The default heap-size is 0 .8 * memory size. --work_space Optional, default is current directory. Deployment of FullNode on the one host wget https://raw.githubusercontent.com/tronprotocol/TronDeployment/master/deploy_tron.sh -O deploy_tron.sh bash deploy_tron.sh Deployment of SolidityNode on the one host wget https://raw.githubusercontent.com/tronprotocol/TronDeployment/master/deploy_tron.sh -O deploy_tron.sh # User can self-configure the IP and Port of GRPC service in the trust-node field of SolidityNode. trust-node is the fullnode you just deploy. bash deploy_tron.sh --app SolidityNode --trust-node Deployment of FullNode and SolidityNode on the same host # You need to configure different gRPC ports on the same host because gRPC port is available on SolidityNode and FullNodeConfigure and it cannot be set as default value 50051. In this case the default value of rpc port is set as 50041. wget https://raw.githubusercontent.com/tronprotocol/TronDeployment/master/deploy_tron.sh -O deploy_tron.sh bash deploy_tron.sh --app FullNode bash deploy_tron.sh --app SolidityNode --rpc-port 50041 Grpc Gateway Deployment \u00b6 Summary This script helps you download the code from https://github.com/tronprotocol/grpc-gateway and deploy the code on your environment. Pre-requests Please follow the guide on https://github.com/tronprotocol/grpc-gateway Install Golang, Protoc, and set $GOPATH environment variable according to your requirement. Download and run script wget https://raw.githubusercontent.com/tronprotocol/TronDeployment/master/deploy_grpc_gateway.sh -O deploy_grpc_gateway.sh Parameter Illustration bash deploy_grpc_gateway.sh --rpchost [ rpc host ip ] --rpcport [ rpc port number ] --httpport [ http port number ] --rpchost The fullnode or soliditynode IP where the grpc service is provided. Default value is \"localhost\" . --rpcport The fullnode or soliditynode port number grpc service is consuming. Default value is 50051 . --httpport The port intends to provide http service provided by grpc gateway. Default value is 18890 . Example Use default configuration\uff1a bash deploy_grpc_gateway.sh Use customized configuration\uff1a bash deploy_grpc_gateway.sh --rpchost 127 .0.0.1 --rpcport 50052 --httpport 18891 Event Subscribe plugin Deployment \u00b6 This is an implementation of Tron eventsubscribe model. api module defines IPluginEventListener, a protocol between Java-tron and event plugin. app module is an example for loading plugin, developers could use it for debugging. kafkaplugin module is the implementation for kafka, it implements IPluginEventListener, it receives events subscribed from Java-tron and relay events to kafka server. mongodbplugin mongodbplugin module is the implementation for mongodb. Setup/Build Clone the repo git clone https://github.com/tronprotocol/event-plugin.git Go to eventplugin cd event-plugin run ./gradlew build This will produce one plugin zip, named plugin-kafka-1.0.0.zip , located in the event-plugin/build/plugins/ directory. Edit **config.conf** of Java-tron\uff0c add the following fields: event.subscribe = { path = \"\" // absolute path of plugin server = \"\" // target server address to receive event triggers dbconfig=\"\" // dbname|username|password topics = [ { triggerName = \"block\" // block trigger, the value can't be modified enable = false topic = \"block\" // plugin topic, the value could be modified }, { triggerName = \"transaction\" enable = false topic = \"transaction\" }, { triggerName = \"contractevent\" enable = true topic = \"contractevent\" }, { triggerName = \"contractlog\" enable = true topic = \"contractlog\" } ] filter = { fromblock = \"\" // the value could be \"\", \"earliest\" or a specified block number as the beginning of the queried range toblock = \"\" // the value could be \"\", \"latest\" or a specified block number as end of the queried range contractAddress = [ \"\" // contract address you want to subscribe, if it's set to \"\", you will receive contract logs/events with any contract address. ] contractTopic = [ \"\" // contract topic you want to subscribe, if it's set to \"\", you will receive contract logs/events with any contract topic. ] } } * path : is the absolute path of \"plugin-kafka-1.0.0.zip\" * server : Kafka server address * topics : each event type maps to one Kafka topic, we support four event types subscribing, block, transaction, contractlog and contractevent. * dbconfig : db configuration information for mongodb, if using kafka, delete this one; if using Mongodb, add like that dbname|username|password * triggerName : the trigger type, the value can't be modified. * enable : plugin can receive nothing if the value is false. * topic : the value is the kafka topic to receive events. Make sure it has been created and Kafka process is running * filter : filter condition for process trigger. note : if the server is not 127.0.0.1, pls set some properties in config/server.properties file remove comment and set listeners=PLAINTEXT://:9092 remove comment and set advertised.listeners to PLAINTEXT://host_ip:9092 Install Kafka On Mac : brew install kafka On Linux : cd /usr/local wget http://archive.apache.org/dist/kafka/0.10.2.2/kafka_2.10-0.10.2.2.tgz tar -xzvf kafka_2.10-0.10.2.2.tgz mv kafka_2.10-0.10.2.2 kafka add \"export PATH=$PATH:/usr/local/kafka/bin\" to end of /etc/profile source /etc/profile kafka-server-start.sh /usr/local/kafka/config/server.properties & Note : make sure the version of Kafka is the same as the version set in build.gradle of eventplugin project.(kafka_2.10-0.10.2.2 kafka) Run Kafka On Mac : zookeeper-server-start /usr/local/etc/kafka/zookeeper.properties & kafka-server-start /usr/local/etc/kafka/server.properties On Linux : zookeeper-server-start.sh /usr/local/kafka/config/zookeeper.properties & Sleep about 3 seconds kafka-server-start.sh /usr/local/kafka/config/server.properties & Create topics to receive events, the topic is defined in config.conf On Mac : kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic block kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic transaction kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic contractlog kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic contractevent On Linux : kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic block kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic transaction kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic contractlog kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic contractevent Kafka consumer On Mac : kafka-console-consumer --bootstrap-server localhost:9092 --topic block kafka-console-consumer --bootstrap-server localhost:9092 --topic transaction kafka-console-consumer --bootstrap-server localhost:9092 --topic contractlog kafka-console-consumer --bootstrap-server localhost:9092 --topic contractevent On Linux : kafka-console-consumer.sh --zookeeper localhost:2181 --topic block kafka-console-consumer.sh --zookeeper localhost:2181 --topic transaction kafka-console-consumer.sh --zookeeper localhost:2181 --topic contractlog kafka-console-consumer.sh --zookeeper localhost:2181 --topic contractevent Load plugin in Java-tron add --es to command line, for example: java -jar FullNode.jar -p privatekey -c config.conf --es Event filter which is defined in config.conf, path: event.subscribe filter = { fromblock = \"\" // the value could be \"\", \"earliest\" or a specified block number as the beginning of the queried range toblock = \"\" // the value could be \"\", \"latest\" or a specified block number as end of the queried range contractAddress = [ \"TVkNuE1BYxECWq85d8UR9zsv6WppBns9iH\" // contract address you want to subscribe, if it's set to \"\", you will receive contract logs/events with any contract address. ] contractTopic = [ \"f0f1e23ddce8a520eaa7502e02fa767cb24152e9a86a4bf02529637c4e57504b\" // contract topic you want to subscribe, if it's set to \"\", you will receive contract logs/events with any contract topic. ] } Download and install MongoDB ** Suggested Configuration ** CPU/ RAM: 16Core / 32G DISK: 500G System: CentOS 64 The version of MongoDB is 4.0.4 , below is the command: cd /home/java-tron curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-4.0.4.tgz tar zxvf mongodb-linux-x86_64-4.0.4.tgz mv mongodb-linux-x86_64-4.0.4 mongodb ** Set environment ** - export MONGOPATH=/home/java-tron/mongodb/ - export PATH= PATH: PATH: MONGOPATH/bin ** Create mongodb config ** The path is : /etc/mongodb/mgdb.conf cd /etc/mongodb touch mgdb.conf Create data&log folder for mongodb Create data, log subfolder in mongodb directory, and add their absolute path to mgdb.conf ** Example: ** dbpath=/home/java-tron/mongodb/data logpath=/home/java-tron/mongodb/log/mongodb.log port=27017 logappend=true fork=true bind_ip=0.0.0.0 auth=true wiredTigerCacheSizeGB=2 ** Note: ** - bind_ip must be configured to 0.0.0.0\uff0cotherwise remote connection will be refused. - wiredTigerCacheSizeGB, must be configured to prevent OOM ** Launch MongoDB ** - mongod --config /etc/mongodb/mgdb.conf ** Create admin account: ** - mongo - use admin - db.createUser({user:\"root\",pwd:\"admin\",roles:[{role:\"root\",db:\"admin\"}]}) ** Create eventlog and its owner account ** db.auth(\"root\", \"admin\") use eventlog db.createUser({user:\"tron\",pwd:\"123456\",roles:[{role:\"dbOwner\",db:\"eventlog\"}]}) database: eventlog, username:tron, password: 123456 ** Firewall rule: ** - iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 27017 -j ACCEPT ** Remote connection via mongo: ** mongo 47.90.245.68:27017 use eventlog db.auth(\"tron\", \"123456\") show collections db.block.find() ** Query block trigger data: ** db.block.find({blockNumber: {$lt: 1000}}); // return records whose blockNumber less than1000 ** Set database index to speedup query: ** cd /{projectPath} sh insertIndex.sh Event query service deployment \u00b6 Download sourcecode Download sourcecode git clone https://github.com/tronprotocol/tron-eventquery.git cd troneventquery Build mvn package After the build command is executed successfully, troneventquery jar to release will be generated under troneventquery/target directory. Configuration of mongodb \"config.conf\" should be created for storing mongodb configuration, such as database name, username, password, and so on. We provided an example in sourcecode, which is \" troneventquery/config.conf \". Replace with your specified configuration if needed. Note : Make sure the relative path of config.conf and troneventquery jar. The config.conf 's path is the parent of troneventquery jar. mongo.host=IP mongo.port=27017 mongo.dbname=eventlog mongo.username=tron mongo.password=123456 mongo.connectionsPerHost=8 mongo.threadsAllowedToBlockForConnectionMultiplier=4 Any configuration could be modified except mongo.dbname , \" eventlog \" is the specified database name for event subscribe. Run troneventquery/deploy.sh is used to deploy troneventquery troneventquery/insertIndex.sh is used to setup mongodb index to speedup query. Advanced Configurations \u00b6 Read the Advanced Configuration","title":"Deployment"},{"location":"developers/deployment/#deployment","text":"","title":"Deployment"},{"location":"developers/deployment/#premise","text":"Create separate directories for fullnode and soliditynode NOTE: SolidityNode is deprecated. Now a FullNode supports all RPCs of a SolidityNode. New developers should deploy FullNode only. /deploy/fullnode /deploy/soliditynode Create two folders for fullnode and soliditynode. Clone the latest master branch of https://github.com/tronprotocol/java-tron and extract it to /deploy/java-tron Make sure you have the proper dependencies. JDK 1.8 (JDK 1.9+ is not supported yet) On Linux Ubuntu system (e.g. Ubuntu 16.04.4 LTS), ensure that the machine has Oracle JDK 8 , instead of having Open JDK 8 in the system. If you are building the source code by using Open JDK 8 , you will get Build Failed result. Open UDP ports for connection to the network MINIMUM 2 CPU Cores","title":"Premise"},{"location":"developers/deployment/#deployment-guide","text":"1. Build the java-tron project cd /deploy/java-tron ./gradlew build 2. Copy the FullNode.jar and SolidityNode.jar along with configuration files into the respective directories download your needed configuration file from https://github.com/tronprotocol/TronDeployment. main_net_config.conf is the configuration for MainNet, and test_net_config.conf is the configuration for TestNet. please rename the configuration file to `config.conf` and use this config.conf to start FullNode and SolidityNode. cp build/libs/FullNode.jar ../fullnode cp build/libs/SolidityNode.jar ../soliditynode 3. You can now run your FullNode using the following command java -jar FullNode.jar -c config.conf // make sure that your config.conf is downloaded from https://github.com/tronprotocol/TronDeployment 4. Configure the SolidityNode configuration file You need to edit config.conf to connect to your local FullNode. Change trustNode in node to local 127.0.0.1:50051 , which is the default rpc port. Set listen.port to any number within the range of 1024-65535. Please don't use any ports between 0-1024 since you'll most likely hit conflicts with other system services. Also change rpc port to 50052 or something to avoid conflicts. Please forward the UDP port 18888 for FullNode. rpc { port = 50052 } 5. You can now run your SolidityNode using the following command\uff1a java -jar SolidityNode.jar -c config.conf //make sure that your config.conf is downloaded from https://github.com/tronprotocol/TronDeployment 6. Running a Super Representative Node for mainnet java -jar FullNode.jar -p your private key --witness -c your config.conf(Example\uff1a/data/java-tron/config.conf) Example: java -jar FullNode.jar -p 650950B193DDDDB35B6E48912DD28F7AB0E7140C1BFDEFD493348F02295BD812 --witness -c /data/java-tron/config.conf This is similar to running a private testnet, except that the IPs in the config.conf are officially declared by TRON. 7. Running a Super Representative Node for private testnet You should modify the config.conf: Replace existing entry in genesis.block.witnesses with your address Replace existing entry in seed.node ip.list with your ip list The first Super Node start, needSyncCheck should be set false Set p2pversion to 61 cd build/libs java -jar FullNode.jar -p your private key --witness -c your config.conf (Example\uff1a/data/java-tron/config.conf) Example: java -jar FullNode.jar -p 650950B193DDDDB35B6E48912DD28F7AB0E7140C1BFDEFD493348F02295BD812 --witness -c /data/java-tron/config.conf","title":"Deployment Guide"},{"location":"developers/deployment/#logging-and-network-connection-verification","text":"Logs for both nodes are located in /deploy/\\*/logs/tron.log . Use tail -f /logs/tron.log/ to follow along with the block syncing. You should see something similar to this in your logs for block synchronization: FullNode 12:00:57.658 INFO [pool-7-thread-1] [o.t.c.n.n.NodeImpl](NodeImpl.java:830) Success handle block Num:236610,ID:0000000000039c427569efa27cc2493c1fff243cc1515aa6665c617c45d2e1bf SolidityNode 12:00:40.691 INFO [pool-17-thread-1] [o.t.p.SolidityNode](SolidityNode.java:88) sync solidity block, lastSolidityBlockNum:209671, remoteLastSolidityBlockNum:211823","title":"Logging and Network Connection Verification"},{"location":"developers/deployment/#stop-node-gracefully","text":"Create file stop.sh\uff0cuse kill -15 to close FullNode.jar(or SolidityNode.jar). You need to modify pid= ps -ef |grep FullNode.jar |grep -v grep |awk '{print $2}' to find the correct pid. #!/bin/bash while true; do pid=`ps -ef |grep FullNode.jar |grep -v grep |awk '{print $2}'` if [ -n \"$pid\" ]; then kill -15 $pid echo \"The java-tron process is exiting, it may take some time, forcing the exit may cause damage to the database, please wait patiently...\" sleep 1 else echo \"java-tron killed successfully!\" break fi done","title":"Stop Node Gracefully"},{"location":"developers/deployment/#fullnode-and-soliditynode-fast-deployment","text":"Download fast deployment script, run the script according to different types of node.","title":"FullNode and SolidityNode Fast Deployment"},{"location":"developers/deployment/#grpc-gateway-deployment","text":"","title":"Grpc Gateway Deployment"},{"location":"developers/deployment/#event-subscribe-plugin-deployment","text":"This is an implementation of Tron eventsubscribe model. api module defines IPluginEventListener, a protocol between Java-tron and event plugin. app module is an example for loading plugin, developers could use it for debugging. kafkaplugin module is the implementation for kafka, it implements IPluginEventListener, it receives events subscribed from Java-tron and relay events to kafka server. mongodbplugin mongodbplugin module is the implementation for mongodb.","title":"Event Subscribe plugin Deployment"},{"location":"developers/deployment/#event-query-service-deployment","text":"","title":"Event query service deployment"},{"location":"developers/deployment/#advanced-configurations","text":"Read the Advanced Configuration","title":"Advanced Configurations"},{"location":"developers/governance/","text":"Governance \u00b6 The governance of the TRON network is accomplished by modifying the network parameters . The modification of network parameters is also called a network upgrade. Anyone can propose a discussion on modifying one or several network parameters, however, only super representatives or super representative partners can submit voting requests on-chain. Before the voting deadline, 27 super representatives can vote on the proposal. After the voting deadline arrives and the number of votes meets the requirement, the proposal will take effect. You can view the list of the past completed proposals here . Please according to the following process to propose a voting request: Initiate a discussion on proposal Community discussion Initiate a voting request Voting and taking effective Initiate a discussion on a proposal \u00b6 Any TRON network participant can initiate a discussion on a proposal. Please create a proposal discussion issue in TIP repository . The Issue is used to introduce the proposal in detail, including the motivation of this proposal, the TRON network parameters to be modified and their values, technical specifications, and the impact of the modification, etc. for a new proposal, please refer to this example to create an issue for discussion. Below are the specifications of how to write an issue for proposal discussion. Title \u00b6 We hope that all users of the TRON ecosystem can participate in network governance. In order to be able to better publicize in the community, it is recommended to name the proposal and put the name at the beginning of the title. Here is an example: Palma Upgrade: proposal to change the unit price of energy to 420 sun Body \u00b6 In the issue body, the content of the proposal should be introduced in detail, including motivation, estimated time to initiate the proposal vote and effective time of the proposal, how to initiate a proposal vote, technical specifications or background information of the proposal, etc. # Simple Summary Briefly introduce the parameters to be modified by this proposal and their values, and summarize the issue it wants to solve # Motivation Describe the motivation for the proposal, what is the problem encountered now, that is, why one or some dynamic parameters need to be modified. # Timeline Indicate when to initiate the proposal voting request, and the estimated effective date of the proposal. After the issue is proposed, two weeks are generally reserved for community discussion. Therefore, the proposal initiation time set in the Issue should be two weeks after the issue is proposed. # How to Initialize the Voting Request Indicates the command to initiate the proposal voting request. # Technical Specification / Background The specific technical specifications or background information of the proposal Community discussion \u00b6 After the proposal issue is initiated, the initiator of the issue should try his best to promote it in the community, attract community users to participate in the discussion on the proposal, and update the proposal according to the results of the discussion. Initiate a voting request \u00b6 Generally, the initiation time of the voting request set in the proposal is two weeks after the proposed issue is initiated. When the community has already fully discussed on the proposal and formed a community consensus, the super representative or super representative partner will initiate a voting request on the chain. Vote and take effect \u00b6 The validity period of the voting request initiated on-chain is 3 days. During the validity period, all 27 super representatives can vote for the proposal. When the voting deadline is reached, if the number of votes obtained is equal to or greater than 18 votes, the proposal will take effect.","title":"Governance Workflow"},{"location":"developers/governance/#governance","text":"The governance of the TRON network is accomplished by modifying the network parameters . The modification of network parameters is also called a network upgrade. Anyone can propose a discussion on modifying one or several network parameters, however, only super representatives or super representative partners can submit voting requests on-chain. Before the voting deadline, 27 super representatives can vote on the proposal. After the voting deadline arrives and the number of votes meets the requirement, the proposal will take effect. You can view the list of the past completed proposals here . Please according to the following process to propose a voting request: Initiate a discussion on proposal Community discussion Initiate a voting request Voting and taking effective","title":"Governance"},{"location":"developers/governance/#initiate-a-discussion-on-a-proposal","text":"Any TRON network participant can initiate a discussion on a proposal. Please create a proposal discussion issue in TIP repository . The Issue is used to introduce the proposal in detail, including the motivation of this proposal, the TRON network parameters to be modified and their values, technical specifications, and the impact of the modification, etc. for a new proposal, please refer to this example to create an issue for discussion. Below are the specifications of how to write an issue for proposal discussion.","title":"Initiate a discussion on a proposal"},{"location":"developers/governance/#title","text":"We hope that all users of the TRON ecosystem can participate in network governance. In order to be able to better publicize in the community, it is recommended to name the proposal and put the name at the beginning of the title. Here is an example: Palma Upgrade: proposal to change the unit price of energy to 420 sun","title":"Title"},{"location":"developers/governance/#body","text":"In the issue body, the content of the proposal should be introduced in detail, including motivation, estimated time to initiate the proposal vote and effective time of the proposal, how to initiate a proposal vote, technical specifications or background information of the proposal, etc. # Simple Summary Briefly introduce the parameters to be modified by this proposal and their values, and summarize the issue it wants to solve # Motivation Describe the motivation for the proposal, what is the problem encountered now, that is, why one or some dynamic parameters need to be modified. # Timeline Indicate when to initiate the proposal voting request, and the estimated effective date of the proposal. After the issue is proposed, two weeks are generally reserved for community discussion. Therefore, the proposal initiation time set in the Issue should be two weeks after the issue is proposed. # How to Initialize the Voting Request Indicates the command to initiate the proposal voting request. # Technical Specification / Background The specific technical specifications or background information of the proposal","title":"Body"},{"location":"developers/governance/#community-discussion","text":"After the proposal issue is initiated, the initiator of the issue should try his best to promote it in the community, attract community users to participate in the discussion on the proposal, and update the proposal according to the results of the discussion.","title":"Community discussion"},{"location":"developers/governance/#initiate-a-voting-request","text":"Generally, the initiation time of the voting request set in the proposal is two weeks after the proposed issue is initiated. When the community has already fully discussed on the proposal and formed a community consensus, the super representative or super representative partner will initiate a voting request on the chain.","title":"Initiate a voting request"},{"location":"developers/governance/#vote-and-take-effect","text":"The validity period of the voting request initiated on-chain is 3 days. During the validity period, all 27 super representatives can vote for the proposal. When the voting deadline is reached, if the number of votes obtained is equal to or greater than 18 votes, the proposal will take effect.","title":"Vote and take effect"},{"location":"developers/gpg/","text":"This file contains the PGP keys of official support. Users: pgp < KEYS or gpg --import KEYS or gpg --keyserver hkp://keys.gnupg.net --search-keys support@tron.network pub rsa3072 2020-10-20 [SC] fingerprint = C07A AC17 C98D 205F 0CE3 0BF9 7F0A F58B 65C7 EEF4 uid Tron-Support support@tron.network sub rsa3072 2020-10-20 [E] -----BEGIN PGP PUBLIC KEY BLOCK----- mQGNBF+O4sMBDADTV2ymtGL+iZOAqc+U+jG8SLJRZlrw3k0Yc9aPeMvVvikAC7Sl j+3vTU5JjCYWPmcRqkHo1RyNImZg2GoikMB+y4/kAu/IHYyIbKlXQiC/XDPQ0Gpk 0mq74Df/24DFXBjYm9lpvisavaaVnQOxxwvLdVxBMdKZoZALcmy3dSBHVuqOfqrV znD5zE6fSpGonCiCZSx34VRCe5rNTBj0DnTjmBo3WzroxkjMqVeXpt8hWmfwUPGb EjvkopzGk+RtHfZvJrLrDsd3XF0M1iDzHSpBpVTs2kIoEMN2wK6YbMdYJk6mQDs4 3IH1uEiwNNd+npUDSPX2mUuPDmcZgO2msiXC/SuSSxZ3tEWQQ/g9Uzf5gv494em5 DNGmoS5EUDnWjv1CtmHsBclxmb1VS72CsxQobnUcQ4LosKJ1eCK6cgOCTbPAtwGf VitXUZRubwfUmPKEQOaoUoYtdOR50V0aSHfDFnNO3yhyZESUZBtNK9J7JdBTaGdo Z/TXxUbpNF5ZHrcAEQEAAbQjVHJvbi1TdXBwb3J0IDxzdXBwb3J0QHRyb24ubmV0 d29yaz6JAc4EEwEIADgWIQTAeqwXyY0gXwzjC/l/CvWLZcfu9AUCX47iwwIbAwUL CQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRB/CvWLZcfu9GtCDACRsKze6Bk9TJik bz5IkdUfCBY9I8wCgcjqqO1knC47vwAwSt9GckEMu9LYTrrTzbedgBH0PF3FHFxy DpnQf9UgQ1AGOLm8H2ZN0W7ZF9wHtDJKjvV4GKIOmIi9tJ57LqqLAaPGbO01DAx4 0PoEM4257fbKGYnAUUgKZxRJBAMhE8DdlsnQ1qqPeVVxmBFYD8zEjvW0ROfV59FI OfReFJoCvJoX9LpMGLi1HwichJkcItXwtNAdFbNLJSYc8ZatcmDkkHTwRn2wRHBc aJOFGjZma2xjkCXB+4QFwjI2ng9Y2HpufwquP0ptUepq7kf1WeFdzChXlIOx+35y pK67EQxr/ExpIl8Sti2Oe4pPzhOoRVs05y+9ghVQ9rN7/16y7/w3GAZelrvEucM8 KYPBPIBILu7atuXHDhgeCDfbUIR3npAkFZJpW702BUg8jP/opwGlPvB7+A3+7r0e zLlwVyfKXTq1SbeaMgUyQ44vJpXBTiz2cqQZ5LC/OJuumw6NgBW5AY0EX47iwwEM AJjdQnztPlnTydbRf/XgAbNX5dFDE2+T86LW03ke/oHMFWTg3iWoQs/dAh3ucPw7 imU05mJr4+FrVFmU1NULLfG5T7dEPzPkZYN/pKa7EwBV2alLN6tab7gpS3ABYtnq GFZSOAGa9dwwhpAmItSG+2nBL76+7fdGmxzUsoGtjbM/m2nrMtuj/04y/aGD6xC8 6Ncup+syJtjhN2i+98PqNwhlAd9wYrzed8fzUH/84tXAIdKLZS7wdQA6fWyj78nW I9wMlS5h/QDBsDXDd9/Bv4FgUfIFgLR+K6M6gx6Hl4AyWN1JvWIlvuqPLqcEv3b5 bZlOCRB5NsuEzLBdEaydN8oEcL9G578o0sAp6qbdza/Mtbq+n1y9FSItuYJxHtZC RpeICwKgOS48YeLRjvBYhogTT2GqPaoT/a6iMKT4c+MgbvgD487SjagYlf0CJ6PD ENnjIZfERXgwAFq528CWJjYwF9acjEGQkcJzH5+R3Ev5d/YdlQLFtdUirB4rc/5T JQARAQABiQG2BBgBCAAgFiEEwHqsF8mNIF8M4wv5fwr1i2XH7vQFAl+O4sMCGwwA CgkQfwr1i2XH7vSfaQv/f8kcLDn+wCN7egSqt4XXKOpDLyKIB/cczGfRWQG4pZns 3rFjnvqKnYMTkm6vnf0JW8jUgW5V2PxNxVOKC0/KhbYX3QikUqO1wcjr7a4JsOtH PNZd8SXCRvLLifyw6QkK5FnFNLBA8oV5bej73gpEaSqF0kXZI9UP9dfvCp0R22Zw 48TxEbhj9i8x6pWZ4hckbojGVYqeo3LdTVMA75FXVfFzVoRJgvow0lEXqTKTPASU PuWejMXfqdN1Vu20IJvCgij7l0RTwK7ushX6a6mX5QAGIb4Qa3UkHGtEgwOJ/QVF WzjNwu0praNGHqIqirxpBT6ze/Oz47IsSGY727+4Edanz73upPwkt54Rb6wimxKf MTSixi+cpzJgsVBiJY4VRIuGSq3ITXZjaEoM7Zu6+0KIb19r6PcuP+wMZJPkup0/ 8nrS3HspazsZUq5kz3fFy2MkXv7dXduQN3iqKEtmedcCDCnglnzi0O/Ryl2niqWw iCwhvZAEFCYiEkUJdk+A =G5T7 -----END PGP PUBLIC KEY BLOCK-----","title":"Gpg"},{"location":"developers/incentives/","text":"Community Developers Incentives Programme \u00b6 Bonus point applies in TRON incentives programme. Developers can earn points by contributing to TRON. When a issue (or PR) is closed, it will be added into the reward programme. The core devs will discuss and comment the issue (or PR), the points of a issue (or PR) received will be added in the comment to track. You can find your points ranking at Tronscan . Reward 1: At the end of every month, we will calculate all points each developer gets in the current month and who finish in Top 5 will be rewarded with cash. At the end of every year, we will calculate all points each developer gets in the current year and who finish in Top 5 will be rewarded with cash. The Top 5 developers who win the cash reward will be announced at Tronscan. Also, there is a chance to display developers' photos at TRON official website. No. 1 No. 2 No. 3 No. 4 No. 5 200 USD 180 USD 150 USD 120 ~ 140 USD 100 ~ 120 USD Reward 2: Every developer who participates java-tron's development will be honored with a TRON Honorary Developer Certificate. And we will give a vote of thanks to the developers on TRON official website. The following shows the content you can contribute to. Non-code Related \u00b6 ** 1. TIP ** Description: TRON Improvement Proposal(TIP) Scope: Any improvement related to TRON ecosystem, like a new feature, TRC, protocol improvement, programming tool, etc. Points: Critical High Medium Low 20 15 10 < 5 ** 2. Documentation ** Description: To revise, update and add technical documentation related to TRON network. Scope: mechanism and algorithm, network architecture and database, contracts and other technical documentation Points: Critical High Medium Low 20 15 10 < 5 ** 3. Issue ** Description: Create a topic about a question, enhancement, bug or feature and so on to discuss Scope: java-tron, TRON ecosystem Points: Critical High Medium Low 10 8 5 < 2 Code Related \u00b6 ** 1. Feature Development ** Description: To add new features to TRON network Scope: java-tron, wallet-cli Points: Critical High Medium Low 100 80 50 < 20 ** 2. Bug Report ** Description: To report bugs in online TRON network Scope: java-tron, wallet-cli Points: Critical High Medium Low 20 15 10 < 5 3. Bug Fix Description: To fix bugs in online TRON network Scope: java-tron, wallet-cli Points: Critical High Medium Low 40 30 20 < 10 4. Security Related Description: To find the security risks and enhance the security of TRON network and ecosystem Scope: java-tron, TRON ecosystem Points: Critical High Medium Low 100 80 50 < 20 5. Others Description: Code improvements, etc. Scope: java-tron, wallet-cli Points: Critical High Medium Low 20 15 10 < 5 In order to get 5 (or more) points, the content of a PR should be creative, practical, critical or can reflect significant workload. One PR should aim at solving one type of problems, so do not break one type of PR into many small PRs.","title":"Community Developers Incentives Programme"},{"location":"developers/incentives/#community-developers-incentives-programme","text":"Bonus point applies in TRON incentives programme. Developers can earn points by contributing to TRON. When a issue (or PR) is closed, it will be added into the reward programme. The core devs will discuss and comment the issue (or PR), the points of a issue (or PR) received will be added in the comment to track. You can find your points ranking at Tronscan . Reward 1: At the end of every month, we will calculate all points each developer gets in the current month and who finish in Top 5 will be rewarded with cash. At the end of every year, we will calculate all points each developer gets in the current year and who finish in Top 5 will be rewarded with cash. The Top 5 developers who win the cash reward will be announced at Tronscan. Also, there is a chance to display developers' photos at TRON official website. No. 1 No. 2 No. 3 No. 4 No. 5 200 USD 180 USD 150 USD 120 ~ 140 USD 100 ~ 120 USD Reward 2: Every developer who participates java-tron's development will be honored with a TRON Honorary Developer Certificate. And we will give a vote of thanks to the developers on TRON official website. The following shows the content you can contribute to.","title":"Community Developers Incentives Programme"},{"location":"developers/incentives/#non-code-related","text":"** 1. TIP ** Description: TRON Improvement Proposal(TIP) Scope: Any improvement related to TRON ecosystem, like a new feature, TRC, protocol improvement, programming tool, etc. Points: Critical High Medium Low 20 15 10 < 5 ** 2. Documentation ** Description: To revise, update and add technical documentation related to TRON network. Scope: mechanism and algorithm, network architecture and database, contracts and other technical documentation Points: Critical High Medium Low 20 15 10 < 5 ** 3. Issue ** Description: Create a topic about a question, enhancement, bug or feature and so on to discuss Scope: java-tron, TRON ecosystem Points: Critical High Medium Low 10 8 5 < 2","title":"Non-code Related"},{"location":"developers/incentives/#code-related","text":"** 1. Feature Development ** Description: To add new features to TRON network Scope: java-tron, wallet-cli Points: Critical High Medium Low 100 80 50 < 20 ** 2. Bug Report ** Description: To report bugs in online TRON network Scope: java-tron, wallet-cli Points: Critical High Medium Low 20 15 10 < 5 3. Bug Fix Description: To fix bugs in online TRON network Scope: java-tron, wallet-cli Points: Critical High Medium Low 40 30 20 < 10 4. Security Related Description: To find the security risks and enhance the security of TRON network and ecosystem Scope: java-tron, TRON ecosystem Points: Critical High Medium Low 100 80 50 < 20 5. Others Description: Code improvements, etc. Scope: java-tron, wallet-cli Points: Critical High Medium Low 20 15 10 < 5 In order to get 5 (or more) points, the content of a PR should be creative, practical, critical or can reflect significant workload. One PR should aim at solving one type of problems, so do not break one type of PR into many small PRs.","title":"Code Related"},{"location":"developers/issue-workflow/","text":"Issue Work Flow \u00b6 We encourage community contributors to participate in the submission and discussion of Java-tron issues. You can submit your questions or ideas in the form of issues, or participate in issue discussions or help to provide solutions. Your every question or comment is driving Java-tron's development. We thank you for your contribution to Java-tron. Submit an Issue \u00b6 If you encounter java-tron related problems or find related bugs, you are welcome to submit an Issue, but please respect the following rules: Search for existing issues Please check to see if someone has already reported your issue or requested your idea, this will not only solve your problem quickly but also avoid duplicate issues. Submit an issue Please select the type of issue you want to report and fill in the issue content according to the template requirements. Ask a question - Please elaborate on the problem you encountered, the results you expected, and the results you actually saw, so community participants can better understand your problem and come up with a solution faster. Report a bug - In addition to clarifying the problem, the expected behaviour, and the actual behaviour, the steps to reproduce the bug should also be described, and the java-tron log and backtrace when the problem occurs should be attached. Request a feature - Please clarify why should this feature exist\uff0cwhat are the use-cases\uff0cdo you have ideas regarding the implementation of this feature and are you willing to implement this feature. Issue Handling Process \u00b6 The issue handling process is as follows: Tag Issues - We hold weekly meetings to categorize Issues and tag Issues with appropriate Labels . Assign an Issue - Assign an Issue to one or several community core developers, and the core developers will participate in Issue investigations and discussions. Community Discussion - anyone can participate in the investigation and discussion of the Issue, and write their thoughts or opinions in the comments, and the solution to the problem can be obtained from the community discussion. Close the Issue - Issue submitters can close the Issue at any time. When the issue is resolved, or it has not been discussed by the community for a long time, we will close the Issue. Issue submitters or other users can also reopen the Issue as needed. Issue Labels \u00b6 Use the following labels according to the Issue feature: topic topic: Block/Transaction topic: Build topic: Consensus topic: DB topic: Deployment topic: Documentation topic: Event subscribe topic: gRPC/HTTP api topic: Net topic: Performance topic: Resource manage topic: Shielded Transaction topic: Smart contract topic: Solidity topic: Testnet/Privatenet type type: Announcement type: Bug type: Enhancement type: Feature Request type: Manual type: Other type: Question resolution resolution: Duplicated resolution: Needs More Information resolution: Wontfix improvement","title":"Issue Workflow"},{"location":"developers/issue-workflow/#issue-work-flow","text":"We encourage community contributors to participate in the submission and discussion of Java-tron issues. You can submit your questions or ideas in the form of issues, or participate in issue discussions or help to provide solutions. Your every question or comment is driving Java-tron's development. We thank you for your contribution to Java-tron.","title":"Issue Work Flow"},{"location":"developers/issue-workflow/#submit-an-issue","text":"If you encounter java-tron related problems or find related bugs, you are welcome to submit an Issue, but please respect the following rules: Search for existing issues Please check to see if someone has already reported your issue or requested your idea, this will not only solve your problem quickly but also avoid duplicate issues. Submit an issue Please select the type of issue you want to report and fill in the issue content according to the template requirements. Ask a question - Please elaborate on the problem you encountered, the results you expected, and the results you actually saw, so community participants can better understand your problem and come up with a solution faster. Report a bug - In addition to clarifying the problem, the expected behaviour, and the actual behaviour, the steps to reproduce the bug should also be described, and the java-tron log and backtrace when the problem occurs should be attached. Request a feature - Please clarify why should this feature exist\uff0cwhat are the use-cases\uff0cdo you have ideas regarding the implementation of this feature and are you willing to implement this feature.","title":"Submit an Issue"},{"location":"developers/issue-workflow/#issue-handling-process","text":"The issue handling process is as follows: Tag Issues - We hold weekly meetings to categorize Issues and tag Issues with appropriate Labels . Assign an Issue - Assign an Issue to one or several community core developers, and the core developers will participate in Issue investigations and discussions. Community Discussion - anyone can participate in the investigation and discussion of the Issue, and write their thoughts or opinions in the comments, and the solution to the problem can be obtained from the community discussion. Close the Issue - Issue submitters can close the Issue at any time. When the issue is resolved, or it has not been discussed by the community for a long time, we will close the Issue. Issue submitters or other users can also reopen the Issue as needed.","title":"Issue Handling Process"},{"location":"developers/issue-workflow/#issue-labels","text":"Use the following labels according to the Issue feature: topic topic: Block/Transaction topic: Build topic: Consensus topic: DB topic: Deployment topic: Documentation topic: Event subscribe topic: gRPC/HTTP api topic: Net topic: Performance topic: Resource manage topic: Shielded Transaction topic: Smart contract topic: Solidity topic: Testnet/Privatenet type type: Announcement type: Bug type: Enhancement type: Feature Request type: Manual type: Other type: Question resolution resolution: Duplicated resolution: Needs More Information resolution: Wontfix improvement","title":"Issue Labels"},{"location":"developers/java-tron/","text":"Developer Guide \u00b6 Thank you for considering to help out with the source code! We welcome contributions from anyone, and are grateful for even the smallest of fixes! GitHub is used to track issues and contribute code, suggestions, feature requests or documentation. If you want to participate in Java-tron development, please follow the Github code submission process as follows: Fork Java-tron repository Fix the code Commit the code Send a pull request The maintainers review and merge into the main code base For small fixes, you can send a pull request (PR) directly, but make sure the PR includes a detailed description. For more complex changes, you need to submit an issue to the TIP repository detailing your motivations, implementation plans, etc. For how to submit a TIP issue, please refer to TIP Specification . We encourage Java-tron developers to submit PRs as soon as possible. Even if they are not fully developed, you can submit a PR first, so that other developers can know that the TIP Issue corresponding to this PR is in the state of In Progress . Developers should develop and submit a PR based on the develop branch, reviewers will review the PR according to Code Review Guidelines . Key Branches \u00b6 Java-tron only has master , develop , release-* , feature-* , and hotfix-* branches, which are described below: develop branch The develop branch only accepts merge requests from other forked branches or release_* branches. It is not allowed to directly push changes to the develop branch. A release_* branch has to be pulled from the develop branch when a new build is to be released. master branch release_* branches and hotfix/* branches should only be merged into the master branch when a new build is released. release branch release_* is a branch pulled from the develop branch for release. It should be merged into master after a regression test and will be permanently kept in the repository. If a bug is identified in a release_* branch, its fixes should be directly merged into the release_* branch. After the fixes passing the regression test, the release_* branch should be merged back into the develop branch. Essentially, a release_* branch serves as a snapshot for each release. feature branch feature/* is an important feature branch pulled from the develop branch. After the feature/* branch is code-complete, it should be merged back to the develop branch. The feature/* branch is maintainable. hotfix branch It is pulled from the master branch and should be merged back into the master branch and the develop branch. Only pull requests of the fork repository (pull requests for bug fixes) should be merged into the hotfix/ branch. hotfix/ branches are used only for fixing bugs found after release. Submitting Code \u00b6 If you want to contribute codes to java-tron, please follow the following steps: Fork Java-tron repository Fork a new repository from tronprotocol/java-tron to your personal code repository $ git clone https://github.com/yourname/java-tron.git $ git remote add upstream https://github.com/tronprotocol/java-tron.git (\"upstream\" refers to upstream projects repositories, namely tronprotocol's repositories, and can be named as you like it. We usually call it \"upstream\" for convenience) Edit the code in the fork repository Before developing new features, please synchronize your fork repository with the upstream repository. git fetch upstream git checkout develop git merge upstream/develop --no-ff (Add --no-ff to turn off the default fast merge mode) Pull a new branch from the develop branch of your repository for local development. Please refer to Branch Naming Conventions \u3002 git checkout -b feature/branch_name develop Write and commit the new code when it is completed. Please refer to Commit Messages git add . git commit -m 'commit message' Commit the new branch to your personal remote repository git push origin new_feature Push code Submit a pull request (PR) from your repository to tronprotocol/java-tron . Please be sure to click on the link in the red box shown below. Select the base branch for tronprotocol and the compare branch for your personal fork repository. Code Review Guidelines \u00b6 The only way to get code into java-tron is to send a pull request. Those pull requests need to be reviewed by someone. The following guide explains our expectations around PRs for both authors and reviewers. The Process \u00b6 The first decision to make for any PR is whether it\u2019s worth including at all. To make the decision we must understand what the PR is about. If there isn\u2019t enough description content or the diff is too large, request an explanation. Anyone can do this part. We expect that reviewers check the style and functionality of the PR, providing comments to the author using the GitHub review system. Reviewers should follow up with the PR until it is in good shape, then approve the PR. Approved PRs can be merged by the code maintainer. When communicating with authors, be polite and respectful. Functional Checks \u00b6 For PRs that fix an issue, reviewers should try reproduce the issue and verify that the pull request actually fixes it. Authors can help with this by including a unit test that fails without (and passes with) the change. For PRs adding new features, reviewers should attempt to use the feature and comment on how it feels to use it. For example: if a PR adds a new command line flag, use the program with the flag and comment on whether the flag feels useful. We expect appropriate unit test coverage. Reviewers should verify that new code is covered by unit tests. Code Style \u00b6 We would like all developers to follow a standard development flow and coding style. Therefore, we suggest the following: Review the code with coding style checkers. Review the code before submission. Run standardized tests. Sonar -scanner and Travis CI continuous integration scanner will be automatically triggered when a pull request has been submitted. When a PR passes all the checks, the java-tron maintainers will then review the PR and offer feedback and modifications when necessary. Once adopted, the PR will be closed and merged into the develop branch. We are glad to receive your pull requests and will try our best to review them as soon as we can. Any pull request is welcome, even if it is for a typo. Please kindly address the issue you find. We would appreciate your contribution. Please do not be discouraged if your pull request is not accepted, as it may be an oversight. Please explain your code as detailed as possible to make it easier to understand. Please make sure your submission meets the following code style: The code must conform to Google Code Style . The code must have passed the Sonar scanner test. The code has to be pulled from the develop branch. Branch Naming Conventions \u00b6 Branch naming should follow the following guidelines: Always name the master branch and develop branch as \"master\" and \"develop\". Name the release_* branch using version numbers, which are assigned by the project lead (e.g., Odyssey-v3.1.3, 3.1.3, etc.). Use hotfix/ as the prefix of the hotfix branch, briefly describe the bug in the name, and connect words with underline (e.g., hotfix/typo, hotfix/null_point_exception, etc.). Use feature/ as the prefix of the feature branch, briefly describe the feature in the name, and connect words with underline (e.g., feature/new_resource_model, etc.). Pull Request Guidelines \u00b6 Pull Requests should follow the following specifications: Create one PR for one issue. Avoid massive PRs. Write an overview of the purpose of the PR in its title. Write a description of the PR for future reviewers. Elaborate on the feedback you need (if any). Commit Messages \u00b6 Commit messages should follow the rule below, we provide a template with corresponding instructions. Template: ():