Find file Copy path
executable file 39 lines (24 sloc) 905 Bytes
#!/usr/bin/env python3
from lightning import Plugin
plugin = Plugin(autopatch=True)
def hello(plugin, name="world"):
"""This is the documentation string for the hello-function.
It gets reported as the description when registering the function
as a method with `lightningd`.
greeting = plugin.get_option('greeting')
s = '{} {}'.format(greeting, name)
return s
def init(options, configuration, plugin):
plugin.log("Plugin initialized")
def on_connect(plugin, id, address):
plugin.log("Received connect event for peer {}".format(id))
def on_disconnect(plugin, id):
plugin.log("Received disconnect event for peer {}".format(id))
plugin.add_option('greeting', 'Hello', 'The greeting I should use.')