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
doc: Add RPC interface guidelines #10281
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
|
||
- *Exception*: Some RPC calls can take both an `int` and `bool`, most notably when a bool was switched | ||
to a multi-value, or due to other historical reasons. **Always** have false map to 0 and | ||
true to 1 in this case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the case right now. At the moment, 0 maps to false and !0 maps to true. See e.g. getrawtransaction
's verbose
argument handling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EH, I have that the wrong way around, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or not. What I meant here is:
false=0
true=1
E.g, the C++ mapping, not the bash mapping. As far as I know, we follow that everywhere?
If this wording is confusing, can you suggest another way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I read it as "interpret 0 as false and 1 as true, and anything else is [??]".
I.e. if a user passes 2 or -1 to the new RPC command which maps as you said, how will it treat values beyond [0, 1]?
Am I misunderstanding?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't say anything about values besides 0 and 1 on purpose. Those may either map to 1, or to something else entirely (referring to "when bool has switched to multi-value"), or cause a failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh I was reading this backwards. You're talking about when a bool becomes an int, and I about when an int is interpreted as a bool. I'll think on wording to make this obvious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-reading this, I think I was simply not reading it properly. I think it looks fine as is.
doc/developer-notes.md
Outdated
|
||
- Set okSafeMode in the RPC command table to a sensible value: safe mode is when the | ||
block chain is regarded to be in a confused state, and the client deems it unsafe to | ||
do anything irreversible such as send. Anything that just queries should be permitted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! I vaguely presumed this was the case but never found anything explicitly stating it.
Great addition. |
doc/developer-notes.md
Outdated
- *Rationale*: If not, the call can not be used with name-based arguments. | ||
|
||
- Set okSafeMode in the RPC command table to a sensible value: safe mode is when the | ||
block chain is regarded to be in a confused state, and the client deems it unsafe to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: s/block chain/blockchain
32fd23f
to
359f71d
Compare
Looks good. ACK 359f71d0fb243fa49884132c0fb0c24118d77842 |
ACK |
359f71d
to
c26655e
Compare
c26655e doc: Add RPC interface guidelines (Wladimir J. van der Laan) Tree-SHA512: e4cf1625d136fef9fe24361b6507c7e7ec2e676fb9727bbdcd4320aace6d0b49ce707592cb93a67b427168a1f373542e94bcea418b4e1c0cb1e9430af7412c8f
c26655e doc: Add RPC interface guidelines (Wladimir J. van der Laan) Tree-SHA512: e4cf1625d136fef9fe24361b6507c7e7ec2e676fb9727bbdcd4320aace6d0b49ce707592cb93a67b427168a1f373542e94bcea418b4e1c0cb1e9430af7412c8f
c26655e doc: Add RPC interface guidelines (Wladimir J. van der Laan) Tree-SHA512: e4cf1625d136fef9fe24361b6507c7e7ec2e676fb9727bbdcd4320aace6d0b49ce707592cb93a67b427168a1f373542e94bcea418b4e1c0cb1e9430af7412c8f
c26655e doc: Add RPC interface guidelines (Wladimir J. van der Laan) Tree-SHA512: e4cf1625d136fef9fe24361b6507c7e7ec2e676fb9727bbdcd4320aace6d0b49ce707592cb93a67b427168a1f373542e94bcea418b4e1c0cb1e9430af7412c8f
c26655e doc: Add RPC interface guidelines (Wladimir J. van der Laan) Tree-SHA512: e4cf1625d136fef9fe24361b6507c7e7ec2e676fb9727bbdcd4320aace6d0b49ce707592cb93a67b427168a1f373542e94bcea418b4e1c0cb1e9430af7412c8f
c26655e doc: Add RPC interface guidelines (Wladimir J. van der Laan) Tree-SHA512: e4cf1625d136fef9fe24361b6507c7e7ec2e676fb9727bbdcd4320aace6d0b49ce707592cb93a67b427168a1f373542e94bcea418b4e1c0cb1e9430af7412c8f
c26655e doc: Add RPC interface guidelines (Wladimir J. van der Laan) Tree-SHA512: e4cf1625d136fef9fe24361b6507c7e7ec2e676fb9727bbdcd4320aace6d0b49ce707592cb93a67b427168a1f373542e94bcea418b4e1c0cb1e9430af7412c8f
c26655e doc: Add RPC interface guidelines (Wladimir J. van der Laan) Tree-SHA512: e4cf1625d136fef9fe24361b6507c7e7ec2e676fb9727bbdcd4320aace6d0b49ce707592cb93a67b427168a1f373542e94bcea418b4e1c0cb1e9430af7412c8f
c26655e doc: Add RPC interface guidelines (Wladimir J. van der Laan) Tree-SHA512: e4cf1625d136fef9fe24361b6507c7e7ec2e676fb9727bbdcd4320aace6d0b49ce707592cb93a67b427168a1f373542e94bcea418b4e1c0cb1e9430af7412c8f
c26655e doc: Add RPC interface guidelines (Wladimir J. van der Laan) Tree-SHA512: e4cf1625d136fef9fe24361b6507c7e7ec2e676fb9727bbdcd4320aace6d0b49ce707592cb93a67b427168a1f373542e94bcea418b4e1c0cb1e9430af7412c8f
c26655e doc: Add RPC interface guidelines (Wladimir J. van der Laan) Tree-SHA512: e4cf1625d136fef9fe24361b6507c7e7ec2e676fb9727bbdcd4320aace6d0b49ce707592cb93a67b427168a1f373542e94bcea418b4e1c0cb1e9430af7412c8f
c26655e doc: Add RPC interface guidelines (Wladimir J. van der Laan) Tree-SHA512: e4cf1625d136fef9fe24361b6507c7e7ec2e676fb9727bbdcd4320aace6d0b49ce707592cb93a67b427168a1f373542e94bcea418b4e1c0cb1e9430af7412c8f
c26655e doc: Add RPC interface guidelines (Wladimir J. van der Laan) Tree-SHA512: e4cf1625d136fef9fe24361b6507c7e7ec2e676fb9727bbdcd4320aace6d0b49ce707592cb93a67b427168a1f373542e94bcea418b4e1c0cb1e9430af7412c8f
Could be useful. Anything that I forgot?