getXmrNodeSettings method
Fetches the XMR node settings from the server.
This method sends a GetXmrNodeSettingsRequest to retrieve the current local Monero node settings configured on the Haveno server.
Example:
final nodeSettings = await xmrNodeProvider.getXmrNodeSettings();
if (nodeSettings != null) {
print('Blockchain Path: ${nodeSettings.blockchainPath}');
}
Returns:
- A
Future
containing theXmrNodeSettings
. null
if an error occurs or no settings are available.
Throws:
- DaemonNotConnectedException if the client is not connected to the gRPC server.
Implementation
Future<XmrNodeSettings?> getXmrNodeSettings() async {
if (!havenoChannel.isConnected) {
throw DaemonNotConnectedException();
}
try {
final getXmrNodeSettingsReply = await havenoChannel.xmrNodeClient!
.getXmrNodeSettings(GetXmrNodeSettingsRequest());
return getXmrNodeSettingsReply.settings;
} on GrpcError catch (e) {
handleGrpcError(e);
}
return null;
}