<p>This is the third in a series of PRs leading up to a larger refactoring effort. It should be merged immediately after PRs <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="548255770" data-permission-text="Issue title is private" data-url="https://github.com/bisq-network/bisq/issues/3886" data-hovercard-type="pull_request" data-hovercard-url="/bisq-network/bisq/pull/3886/hovercard" href="https://github.com/bisq-network/bisq/pull/3886">#3886</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="548263192" data-permission-text="Issue title is private" data-url="https://github.com/bisq-network/bisq/issues/3887" data-hovercard-type="pull_request" data-hovercard-url="/bisq-network/bisq/pull/3887/hovercard" href="https://github.com/bisq-network/bisq/pull/3887">#3887</a>, in that order.</p>
<p>The proof of concept introduced here was authored by <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/chimp1984/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/chimp1984">@chimp1984</a> and is not strictly related to the refactoring effort that will follow in the next and final PR in this series, but that refactoring effort began on top of these changes. To avoid rework in teasing these changes apart and submitting them fully separately, I'm choosing to introduce the gRPC PoC here such that the refactoring work can be submitted immediately afterward. Please note that commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/bisq-network/bisq/commit/65175a7f4fea2127539518ba9fdf4ed646c0459f/hovercard" href="https://github.com/bisq-network/bisq/commit/65175a7f4fea2127539518ba9fdf4ed646c0459f"><tt>65175a7</tt></a> completely disables the PoC functionality such that the API cannot be used in production. Once this series of PRs is merged, I plan to return to the gRPC API effort, where I already have a number of modifications to this proof of concept in flight. So this code won't just "sit there"; it will be reworked into production-readiness as one of my next priorities.</p>
<pre><code>65175a7f4 (Chris Beams, 3 weeks ago)
   Remove --desktopWith{Grpc|Http}Api options for now

   The previous commit introduces the BisqGrpcServer as a proof of concept,
   but it is not yet ready for production use. This commit removes the
   `--desktopWithGrpcApi` option that starts the gRPC server until such time
   that it is production-ready.

   This change also removes the `--desktopWithHttpApi` option for starting an
   HTTP API server. The option has been in place for some time, but it was
   'false advertising' in the sense that nothing actually happened if the user
   specified it, because there is in fact no HTTP API implementation to be
   started.

   Note that when the gRPC API option is reintroduced, it will be renamed to
   `--rpcserver` or similar, following the convention in Bitcoin Core.

5c02ce576 (chimp1984, 4 months ago)
   Introduce gRPC API proof of concept

   This commit introduces a new `grpc` module including the following key
   types:

    - BisqGrpcServer: The API implementation itself, along with generated
     gRPC Response/Reploy types defined in grpc/src/main/proto/grpc.proto.

    - BisqGrpcServerMain: A 'headless' / daemon-like entry point for
     running a Bisq node without the JavaFX desktop UI.

    - BisqGrpcClient: A simple, repl-style client for the API that allows
     the user to exercise the various endpoints as seen in the example
     below.

   In the `desktop` module, the BisqAppMain class has been modified to start a
   BisqGrpcServer instance if the `--desktopWithGrpcApi` option has been set
   to `true`.

   In the `core` module, a new `CoreApi` class has been introduced providing a
   kind of comprehensive facade for all Bisq functionality to be exposed via
   the RPC API.

   How to explore the proof of concept:

    1. Run the main() method in BisqAppMain providing
   `--desktopWithGrpcApi=true` as a program argument or alternatively, run
   the main() method in BisqGrpcServerMain, where no special option is
   required. In either case, you'll notice the following entry in the log
   output:

       INFO  bisq.grpc.BisqGrpcServer: Server started, listening on 8888

    2. Now run the main() method in BisqGrpcClient. Once it has started up
   you are connected to the gRPC server started in step 1 above. To
   exercise the API, type `getVersion` via stdin and hit return. You
   should see the following response:

       INFO bisq.grpc.BisqGrpcClient - 1.2.4

    Likewise, you can type `getBalance` and you'll see the following
   response:

       INFO bisq.grpc.BisqGrpcClient - 0.00 BTC

    and so forth for each of the implemented endpoints. For a list of
   implemented endpoints, see BisqGrpcServer.start().

   Note once again that the code here is merely a proof of concept and should
   not be considered complete or production-ready in any way. In a subsequent
   commit, the `--desktopWithGrpcApi` option will be disabled in order to
   avoid any potential production use.

   The content of this commit is the result of squashing a number of commits
   originally authored by chimp1984 in the `chimp1984` fork's `grpc` branch.

   Co-authored-by: Chris Beams <chris@beams.io>
</code></pre>
<p>Please disregard the several additional unrelated related commits in this PR. They are part of PRs <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="548255770" data-permission-text="Issue title is private" data-url="https://github.com/bisq-network/bisq/issues/3886" data-hovercard-type="pull_request" data-hovercard-url="/bisq-network/bisq/pull/3886/hovercard" href="https://github.com/bisq-network/bisq/pull/3886">#3886</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="548263192" data-permission-text="Issue title is private" data-url="https://github.com/bisq-network/bisq/issues/3887" data-hovercard-type="pull_request" data-hovercard-url="/bisq-network/bisq/pull/3887/hovercard" href="https://github.com/bisq-network/bisq/pull/3887">#3887</a> and will disappear here when those PRs are merged.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/bisq-network/bisq/pull/3888'>https://github.com/bisq-network/bisq/pull/3888</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Introduce gRPC API proof of concept</li>
  <li>Ignore Structure101 Workspace files</li>
  <li>Revert "Apply kotlin plugin and convert one unused class to kotlin"</li>
  <li>Do not strip trailing whitespace in Git diffs</li>
  <li>Remove --desktopWith{Grpc|Http}Api options for now</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3888/files#diff-0">.editorconfig</a>
    (3)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3888/files#diff-1">.gitignore</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3888/files#diff-2">build.gradle</a>
    (74)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3888/files#diff-3">core/src/main/java/bisq/core/CoreApi.java</a>
    (163)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3888/files#diff-4">core/src/main/java/bisq/core/app/AppOptionKeys.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3888/files#diff-5">core/src/main/java/bisq/core/app/BisqEnvironment.java</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3888/files#diff-6">core/src/main/java/bisq/core/app/BisqExecutable.java</a>
    (10)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3888/files#diff-7">desktop/src/main/java/bisq/desktop/app/BisqAppMain.java</a>
    (22)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3888/files#diff-8">gradle/witness/gradle-witness.gradle</a>
    (53)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3888/files#diff-9">grpc/src/main/java/bisq/grpc/BisqGrpcApp.java</a>
    (26)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3888/files#diff-10">grpc/src/main/java/bisq/grpc/BisqGrpcClient.java</a>
    (297)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3888/files#diff-11">grpc/src/main/java/bisq/grpc/BisqGrpcServer.java</a>
    (236)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3888/files#diff-12">grpc/src/main/java/bisq/grpc/BisqGrpcServerMain.java</a>
    (127)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3888/files#diff-13">grpc/src/main/java/resources/logback.xml</a>
    (16)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3888/files#diff-14">grpc/src/main/proto/grpc.proto</a>
    (148)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3888/files#diff-15">p2p/src/test/java/bisq/network/p2p/storage/mocks/MockData.java</a>
    (88)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3888/files#diff-16">p2p/src/test/java/bisq/network/p2p/storage/mocks/MockData.kt</a>
    (39)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/3888/files#diff-17">settings.gradle</a>
    (1)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/bisq-network/bisq/pull/3888.patch'>https://github.com/bisq-network/bisq/pull/3888.patch</a></li>
  <li><a href='https://github.com/bisq-network/bisq/pull/3888.diff'>https://github.com/bisq-network/bisq/pull/3888.diff</a></li>
</ul>

<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/3888?email_source=notifications&email_token=AJFFTNXRMBJVPLAL7IBKNR3Q5DJK7A5CNFSM4KFMYAI2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IFN5XAA">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNX4JKOQDK5Q3GFYHO3Q5DJK7ANCNFSM4KFMYAIQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNTLILTA2S3B3HQ6L6DQ5DJK7A5CNFSM4KFMYAI2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IFN5XAA.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/3888?email_source=notifications\u0026email_token=AJFFTNXRMBJVPLAL7IBKNR3Q5DJK7A5CNFSM4KFMYAI2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IFN5XAA",
"url": "https://github.com/bisq-network/bisq/pull/3888?email_source=notifications\u0026email_token=AJFFTNXRMBJVPLAL7IBKNR3Q5DJK7A5CNFSM4KFMYAI2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IFN5XAA",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>