[c-lightning] Towards an autopilot

ZmnSCPxj ZmnSCPxj at protonmail.com
Fri Mar 23 18:13:11 AEDT 2018

Good morning Jan,

Thank you very much your kind words.

Indeed, this is why I want to make, plugin system for autopilot.

I want to make easy, making various algorithms for funding and closing channels.

(even if we cannot make plugin system immediately, it will at least (hopefully) make implementing and mixing multiple algortihms easy a little...)


I conceptualize a little more.

Periodically, autopilot (really, driver) wakes up.  For example, every 10 seconds (settable).

Algorithms have two entrypoints: (1) periodic call entry point (2) funding channel entry point.  Entry points are optional, algorithm can have one or other or both (pointless algorithm has none).

On the periodic cycle, driver calls the algorithm wrangler to enter the periodic call entry point of configured algorithms.

In the periodic cycle, algorithms can propose existing channels to be closed.  If so, driver will close proposed channels to close.

Then, driver checks `listfunds` to look for onchain funds.  If onchain funds exist, driver will look for proposed peers in its list (this starts empty).  If the list of proposed peers is empty, it calls wrangler to enter the funding channel entry point of configured algorithms; algorithms should propose nodes to fund in this entry point (if no algorithms propose nodes to fund, driver will cry itself back to sleep).

Algorithms that want to close based on some rule will hook into the driver via the periodic call entry point, and check the rule (although algorithms need to be carefully designed not to be too aggressive to propose closure).  Algorithms that want to fund channel based on some rule will hook into the driver via the funding  channel entry point.  Algorithms that want to monitor some status (e.g. maybe the algorithm tries to judge uptime of nodes by pinging them periodically, and propose nodes with high uptime for channeling) it can hook by periodic call entry point.

This also ties in to the need for channel statistics (to have good judgment point of when to close them), which we currently do not have.


Sent with [ProtonMail](https://protonmail.com) Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On March 22, 2018 4:17 PM, Ján Sáreník <jajomojo at gmail.com> wrote:

> Good morning ZmnSCPxj!
> On Thu, Mar 22, 2018, 05:14 <ZmnSCPxj at protonmail.com> wrote:
>> --
>> In addition, we want to consider the question of closing channels.
>> Obviously we will want good statistics, e.g. how many payments we have succeeded on that channel, how much those payments are, etc.
>> A similar system for algorithms could be done too, although I am unsure how the driver decides when to close channels.
> What about a simple bittorrent-like ratio comparing the fee that was paid for opening the channel and the amount which flew through the channel?
> I like the idea of autopilot. Thank you for putting it into words!
> Best regards, Ján
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/c-lightning/attachments/20180323/8e127840/attachment.html>

More information about the c-lightning mailing list