Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API call to get DAO status #7012

Merged
merged 1 commit into from Feb 25, 2024
Merged

Add API call to get DAO status #7012

merged 1 commit into from Feb 25, 2024

Conversation

ghost
Copy link

@ghost ghost commented Jan 26, 2024

Expose DaoFacade.isDaoStateReadyAndInSync status to API clients.


getdaostatus

NAME
----
getdaostatus - get DAO status

SYNOPSIS
--------
getdaostatus

DESCRIPTION
-----------
Returns the operating status of the Bisq DAO:
true - DAO is ready and in sync
false - DAO is not ready

At startup the status will return false until the DAO has completed synchronizing.
Trading operations should not be performed when the status is false.
While running, the status can be used to determine if DAO is in sync with the seed nodes.

EXAMPLES
--------
$ ./bisq-cli --password=xyz --port=9998 getdaostatus

@dutu
Copy link

dutu commented Jan 29, 2024

Just wanted to point out, there seams to be no call rate metering.

@dutu
Copy link

dutu commented Jan 31, 2024

I have applied the changes on top of v1.9.14 and currently using the new gRPC method. Everything working well!!

Copy link
Contributor

@alvasw alvasw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit

getdaostatus is missing in the /bisq-cli --helpoutput.

@dutu
Copy link

dutu commented Feb 9, 2024

Should rate metering be included as well?

final Optional<ServerInterceptor> rateMeteringInterceptor() {
return getCustomRateMeteringInterceptor(coreApi.getConfig().appDataDir, this.getClass())
.or(() -> Optional.of(CallRateMeteringInterceptor.valueOf(
new HashMap<>() {{
put(getGetNetworkMethod().getFullMethodName(), new GrpcCallRateMeter(1, SECONDS));
put(getGetBalancesMethod().getFullMethodName(), new GrpcCallRateMeter(1, SECONDS));
put(getGetAddressBalanceMethod().getFullMethodName(), new GrpcCallRateMeter(1, SECONDS));
put(getGetFundingAddressesMethod().getFullMethodName(), new GrpcCallRateMeter(1, SECONDS));
put(getGetUnusedBsqAddressMethod().getFullMethodName(), new GrpcCallRateMeter(1, SECONDS));
put(getSendBsqMethod().getFullMethodName(), new GrpcCallRateMeter(1, MINUTES));
put(getSendBtcMethod().getFullMethodName(), new GrpcCallRateMeter(1, MINUTES));
put(getGetTxFeeRateMethod().getFullMethodName(), new GrpcCallRateMeter(1, SECONDS));
put(getSetTxFeeRatePreferenceMethod().getFullMethodName(), new GrpcCallRateMeter(1, SECONDS));
put(getUnsetTxFeeRatePreferenceMethod().getFullMethodName(), new GrpcCallRateMeter(1, SECONDS));
put(getGetTransactionMethod().getFullMethodName(), new GrpcCallRateMeter(1, SECONDS));
// Trying to set or remove a wallet password several times before the 1st attempt has time to
// persist the change to disk may corrupt the wallet, so allow only 1 attempt per 5 seconds.
put(getSetWalletPasswordMethod().getFullMethodName(), new GrpcCallRateMeter(1, SECONDS, 5));
put(getRemoveWalletPasswordMethod().getFullMethodName(), new GrpcCallRateMeter(1, SECONDS, 5));
put(getLockWalletMethod().getFullMethodName(), new GrpcCallRateMeter(1, SECONDS));
put(getUnlockWalletMethod().getFullMethodName(), new GrpcCallRateMeter(1, SECONDS));
}}
)));
}

@ghost
Copy link
Author

ghost commented Feb 9, 2024

--help text change and rate metering added.

Copy link
Contributor

@alvasw alvasw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

Tested:

  • bisq-cli --help
  • bisq-cli getdaostatus --help
  • bisq-cli getdaostatus
  • Rate Limiting

Copy link
Contributor

@alejandrogarcia83 alejandrogarcia83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@alejandrogarcia83 alejandrogarcia83 merged commit c86d965 into bisq-network:master Feb 25, 2024
3 checks passed
@ghost ghost mentioned this pull request Feb 29, 2024
@alejandrogarcia83 alejandrogarcia83 modified the milestones: v1.9.15, v1.9.16 Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants