mirror of
https://github.com/aljazceru/plugins.git
synced 2025-12-20 14:44:20 +01:00
docs: Rename from c-lightning to core-lightning for local plugins
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
# Autopilot
|
# Autopilot
|
||||||
|
|
||||||
This is a version of Rene Pickhardt's [Autopilot library][lib] ported as a
|
This is a version of Rene Pickhardt's [Autopilot library][lib] ported as a
|
||||||
c-lightning plugin.
|
Core-Lightning plugin.
|
||||||
|
|
||||||
> :warning: This plugin is still being ported and may not be currently reflect
|
> :warning: This plugin is still being ported and may not be currently reflect
|
||||||
> the entire functionality. :construction:
|
> the entire functionality. :construction:
|
||||||
|
|||||||
@@ -3,16 +3,16 @@ Created on 04.09.2018
|
|||||||
|
|
||||||
@author: rpickhardt
|
@author: rpickhardt
|
||||||
|
|
||||||
This software is a command line tool and c-lightning wrapper for lib_autopilot
|
This software is a command line tool and Core-Lightning wrapper for lib_autopilot
|
||||||
|
|
||||||
You need to have a c-lightning node running in order to utilize this program.
|
You need to have a Core-Lightning node running in order to utilize this program.
|
||||||
Also you need lib_autopilot. You can run
|
Also you need lib_autopilot. You can run
|
||||||
|
|
||||||
python3 c-lightning-autopilot --help
|
python3 Core-Lightning-autopilot --help
|
||||||
|
|
||||||
in order to get all the command line options
|
in order to get all the command line options
|
||||||
|
|
||||||
usage: c-lightning-autopilot.py [-h] [-b BALANCE] [-c CHANNELS]
|
usage: Core-Lightning-autopilot.py [-h] [-b BALANCE] [-c CHANNELS]
|
||||||
[-r PATH_TO_RPC_INTERFACE]
|
[-r PATH_TO_RPC_INTERFACE]
|
||||||
[-s {diverse,merge}] [-p PERCENTILE_CUTOFF]
|
[-s {diverse,merge}] [-p PERCENTILE_CUTOFF]
|
||||||
[-d] [-i INPUT]
|
[-d] [-i INPUT]
|
||||||
@@ -36,7 +36,7 @@ optional arguments:
|
|||||||
|
|
||||||
a good example call of the program could look like that:
|
a good example call of the program could look like that:
|
||||||
|
|
||||||
python3 c-lightning-autopilot.py -s diverse -c 30 -b 10000000
|
python3 core-lightning-autopilot.py -s diverse -c 30 -b 10000000
|
||||||
|
|
||||||
This call would use up to 10'000'000 satoshi to create 30 channels which are
|
This call would use up to 10'000'000 satoshi to create 30 channels which are
|
||||||
generated by using the diverse strategy to mix the 4 heuristics.
|
generated by using the diverse strategy to mix the 4 heuristics.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ from typing import Iterator
|
|||||||
import sqlite3
|
import sqlite3
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
|
|
||||||
# A 'transaction' that was proposed by c-lightning and that needs saving to the
|
# A 'transaction' that was proposed by Core-Lightning and that needs saving to the
|
||||||
# backup. `version` is the `data_version` of the database **after** `transaction`
|
# backup. `version` is the `data_version` of the database **after** `transaction`
|
||||||
# has been applied. A 'snapshot' represents a complete copy of the database.
|
# has been applied. A 'snapshot' represents a complete copy of the database.
|
||||||
# This is used by the plugin from time to time to allow the backend to compress
|
# This is used by the plugin from time to time to allow the backend to compress
|
||||||
@@ -81,7 +81,7 @@ class Backend(object):
|
|||||||
self.db = self._db_open(dest)
|
self.db = self._db_open(dest)
|
||||||
|
|
||||||
def _rewrite_stmt(self, stmt: str) -> str:
|
def _rewrite_stmt(self, stmt: str) -> str:
|
||||||
"""We had a stmt expansion bug in c-lightning, this replicates the fix.
|
"""We had a stmt expansion bug in Core-Lightning, this replicates the fix.
|
||||||
|
|
||||||
We were expanding statements incorrectly, missing some
|
We were expanding statements incorrectly, missing some
|
||||||
whitespace between a param and the `WHERE` keyword. This
|
whitespace between a param and the `WHERE` keyword. This
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ def init(lightning_dir, backend_url):
|
|||||||
else:
|
else:
|
||||||
print("Database does not exist yet, created an empty backup file")
|
print("Database does not exist yet, created an empty backup file")
|
||||||
|
|
||||||
print("Initialized backup backend {destination}, you can now start c-lightning".format(
|
print("Initialized backup backend {destination}, you can now start Core-Lightning".format(
|
||||||
destination=destination,
|
destination=destination,
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|||||||
@@ -23,16 +23,16 @@ root.addHandler(handler)
|
|||||||
|
|
||||||
|
|
||||||
def check_first_write(plugin, data_version):
|
def check_first_write(plugin, data_version):
|
||||||
"""Verify that we are up-to-date and c-lightning didn't forget writes.
|
"""Verify that we are up-to-date and Core-Lightning didn't forget writes.
|
||||||
|
|
||||||
We may be at most 1 write off:
|
We may be at most 1 write off:
|
||||||
|
|
||||||
- c-lightning and backup are at the same version (happy case)
|
- Core-Lightning and backup are at the same version (happy case)
|
||||||
- c-lightning is 1 write behind: it must've crashed inbetween calling the
|
- Core-Lightning is 1 write behind: it must've crashed inbetween calling the
|
||||||
hook and committing the DB transaction.
|
hook and committing the DB transaction.
|
||||||
- c-lightning is one or more writes ahead: either we lost some writes, or
|
- Core-Lightning is one or more writes ahead: either we lost some writes, or
|
||||||
c-lightning was running without the plugin at some point -> crash!
|
Core-Lightning was running without the plugin at some point -> crash!
|
||||||
- c-lighning is more than 1 write behind: c-lightning had a lobotomy, or
|
- c-lighning is more than 1 write behind: Core-Lightning had a lobotomy, or
|
||||||
was restored from an old backup -> crash!
|
was restored from an old backup -> crash!
|
||||||
"""
|
"""
|
||||||
backend = plugin.backend
|
backend = plugin.backend
|
||||||
@@ -50,7 +50,7 @@ def check_first_write(plugin, data_version):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
elif backend.prev_version > data_version - 1:
|
elif backend.prev_version > data_version - 1:
|
||||||
kill("c-lightning seems to have lost some state (failed restore?). Emergency shutdown.")
|
kill("Core-Lightning seems to have lost some state (failed restore?). Emergency shutdown.")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
kill("Backup is out of date, we cannot continue safely. Emergency shutdown.")
|
kill("Backup is out of date, we cannot continue safely. Emergency shutdown.")
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ class FileBackend(Backend):
|
|||||||
|
|
||||||
# If this assertion fails we are in a degenerate state: we
|
# If this assertion fails we are in a degenerate state: we
|
||||||
# have less than two changes in the backup (starting
|
# have less than two changes in the backup (starting
|
||||||
# c-lightning alone produces 6 changes), and compacting an
|
# Core-Lightning alone produces 6 changes), and compacting an
|
||||||
# almost empty backup is not useful.
|
# almost empty backup is not useful.
|
||||||
assert change is not None
|
assert change is not None
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "cln-backup"
|
name = "cln-backup"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
description = "Keep your c-lightning node save by backing it up, in real-time (allows recovering without channel closures)."
|
description = "Keep your Core-Lightning node save by backing it up, in real-time (allows recovering without channel closures)."
|
||||||
authors = ["Christian Decker <decker@blockstream.com>"]
|
authors = ["Christian Decker <decker@blockstream.com>"]
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
Remote backup backend for c-lightning
|
Remote backup backend for Core-Lightning
|
||||||
=====================================
|
=====================================
|
||||||
|
|
||||||
Introduction
|
Introduction
|
||||||
------------
|
------------
|
||||||
|
|
||||||
The purpose of this backend is to allow hassle-free incremental remote backups of a c-lightning
|
The purpose of this backend is to allow hassle-free incremental remote backups of a Core-Lightning
|
||||||
daemon's state.
|
daemon's state.
|
||||||
|
|
||||||
The remote backup system consists of two parts:
|
The remote backup system consists of two parts:
|
||||||
|
|
||||||
- A `backup.py` plugin backend that listens for changes to c-lightning's database and communicates them
|
- A `backup.py` plugin backend that listens for changes to Core-Lightning's database and communicates them
|
||||||
to a remote server.
|
to a remote server.
|
||||||
|
|
||||||
- A server daemon that receives changes from the backup backend and communicates with a local backup backend
|
- A server daemon that receives changes from the backup backend and communicates with a local backup backend
|
||||||
to store them. The server side does not need to be running c-lightning, nor have it installed.
|
to store them. The server side does not need to be running Core-Lightning, nor have it installed.
|
||||||
|
|
||||||
### URL scheme
|
### URL scheme
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ backup-cli server file:///path/to/backup 127.0.0.1:8700
|
|||||||
On the client side:
|
On the client side:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Make sure c-lightning is not running
|
# Make sure Core-Lightning is not running
|
||||||
lightning-cli stop
|
lightning-cli stop
|
||||||
# Initialize the socket backend (this makes an initial snapshot, and creates a configuration file for the plugin)
|
# Initialize the socket backend (this makes an initial snapshot, and creates a configuration file for the plugin)
|
||||||
backup-cli init socket:127.0.0.1:8700 --lightning-dir "$HOME/.lightning/bitcoin"
|
backup-cli init socket:127.0.0.1:8700 --lightning-dir "$HOME/.lightning/bitcoin"
|
||||||
@@ -48,7 +48,7 @@ Usage with SSH
|
|||||||
--------------
|
--------------
|
||||||
|
|
||||||
The easiest way to connect the server and client if they are not running on the same host is with a ssh
|
The easiest way to connect the server and client if they are not running on the same host is with a ssh
|
||||||
forward. For example, when connecting from another machine to the one running c-lightning use:
|
forward. For example, when connecting from another machine to the one running Core-Lightning use:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ssh mylightninghost -R 8700:127.0.0.1:8700
|
ssh mylightninghost -R 8700:127.0.0.1:8700
|
||||||
@@ -82,9 +82,9 @@ HiddenServicePort 8700 127.0.0.1:8700
|
|||||||
Goals
|
Goals
|
||||||
-----
|
-----
|
||||||
|
|
||||||
- Hassle-free incremental remote backup of c-lightning's database over a simple TCP protocol.
|
- Hassle-free incremental remote backup of Core-Lightning's database over a simple TCP protocol.
|
||||||
|
|
||||||
- Safety. c-lightningd will only proceed when the remote backend has acknowledged storing a change, and will halt when there is no connection to the backup server.
|
- Safety. Core-Lightning will only proceed when the remote backend has acknowledged storing a change, and will halt when there is no connection to the backup server.
|
||||||
|
|
||||||
- Bandwidth efficiency. Updates can be really large, and SQL statements ought to be well compressible, so bandwidth is saved by performing zlib compression on the changes and snapshots.
|
- Bandwidth efficiency. Updates can be really large, and SQL statements ought to be well compressible, so bandwidth is saved by performing zlib compression on the changes and snapshots.
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ lightningd --plugin=/path/to/plugin/drain.py
|
|||||||
```
|
```
|
||||||
|
|
||||||
Alternatively, you can also symlink or copy the plugins executable to the
|
Alternatively, you can also symlink or copy the plugins executable to the
|
||||||
`.lightning/plugins` folder or the `plugins` folder of your c-lightning
|
`.lightning/plugins` folder or the `plugins` folder of your Core-Lightning
|
||||||
installation as executables within these directories will be loaded as plugins.
|
installation as executables within these directories will be loaded as plugins.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Helpme plugin for c-lightning
|
# Helpme plugin for Core-Lightning
|
||||||
|
|
||||||
This plugin is designed to walk you through setting up a fresh
|
This plugin is designed to walk you through setting up a fresh
|
||||||
c-lightning node, offering advice for common problems.
|
Core-Lightning node, offering advice for common problems.
|
||||||
|
|
||||||
## Example Usage
|
## Example Usage
|
||||||
|
|
||||||
|
|||||||
@@ -422,7 +422,7 @@ def get_channel_list(peers, state='CHANNELD_NORMAL'):
|
|||||||
|
|
||||||
|
|
||||||
def give_general_advice(plugin):
|
def give_general_advice(plugin):
|
||||||
r = """Welcome to c-lightning!
|
r = """Welcome to Core-Lightning!
|
||||||
|
|
||||||
The lightning network consists of bitcoin channels between computers
|
The lightning network consists of bitcoin channels between computers
|
||||||
(like this one), and the ability to send those bitcoins between them.
|
(like this one), and the ability to send those bitcoins between them.
|
||||||
@@ -829,7 +829,7 @@ Beware that if your node is offline while channels are open, the other side of t
|
|||||||
|
|
||||||
|
|
||||||
def give_plugin_advice(plugin):
|
def give_plugin_advice(plugin):
|
||||||
return """You can create plugins for c-lightning which do awesome things. Like me, the 'helpme' plugin! They can also, y'know, steal your lunch, so be careful!
|
return """You can create plugins for Core-Lightning which do awesome things. Like me, the 'helpme' plugin! They can also, y'know, steal your lunch, so be careful!
|
||||||
|
|
||||||
There's a repository of useful plugins at https://github.com/lightningd/plugins
|
There's a repository of useful plugins at https://github.com/lightningd/plugins
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
The Noise plugin allows sending and receiving private messages through the
|
The Noise plugin allows sending and receiving private messages through the
|
||||||
Lightning Network. It is implemented on top to c-lightning's ~createonion~ and
|
Lightning Network. It is implemented on top to Core-Lightning's ~createonion~ and
|
||||||
~sendonion~ RPC methods that allow delivering custom payloads to a specific
|
~sendonion~ RPC methods that allow delivering custom payloads to a specific
|
||||||
node, as well as the ~htlc_accepted~ hook which can be used to extract the
|
node, as well as the ~htlc_accepted~ hook which can be used to extract the
|
||||||
message from the onion payload.
|
message from the onion payload.
|
||||||
|
|||||||
Reference in New Issue
Block a user