mirror of
https://github.com/ElementsProject/lightning.git
synced 2026-08-13 12:32:55 +02:00
Some checks are pending
Continuous Integration / Pre-build checks (push) Waiting to run
Continuous Integration / Build compile-clang-sanitizers (push) Blocked by required conditions
Continuous Integration / Build compile-clang (push) Blocked by required conditions
Continuous Integration / Build compile-gcc (push) Blocked by required conditions
Continuous Integration / Build compile-gcc-O1 (push) Blocked by required conditions
Continuous Integration / Build compile-gcc-O3 (push) Blocked by required conditions
Continuous Integration / check-compiled-source (compile-gcc) (push) Blocked by required conditions
Continuous Integration / Run unit tests (push) Blocked by required conditions
Continuous Integration / Run unit tests-1 (push) Blocked by required conditions
Continuous Integration / Build 32-bit (size_t != 64-bit warnings) (push) Blocked by required conditions
Continuous Integration / Run fuzz regression tests (push) Blocked by required conditions
Continuous Integration / Check we can downgrade the node (push) Blocked by required conditions
Continuous Integration / Check we can downgrade the node-1 (push) Blocked by required conditions
Continuous Integration / Check we can downgrade the node-2 (push) Blocked by required conditions
Continuous Integration / First Integration Tests (1/6) (push) Blocked by required conditions
Continuous Integration / First Integration Tests (2/6) (push) Blocked by required conditions
Continuous Integration / First Integration Tests (3/6) (push) Blocked by required conditions
Continuous Integration / First Integration Tests (4/6) (push) Blocked by required conditions
Continuous Integration / First Integration Tests (5/6) (push) Blocked by required conditions
Continuous Integration / First Integration Tests (6/6) (push) Blocked by required conditions
Continuous Integration / Test CLN dual-fund Full Integration (push) Blocked by required conditions
Continuous Integration / Test CLN liquid Full Integration (push) Blocked by required conditions
Continuous Integration / Test CLN postgres Full Integration (push) Blocked by required conditions
Continuous Integration / Valgrind Test CLN (1/12) (push) Blocked by required conditions
Continuous Integration / Valgrind Test CLN (10/12) (push) Blocked by required conditions
Continuous Integration / Valgrind Test CLN (11/12) (push) Blocked by required conditions
Continuous Integration / Valgrind Test CLN (12/12) (push) Blocked by required conditions
Continuous Integration / Valgrind Test CLN (2/12) (push) Blocked by required conditions
Continuous Integration / Valgrind Test CLN (3/12) (push) Blocked by required conditions
Continuous Integration / Valgrind Test CLN (4/12) (push) Blocked by required conditions
Continuous Integration / Valgrind Test CLN (5/12) (push) Blocked by required conditions
Continuous Integration / Valgrind Test CLN (6/12) (push) Blocked by required conditions
Continuous Integration / Valgrind Test CLN (7/12) (push) Blocked by required conditions
Continuous Integration / Valgrind Test CLN (8/12) (push) Blocked by required conditions
Continuous Integration / Valgrind Test CLN (9/12) (push) Blocked by required conditions
Continuous Integration / ASan/UBSan (1/6) (push) Blocked by required conditions
Continuous Integration / ASan/UBSan (2/6) (push) Blocked by required conditions
Continuous Integration / ASan/UBSan (3/6) (push) Blocked by required conditions
Continuous Integration / ASan/UBSan (4/6) (push) Blocked by required conditions
Continuous Integration / ASan/UBSan (5/6) (push) Blocked by required conditions
Continuous Integration / ASan/UBSan (6/6) (push) Blocked by required conditions
Continuous Integration / Update examples in doc schemas (push) Blocked by required conditions
Continuous Integration / Test minimum supported BTC v25.0 with clang (push) Blocked by required conditions
Continuous Integration / CI completion (push) Blocked by required conditions
Release Rust 🦀 / release_rust (push) Waiting to run
ReadMe Sync / rdme-docs-sync (push) Waiting to run
ReadMe RPC Sync / rdme-rpc-sync (push) Waiting to run
The plugin start command only accepted plugin options flattened onto the RPC call (e.g. via -k/--keyword), but the plugin RPC schema documents an explicit 'options' array. This mismatch meant that callers using named parameters against generated RPC bindings (cln-rpc, grpc, protobuf), which cannot flatten arbitrary options, failed with 'unknown parameter options'. Options without a value are treated as boolean flags, matching the flattened form. Changelog-Fixed: JSON-RPC: `plugin start` now accepts plugin options as an `options` array of `keyword=value` strings, as documented in the `plugin` schema.
56 lines
1.4 KiB
Python
Executable file
56 lines
1.4 KiB
Python
Executable file
#!/usr/bin/env python3
|
|
from pyln.client import Plugin, RpcException
|
|
from typing import Any, Optional
|
|
|
|
plugin = Plugin()
|
|
|
|
|
|
@plugin.method("dynamic-option-report")
|
|
def record_lookup(plugin):
|
|
return {
|
|
"test-dynamic-config": plugin.get_option("test-dynamic-config"),
|
|
"test-dynamic-int": plugin.get_option("test-dynamic-int"),
|
|
"test-dynamic-bool": plugin.get_option("test-dynamic-bool"),
|
|
"test-dynamic-flag": plugin.get_option("test-dynamic-flag"),
|
|
}
|
|
|
|
|
|
def on_config_change(plugin, config: str, value: Optional[Any]) -> None:
|
|
"""Callback method called when a config value is changed."""
|
|
plugin.log(f"Setting config {config} to {value}")
|
|
if value == "bad value":
|
|
raise RpcException("I don't like bad values!")
|
|
|
|
|
|
plugin.add_option(
|
|
name="test-dynamic-config",
|
|
description="A config option which can be changed at run-time",
|
|
default="initial",
|
|
dynamic=True,
|
|
on_change=on_config_change,
|
|
)
|
|
|
|
plugin.add_option(
|
|
name="test-dynamic-int",
|
|
description="An int option which can be changed at run-time",
|
|
default=0,
|
|
opt_type="int",
|
|
dynamic=True,
|
|
)
|
|
|
|
plugin.add_option(
|
|
name="test-dynamic-bool",
|
|
description="A bool option which can be changed at run-time",
|
|
default=False,
|
|
opt_type="bool",
|
|
dynamic=True,
|
|
)
|
|
|
|
plugin.add_flag_option(
|
|
name="test-dynamic-flag",
|
|
description="A flag option which can be changed at run-time",
|
|
dynamic=True,
|
|
)
|
|
|
|
|
|
plugin.run()
|