Code Monkey home page Code Monkey logo

Comments (3)

shesek avatar shesek commented on June 14, 2024 1

IIf each invoice is only as intensive as a row in sqlite then, as you've stated, there's really no reason to be concerned over the number of open invoices.

I verified this with @rustyrussell who is more qualified on this than I am, and yes - its just a row in the db.

from nanotip.

shesek avatar shesek commented on June 14, 2024

Right, it does give users the ability to freely create new invoices on the c-lightning node. That's not much different from an e-commerce website allowing users to store shopping cart information, invoices, etc. on the server. The main difference is that here its a one-click operation, while the checkout process on e-commerce is usually more complex. But that won't matter much to bots that wants to DDoS the service...

As for your question: the limitation is really up to server hosting it. Each invoice is a row in c-lightning's sqlite database and Lightning Charge's sqlite database. How many of these you can process and store depends on the storage, memory and CPU available on the server.

Note that Lightning Charge deletes unpaid invoices from both itself and c-lightning a few days after they expire, so the invoices will eventually be removed if they're not paid.

Should expiry time be less than the default 3600 in this case?

Whether they should is really up to you. But you can make the expiry time shorter by adding the following in nanotip.js:

@@ -39,7 +39,6 @@ app.post('/', (req, res, next) =>
     amount: req.body.amount
   , currency: req.body.currency
   , description: app.settings.title
+  , expiry: 120 // expire in 2 minutes
   , webhook: app.settings.url + '/webhook/' + webhookToken
   , metadata: { source: 'nanotip', checkout: { redirect_url: thankyouUrl }, info: req.body.info }
   })

I could also add this as a configuration option you can set more easily, created #4 to keep track of that.

from nanotip.

coinables avatar coinables commented on June 14, 2024

Each invoice is a row in c-lightning's sqlite database and Lightning Charge's sqlite database. How many of these you can process and store depends on the storage, memory and CPU available on the server.

Thank you, that is what I was wondering. I wasn't sure how many resources an invoice took from the c-lightning node, for example if each invoice had to be actively "listened for" by the node for new payments and if a flood of new invoices could cause stress on the node. If each invoice is only as intensive as a row in sqlite then, as you've stated, there's really no reason to be concerned over the number of open invoices.

from nanotip.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.