java-tron
What's TRON?
TRON is a block chain-based decentralized smart protocol and an application development platform. It allows each user to freely publish, store and own contents and data, and in the decentralized autonomous form, decides an incentive mechanism and enables application developers and content creators through digital asset distribution, circulation and transaction, thus forming a decentralized content entertainment ecosystem.
TRON is a product of Web 4.0 and the decentralized internet of next generation.
Quick Start
Note: This repository is a IDEA project which you can simply download and import.
Download and build
> git clone https://github.com/tronprotocol/java-tron.git
> cd java-tron
> gradle build
Import project to IDEA
- [File] -> [New] -> [Project from Existing Sources...]
- Select java-tron/build.gradle
- Dialog [Import Project from Gradle], confirm [Use auto-import] and [Use gradle wrapper task configuration] have been selected,then select Gradle JVM(JDK 1.8)and click [OK]
Testing
Install Kafka and create two topics (block and transaction)
Update the configuration
Starting program
IDEA:
- [Edit Configurations...] -> [Add New Configuration] -> [Application]
- [Edit Configurations...] -> [Main Class]:
org.tron.example.Tron
- [Edit Configurations...] -> [Use classpath of module]:
java-tron_main
- [Edit Configurations...] -> [Program arguments]:
--type server
- Run
or simply from terminal:
- ./gradlew run -Pserver=true
Complete process
Other nodes to join need to modify the connection ip
Commands
help
Description | Example |
---|---|
Help tips | help |
account
Description | Example |
---|---|
Get address | account |
getbalance
Description | Example |
---|---|
Get balance | getbalance |
send [to] [balance]
Description | Example |
---|---|
Send balance to address | send 2cddf5707aefefb199cb16430fb0f6220d460dfe 2 |
printblockchain
Description | Example |
---|---|
Print blockchain | printblockchain |
exit
Description | Example |
---|---|
Exit | exit |
Contact
Chat with us via Gitter.
Contribution
Contributions are welcomed and greatly appreciated. Please see CONTRIBUTING.md for details on submitting patches and the contribution workflow.