[c-lightning] Plugins/passthrough for next version?

René Pickhardt r.pickhardt at googlemail.com
Tue Aug 28 02:59:11 AEST 2018


Hey everyone,

On Sun, Aug 26, 2018 at 2:23 PM Christian Decker <decker.christian at gmail.com>
wrote:

> The embedded plugins would also be
> completely isolated, which is good for autopilots and similar
> self-contained things, but not so good for wallets and things that
> actually need to talk to the outside world.
>

being allowed to write python code I was finally able to do some meaning
full contribution (:  I have created a first draft for a c-lightning
autopilot in python as a side car.  Some more explainations are in the pull
request:

https://github.com/ElementsProject/lightning/pull/1888

I would love to get some feedback on this before progressing. Currently the
lib only takes the network to pythong networkx lib and uses four different
heuristics to generate a rather diverse candidate set. The current code has
no suggestions of how many funds to allocate to each channel (and how many
channels should be opened). However in the pull request I discussed a
strategy with which to decide how many funds to allocate for each channel.
The key idea is that it makes sense to use a channel balance that is about
the average of the channel balances of the suggested partner. I think the
following code snippet is easier than explaining the strategy. the results
of that code can be seen in the pull request:

pdf = {}

for candidate in candidates:

    neighbors = list(self.G.neighbors(candidate))

    capacity = sum([self.G.get_edge_data(candidate, n)["satoshis"] for n in
neighbors])

    average = capacity / len(neighbors)

    pdf[candidate] = average

cumsum = sum(pdf.values())

pdf = {k:v/cumsum for k,v in pdf.items()}

w = 0.70

print("percentage   smoothed percentage    capacity    numchannels
alias")

print(
"----------------------------------------------------------------------")

for k,v in pdf.items():

    neighbors = list(self.G.neighbors(k))

    capacity = sum([self.G.get_edge_data(k, n)["satoshis"] for n in
neighbors])

    v = v*100

    print("{:12.2f}  ".format(v), "{:12.2f}     ".format(w * v +
100*(1-w)/len(candidates))
,"{:10} {:10}     ".format( capacity, len(neighbors)), self.G.node[k][
"alias"] )

with kind regards Rene

-- 
https://www.rene-pickhardt.de

Skype: rene.pickhardt

mobile: +49 (0)176 5762 3618
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/c-lightning/attachments/20180827/d30f3aed/attachment-0001.html>


More information about the c-lightning mailing list