Skip to content

Commit 3d4858d

Browse files
author
wubin1
committed
fix struct of read me
1 parent 6a37b52 commit 3d4858d

3 files changed

Lines changed: 276 additions & 271 deletions

File tree

‎README.md‎

Lines changed: 3 additions & 271 deletions
Original file line numberDiff line numberDiff line change
@@ -61,278 +61,10 @@ TRON enables large-scale development and engagement. With over 2000 transactions
6161
TRON Protocol and the Tron Virtual Machine (TVM) allow anyone to develop decentralized applications (DAPPs) for themselves or their communities with smart contracts thereby making decentralized crowdfunding and token issuance easier than ever.
6262

6363
# How to Build
64+
https://github.com/tronprotocol/java-tron/blob/fixReadMe/build.md
6465

65-
## Prepare dependencies
66-
67-
* JDK 1.8 (JDK 1.9+ are not supported yet)
68-
* 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.
69-
* Open **UDP** ports for connection to the network
70-
* **MINIMUM** 2 ENERGY Cores
71-
72-
## Build and Deploy automatically using scripts
73-
74-
- Please take a look at the [Tron Deployment Scripts](https://github.com/tronprotocol/TronDeployment) repository.
75-
76-
## Getting the code with git
77-
78-
* Use Git from the Terminal, see the [Setting up Git](https://help.github.com/articles/set-up-git/) and [Fork a Repo](https://help.github.com/articles/fork-a-repo/) articles.
79-
* develop branch: the newest code
80-
* master branch: more stable than develop.
81-
In the shell command, type:
82-
```bash
83-
git clone https://github.com/tronprotocol/java-tron.git
84-
git checkout -t origin/master
85-
```
86-
87-
* For Mac, you can also install **[GitHub for Mac](https://mac.github.com/)** then **[fork and clone our repository](https://guides.github.com/activities/forking/)**.
88-
89-
* If you'd rather not use Git, [Download the ZIP](https://github.com/tronprotocol/java-tron/archive/develop.zip)
90-
91-
## Including java-tron as dependency
92-
93-
* If you don't want to checkout the code and build the project, you can include it directly as a dependency
94-
95-
**Using gradle:**
96-
97-
```
98-
repositories {
99-
maven { url 'https://jitpack.io' }
100-
}
101-
dependencies {
102-
implementation 'com.github.tronprotocol:java-tron:develop-SNAPSHOT'
103-
}
104-
```
105-
106-
**Using maven:**
107-
108-
```xml
109-
...
110-
<repositories>
111-
<repository>
112-
<id>jitpack.io</id>
113-
<url>https://jitpack.io</url>
114-
</repository>
115-
</repositories>
116-
...
117-
<dependency>
118-
<groupId>com.github.tronprotocol</groupId>
119-
<artifactId>java-tron</artifactId>
120-
<version>develop-SNAPSHOT</version><!--You can use any of the tag/branch name available-->
121-
</dependency>
122-
```
123-
124-
125-
126-
127-
## Building from source code
128-
129-
* Build in the Terminal
130-
131-
```bash
132-
cd java-tron
133-
./gradlew build
134-
```
135-
136-
137-
* Build in [IntelliJ IDEA](https://www.jetbrains.com/idea/) (community version is enough):
138-
139-
**Please run ./gradlew build once to build the protocol files**
140-
141-
1. Start IntelliJ. Select `File` -> `Open`, then locate to the java-tron folder which you have git cloned to your local drive. Then click `Open` button on the right bottom.
142-
2. Check on `Use auto-import` on the `Import Project from Gradle` dialog. Select JDK 1.8 in the `Gradle JVM` option. Then click `OK`.
143-
3. IntelliJ will open the project and start gradle syncing, which will take several minutes, depending on your network connection and your IntelliJ configuration
144-
4. Enable Annotations, `Preferences` -> Search `annotations` -> check `Enable Annotation Processing`.
145-
5. After the syncing finished, select `Gradle` -> `Tasks` -> `build`, and then double click `build` option.
146-
147-
# Running
148-
149-
### Running multi-nodes
150-
151-
https://github.com/tronprotocol/Documentation/blob/master/TRX/Solidity_and_Full_Node_Deployment_EN.md
152-
153-
## Running a local node and connecting to the public testnet
154-
155-
* Use the [Testnet Config](https://github.com/tronprotocol/TronDeployment/blob/master/test_net_config.conf) or use the [Tron Deployment Scripts](https://github.com/tronprotocol/TronDeployment)
156-
157-
158-
### Running a Super Representative Node for mainnet
159-
160-
* Use the executable JAR(Recommended way)
161-
162-
```bash
163-
java -jar FullNode.jar -p your private key --witness -c your config.conf(Example:/data/java-tron/config.conf)
164-
Example:
165-
java -jar FullNode.jar -p 650950B193DDDDB35B6E48912DD28F7AB0E7140C1BFDEFD493348F02295BD812 --witness -c /data/java-tron/config.conf
166-
167-
```
168-
169-
This is similar to running a private testnet, except that the IPs in the `config.conf` are officially declared by TRON.
170-
171-
<details>
172-
<summary>Correct output</summary>
173-
174-
```bash
175-
176-
20:43:18.138 INFO [main] [o.t.p.FullNode](FullNode.java:21) Full node running.
177-
20:43:18.486 INFO [main] [o.t.c.c.a.Args](Args.java:429) Bind address wasn't set, Punching to identify it...
178-
20:43:18.493 INFO [main] [o.t.c.c.a.Args](Args.java:433) UDP local bound to: 10.0.8.146
179-
20:43:18.495 INFO [main] [o.t.c.c.a.Args](Args.java:448) External IP wasn't set, using checkip.amazonaws.com to identify it...
180-
20:43:19.450 INFO [main] [o.t.c.c.a.Args](Args.java:461) External address identified: 47.74.147.87
181-
20:43:19.599 INFO [main] [o.s.c.a.AnnotationConfigApplicationContext](AbstractApplicationContext.java:573) Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@124c278f: startup date [Fri Apr 27 20:43:19 CST 2018]; root of context hierarchy
182-
20:43:19.972 INFO [main] [o.s.b.f.a.AutowiredAnnotationBeanPostProcessor](AutowiredAnnotationBeanPostProcessor.java:153) JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
183-
20:43:20.380 INFO [main] [o.t.c.d.DynamicPropertiesStore](DynamicPropertiesStore.java:244) update latest block header timestamp = 0
184-
20:43:20.383 INFO [main] [o.t.c.d.DynamicPropertiesStore](DynamicPropertiesStore.java:252) update latest block header number = 0
185-
20:43:20.393 INFO [main] [o.t.c.d.DynamicPropertiesStore](DynamicPropertiesStore.java:260) update latest block header id = 00
186-
20:43:20.394 INFO [main] [o.t.c.d.DynamicPropertiesStore](DynamicPropertiesStore.java:265) update state flag = 0
187-
20:43:20.559 INFO [main] [o.t.c.c.TransactionCapsule](TransactionCapsule.java:83) Transaction create succeeded!
188-
20:43:20.567 INFO [main] [o.t.c.c.TransactionCapsule](TransactionCapsule.java:83) Transaction create succeeded!
189-
20:43:20.568 INFO [main] [o.t.c.c.TransactionCapsule](TransactionCapsule.java:83) Transaction create succeeded!
190-
20:43:20.568 INFO [main] [o.t.c.c.TransactionCapsule](TransactionCapsule.java:83) Transaction create succeeded!
191-
20:43:20.569 INFO [main] [o.t.c.c.TransactionCapsule](TransactionCapsule.java:83) Transaction create succeeded!
192-
20:43:20.596 INFO [main] [o.t.c.d.Manager](Manager.java:300) create genesis block
193-
20:43:20.607 INFO [main] [o.t.c.d.Manager](Manager.java:306) save block: BlockCapsule
194-
195-
```
196-
197-
Then observe whether block synchronization success,If synchronization successfully explains the success of the super node
198-
199-
</details>
200-
201-
202-
### Running a Super Representative Node for private testnet
203-
* use master branch
204-
* You should modify the config.conf
205-
1. Replace existing entry in genesis.block.witnesses with your address.
206-
2. Replace existing entry in seed.node ip.list with your ip list.
207-
3. The first Super Node start, needSyncCheck should be set false
208-
4. Set p2pversion to 61
209-
210-
* Use the executable JAR(Recommended way)
211-
212-
```bash
213-
cd build/libs
214-
java -jar FullNode.jar -p your private key --witness -c your config.conf (Example:/data/java-tron/config.conf)
215-
Example:
216-
java -jar FullNode.jar -p 650950B193DDDDB35B6E48912DD28F7AB0E7140C1BFDEFD493348F02295BD812 --witness -c /data/java-tron/config.conf
217-
218-
```
219-
220-
<details>
221-
<summary>Show Output</summary>
222-
223-
```bash
224-
> ./gradlew run -Pwitness
225-
226-
> Task :generateProto UP-TO-DATE
227-
Using TaskInputs.file() with something that doesn't resolve to a File object has been deprecated and is scheduled to be removed in Gradle 5.0. Use TaskInputs.files() instead.
228-
229-
> Task :run
230-
20:39:22.749 INFO [o.t.c.c.a.Args] private.key = 63e62a71ed39e30bac7223097a173924aad5855959de517ff2987b0e0ec89f1a
231-
20:39:22.816 WARN [o.t.c.c.a.Args] localwitness size must be one, get the first one
232-
20:39:22.832 INFO [o.t.p.FullNode] Here is the help message.output-directory/
233-
三月 22, 2018 8:39:23 下午 org.tron.core.services.RpcApiService start
234-
信息: Server started, listening on 50051
235-
20:39:23.706 INFO [o.t.c.o.n.GossipLocalNode] listener message
236-
20:39:23.712 INFO [o.t.c.o.n.GossipLocalNode] sync group = a41d27f10194c53703be90c6f8735bb66ffc53aa10ea9024d92dbe7324b1aee3
237-
20:39:23.716 INFO [o.t.c.s.WitnessService] Sleep : 1296 ms,next time:2018-03-22T20:39:25.000+08:00
238-
20:39:23.734 WARN [i.s.t.BootstrapFactory] Env doesn't support epoll transport
239-
20:39:23.746 INFO [i.s.t.TransportImpl] Bound to: 192.168.10.163:7080
240-
20:39:23.803 INFO [o.t.c.n.n.NodeImpl] other peer is nil, please wait ...
241-
20:39:25.019 WARN [o.t.c.d.Manager] nextFirstSlotTime:[2018-03-22T17:57:20.001+08:00],now[2018-03-22T20:39:25.067+08:00]
242-
20:39:25.019 INFO [o.t.c.s.WitnessService] ScheduledWitness[448d53b2df0cd78158f6f0aecdf60c1c10b15413],slot[1946]
243-
20:39:25.021 INFO [o.t.c.s.WitnessService] It's not my turn
244-
20:39:25.021 INFO [o.t.c.s.WitnessService] Sleep : 4979 ms,next time:2018-03-22T20:39:30.000+08:00
245-
20:39:30.003 WARN [o.t.c.d.Manager] nextFirstSlotTime:[2018-03-22T17:57:20.001+08:00],now[2018-03-22T20:39:30.052+08:00]
246-
20:39:30.003 INFO [o.t.c.s.WitnessService] ScheduledWitness[6c22c1af7bfbb2b0e07148ecba27b56f81a54fcf],slot[1947]
247-
20:39:30.003 INFO [o.t.c.s.WitnessService] It's not my turn
248-
20:39:30.003 INFO [o.t.c.s.WitnessService] Sleep : 4997 ms,next time:2018-03-22T20:39:35.000+08:00
249-
20:39:33.803 INFO [o.t.c.n.n.NodeImpl] other peer is nil, please wait ...
250-
20:39:35.005 WARN [o.t.c.d.Manager] nextFirstSlotTime:[2018-03-22T17:57:20.001+08:00],now[2018-03-22T20:39:35.054+08:00]
251-
20:39:35.005 INFO [o.t.c.s.WitnessService] ScheduledWitness[48e447ec869216de76cfeeadf0db37a3d1c8246d],slot[1948]
252-
20:39:35.005 INFO [o.t.c.s.WitnessService] It's not my turn
253-
20:39:35.005 INFO [o.t.c.s.WitnessService] Sleep : 4995 ms,next time:2018-03-22T20:39:40.000+08:00
254-
20:39:40.005 WARN [o.t.c.d.Manager] nextFirstSlotTime:[2018-03-22T17:57:20.001+08:00],now[2018-03-22T20:39:40.055+08:00]
255-
20:39:40.010 INFO [o.t.c.d.Manager] postponedTrxCount[0],TrxLeft[0]
256-
20:39:40.022 INFO [o.t.c.d.DynamicPropertiesStore] update latest block header id = fd30a16160715f3ca1a5bcad18e81991cd6f47265a71815bd2c943129b258cd2
257-
20:39:40.022 INFO [o.t.c.d.TronStoreWithRevoking] Address is [108, 97, 116, 101, 115, 116, 95, 98, 108, 111, 99, 107, 95, 104, 101, 97, 100, 101, 114, 95, 104, 97, 115, 104], BytesCapsule is org.tron.core.capsule.BytesCapsule@2ce0e954
258-
20:39:40.023 INFO [o.t.c.d.DynamicPropertiesStore] update latest block header number = 140
259-
20:39:40.024 INFO [o.t.c.d.TronStoreWithRevoking] Address is [108, 97, 116, 101, 115, 116, 95, 98, 108, 111, 99, 107, 95, 104, 101, 97, 100, 101, 114, 95, 110, 117, 109, 98, 101, 114], BytesCapsule is org.tron.core.capsule.BytesCapsule@83924ab
260-
20:39:40.024 INFO [o.t.c.d.DynamicPropertiesStore] update latest block header timestamp = 1521722380001
261-
20:39:40.024 INFO [o.t.c.d.TronStoreWithRevoking] Address is [108, 97, 116, 101, 115, 116, 95, 98, 108, 111, 99, 107, 95, 104, 101, 97, 100, 101, 114, 95, 116, 105, 109, 101, 115, 116, 97, 109, 112], BytesCapsule is org.tron.core.capsule.BytesCapsule@ca6a6f8
262-
20:39:40.024 INFO [o.t.c.d.Manager] updateWitnessSchedule number:140,HeadBlockTimeStamp:1521722380001
263-
20:39:40.025 WARN [o.t.c.u.RandomGenerator] index[-3] is out of range[0,3],skip
264-
20:39:40.070 INFO [o.t.c.d.TronStoreWithRevoking] Address is [73, 72, -62, -24, -89, 86, -39, 67, 112, 55, -36, -40, -57, -32, -57, 61, 86, 12, -93, -115], AccountCapsule is account_name: "Sun"
265-
address: "IH\302\350\247V\331Cp7\334\330\307\340\307=V\f\243\215"
266-
balance: 9223372036854775387
267-
268-
20:39:40.081 INFO [o.t.c.d.TronStoreWithRevoking] Address is [41, -97, 61, -72, 10, 36, -78, 10, 37, 75, -119, -50, 99, -99, 89, 19, 47, 21, 127, 19], AccountCapsule is type: AssetIssue
269-
address: ")\237=\270\n$\262\n%K\211\316c\235Y\023/\025\177\023"
270-
balance: 420
271-
272-
20:39:40.082 INFO [o.t.c.d.TronStoreWithRevoking] Address is [76, 65, 84, 69, 83, 84, 95, 83, 79, 76, 73, 68, 73, 70, 73, 69, 68, 95, 66, 76, 79, 67, 75, 95, 78, 85, 77], BytesCapsule is org.tron.core.capsule.BytesCapsule@ec1439
273-
20:39:40.083 INFO [o.t.c.d.Manager] there is account List size is 8
274-
20:39:40.084 INFO [o.t.c.d.Manager] there is account ,account address is 448d53b2df0cd78158f6f0aecdf60c1c10b15413
275-
20:39:40.084 INFO [o.t.c.d.Manager] there is account ,account address is 548794500882809695a8a687866e76d4271a146a
276-
20:39:40.084 INFO [o.t.c.d.Manager] there is account ,account address is 48e447ec869216de76cfeeadf0db37a3d1c8246d
277-
20:39:40.084 INFO [o.t.c.d.Manager] there is account ,account address is 55ddae14564f82d5b94c7a131b5fcfd31ad6515a
278-
20:39:40.085 INFO [o.t.c.d.Manager] there is account ,account address is 6c22c1af7bfbb2b0e07148ecba27b56f81a54fcf
279-
20:39:40.085 INFO [o.t.c.d.Manager] there is account ,account address is 299f3db80a24b20a254b89ce639d59132f157f13
280-
20:39:40.085 INFO [o.t.c.d.Manager] there is account ,account address is abd4b9367799eaa3197fecb144eb71de1e049150
281-
20:39:40.085 INFO [o.t.c.d.Manager] there is account ,account address is 4948c2e8a756d9437037dcd8c7e0c73d560ca38d
282-
20:39:40.085 INFO [o.t.c.d.TronStoreWithRevoking] Address is [108, 34, -63, -81, 123, -5, -78, -80, -32, 113, 72, -20, -70, 39, -75, 111, -127, -91, 79, -49], WitnessCapsule is org.tron.core.capsule.WitnessCapsule@4cb4f7fb
283-
20:39:40.086 INFO [o.t.c.d.TronStoreWithRevoking] Address is [41, -97, 61, -72, 10, 36, -78, 10, 37, 75, -119, -50, 99, -99, 89, 19, 47, 21, 127, 19], WitnessCapsule is org.tron.core.capsule.WitnessCapsule@7be2474a
284-
20:39:40.086 INFO [o.t.c.d.TronStoreWithRevoking] Address is [72, -28, 71, -20, -122, -110, 22, -34, 118, -49, -18, -83, -16, -37, 55, -93, -47, -56, 36, 109], WitnessCapsule is org.tron.core.capsule.WitnessCapsule@3e375891
285-
20:39:40.086 INFO [o.t.c.d.TronStoreWithRevoking] Address is [68, -115, 83, -78, -33, 12, -41, -127, 88, -10, -16, -82, -51, -10, 12, 28, 16, -79, 84, 19], WitnessCapsule is org.tron.core.capsule.WitnessCapsule@55d77b83
286-
20:39:40.090 INFO [o.t.c.d.Manager] countWitnessMap size is 0
287-
20:39:40.091 INFO [o.t.c.d.TronStoreWithRevoking] Address is [41, -97, 61, -72, 10, 36, -78, 10, 37, 75, -119, -50, 99, -99, 89, 19, 47, 21, 127, 19], WitnessCapsule is org.tron.core.capsule.WitnessCapsule@310dd876
288-
20:39:40.092 INFO [o.t.c.d.TronStoreWithRevoking] Address is [72, -28, 71, -20, -122, -110, 22, -34, 118, -49, -18, -83, -16, -37, 55, -93, -47, -56, 36, 109], WitnessCapsule is org.tron.core.capsule.WitnessCapsule@151b42bc
289-
20:39:40.092 INFO [o.t.c.d.TronStoreWithRevoking] Address is [108, 34, -63, -81, 123, -5, -78, -80, -32, 113, 72, -20, -70, 39, -75, 111, -127, -91, 79, -49], WitnessCapsule is org.tron.core.capsule.WitnessCapsule@2d0388aa
290-
20:39:40.092 INFO [o.t.c.d.TronStoreWithRevoking] Address is [68, -115, 83, -78, -33, 12, -41, -127, 88, -10, -16, -82, -51, -10, 12, 28, 16, -79, 84, 19], WitnessCapsule is org.tron.core.capsule.WitnessCapsule@478a55e7
291-
20:39:40.101 INFO [o.t.c.d.TronStoreWithRevoking] Address is [-3, 48, -95, 97, 96, 113, 95, 60, -95, -91, -68, -83, 24, -24, 25, -111, -51, 111, 71, 38, 90, 113, -127, 91, -46, -55, 67, 18, -101, 37, -116, -46], BlockCapsule is BlockCapsule{blockId=fd30a16160715f3ca1a5bcad18e81991cd6f47265a71815bd2c943129b258cd2, num=140, parentId=dadeff07c32d342b941cfa97ba82870958615e7ae73fffeaf3c6a334d81fe3bd, generatedByMyself=true}
292-
20:39:40.102 INFO [o.t.c.d.Manager] save block: BlockCapsule{blockId=fd30a16160715f3ca1a5bcad18e81991cd6f47265a71815bd2c943129b258cd2, num=140, parentId=dadeff07c32d342b941cfa97ba82870958615e7ae73fffeaf3c6a334d81fe3bd, generatedByMyself=true}
293-
20:39:40.102 INFO [o.t.c.s.WitnessService] Block is generated successfully, Its Id is fd30a16160715f3ca1a5bcad18e81991cd6f47265a71815bd2c943129b258cd2,number140
294-
20:39:40.102 INFO [o.t.c.n.n.NodeImpl] Ready to broadcast a block, Its hash is fd30a16160715f3ca1a5bcad18e81991cd6f47265a71815bd2c943129b258cd2
295-
20:39:40.107 INFO [o.t.c.s.WitnessService] Produced
296-
20:39:40.107 INFO [o.t.c.s.WitnessService] Sleep : 4893 ms,next time:2018-03-22T20:39:45.000+08:00
297-
20:39:43.805 INFO [o.t.c.n.n.NodeImpl] other peer is nil, please wait ...
298-
20:39:45.002 WARN [o.t.c.d.Manager] nextFirstSlotTime:[2018-03-22T20:39:45.001+08:00],now[2018-03-22T20:39:45.052+08:00]
299-
20:39:45.003 INFO [o.t.c.s.WitnessService] ScheduledWitness[48e447ec869216de76cfeeadf0db37a3d1c8246d],slot[1]
300-
20:39:45.003 INFO [o.t.c.s.WitnessService] It's not my turn
301-
20:39:45.003 INFO [o.t.c.s.WitnessService] Sleep : 4997 ms,next time:2018-03-22T20:39:50.000+08:00
302-
20:39:50.002 WARN [o.t.c.d.Manager] nextFirstSlotTime:[2018-03-22T20:39:45.001+08:00],now[2018-03-22T20:39:50.052+08:00]
303-
20:39:50.003 INFO [o.t.c.s.WitnessService] ScheduledWitness[6c22c1af7bfbb2b0e07148ecba27b56f81a54fcf],slot[2]
304-
20:39:50.003 INFO [o.t.c.s.WitnessService] It's not my turn
305-
20:39:50.003 INFO [o.t.c.s.WitnessService] Sleep : 4997 ms,next time:2018-03-22T20:39:55.000+08:00
306-
307-
```
308-
309-
</details>
310-
311-
* In IntelliJ IDEA
312-
313-
<details>
314-
<summary>
315-
316-
Open the configuration panel:
317-
318-
</summary>
319-
320-
![](docs/images/program_configure.png)
321-
322-
</details>
323-
324-
<details>
325-
<summary>
326-
327-
In the `Program arguments` option, fill in `--witness`:
328-
329-
</summary>
330-
331-
![](docs/images/set_witness_param.jpeg)
332-
333-
</details>
334-
335-
Then, run `FullNode::main()` again.
66+
# How to Run
67+
https://github.com/tronprotocol/java-tron/blob/fixReadMe/run.md
33668

33769
# Quick Start
33870

0 commit comments

Comments
 (0)