ProtoBuf is a flexible and efficient language-independent structured data representation method that can be used to represent communication protocols and data storage. Compared to XML, ProtoBuF is smaller, faster and simpler. You can use the ProtoBuf compiler to generate source code for specific languages (such as C++, Java, Python, etc., ProtoBuf currently supports mainstream programming languages) for serialization and deserialization.
Tron applies GPB-message standard to communicate with tron network, such as generate signed raw tx with transfer contract and broadcast to network.
#create a directory to house protoc $ mkdir protoc $ cd protoc #btcschools.net applied protoc v3.14.0 with linux os and x86_64 architeture $ wget https://github.com/protocolbuffers/protobuf/releases/download/v3.14.0/protoc-3.14.0-linux-x86_64.zip
$ unzip protoc-3.14.0-linux-x86_64.zip
$ cd bin $ ./protoc --version # this will output libprotoc 3.14.0
$ git clone https://github.com/tronprotocol/wallet-cli # a wallet-cli folder will be created automatically
$ ls wallet-cli/src/main/protos/core #You will see many different raw message
#compile Discover.proto $ /home/btcschools/protoc/bin/protoc --proto_path='/home/btcschools/wallet-cli/src/main/protos' --php_out='/home/btcschools/public_html/tron/protobuf/core' core/Discover.proto #compile Tron.proto $ /home/btcschools/protoc/bin/protoc --proto_path='/home/btcschools/wallet-cli/src/main/protos' --php_out='/home/btcschools/public_html/tron/protobuf/core' core/Tron.proto #compile TronInventoryItems.proto $ /home/btcschools/protoc/bin/protoc --proto_path='/home/btcschools/wallet-cli/src/main/protos' --php_out='/home/btcschools/public_html/tron/protobuf/core' core/TronInventoryItems.proto #compile all system contract's proto files $ /home/btcschools/protoc/bin/protoc --proto_path='/home/btcschools/wallet-cli/src/main/protos' --php_out='/home/btcschools/public_html/tron/protobuf/core/contract' core/contract/*.proto