-
Notifications
You must be signed in to change notification settings - Fork 974
[plugin] 0.0.1 of donation plugin and invoice query service #2152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[plugin] 0.0.1 of donation plugin and invoice query service #2152
Conversation
|
@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 | |||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
|
I was unable to get the donation server running locally. After calling 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! |
|
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 😉 |
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.