[bisq-network/bisq] [WIP] Create new ping API method (#4502)
Stan
notifications at github.com
Tue Sep 8 16:05:44 UTC 2020
A daemon will return an `int32 = 1` (the pong) to the CLI if successful, then an `api service is available` message will be displayed in the CLI's console. If a valid pong is not returned, an `api service is not available` message is displayed in the console.
TODO: Experiments will be made to see if this implementation can be used to check server availabilty for other requests. This server `ping` 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. _No other API methods call `ping` with this change; experiments will be done later, giving other devs time to consider the idea first._
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.
A ping test was added to apitest/scripts/mainnet-test.sh.
_This cannot be merged, but the code is safely backed up and the concept could be reviewed by other devs._
You can view, comment on, or merge this pull request online at:
https://github.com/bisq-network/bisq/pull/4502
-- Commit Summary --
* Register dispute agents in apitest arbitrator daemon
* Add empty comments to keep codacy happy
* Fix codacy issue caused by unused class level var
* Add DisputeAgents service proto def
* Add GrpcDisputeAgentsService boilerplate
* Add GrpcDisputeAgentsService to server
* Create disputeAgentsService instance in GrpcStubs
* Implement the new registerdisputeagent api method
* Add registerdisputeagent method to cli
* Refactor apitest to support gRPC calls to any daemon
* Delete renamed class
* Add RegisterDisputeAgentsTest
* Fix import statements
* Resolve merge conflict
* Revert "Resolve merge conflict"
* Downgrade jfoenix dependency
* Create new ping API method
-- File Changes --
M apitest/scripts/mainnet-test.sh (7)
M apitest/src/main/java/bisq/apitest/Scaffold.java (2)
M apitest/src/main/java/bisq/apitest/config/ApiTestConfig.java (4)
M apitest/src/main/java/bisq/apitest/linux/BisqApp.java (4)
M apitest/src/test/java/bisq/apitest/ApiTestCase.java (27)
M apitest/src/test/java/bisq/apitest/method/GetBalanceTest.java (4)
M apitest/src/test/java/bisq/apitest/method/GetVersionTest.java (3)
M apitest/src/test/java/bisq/apitest/method/MethodTest.java (37)
A apitest/src/test/java/bisq/apitest/method/RegisterDisputeAgentsTest.java (108)
M apitest/src/test/java/bisq/apitest/method/WalletProtectionTest.java (51)
M apitest/src/test/java/bisq/apitest/scenario/FundWalletScenarioTest.java (11)
M build.gradle (4)
M cli/src/main/java/bisq/cli/CliMain.java (64)
M cli/src/main/java/bisq/cli/GrpcStubs.java (6)
M core/src/main/java/bisq/core/api/CoreApi.java (31)
A core/src/main/java/bisq/core/api/CoreDisputeAgentsService.java (145)
M core/src/main/java/bisq/core/support/dispute/agent/DisputeAgentManager.java (2)
A daemon/src/main/java/bisq/daemon/grpc/GrpcDisputeAgentsService.java (45)
M daemon/src/main/java/bisq/daemon/grpc/GrpcServer.java (24)
M gradle/witness/gradle-witness.gradle (2)
M proto/src/main/proto/grpc.proto (45)
-- Patch Links --
https://github.com/bisq-network/bisq/pull/4502.patch
https://github.com/bisq-network/bisq/pull/4502.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4502
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200908/a4dfa31c/attachment-0001.html>
More information about the bisq-github
mailing list