Skip to content

Commit

Permalink
chore: add some todo comments
Browse files Browse the repository at this point in the history
  • Loading branch information
h5law committed Nov 12, 2023
1 parent c85f75b commit dfd28f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/relayer/proxy/jsonrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,16 @@ func (jsrv *jsonRPCServer) serveHTTP(ctx context.Context, request *http.Request)

// Build the request to be sent to the native service by substituting
// the destination URL's host with the native service's listen address.
// TODO_HACK: Currently, the native service's listen address is hardcoded to localhost:8547.
// This should be changed to the actual listen address of the native service.
// However, the native service 'ws://anvil:8547' causes errors
log.Printf("DEBUG: Building relay request to native service %s...", jsrv.proxiedServiceEndpoint.String())
destinationURL, err := url.Parse(request.URL.String())
if err != nil {
return nil, err
}
destinationURL.Host = "localhost:8547"
destinationURL.Scheme = "http"
destinationURL.Scheme = "http" // this is not captured and needs to be set
log.Printf("DEBUG: Sending relay request to native service %s...", destinationURL.String())

relayHTTPRequest := &http.Request{
Expand Down
2 changes: 2 additions & 0 deletions proto/pocket/service/relay.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ message JSONRPCRequestPayload {
uint32 id = 1; // Identifier established by the Client to create context for the request.
string jsonrpc = 2; // Version of JSON-RPC. Must be exactly "2.0".
string method = 3; // Method being invoked on the server.
// TODO_RESEARCH: Find out why the params being a map causes errors
// should they be a list of maps?
//map<string, string> params = 4; // Parameters for the method. https://www.jsonrpc.org/specification#parameter_structures
repeated string params = 4; // Parameters for the method. https://www.jsonrpc.org/specification#parameter_structures
}
Expand Down

0 comments on commit dfd28f8

Please sign in to comment.