You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/architecture/database.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# Database configuration
2
-
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.
2
+
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.
3
3
4
-
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.
4
+
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.
Copy file name to clipboardExpand all lines: docs/architecture/event.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
### TIP
6
6
7
-
The TIP: [TIP-12:Tron event subscribes model](https://github.com/tronprotocol/tips/blob/master/tip-12.md) .
7
+
The TIP: [TIP-12:TRON event subscribes model](https://github.com/tronprotocol/tips/blob/master/tip-12.md) .
8
8
9
9
### Event Type
10
10
@@ -72,7 +72,7 @@ Contract Event and Contract Log Even support event filter function which include
72
72
```
73
73
fromBlock: the start block number
74
74
toBlock: the end block number
75
-
contractAddress: contract adsresses list
75
+
contractAddress: contract addresses list
76
76
contractTopics: contract topics list
77
77
```
78
78
@@ -98,21 +98,21 @@ contractTopics: contract topics list
98
98
99
99
#### Event query
100
100
101
-
Tron Event Query Service
101
+
TRON Event Query Service
102
102
103
103
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.
104
104
105
-
For more information of tron event subscribe model, please refer to [TIP-12](https://github.com/tronprotocol/TIPs/issues/12).
105
+
For more information of TRON event subscribe model, please refer to [TIP-12](https://github.com/tronprotocol/TIPs/issues/12).
## Using Java-tron's Built-in Message Queue for Event Subscription
111
+
## Using java-tron's Built-in Message Queue for Event Subscription
112
112
113
-
TRON provides event subscription service. Developers can not only obtain on-chain events through event plugin, but also through [Java-tron’s built-in ZeroMQ message queue](https://github.com/tronprotocol/tips/blob/master/tip-28.md). 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.
113
+
TRON provides event subscription service. Developers can not only obtain on-chain events through event plugin, but also through [java-tron’s built-in ZeroMQ message queue](https://github.com/tronprotocol/tips/blob/master/tip-28.md). 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.
114
114
115
-
This article will introduce how to subscribe to events through Java-tron's built-in message queue in detail.
115
+
This article will introduce how to subscribe to events through java-tron's built-in message queue in detail.
116
116
117
117
118
118
### Configure node
@@ -190,4 +190,4 @@ When the node has a new block, the subscriber will receive block event, the outp
190
190
```
191
191
received a message related to: blockTrigger, containing message: {"timeStamp":1678343709000,"triggerName":"blockTrigger","blockNumber":1361,"blockHash":"00000000000005519b3995cd638753a862c812d1bda11de14bbfaa5ad3383280","transactionSize":0,"latestSolidifiedBlockNumber":1361,"transactionList":[]}
192
192
received a message related to: blockTrigger, containing message: {"timeStamp":1678343712000,"triggerName":"blockTrigger","blockNumber":1362,"blockHash":"0000000000000552d53d1bdd9929e4533a983f14df8931ee9b3bf6d6c74a47b0","transactionSize":0,"latestSolidifiedBlockNumber":1362,"transactionList":[]}
Copy file name to clipboardExpand all lines: docs/clients/wallet-cli-command.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -209,7 +209,7 @@ This command is used to manage account permissions, assign permissions to other
209
209
* active: access to other features of accounts, and access that authorizes a certain feature. Block production authorization is not included if it's for SR purposes.
210
210
* witness: only for super representatives, block production authorization will be granted to one of the other users.
211
211
212
-
**NOTE** the parameter`Permission` must written in JSON format and entered in line. If the owner accountis not SR, then do not assign super representative permission.
212
+
**NOTE** the parameter`Permission` must written in JSON format and entered in line. If the owner account is not SR, then do not assign super representative permission.
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:
3
+
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:
4
4

5
5
6
-
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.
6
+
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.
7
7
8
8
Install and run: [Wallet-Cli](https://github.com/tronprotocol/wallet-cli)
Copy file name to clipboardExpand all lines: docs/contracts/contract.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
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.
6
6
7
-
TRON smart contract support Solidity language in (Ethereum). You can find the latest solidity version in the [Tron solidity repository](https://github.com/tronprotocol/solidity/releases). 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.
7
+
TRON smart contract support Solidity language in (Ethereum). You can find the latest solidity version in the [TRON solidity repository](https://github.com/tronprotocol/solidity/releases). 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.
8
8
9
9
## Smart Contract Features
10
10
TRON virtual machine is based on Ethereum solidity language, it also has TRON's own features.
@@ -62,12 +62,12 @@ message SmartContract {
62
62
```
63
63
origin_address: smart contract creator address
64
64
contract_address: smart contract address
65
-
abi: the api information of the all the function of the smart contract
65
+
abi: the api information of all the function of the smart contract
66
66
bytecode: smart contract byte code
67
67
call_value: TRX transferred into smart contract while call the contract
68
68
consume_user_resource_percent: resource consumption percentage set by the developer
69
69
name: smart contract name
70
-
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)
70
+
origin_energy_limit: energy consumption of the developer limit in one call, must be 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)
71
71
72
72
Through other two grpc message types CreateSmartContract and TriggerSmartContract to create and use smart contract.
73
73
@@ -77,13 +77,13 @@ Through other two grpc message types CreateSmartContract and TriggerSmartContrac
77
77
78
78
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
79
79
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
80
-
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.
80
+
Inconstant function will be broadcasted in the form of a transaction while being called, the function will change the data on the chain, such as transfer, changing the value of the internal variables of contracts, etc.
81
81
82
82
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.
83
83
84
84
***message calls**
85
85
86
-
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.
86
+
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 meantime, 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.
87
87
88
88
***delegate call/call code/library**
89
89
@@ -135,7 +135,7 @@ Ethereum VM address is 20 bytes, but TRON's VM address is 21 bytes.
135
135
Need to convert TRON's address while using in solidity (recommended):
136
136
```text
137
137
/**
138
-
* @dev convert uint256 (HexString add 0x at beginning) tron address to solidity address type
138
+
* @dev convert uint256 (HexString add 0x at beginning) TRON address to solidity address type
139
139
* @param tronAddress uint256 tronAddress, begin with 0x, followed by HexString
0 commit comments