In commit “Split node / wallet RPC calls based on the endpoint”
I don’t see what this has to do with multiwallet support and I think this commit and previous commit should go into a separate PR if we want to introduce a more heavily embroidered URL scheme beyond /v1/wallet/filename
.
Also if there’s going to be a JSON-RPC URL scheme, it needs to be documented and explained somewhere (maybe a new doc/JSONRPC-interface.md
file), and should probably get a some more discussion. Personally I don’t see why people seem to be in love with convoluted URL schemes. We are not implementing a REST API which is centered around URLs. We are implementing a RPC API where you call a method, pass JSON arguments, and get a JSON return value. I don’t think it’s good to be adding restrictions and side-channels around the JSON requests without explicit reason.
Supporting a ?wallet=filename
query option or /wallet/filename
path selector makes a certain amount of sense if we think JSON-RPC named arguments are too awkward, or because we want to implement a multiprocess framework like the one John described where the RPC handler has “superuser access” to all wallets and forwards calls to them (https://github.com/bitcoin/bitcoin/pull/10650#issuecomment-311669411).
Supporting /v1
, /v2
path selectors maybe also makes sense if we want to be able to make breaking changes to RPC methods. And maybe requiring node / wallet URL endpoints also makes sense for reasons that I don’t understand, but I definitely think those reasons deserve to be discussed, and to get some documentation, and not to be shoehorned into the last 2 commits of a tangentially related PR.