Skip to content

Commit 546d13c

Browse files
ShahanaFarooquirustyrussell
authored andcommitted
Separate reckless utility (1) and reckless rpc (7) documentation
Changelog-None.
1 parent 99ef16f commit 546d13c

File tree

7 files changed

+160
-124
lines changed

7 files changed

+160
-124
lines changed

.github/scripts/sync-rpc-cmds.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def extract_rpc_commands(rst_content):
7070
commands = re.findall(
7171
r"\b([a-zA-Z0-9_-]+)" r"\s+<([^>]+)>\n", manpages_block.group(1)
7272
)
73-
return [(re.sub(r"\blightning-", "", rpc_name), file_name) for rpc_name, file_name in commands]
73+
return commands
7474
return []
7575

7676

contrib/msggen/msggen/schema.json

+2-40
Original file line numberDiff line numberDiff line change
@@ -29655,51 +29655,13 @@
2965529655
}
2965629656
}
2965729657
},
29658-
"notes": [
29659-
"Reckless currently supports python and javascript plugins.",
29660-
"Running the first time will prompt the user that their lightningd's bitcoin config will be appended (or created) to inherit the reckless config file (this config is specific to bitcoin by default.). Management of plugins will subsequently modify this file.",
29661-
"",
29662-
"Available option flags:",
29663-
"**-d**, **--reckless-dir** *reckless_dir*: specify an alternative data directory for reckless to use. Useful if your .lightning is protected from execution.",
29664-
"",
29665-
"**-l**, **--lightning** *lightning\\_data\\_dir*: lightning data directory (defaults to $USER/.lightning)",
29666-
"",
29667-
"**-c**, **--conf** *lightning\\_config*: pass the config used by lightningd",
29668-
"",
29669-
"**-r**, **--regtest**: use the regtest network and config instead of bitcoin mainnet",
29670-
"",
29671-
"**-v**, **--verbose**: request additional debug output",
29672-
"",
29673-
"**--network**=*network*: specify bitcoin, regtest, liquid, liquid-regtest, litecoin, signet, or testnet networks. (default: bitcoin)",
29674-
"",
29675-
"**--version**: print the version of reckless and exit",
29676-
"",
29677-
"",
29678-
"Troubleshooting tips:",
29679-
"",
29680-
"Plugins must be executable. For python plugins, the shebang is invoked, so **python3** should be available in your environment. This can be verified with **which Python3**. The default reckless directory is $USER/.lightning/reckless and it should be possible for the lightningd user to execute files located here. If this is a problem, the option flag **reckless -d=<my_alternate_dir>** may be used to relocate the reckless directory from its default. Consider creating a permanent alias in this case.",
29681-
"Python plugins are installed to their own virtual environments. The environment is activated by a wrapper (named the same as the plugin) which then imports and executes the actual plugin entrypoint.",
29682-
"",
29683-
"For Plugin Developers:",
29684-
"",
29685-
"To make your plugin compatible with reckless install:",
29686-
"- Choose a unique plugin name: The plugin entrypoint is inferred. Naming your plugin executable the same as your plugin name will allow reckless to identify it correctly (file extensions are okay.)",
29687-
"- For python plugins, a requirements.txt is the preferred medium for python dependencies. A pyproject.toml will be used as a fallback, but test installation via `pip install -e .` - Poetry looks for additional files in the working directory, whereas with pip, any references to these will require something like `packages = [{ include = \"*.py\" }]` under the `[tool.poetry]` section.",
29688-
"- Additional repository sources may be added with `reckless source add https://my.repo.url/here` however, https://github.com/lightningd/plugins is included by default. Consider adding your plugin lightningd/plugins to make installation simpler.",
29689-
"- If your plugin is located in a subdirectory of your repo with a different name than your plugin, it will likely be overlooked."
29690-
],
2969129658
"author": [
29692-
"Antoine Poinsot wrote the original reckless plugin on which this is based.",
29693-
"",
29694-
"Rusty Russell wrote the outline for the reckless utility's function",
29695-
"",
29696-
"Alex Myers <<[email protected]>> is mainly responsible for the reckless code and this man page, with thanks to Christian Decker for extensive review."
29659+
"Alex Myers <<[email protected]>> is mainly responsible."
2969729660
],
2969829661
"see_also": [
29699-
"reckless(7)"
29662+
"reckless(1)"
2970029663
],
2970129664
"resources": [
29702-
"Core-Lightning plugins repo: <https://github.com/lightningd/plugins>",
2970329665
"Main web site: <https://github.com/ElementsProject/lightning>"
2970429666
],
2970529667
"examples": [

doc/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ NON_PREFIXED_MANPAGES := doc/lightning-cli.1 \
158158
doc/lightningd.8 \
159159
doc/lightningd-config.5 \
160160
doc/lightningd-rpc.7 \
161-
doc/lightning-hsmtool.8
161+
doc/lightning-hsmtool.8 \
162+
doc/lightning-reckless.1
162163

163164
MANPAGES := $(PREFIXED_MANPAGES) $(NON_PREFIXED_MANPAGES)
164165

doc/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ Core Lightning Documentation
8888
keysend <keysend.7.md>
8989
lightning-cli <lightning-cli.1.md>
9090
lightning-hsmtool <lightning-hsmtool.8.md>
91+
lightning-reckless <lightning-reckless.1.md>
9192
lightningd <lightningd.8.md>
9293
lightningd-config <lightningd-config.5.md>
9394
lightningd-rpc <lightningd-rpc.7.md>

doc/lightning-reckless.1.md

+150
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
reckless - install and activate a CLN plugin by name
2+
====================================================
3+
4+
SYNOPSIS
5+
--------
6+
7+
**reckless** [*options*] **install/uninstall/enable/disable/source** *target*
8+
9+
DESCRIPTION
10+
-----------
11+
12+
Reckless is a plugin manager for Core-Lightning. Typical plugin
13+
installation involves: finding the source plugin, copying,
14+
installing dependencies, testing, activating, and updating the
15+
lightningd config file. Reckless does all of these by invoking:
16+
17+
**reckless** **install**[@*commit/tag*] *plugin\_name*
18+
19+
reckless will exit early in the event that:
20+
21+
- the plugin is not found in any available source repositories
22+
- dependencies are not successfully installed
23+
- the plugin fails to execute
24+
25+
Reckless-installed plugins reside in the 'reckless' subdirectory
26+
of the user's `.lightning` folder. By default, plugins are activated
27+
on the `bitcoin` network (and use lightningd's bitcoin network
28+
config), but regtest may also be used.
29+
30+
Other commands include:
31+
32+
**reckless** **uninstall** *plugin\_name*
33+
disables the plugin, removes the directory.
34+
35+
**reckless** **search** *plugin\_name*
36+
looks through all available sources for a plugin matching
37+
this name.
38+
39+
**reckless** **enable** *plugin\_name*
40+
dynamically enables the reckless-installed plugin and updates
41+
the config to match.
42+
43+
**reckless** **disable** *plugin\_name*
44+
dynamically disables the reckless-installed plugin and updates
45+
the config to match.
46+
47+
**reckless** **source** **list**
48+
list available plugin repositories.
49+
50+
**reckless** **source** **add** *repo\_url*
51+
add another plugin repo for reckless to search.
52+
53+
**reckless** **source** **rm** *repo\_url*
54+
remove a plugin repo for reckless to search.
55+
56+
OPTIONS
57+
-------
58+
59+
Available option flags:
60+
61+
**-d**, **--reckless-dir** *reckless\_dir*
62+
specify an alternative data directory for reckless to use.
63+
Useful if your .lightning is protected from execution.
64+
65+
**-l**, **--lightning** *lightning\_data\_dir*
66+
lightning data directory (defaults to $USER/.lightning)
67+
68+
**-c**, **--conf** *lightning\_config*
69+
pass the config used by lightningd
70+
71+
**-r**, **--regtest**
72+
use the regtest network and config instead of bitcoin mainnet
73+
74+
**-v**, **--verbose**
75+
request additional debug output
76+
77+
**--network**=*network*
78+
specify bitcoin, regtest, liquid, liquid-regtest, litecoin, signet,
79+
or testnet networks. (default: bitcoin)
80+
81+
NOTES
82+
-----
83+
84+
Reckless currently supports python and javascript plugins.
85+
86+
Running the first time will prompt the user that their lightningd's
87+
bitcoin config will be appended (or created) to inherit the reckless
88+
config file (this config is specific to bitcoin by default.)
89+
Management of plugins will subsequently modify this file.
90+
91+
92+
Troubleshooting tips:
93+
94+
Plugins must be executable. For python plugins, the shebang is
95+
invoked, so **python3** should be available in your environment. This
96+
can be verified with **which Python3**. The default reckless directory
97+
is $USER/.lightning/reckless and it should be possible for the
98+
lightningd user to execute files located here. If this is a problem,
99+
the option flag **reckless -d=<my\_alternate\_dir>** may be used to
100+
relocate the reckless directory from its default. Consider creating a
101+
permanent alias in this case.
102+
103+
Python plugins are installed to their own virtual environments. The
104+
environment is activated by a wrapper (named the same as the plugin)
105+
which then imports and executes the actual plugin entrypoint.
106+
107+
For Plugin Developers:
108+
109+
To make your plugin compatible with reckless install:
110+
111+
- Choose a unique plugin name.
112+
- The plugin entrypoint is inferred. Naming your plugin executable
113+
the same as your plugin name will allow reckless to identify it
114+
correctly (file extensions are okay.)
115+
- For python plugins, a requirements.txt is the preferred medium for
116+
python dependencies. A pyproject.toml will be used as a fallback,
117+
but test installation via `pip install -e .` - Poetry looks for
118+
additional files in the working directory, whereas with pip, any
119+
references to these will require something like
120+
`packages = [{ include = "*.py" }]` under the `[tool.poetry]`
121+
section.
122+
- Additional repository sources may be added with
123+
`reckless source add https://my.repo.url/here` however,
124+
https://github.com/lightningd/plugins is included by default.
125+
Consider adding your plugin lightningd/plugins to make
126+
installation simpler.
127+
- If your plugin is located in a subdirectory of your repo with a
128+
different name than your plugin, it will likely be overlooked.
129+
130+
AUTHOR
131+
------
132+
133+
Antoine Poinsot wrote the original reckless plugin on which this is
134+
based.
135+
136+
Rusty Russell wrote the outline for the reckless utility's function
137+
138+
Alex Myers <<[email protected]>> is mostly responsible for the
139+
reckless code and this man page, with thanks to Christian Decker for
140+
extensive review.
141+
142+
SEE ALSO
143+
--------
144+
145+
reckless(7), Core-Lightning plugins repo: <https://github.com/lightningd/plugins>
146+
147+
RESOURCES
148+
---------
149+
150+
Main web site: <https://github.com/ElementsProject/lightning>

doc/reckless.7.md

+2-42
Original file line numberDiff line numberDiff line change
@@ -23,41 +23,6 @@ The **reckless** RPC starts a reckless process with the *command* and *target* p
2323
- (string)
2424
- (array)
2525

26-
NOTES
27-
-----
28-
29-
Reckless currently supports python and javascript plugins.
30-
Running the first time will prompt the user that their lightningd's bitcoin config will be appended (or created) to inherit the reckless config file (this config is specific to bitcoin by default.). Management of plugins will subsequently modify this file.
31-
32-
Available option flags:
33-
**-d**, **--reckless-dir** *reckless\_dir*: specify an alternative data directory for reckless to use. Useful if your .lightning is protected from execution.
34-
35-
**-l**, **--lightning** *lightning\_data\_dir*: lightning data directory (defaults to $USER/.lightning)
36-
37-
**-c**, **--conf** *lightning\_config*: pass the config used by lightningd
38-
39-
**-r**, **--regtest**: use the regtest network and config instead of bitcoin mainnet
40-
41-
**-v**, **--verbose**: request additional debug output
42-
43-
**--network**=*network*: specify bitcoin, regtest, liquid, liquid-regtest, litecoin, signet, or testnet networks. (default: bitcoin)
44-
45-
**--version**: print the version of reckless and exit
46-
47-
48-
Troubleshooting tips:
49-
50-
Plugins must be executable. For python plugins, the shebang is invoked, so **python3** should be available in your environment. This can be verified with **which Python3**. The default reckless directory is $USER/.lightning/reckless and it should be possible for the lightningd user to execute files located here. If this is a problem, the option flag **reckless -d=<my\_alternate\_dir>** may be used to relocate the reckless directory from its default. Consider creating a permanent alias in this case.
51-
Python plugins are installed to their own virtual environments. The environment is activated by a wrapper (named the same as the plugin) which then imports and executes the actual plugin entrypoint.
52-
53-
For Plugin Developers:
54-
55-
To make your plugin compatible with reckless install:
56-
- Choose a unique plugin name: The plugin entrypoint is inferred. Naming your plugin executable the same as your plugin name will allow reckless to identify it correctly (file extensions are okay.)
57-
- For python plugins, a requirements.txt is the preferred medium for python dependencies. A pyproject.toml will be used as a fallback, but test installation via `pip install -e .` - Poetry looks for additional files in the working directory, whereas with pip, any references to these will require something like `packages = [{ include = "*.py" }]` under the `[tool.poetry]` section.
58-
- Additional repository sources may be added with `reckless source add https://my.repo.url/here` however, https://github.com/lightningd/plugins is included by default. Consider adding your plugin lightningd/plugins to make installation simpler.
59-
- If your plugin is located in a subdirectory of your repo with a different name than your plugin, it will likely be overlooked.
60-
6126
RETURN VALUE
6227
------------
6328

@@ -71,21 +36,16 @@ On success, an object is returned, containing:
7136
AUTHOR
7237
------
7338

74-
Antoine Poinsot wrote the original reckless plugin on which this is based.
75-
76-
Rusty Russell wrote the outline for the reckless utility's function
77-
78-
Alex Myers <<[email protected]>> is mainly responsible for the reckless code and this man page, with thanks to Christian Decker for extensive review.
39+
Alex Myers <<[email protected]>> is mainly responsible.
7940

8041
SEE ALSO
8142
--------
8243

83-
reckless(7)
44+
reckless(1)
8445

8546
RESOURCES
8647
---------
8748

88-
Core-Lightning plugins repo: <https://github.com/lightningd/plugins>
8949
Main web site: <https://github.com/ElementsProject/lightning>
9050

9151
EXAMPLES

doc/schemas/reckless.json

+2-40
Original file line numberDiff line numberDiff line change
@@ -86,51 +86,13 @@
8686
}
8787
}
8888
},
89-
"notes": [
90-
"Reckless currently supports python and javascript plugins.",
91-
"Running the first time will prompt the user that their lightningd's bitcoin config will be appended (or created) to inherit the reckless config file (this config is specific to bitcoin by default.). Management of plugins will subsequently modify this file.",
92-
"",
93-
"Available option flags:",
94-
"**-d**, **--reckless-dir** *reckless_dir*: specify an alternative data directory for reckless to use. Useful if your .lightning is protected from execution.",
95-
"",
96-
"**-l**, **--lightning** *lightning\\_data\\_dir*: lightning data directory (defaults to $USER/.lightning)",
97-
"",
98-
"**-c**, **--conf** *lightning\\_config*: pass the config used by lightningd",
99-
"",
100-
"**-r**, **--regtest**: use the regtest network and config instead of bitcoin mainnet",
101-
"",
102-
"**-v**, **--verbose**: request additional debug output",
103-
"",
104-
"**--network**=*network*: specify bitcoin, regtest, liquid, liquid-regtest, litecoin, signet, or testnet networks. (default: bitcoin)",
105-
"",
106-
"**--version**: print the version of reckless and exit",
107-
"",
108-
"",
109-
"Troubleshooting tips:",
110-
"",
111-
"Plugins must be executable. For python plugins, the shebang is invoked, so **python3** should be available in your environment. This can be verified with **which Python3**. The default reckless directory is $USER/.lightning/reckless and it should be possible for the lightningd user to execute files located here. If this is a problem, the option flag **reckless -d=<my_alternate_dir>** may be used to relocate the reckless directory from its default. Consider creating a permanent alias in this case.",
112-
"Python plugins are installed to their own virtual environments. The environment is activated by a wrapper (named the same as the plugin) which then imports and executes the actual plugin entrypoint.",
113-
"",
114-
"For Plugin Developers:",
115-
"",
116-
"To make your plugin compatible with reckless install:",
117-
"- Choose a unique plugin name: The plugin entrypoint is inferred. Naming your plugin executable the same as your plugin name will allow reckless to identify it correctly (file extensions are okay.)",
118-
"- For python plugins, a requirements.txt is the preferred medium for python dependencies. A pyproject.toml will be used as a fallback, but test installation via `pip install -e .` - Poetry looks for additional files in the working directory, whereas with pip, any references to these will require something like `packages = [{ include = \"*.py\" }]` under the `[tool.poetry]` section.",
119-
"- Additional repository sources may be added with `reckless source add https://my.repo.url/here` however, https://github.com/lightningd/plugins is included by default. Consider adding your plugin lightningd/plugins to make installation simpler.",
120-
"- If your plugin is located in a subdirectory of your repo with a different name than your plugin, it will likely be overlooked."
121-
],
12289
"author": [
123-
"Antoine Poinsot wrote the original reckless plugin on which this is based.",
124-
"",
125-
"Rusty Russell wrote the outline for the reckless utility's function",
126-
"",
127-
"Alex Myers <<[email protected]>> is mainly responsible for the reckless code and this man page, with thanks to Christian Decker for extensive review."
90+
"Alex Myers <<[email protected]>> is mainly responsible."
12891
],
12992
"see_also": [
130-
"reckless(7)"
93+
"reckless(1)"
13194
],
13295
"resources": [
133-
"Core-Lightning plugins repo: <https://github.com/lightningd/plugins>",
13496
"Main web site: <https://github.com/ElementsProject/lightning>"
13597
],
13698
"examples": [

0 commit comments

Comments
 (0)