-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
The getblock
RPC signature is different from bitcoin core.
#1334
Comments
hi there? |
I can help create a PR if we want to make the signature consistent. Currently |
The code serving RPC requests is not that complicated, especially the parsers. It shouldn't be that difficult to make getblock 000xxxxxxxxxxxxxxxxxxxx true same as getblock 0xxxxxxxxxxxxxxxx 1. In bitcoin core configs, 0 is false and I think, anything else is true, or maybe 1 is true and anything else is false. It surely would not be complicated to parse both syntaxes, which yes would make it a little smoother integrating to other apps. |
@l0k1verloren Thanks for your reply! I know it's not complicated so I want to get a confirmation on whether the project owners want this change. bitcoind is using So bitcoind's verbosity and btcd's flags are in these relationships:
I like bitcoind's approach better, since it's merging multiple flags as verbosity levels and more extensible. Golang is by design strong typed. I'm not sure it's advisable to support both |
There is no type rules telling you whether you parse a string to be a number or text. Implementing both syntaxes in one is not that hard when there is a fixed set of possible options appearing. We have therefore 0-2 possible options. Nothing means defaults. A single parameter is either a number or assigns one of those values. Two parameters you know they both must be named values. I urge you to try implementing both, it would be one less thing to complicate swapping out bitcoind for btcd for applications. |
@l0k1verloren Besides, I'm more thinking from a compatibility perspective. I don't want to surprise the user when he noticed that both |
Perhaps the syntax should also be altered by the rpcquirks flag. In fact now I think about it, why isn't it already? Being able to turn-key slot btcd in place of bitcoin core is very nice, and yes, I agree, what was the point of creating a new syntax at all? |
A pull request has been opened long time back, #1112 |
@xlk3099 Thanks. I'm not alone. |
Closing since handled as stated above. |
In bitcoin core, it accepts a number for verbosity
But we are using two booleans. Is it possible to use the same signature as bitcoin core?
The text was updated successfully, but these errors were encountered: