Skip to content
This repository was archived by the owner on Dec 11, 2018. It is now read-only.

Commit 5db3f50

Browse files
authored
Merge pull request #146 from ybhgenius/master
revised
2 parents b40e220 + 81a31bc commit 5db3f50

File tree

1 file changed

+87
-84
lines changed

1 file changed

+87
-84
lines changed

docs/TRON_Client.rst

Lines changed: 87 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ Create account
610610

611611
4. Tap GENERATE ADDRESS AND PRIVATE KEY and tap OK after reading the information page.
612612

613-
.. image:: (https://raw.githubusercontent.com/tronprotocol/Documentation/master/images/Wallet_for_Android/创建钱包账户/4.png
613+
.. image:: https://raw.githubusercontent.com/tronprotocol/Documentation/master/images/Wallet_for_Android/创建钱包账户/4.png
614614
:width: 842px
615615
:height: 1496px
616616
:align: center
@@ -805,18 +805,17 @@ Check history
805805
Wallet-Cli
806806
----------
807807

808-
# wallet-cli [![Build Status](https://travis-ci.org/tronprotocol/wallet-cli.svg?branch=master)](https://travis-ci.org/tronprotocol/wallet-cli)
809-
Wallet CLI
808+
Download wallet-cli
809+
~~~~~~~~~~~~~~~~~~~
810810

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

812-
Download wallet-cli
813-
---------------------------------
814-
git clone https://github.com/tronprotocol/wallet-cli.git
815813

814+
Edit config.conf in src/main/resources
815+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
816+
817+
.. code-block:: shell
816818
817-
Edit config.conf in src/main/resources
818-
----------------------------------------
819-
```
820819
net {
821820
type = mainnet
822821
#type = testnet
@@ -834,46 +833,46 @@ soliditynode = {
834833
]
835834
}//note: solidity node is optional
836835

837-
```
838836
Build and run wallet-cli by command line
839-
----------------------------------------
840-
Create a new command line terminal window.
837+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
838+
Create a new command line terminal window.
839+
840+
.. code-block:: shell
841841
842-
```
843842
cd wallet-cli
844843
./gradlew build
845844
./gradlew run
846-
```
847845

848846
Build and run web wallet
849-
----------------------------------------
850-
```
847+
~~~~~~~~~~~~~~~~~~~~~~~~
848+
851849
cd wallet-cli
852850
./gradlew build
853851
cd build/libs
854852
java -jar wallet-cli.jar
855-
```
856853

857854

858855
How wallet-cli connects to java-tron :
859-
--------------------------------------
860-
Wallet-cli connect to java-tron by grpc protocol.
861-
Java-tron nodes can be deployed locally or remotely.
862-
We can set the connected java-tron node IP in config.conf of wallet-cli.
856+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
857+
Wallet-cli connect to java-tron by grpc protocol.
858+
859+
Java-tron nodes can be deployed locally or remotely.
863860

861+
We can set the connected java-tron node IP in config.conf of wallet-cli.
864862

865-
Wallet-cli supported command list:
866-
----------------------------------
867863

868-
RegisterWallet
864+
Wallet-cli supported command list:
865+
----------------------------------
866+
867+
RegisterWallet
869868
RegisterWallet Password
870869
Register a wallet in local.
871-
Generate a pair of ecc keys.
872-
Derive a AES Key by password and then use the AES algorithm to encrypt and save the private key.
873-
The account address is calculated by the public key sha3-256, and taking the last 20 bytes.
874-
All subsequent operations that require the use of a private key must enter the password.
870+
Generate a pair of ecc keys.
871+
Derive a AES Key by password and then use the AES algorithm to encrypt and save the private key.
872+
The account address is calculated by the public key sha3-256, and taking the last 20 bytes.
873+
All subsequent operations that require the use of a private key must enter the password.
875874

876-
ImportWallet
875+
ImportWallet
877876
ImportwalletByBase64
878877
ChangePassword
879878
Login
@@ -907,117 +906,121 @@ help
907906
Input any one of then, you will get more tips.
908907

909908

910-
How to freeze/unfreeze balance
911-
----------------------------------
909+
How to freeze/unfreeze balance
910+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
912911

913-
After the funds are frozen, the corresponding number of shares and bandwidth will be obtained.
914-
Shares can be used for voting and bandwidth can be used for trading.
915-
The rules for the use and calculation of share and bandwidth are described later in this article.
912+
After the funds are frozen, the corresponding number of shares and bandwidth will be obtained.
913+
Shares can be used for voting and bandwidth can be used for trading.
914+
The rules for the use and calculation of share and bandwidth are described later in this article.
916915

917916

918917
**Freeze operation is as follows:**
919918

920-
```
919+
.. code-block:: shell
920+
921921
freezebalance password amount time
922-
```
923922

924923
*amount:The amount of frozen funds,the unit is drop.
925-
The minimum value is **1000000 drop(1TRX)**.*
924+
925+
The minimum value is **1000000 drop(1TRX)**.*
926926

927927
*time:Freeze time, this value is currently only allowed for **3 days***
928928

929929

930930
For example:
931-
```
932-
freezebalance 123455 10000000 3
933-
```
934931

932+
.. code-block:: shell
933+
934+
freezebalance 123455 10000000 3
935935

936936
After the freeze operation,frozen funds will be transferred from Account Balance to Frozen,
937-
You can view frozen funds from your account information.
938-
After being unfrozen, it is transferred back to Balance by Frozen, and the frozen funds cannot be used for trading.
939937

938+
You can view frozen funds from your account information.
939+
940+
After being unfrozen, it is transferred back to Balance by Frozen, and the frozen funds cannot be used for trading.
941+
942+
When more share or bandwidth is needed temporarily, additional funds may be frozen to obtain additional share and bandwidth.
940943

941-
When more share or bandwidth is needed temporarily, additional funds may be frozen to obtain additional share and bandwidth.
942-
The unfrozen time is postponed until 3 days after the last freeze operation
944+
The unfrozen time is postponed until 3 days after the last freeze operation
943945

944946
After the freezing time expires, funds can be unfroze.
945947

946948

947949
**Unfreeze operation is as follows:**
948-
```
949-
unfreezebalance password
950-
```
951950

951+
.. code-block:: shell
952+
953+
unfreezebalance password
952954

953955

954956
How to vote
955-
----------------------------------
957+
~~~~~~~~~~~
956958

957-
Voting requires share. Share can be obtained by freezing funds.
959+
Voting requires share. Share can be obtained by freezing funds.
958960

959961
- The share calculation method is: **1** unit of share can be obtained for every **1TRX** frozen.
960962
- After unfreezing, previous vote will expire. You can avoid the invalidation of the vote by re-freezing and voting.
961963

962964
**Note:** The Tron Network only records the status of your last vote, which means that each of your votes will cover all previous voting results.
963965

964-
For example:
966+
For example:
967+
968+
.. code-block:: shell
965969
966-
```
967-
freezebalance 123455 10000000 3 // Freeze 10TRX and acquire 10 units of shares
970+
freezebalance 123455 10000000 3 // Freeze 10TRX and acquire 10 units of shares
968971
969-
votewitness 123455 witness1 4 witness2 6 // Cast 4 votes for witness1 and 6 votes for witness2 at the same time.
972+
votewitness 123455 witness1 4 witness2 6 // Cast 4 votes for witness1 and 6 votes for witness2 at the same time.
973+
974+
votewitness 123455 witness1 10 // Voted 10 votes for witness1.
970975
971-
votewitness 123455 witness1 10 // Voted 10 votes for witness1.
972-
```
973976
974977
The final result of the above command was 10 votes for witness1 and 0 votes for witness2.
975978

979+
How to calculate bandwidth
980+
~~~~~~~~~~~~~~~~~~~~~~~~~~
976981

982+
The bandwidth calculation rule is:
977983

978-
How to calculate bandwidth
979-
----------------------------------
984+
.. code-block:: shell
980985
981-
The bandwidth calculation rule is:
982-
```
983986
constant * FrozenFunds * days
984-
```
987+
985988
Assuming freeze 1TRX(1_000_000 DROP),3 days,bandwidth obtained = 1* 1_000_000 * 3 = 3_000_000.
986989

987-
Any contract needs to consume bandwidth, including transfer, transfer of assets, voting, freezing, etc.
988-
The query does not consume bandwidth, and each contract needs to consume **100_000 bandwidth**.
990+
Any contract needs to consume bandwidth, including transfer, transfer of assets, voting, freezing, etc.
991+
The query does not consume bandwidth, and each contract needs to consume **100_000 bandwidth**.
989992

990993
If the previous contract exceeds a certain time (**10s**), this operation does not consume bandwidth.
991994

992-
When the unfreezing operation occurs, the bandwidth is not cleared.
993-
The next time the freeze is performed, the newly added bandwidth is accumulated.
994-
995+
When the unfreezing operation occurs, the bandwidth is not cleared.
996+
The next time the freeze is performed, the newly added bandwidth is accumulated.
995997

996-
How to withdraw balance
997-
----------------------------------
998+
How to withdraw balance
999+
~~~~~~~~~~~~~~~~~~~~~~~
9981000

999-
After each block is produced, the block award is sent to the account's allowance,
1001+
After each block is produced, the block award is sent to the account's allowance,
10001002
and an withdraw operation is allowed every **24 hours** from allowance to balance.
1001-
The funds in allowance cannot be locked or traded.
1003+
The funds in allowance cannot be locked or traded.
10021004

10031005

1004-
How to create witness
1005-
----------------------------------
1006-
Applying to become a witness account needs to consume **100_000TRX**.
1006+
How to create witness
1007+
~~~~~~~~~~~~~~~~~~~~~
1008+
1009+
Applying to become a witness account needs to consume **100_000TRX**.
10071010
This part of the funds will be burned directly.
10081011

1012+
How to create account
1013+
~~~~~~~~~~~~~~~~~~~~~~
10091014

1010-
How to create account
1011-
----------------------------------
1012-
It is not allowed to create accounts directly. You can only create accounts by transferring funds to non-existing accounts.
1013-
Transfer to a non-existent account with a minimum transfer amount of **1TRX**.
1015+
It is not allowed to create accounts directly. You can only create accounts by transferring funds to non-existing accounts.
1016+
Transfer to a non-existent account with a minimum transfer amount of **1TRX**.
10141017

10151018
Command line operation flow example
1016-
-----------------------------------
1019+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10171020

1018-
cd wallet-cli
1019-
./gradlew build
1020-
./gradlew run
1021+
cd wallet-cli
1022+
./gradlew build
1023+
./gradlew run
10211024
RegisterWallet 123456 (password = 123456)
10221025
login 123456
10231026
getAddress (Print 'address = f286522619d962e6f93235ca27b2cb67a9e5c27b', backup it)
@@ -1027,14 +1030,14 @@ getbalance (Print 'Balance = 0')
10271030
getbalance
10281031

10291032
assetIssue 123456 testAssetIssue00001 10000000000000000 1 100 2018-4-1 2018-4-30 1 just-test https://github.com/tronprotocol/wallet-cli/
1030-
getaccount f286522619d962e6f93235ca27b2cb67a9e5c27b
1033+
getaccount f286522619d962e6f93235ca27b2cb67a9e5c27b
10311034
(Print balance: 9999900000
10321035
asset {
1033-
key: "testAssetIssue00001"
1034-
value: 10000000000000000
1036+
key: "testAssetIssue00001"
1037+
value: 10000000000000000
10351038
})
10361039
(cost trx 1000 trx for assetIssue)
1037-
(You can query the trx balance and other asset balances for any account )
1040+
(You can query the trx balance and other asset balances for any account )
10381041
TransferAsset 123456 649DDB4AB82D558AD6809C7AB2BA43D1D1054B3F testAssetIssue00001 10000
10391042

10401043

0 commit comments

Comments
 (0)