-
Notifications
You must be signed in to change notification settings - Fork 141
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
feat: add jsonrpc gateway support #1183
feat: add jsonrpc gateway support #1183
Conversation
@alidevjimmy, you can use commands like |
client: client, | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to add a function here like:
// RegisterBlockchainMethods registers the JSON-RPC methods for the Blockchain service with "mux".
// The handlers convert JSON-RPC requests to gRPC requests and forward them to the gRPC endpoint over "conn".
// The results are then converted back to JSON-RPC responses.
func RegisterTransactionHandler(ctx context.Context, mux *jgw.ServerMux, conn *grpc.ClientConn) error {
return mux.RegisterMethods(ctx, BlockchainMethods(NewTransactionClient(conn)))
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can give a type to: func(ctx context.Context, params json.RawMessage) (interface{}, error)
520887f
to
389e25b
Compare
Feat add jsonrpc gateway support
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1183 +/- ##
==========================================
- Coverage 81.37% 81.33% -0.04%
==========================================
Files 179 179
Lines 9481 9496 +15
==========================================
+ Hits 7715 7724 +9
- Misses 1381 1386 +5
- Partials 385 386 +1 |
…immy/pactus into feat-add-jsonrpc-gateway-support
test: fix config test issue
Description
Added JSON-RPC gateway support for gRPC server using protoc-gen-jrpc-gateway protoc generator plugin and jrpc for json-rpc server.
I tested it manually and it works fine but I'll write tests for it.