-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Expected to support gRPCurl tool for grpc interface invocation easily #5391
Comments
Yes. TRON now does not support the reflection of gRPC, if you are maintaining a fullnode, you can try to update the code to support the reflection. Demo(just a demo, some additional steps may be required):
Or would you like to submit a PR to help TRON support this feature? |
We are ready to implement this function, but need to remind the following points: The scope of reflection enabled Whether include all gRPC services, such as solidity and pBFT? I tend to enable it in all services to ensure that all services behave consistently. Impact on performance Although no very authoritative information was found, after review and analysis, I think adding the reflection to the gRPC servers probably will not affect the performance, because the principle of the reflection is only to retain the meta-information of the Whether need to add a switch configuration Dismatch encoding of results Since different gRPC clients use different encodings for the json results, the display of some fields in the results may not be as expected. For example, in the responses of Therefore, here is a strong reminder that the reflection may be more about helping developers quickly locate bugs, and may not serve online services well. I will post how to encode and decode the results of |
Here I show how to encode and decode the results of The return value of
Below is the return result of HTTP service:
Taking // code logic
String witness = "QYSJS0L2bc6MuErsLtEWBMmRNRrI";
System.out.println("the witness addr is: " + ByteArray.toHexString(Base64.decode(witness)));
// the output
the witness addr is: 4184894b42f66dce8cb84aec2ed11604c991351ac8 |
Bien |
Rationale
Expected Java-tron to support gRPCurl tool for grpc interface invocation.
Why should this feature exist?
Java-tron supports HTTP、json-rpc and grpc APIs, some users may usually test them through command line tool, For example, curl and grpcurl and so on. For http and json-rpc API, they may use curl command, but for grpc call, gRPCurl is not supported by Java-tron. Although other tools can be used: postman or bloomRPC, but they may generally need to import proto files, which is not convenient enough for users to use.
The text was updated successfully, but these errors were encountered: