<p>A daemon will return an <code>int32 = 1</code> (the pong) to the CLI if successful, then an <code>api service is available</code> message will be displayed in the  CLI's console.  If a valid pong is not returned, an <code>api service is not available</code> message is displayed in the console.</p>
<p>TODO:  Experiments will be made to see if this implementation can be used to check server availabilty for other requests.  This server <code>ping</code> implementation checks for a non-null wallet balance before returning a pong.  If this ping impl's wallet check throws an exception to the calling API method, the calling method should throw a gRPC exception to the CLI instead of completing the operation, and the user should see an "api service is not available" message.  <em>No other API methods call <code>ping</code> with this change;  experiments will be done later, giving other devs time to consider the idea first.</em></p>
<p>The premise is that if the wallet balance is available, so is the server, else the server is not avaiable.  This may be a simple solution to the 'p2p not ready' problem affecting daemons.</p>
<p>A ping test was added to apitest/scripts/mainnet-test.sh.</p>
<p><em>This cannot be merged, but the code is safely backed up and the concept could be reviewed by other devs.</em></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/4502'>https://github.com/bisq-network/bisq/pull/4502</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Register dispute agents in apitest arbitrator daemon</li>
  <li>Add empty comments to keep codacy happy</li>
  <li>Fix codacy issue caused by unused class level var</li>
  <li>Add DisputeAgents service proto def</li>
  <li>Add GrpcDisputeAgentsService boilerplate</li>
  <li>Add GrpcDisputeAgentsService to server</li>
  <li>Create disputeAgentsService instance in GrpcStubs</li>
  <li>Implement the new registerdisputeagent api method</li>
  <li>Add registerdisputeagent method to cli</li>
  <li>Refactor apitest to support gRPC calls to any daemon</li>
  <li>Delete renamed class</li>
  <li>Add RegisterDisputeAgentsTest</li>
  <li>Fix import statements</li>
  <li>Resolve merge conflict</li>
  <li>Revert "Resolve merge conflict"</li>
  <li>Downgrade jfoenix dependency</li>
  <li>Create new ping API method</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4502/files#diff-2e75814f8e05472c745f29bef59dd621">apitest/scripts/mainnet-test.sh</a>
    (7)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4502/files#diff-37f4744bd942b58d3fb57a379e71ef67">apitest/src/main/java/bisq/apitest/Scaffold.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4502/files#diff-258dfd0a8fbc6ff5fc1c68369d4b76a0">apitest/src/main/java/bisq/apitest/config/ApiTestConfig.java</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4502/files#diff-fc6ba16b892341b73714491f514ff95c">apitest/src/main/java/bisq/apitest/linux/BisqApp.java</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4502/files#diff-2b486b2248b88650958a2fabbcc673ba">apitest/src/test/java/bisq/apitest/ApiTestCase.java</a>
    (27)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4502/files#diff-8161e17c1c3efbd630fe4ea7de25ebce">apitest/src/test/java/bisq/apitest/method/GetBalanceTest.java</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4502/files#diff-4fcb8c85d38b1f26750d67d2de6e2672">apitest/src/test/java/bisq/apitest/method/GetVersionTest.java</a>
    (3)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4502/files#diff-6d158dc3de2c806c8ad7b561c9eba091">apitest/src/test/java/bisq/apitest/method/MethodTest.java</a>
    (37)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4502/files#diff-f4c0c7647f8f55f67730694f7918bc77">apitest/src/test/java/bisq/apitest/method/RegisterDisputeAgentsTest.java</a>
    (108)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4502/files#diff-1f2ea91158e3388c118064844fcf7ad7">apitest/src/test/java/bisq/apitest/method/WalletProtectionTest.java</a>
    (51)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4502/files#diff-9b1a7aa266738afe56ea454256118898">apitest/src/test/java/bisq/apitest/scenario/FundWalletScenarioTest.java</a>
    (11)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4502/files#diff-c197962302397baf3a4cc36463dce5ea">build.gradle</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4502/files#diff-c373779aeb2c0f02199d152b537b0fd1">cli/src/main/java/bisq/cli/CliMain.java</a>
    (64)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4502/files#diff-fc12d88e0e22b3ab3dd9dbf67fe565a7">cli/src/main/java/bisq/cli/GrpcStubs.java</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4502/files#diff-defe707a4d38994a1dd5a818fc078522">core/src/main/java/bisq/core/api/CoreApi.java</a>
    (31)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4502/files#diff-f905350d6a4eef257cb8420e5b52fcfb">core/src/main/java/bisq/core/api/CoreDisputeAgentsService.java</a>
    (145)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4502/files#diff-d082720b58023e4c4e491d1d88465f2e">core/src/main/java/bisq/core/support/dispute/agent/DisputeAgentManager.java</a>
    (2)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4502/files#diff-ce615183bf8dc2cc13860e6acd86ca85">daemon/src/main/java/bisq/daemon/grpc/GrpcDisputeAgentsService.java</a>
    (45)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4502/files#diff-cf9363e58d0ea299011282758a4aa8e3">daemon/src/main/java/bisq/daemon/grpc/GrpcServer.java</a>
    (24)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4502/files#diff-d5a9251f678d7f964871b83c050aa9a7">gradle/witness/gradle-witness.gradle</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4502/files#diff-328b3309bc03d9ffb3ffb9e780dc7e91">proto/src/main/proto/grpc.proto</a>
    (45)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/bisq-network/bisq/pull/4502.patch'>https://github.com/bisq-network/bisq/pull/4502.patch</a></li>
  <li><a href='https://github.com/bisq-network/bisq/pull/4502.diff'>https://github.com/bisq-network/bisq/pull/4502.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/4502">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNXZ5IGQOHJ5LFFNCO3SEZI5RANCNFSM4RAFSZIQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNUBOJJOTXT6TBCZK6DSEZI5RA5CNFSM4RAFSZI2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4KL4DALA.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/4502",
"url": "https://github.com/bisq-network/bisq/pull/4502",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>