Skip to content

Conversation

@renepickhardt
Copy link
Collaborator

I have created a plugin that allows c-lightning nodes to spin up a flask webserver which wraps the invoice RPC command. In this way owners of lightning nodes have a "donation"-web address for spontaneous payments.

I plan to activate this plugin tomorrow on my website and do my next youtube video coming Monday about plugin development for c-lightning. Therefor it would be cool if this plugin and #2139 would be available by than on the c-lightning master branch as I can point to them easily during the video that I am about to create.

Otherwise I will just point to the PR.

Other than that feedback is highly appriciated. In particular for the java script (somehow eventstream notifications and flask don't run with me) and security of the plugin. My feeling is that this is not the most secure web application.

@renepickhardt renepickhardt changed the title 0.01 of donation plugin and invoice query service 0.0.1 of donation plugin and invoice query service Dec 7, 2018
@renepickhardt renepickhardt changed the title 0.0.1 of donation plugin and invoice query service [plugin] 0.0.1 of donation plugin and invoice query service Dec 7, 2018
@conscott
Copy link
Collaborator

conscott commented Dec 7, 2018

@renepickhardt Cool - I actually did something similar as well if you want to compare a bit.

I made a Flask Invoice API and the code on my website for lightning tips is here which is active on my website on this page . I would also note that my implementation is not super secure. Right now you could definitely spam my site with invoices, but I could set rate limits to the API if it became an issue.

I'll try review this tomorrow when I have some time. Definitely interested in comparing.

@@ -0,0 +1,22 @@
Note: the modules in the ccan/ directory have their own licenses, but
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am uncertain why this particular note is here, when the code is in Python and does not (directly) use ccan, or have a ccan/ subdir within this dir.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cause I copied the file from rusty and forgot to remove this stament. Will fix this later

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping


Therefor people can query for an invoice which they can use to pay

run the plugin with:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running the plugin requires having the necessary third party libs installed first. I think you want to add a requirements.txt file in the top level directory that lists dependencies for the app. In this case I belive it needs:

Flask==1.0.2
Flask-WTF==0.14.2
pylightning==0.0.6
qrcode==6.0
Flask-Bootstrap==3.3.7.1

Without these, the plugin will crash on startup.

Users can then install the deps (globally or in a virtual environment) with

pip install -r requirements.txt


## About the plugin
You can see a demo of the plugin on the authors website at:
https://ln.rene-pickhardt.de/donation
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is giving a 500 error right now

@conscott
Copy link
Collaborator

I was unable to get the donation server running locally. After calling

lightning-cli donationserver start

It seems the python instance crashes, but I haven't been able to dig into why just yet

I think once this is rebased off of #2188 it may be easier to debug. Ill keep trying when I have more time!

@cdecker
Copy link
Member

cdecker commented Mar 28, 2019

I added the plugin to the plugins repo, to give it a new home where it can be found and improved.

https://github.com/lightningd/plugins/tree/master/donations

Closing this PR 😉

@cdecker cdecker closed this Mar 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants