LIGHTNING-HOOK-RPC_COMMAND(7)
π rpc_command β the hook for intercepting and modifying RPC commands
okay so bestie, welcome to LIGHTNING-HOOK-RPC_COMMAND(7) β the manual page about the hook that lets you slide into any RPC command's DMs and take over. no cap, this is main character energy for plugins. π
β¨ DESCRIPTION β¨
the rpc_command hook lets a plugin take over any RPC command. literally any of them. it's giving absolute power. π
you can optionally specify a filters array, containing the command names you actually want to intercept. without it? every single command gets sent to this hook. every. one. (added in v25.12 β so if you're on an older version, that's a π moment)
the plugin receives the full JSON-RPC request and may choose to:
- continue (just vibe and let it through)
- replace the request (swap it out for your own)
- return a custom result or error (do it yourself, diva behavior)
β οΈ heads up bestie: this is a chained hook. only the first plugin that modifies the request or response will take effect. other plugins get ignored and a warning gets logged. so likeβ¦ first come first served, and the rest of the group chat just gets left on read. π
πΈ HOOK PAYLOAD πΈ
what lightningd hands you:
rpc_command(object) β The original JSON-RPC request object.id(one of) β The JSON-RPC request id.- (string)
- (number)
- (null)
method(string) β The RPC method name.params(one of) β The parameters passed to the RPC method.- (object)
- (array)
- (any type)
π¦ HOOK RETURN π¦
what you're allowed to send back:
result(string, optional) (always"continue") β Indicates that lightningd should continue processing the RPC command normally.replace(object, optional) β Replaces the original JSON-RPC request with a new one.jsonrpc(string) (always"2.0") β The JSON-RPC version.id(one of) β The JSON-RPC request id.- (string)
- (number)
- (null)
method(string) β The RPC method name.params(one of) β The parameters passed to the RPC method.- (object)
- (array)
- (any type)
return(object, optional) β Returns a custom JSON-RPC response to the caller.result(object, optional) β Custom result object to return to the caller.error(object, optional) β Custom error object to return to the caller.code(integer) β JSON-RPC error code.message(string) β Human-readable error message.
and that's the whole vibe check, bestie β you're officially certified to intercept RPC commands like the icon you are. π β¨
mwah π this page is from Core Lightning v26.06.9 β LIGHTNING-HOOK-RPC_COMMAND(7), slay, periodt. π«Ά
π¦ where this page comes from
- nixpkgs unstable: clightning 26.06.9
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms