[bisq-network/bisq] [DRAFT] Create new ping API method (#4502)

Stan notifications at github.com
Wed Sep 9 15:48:46 UTC 2020


@chimp1984,  
@cbeams sent his thoughts about this problem some months ago in a keybase video before he handed this API project to me.  I thought about it, put other work in front, and now trying to solve it before I finish out the "simplest trading script" impl.  Chris wanted me to find a way to tell a user if a daemon was ready to perform all functions or no functions, and not show a CLI user anything more detailed than "server up" or "server not ready".  And it needs to be used by some server methods (like create offer, take offer,...) so they know the request can be made or not.  

>> So you see this complexity cannot be simulated with a single method. I would not suggest to use ping for more then simple connectivity tests.

The problem is the requirement to do precisely that -- to communicate the "ready=true/false" state with a single method.  A simple gRPC connectivity check isn't useful for a user or some API methods that should throw an exception when "server not ready".

I thought a non-null balance was enough to determine if the server was ready or not, because a non-null balance means that allBasicServicesInitialized=true (see BisqSetup#initDomainServices)

As you said, it's not that simple; a non-null wallet balance is not enough to indicate the daemon is ready for trading.

What do you think of this solution for this non-trivial type of "ping"?

	if(!bsqNode.isP2pNetworkReady())
		throw new IllegalStateException("p2p network not ready");

	if(!p2PService.isBootstrapped())
		throw new IllegalStateException("p2p service not bootstrapped");

	if(!daoStateService.isParseBlockChainComplete())
		throw new IllegalStateException("dao block chain not complete");

	check for sufficient # of connect peers... a minimum of 4?

	then the wallet balance check...
	
If these checks pass, ping returns a pong, else thows an exception.

-- 
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#issuecomment-689650356
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200909/3e4fa1d8/attachment.html>


More information about the bisq-github mailing list