Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs reorganization #425

Open
wants to merge 93 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
e461147
add http demo for updateAccountPermission
sean-liu55 Feb 27, 2019
423fac7
Update TRC10_IN_SMARTCONTRACT.MD
taihaofu Feb 28, 2019
ad62186
Update TRC10_IN_SMARTCONTRACT.MD
taihaofu Feb 28, 2019
4b9315f
Update TRC10_IN_SMARTCONTRACT.MD
taihaofu Feb 28, 2019
25885de
Update Tron-eventsubscribe.md
DorianRust Mar 1, 2019
2d98a7d
Update Tron-eventsubscribe_CN.md
DorianRust Mar 1, 2019
27d8e83
Update Tron-eventsubscribe_CN.md
DorianRust Mar 1, 2019
a6254bd
add instruction for updateAccountPermission
sean-liu55 Mar 1, 2019
3332eb0
Merge pull request #347 from tronprotocol/feature/add_instruction_for…
sean-liu55 Mar 1, 2019
657c0e2
add http and rpc instruction
sean-liu55 Mar 1, 2019
f098f42
Merge pull request #348 from tronprotocol/feature/add_instruction_for…
sean-liu55 Mar 1, 2019
d83ded8
description of event subscribe
jiangyy0824 Mar 5, 2019
19a1340
Update Tron-eventsubscribe.md
jiangyy0824 Mar 5, 2019
f7f76d6
Update Tron-event_description.md
jiangyy0824 Mar 5, 2019
f1cd154
Update Tron-event_description.md
jiangyy0824 Mar 5, 2019
e18d3dd
modify description of gettransactionsfromthis and gettransactionstothis
houlei1017 Mar 8, 2019
a45f136
update Tron-http.md and RPC-API.md
houlei1017 Mar 8, 2019
dbf196f
update Tron-http.md and RPC-API.md
houlei1017 Mar 8, 2019
466cae7
update English document Tron-http.md
houlei1017 Mar 12, 2019
e753917
Update TRON_Wallet_RPC-API.md
taihaofu Mar 18, 2019
92557e6
Update TRON_Wallet_RPC-API.md
taihaofu Mar 18, 2019
223677f
Update TRON_Wallet_RPC-API.md
taihaofu Mar 18, 2019
060fa12
Update TRON_Wallet_RPC-API.md
taihaofu Mar 18, 2019
d684b62
Update 波场钱包RPC-API.md
taihaofu Mar 18, 2019
dad65a7
Update 波场钱包RPC-API.md
taihaofu Mar 18, 2019
f88d555
Update TRON_Wallet_RPC-API.md
taihaofu Mar 18, 2019
ac3456b
Update TRON_Wallet_RPC-API.md
taihaofu Mar 18, 2019
b6645e4
Update 波场钱包RPC-API.md
taihaofu Mar 18, 2019
8b9096f
Update 波场钱包RPC-API.md
taihaofu Mar 18, 2019
28b22d7
Update 波场钱包RPC-API.md
taihaofu Mar 18, 2019
003efcf
Update TRON_Wallet_RPC-API.md
taihaofu Mar 18, 2019
47c8f3d
Update TRON_Wallet_RPC-API.md
taihaofu Mar 18, 2019
f336344
Update 多重签名.md
renchenchang Mar 21, 2019
a55d347
Update 多重签名.md
renchenchang Mar 21, 2019
6cba050
add code demo for updating witness permission
sean-liu55 Mar 21, 2019
1904890
Merge pull request #351 from tronprotocol/feature/add_instruction_for…
sean-liu55 Mar 21, 2019
f094c23
Update Official_Public_Node.md
hyxc Mar 22, 2019
842d682
Update Official_Public_Node.md
hyxc Mar 22, 2019
24f3675
Update Tron-http.md
hyxc Apr 4, 2019
c0d8af4
add rocksdb
shydesky Apr 8, 2019
fec6585
figure src
shydesky Apr 8, 2019
be9b43e
Merge pull request #355 from tronprotocol/rocksdb
shydesky Apr 8, 2019
206855b
add rocksdb vs leveldb
shydesky Apr 8, 2019
47f6c01
add rocksdb vs leveldb english
shydesky Apr 8, 2019
ff7340e
mdf rocksdb vs leveldb english
shydesky Apr 8, 2019
52203b2
add rocksdb_tuning_parameters.png
shydesky Apr 8, 2019
d37c97d
Merge pull request #356 from tronprotocol/rocksdb
shydesky Apr 8, 2019
a1e5e7f
merge rocksdb: rocksdb vs leveldb
shydesky Apr 8, 2019
97ac645
mdf format:new line
shydesky Apr 8, 2019
992506f
supplement usage of rocksdb
shydesky Apr 8, 2019
480da7d
supplement usage of rocksdb
shydesky Apr 8, 2019
4394819
Update Rocksdb_vs_Leveldb.md
shydesky Apr 10, 2019
f654c9e
Update Rocksdb_vs_Leveldb.md
shydesky Apr 10, 2019
0a587f9
Update Tron-doc.md
renchenchang Apr 11, 2019
5a89d06
Update tron-eventquery.md
DorianRust Apr 18, 2019
b695e56
Update tron-eventquery.md
DorianRust Apr 18, 2019
adb9564
update Tron-http.md
houlei1017 Apr 26, 2019
9951264
translation
zk19862018 Apr 28, 2019
4f47b09
translation
zk19862018 Apr 28, 2019
167c1de
translation
zk19862018 Apr 29, 2019
64e8e51
update Tron-http.md
houlei1017 Apr 29, 2019
cb44f94
Merge branch 'feature/add_parameter' of https://github.com/tronprotoc…
houlei1017 Apr 29, 2019
0960af8
translation
zk19862018 Apr 29, 2019
fbb03ac
update Tron-http.md
houlei1017 Apr 29, 2019
e9d0f77
Merge remote-tracking branch 'origin/feature/add_parameter' into feat…
houlei1017 Apr 29, 2019
4e76596
translation
zk19862018 Apr 29, 2019
ba5364b
Merge branch 'feature/add_parameter' of https://github.com/tronprotoc…
zk19862018 Apr 29, 2019
05a912e
translation
zk19862018 Apr 29, 2019
0ee4f11
mark down style
zk19862018 Apr 29, 2019
46f86cc
update Tron-http.md
houlei1017 Apr 30, 2019
b9e4d94
Merge remote-tracking branch 'origin/feature/add_parameter' into feat…
houlei1017 Apr 30, 2019
312ca88
update Tron-http.md
houlei1017 May 5, 2019
12aca51
update englist Tron-http.md
houlei1017 May 6, 2019
4b8bdce
update http documentation
zk19862018 May 6, 2019
ef2a7e7
add Tron-doc.md English version
zk19862018 May 6, 2019
1fee8ae
translation
zk19862018 May 6, 2019
3c87b79
translation
zk19862018 May 8, 2019
d2e3758
translation
zk19862018 May 9, 2019
1cc8f10
translation
zk19862018 May 9, 2019
4fba536
translation
zk19862018 May 9, 2019
08b324f
translation
zk19862018 May 10, 2019
1fa06be
improve mark down style
zk19862018 May 10, 2019
c83d442
mark down format improvement
zk19862018 May 10, 2019
2234fb1
mark down format improvement
zk19862018 May 10, 2019
0187b96
mark down format improvement
zk19862018 May 10, 2019
a39bc2c
mark down format improvement
zk19862018 May 10, 2019
899a813
feat(doc): docs reorganization
zk19862018 May 13, 2019
b24d8c3
feat(reorganization): delete unused files
zk19862018 May 13, 2019
b2146d3
add tron-http, tron-overview
zk19862018 May 13, 2019
f4dab9f
style improvement
zk19862018 May 14, 2019
ae27ade
add tron-vm.md
zk19862018 May 15, 2019
5056db9
add docs imags
zk19862018 May 15, 2019
6649873
fix images display
zk19862018 May 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add tron-vm.md
  • Loading branch information
zonLi committed May 15, 2019
commit ae27ade8ce874b85433b56122d1b8cd0a024e474
52 changes: 52 additions & 0 deletions docs/Official_Public_Node.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Full Node
* GRPC port: 50051
* P2P network port: 18888
* HTTP port : 8090
```
54.236.37.243
52.53.189.99
18.196.99.16
34.253.187.192
52.56.56.149
35.180.51.163
54.252.224.209
18.228.15.36
52.15.93.92
34.220.77.106
13.127.47.162
13.124.62.58
47.74.149.206
47.90.240.187
47.90.215.84
47.254.77.146
47.74.242.55
47.75.249.119
47.90.201.118
47.74.21.68
47.74.13.168
47.74.33.41
47.52.59.134
47.74.229.70
47.254.27.69
47.89.243.195
47.90.201.112
47.88.174.175
47.74.224.123
47.75.249.4
```

# Solidity Node
* GRPC port: 50051
* HTTP port : 8091
```
47.89.187.247
47.91.18.255
47.75.10.71
47.251.52.228
47.251.48.82
47.74.147.80
34.234.164.105
18.221.34.0
35.178.11.0
35.180.18.107
```
88 changes: 88 additions & 0 deletions docs/Solidity_and_Full_Node_Deployment_EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Deployment of SolidityNode and FullNode on the same host

Create separate directories for fullnode and soliditynode
```
/deploy/fullnode
/deploy/soliditynode
```

Create two folders for fullnode and soliditynode.

Clone our 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__](https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04), 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__](https://github.com/tronprotocol/java-tron/issues/337) result.
* Open **UDP** ports for connection to the network
* **MINIMUM** 2 CPU Cores

## Deployment guide

1. Build the java-tron project
```
cd /deploy/java-tron
./gradlew build
```

2. Copy the FullNode.jar and SolidityNode.jar along with config files into the respective directories.
```
download your needed config file from https://github.com/tronprotocol/TronDeployment.
main_net_config.conf is the config for mainnet, and test_net_config.conf is the config for testnet.
please rename the config 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'll 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:
```
java -jar SolidityNode.jar -c config.conf //make sure that your config.conf is downloaded from https://github.com/tronprotocol/TronDeployment
```

# Logging and network connection verification

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
Create file stop.sh,use kill -15 to close java-tron.jar(or FullNode.jar、SolidityNode.jar).
You need to modify pid=`ps -ef |grep java-tron.jar |grep -v grep |awk '{print $2}'` to find the correct pid.
```
#!/bin/bash
while true; do
pid=`ps -ef |grep java-tron.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
```
104 changes: 104 additions & 0 deletions docs/Tron-VM.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# TRON Virtual Machine (TVM)

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’ve built and uploaded your smart contract to TRON’s 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’s 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
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’s 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

![Flowchart of Tron Virtual Machine](https://raw.githubusercontent.com/ybhgenius/Documentation/master/images/Virtual_Machine/虚拟机.png)

The above flowchart shows how TVM works:
Compilation of Tron smart contract→execution and computing engines of VM→Interoperation 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
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.

## The following is a guide to TVM (smart contract deployment)

1. Compile contract

Contract compilation address: [https://remix.ethereum.org](https://remix.ethereum.org)

2. Get ABI and bytecode
```text
pragma solidity^0.4.11;

contract Tron {
uint256 tron;
constructor() public { }


function set(uint256 number) public returns(bool){
tron = number;
return true;
}
}

ABI: [{“constant":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](https://github.com/tronprotocol/wallet-cli/tree/wallet-cli-vm)
Java-tron-vm branch: [https://github.com/tronprotocol/java-tron/tree/develop_vm](https://github.com/tronprotocol/java-tron/tree/develop_vm)
Password: password of client-end wallet
ContractAddress: customized contract address (in Tron’s 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
```text
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.
2 changes: 1 addition & 1 deletion docs/Tron-overview.md
Original file line number Diff line number Diff line change
@@ -800,7 +800,7 @@ If it contains library, before deploy the contract you need to deploy the librar
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.

# 6 Built-in Contracts and API introduction
# 6 Built-in Contracts and API Introduction
## 6.1 Built-in Contracts
Please refer to:
[https://github.com/tronprotocol/Documentation/blob/master/%E4%B8%AD%E6%96%87%E6%96%87%E6%A1%A3/%E6%B3%A2%E5%9C%BA%E5%8D%8F%E8%AE%AE/%E4%BA%A4%E6%98%93%E6%93%8D%E4%BD%9C%E7%B1%BB%E5%9E%8B%E8%AF%B4%E6%98%8E.md](https://github.com/tronprotocol/Documentation/blob/master/%E4%B8%AD%E6%96%87%E6%96%87%E6%A1%A3/%E6%B3%A2%E5%9C%BA%E5%8D%8F%E8%AE%AE/%E4%BA%A4%E6%98%93%E6%93%8D%E4%BD%9C%E7%B1%BB%E5%9E%8B%E8%AF%B4%E6%98%8E.md)
Loading