From dfd28f8f3257f85ac97acc6c44277ad3d99f8a7b Mon Sep 17 00:00:00 2001 From: harry <53987565+h5law@users.noreply.github.com> Date: Sun, 12 Nov 2023 17:34:07 +0000 Subject: [PATCH] chore: add some todo comments --- pkg/relayer/proxy/jsonrpc.go | 5 ++++- proto/pocket/service/relay.proto | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/relayer/proxy/jsonrpc.go b/pkg/relayer/proxy/jsonrpc.go index 4fa6f5874..bf7736f33 100644 --- a/pkg/relayer/proxy/jsonrpc.go +++ b/pkg/relayer/proxy/jsonrpc.go @@ -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{ diff --git a/proto/pocket/service/relay.proto b/proto/pocket/service/relay.proto index 7715a41c1..968fd8dfe 100644 --- a/proto/pocket/service/relay.proto +++ b/proto/pocket/service/relay.proto @@ -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 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 }