Skip to content

Making bitcoin backend commands chainable hooks #4932

Open
@andrewtoth

Description

@andrewtoth

It would be useful for plugins to be able to chain bitcoin backend commands.

For many plugin use cases, bcli is sufficient for 4 of the 5 commands. For instance, continue using bitcoin-cli but use a different sendrawtransaction implementation to send over tor. Or use bitcoin-cli, but substitute estimatefees to use mempool.space fee estimation.

However, it's not possible to substitute a single command, and instead bcli must be disabled completely. This forces the plugin author to rewrite the entire bcli functionality when all they care about is one command. With chaining, a plugin can be added to override just a single command. There could also be multiple plugins overriding the same command, and deferring to other plugins as fallbacks.

In #3354 there's a lot of discussion about implementing the commands as hooks. Moving the commands to hooks at this point will break many plugins. Could we make the rpc commands chainable, or check for both hooks and command registrations?

See also #3709.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions