tron-protocol-node
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "tron-protocol-node", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Node.js wrapper for Tron protocol. Compiled from tronprotocol/protocol, commit : 0f02cfd.", | ||
@@ -5,0 +5,0 @@ "main": " ", |
@@ -9,27 +9,41 @@ # Tron Node Protocol | ||
Tron protocol offers two ways to communicate with nodes : http and gRPC API. | ||
The gRPC API is specified with google protobuf, which is a mechanism for serializing structured data and an Interface Description Language. | ||
Google Protobuf code can be compiled to different languages - C++, Java, Node.js, etc. | ||
This package is a compiled to Node.js google protobuf code. | ||
The exact steps to replicate the compilation process from protobuf code to node.js code is as follows : | ||
## Steps to compile the code : | ||
###### Download the latest version of the protocol | ||
* git clone https://github.com/tronprotocol/protocol.git && cd protocol/ | ||
``` | ||
git clone https://github.com/tronprotocol/protocol.git && cd protocol/ | ||
``` | ||
###### Install google apis required for the compilation process | ||
* ./install-googleapis.sh | ||
``` | ||
./install-googleapis.sh | ||
``` | ||
###### Create a folder which will contain the artifacts from the compilation | ||
* mkdir node-protocol/ | ||
``` | ||
mkdir node-protocol/ | ||
``` | ||
###### Install grpc compilation tools | ||
* npm i -g grpc-tools | ||
``` | ||
npm i -g grpc-tools | ||
``` | ||
###### Run the compilation command for protocol/api/ files (artifacts are in node-protocol/api -> api_pb.js and api_grpc_pb.js) | ||
* protoc --js_out=import_style=commonjs,binary:node-protocol/ --grpc_out=node-protocol/ --plugin=protoc-gen-grpc=`which grpc_tools_node_protoc_plugin` api/api.proto | ||
``` | ||
protoc --js_out=import_style=commonjs,binary:node-protocol/ --grpc_out=node-protocol/ --plugin=protoc-gen-grpc=\`which grpc_tools_node_protoc_plugin` api/api.proto | ||
``` | ||
###### Run the compilation command for protocol/core/ files (artifacts are in node-protocol/core) | ||
* protoc --js_out=import_style=commonjs,binary:node-protocol/ core/* | ||
``` | ||
protoc --js_out=import_style=commonjs,binary:node-protocol/ core/* | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48
1006596