Comments (3)
Yes, the example here is for the equivalent to bitcoin-cli help
. Adding help to the script (similar to bitcoin-cli -help
) is even easier but not so useful.
from walletwasabi.
--- a/WalletWasabi/Rpc/JsonRpcRequestHandler.cs
+++ b/WalletWasabi/Rpc/JsonRpcRequestHandler.cs
@@ -81,6 +81,11 @@ public class JsonRpcRequestHandler<TService>
{
var methodName = jsonRpcRequest.Method;
+ if (methodName == "help")
+ {
+ return ServiceMetadata(jsonRpcRequest.Id).ToJson(DefaultSettings);
+ }
+
if (!MetadataProvider.TryGetMetadata(methodName, out var procedureMetadata))
{
return Error(JsonRpcErrorCodes.MethodNotFound, $"'{methodName}' method not found.", jsonRpcRequest.Id);
@@ -182,6 +187,24 @@ public class JsonRpcRequestHandler<TService>
}
}
+ private JsonRpcResponse ServiceMetadata(string requestId) =>
+ JsonRpcResponse.CreateResultResponse(
+ requestId,
+ MetadataProvider.EnumerateServiceInfo()
+ .Select(
+ x => new
+ {
+ name = x.Name,
+ parameters = x.Parameters.Select(
+ p => new
+ {
+ name = p.name,
+ type = p.type.Name.ToLower(),
+ optional = p.isOptional,
+ defaultValue = p.defaultValue
+ })
+ }));
+
private string Error(JsonRpcErrorCodes code, string reason, string id)
{
var response = JsonRpcResponse.CreateErrorResponse(id, code, reason);
from walletwasabi.
RPC backend could have endpoint that responds with available RPC methods and their usage, but, independently, wcli.sh
should have brief usage info about script itself. That is how, for example, bitcoin-cli
works (bitcoin-cli help
vs bitcoin-cli -help
).
from walletwasabi.
Related Issues (20)
- [VDG] All txs icons showing as pending without backend connection
- wasabi install HOT 1
- Do not ignore dotnet security warning
- Remove CF
- crash logs, windows 11 HOT 1
- Improve log messages
- CPU pressure makes lots of inputs to be banned
- Do not fallback to P2P when intends is to use a Specific Node HOT 3
- Do not fallback to P2P when intent is to use a Specific Node HOT 2
- Allow Wasabi to connect to specific nodes
- Wasabi Keeps Crashing HOT 3
- wasabi skipping a round for better privacy HOT 5
- Clear local prison when coordinator is changed HOT 1
- Turn "Run in background when window closed" off by default
- Verify Weight units and Virtual size units HOT 1
- Remove trust on coordinator fee rates for coinjoining
- Crashed when about to broadcast a SEND transaction. HOT 1
- wassabee --version always crashes and launches crash report
- crash issue HOT 2
- Wasabi crashing on creation of wallet HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from walletwasabi.