<p></p>
<p>I was semantically wrong to characterise this gateway proxy as something that enables Bisq to work with RESTful clients.  So... oops.  Doing so was a time eater.</p>
<p>What it does is expose one web endpoint mapped to the single gRPC service.  This single gRPC service performs all implemented Bisq functions, whether requests come from a browser (HTTP 1.1) or gRPC client (HTTP2).</p>
<p>Instead of using URL element paths for passing method names & parameters, all method names & params are passed in the request body, like a web form.  That's not RESTful.  I was trying to combine most of the thoughts <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/cbeams/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/cbeams">@cbeams</a> recorded for the #grpc-api channel ( keybase://team/bisq/2020-05-18%20api%20next%20steps ) into one experiment:  just have a single pass-through gRPC service that takes method names + parameters, and expose the one gRPC service to RESTful web clients.  (This kind of web client is not RESTful.)</p>
<p>Right now (if using go grpc-gateway), I can only think of one way of implementing a single pass-through gRPC service that could serve gRPC and RESTful clients:</p>
<ol>
<li>
<p>Use the POC's <code>CallService#call(String[] params)</code>, or something similar, to serve all gRPC clients.  (Keep the client simple.)</p>
</li>
<li>
<p>For RESTful clients, define a gRPC service for each method, and use those gRPC services as pass throughs to the above gRPC <code>CallService#call(String[] params)</code>.</p>
<p><code>/method1/param1/val1</code> maps to gRPC service <code>Method1Service#call(param1, ..., paramN)</code>, <code>Method1</code> returns <code>CallService#call(String[] params)</code></p>
<p><code>/method1/param1/val1/paramN/valN</code> maps to gRPC service <code>Method1Service#call(param1, ..., paramN)</code>, <code>Method1</code> returns <code>CallService#call(String[] params)</code></p>
<p><code>/method2/param/val</code> maps to gRPC service <code>Method2Service#call(param)</code>, <code>Method2</code> returns <code>CallService#call(String[] params)</code></p>
<p>etc...</p>
</li>
</ol>
<p><a href="https://github.com/grpc-ecosystem/grpc-gateway">Go grpc-gateway</a> protos can be used to map multiple URLs with the same base path element to a single gRPC method, but each unique method (with a unique base path element) needs to be mapped to a unique gRPC service.</p>
<p>I didn't do that because I wanted to see how exposing one gRPC service to gRPC and web clients might work.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/pull/4275#issuecomment-638374030">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNSSYIU6DU2PWMVNLLLRU2HVLANCNFSM4NLKNX7A">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNSC4CGCMHLA2M2C7NDRU2HVLA5CNFSM4NLKNX7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEYGNBDQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/pull/4275#issuecomment-638374030",
"url": "https://github.com/bisq-network/bisq/pull/4275#issuecomment-638374030",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>