Skip to content
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

lthnvpnc (client) should inform user of amount LTHN required for payment #101

Open
valiant1x opened this issue May 28, 2019 · 4 comments
Open
Labels

Comments

@valiant1x
Copy link
Contributor

Currently, lthnvpnc only instructs users to pay a provider but does not specify an amount needed. It should at least notify user of the initial required payment and subsequent payment amounts.

Current output:

INFO:audit:action=NEED_PAYMENT,type=PROVIDER_WALLET,wallet=iz5yCnoj1xC3RVv3kzQc1uhUtjJRrh3qFXouzkqGBHf6W3cY1eYBMuseg9RMSqb2fGGN19M6vDiEMHzVRXiZgbBG1vaWCSrDs,paymentid=1A96AE81E8105EC1,
WARNING:lthnvpnc:Waiting for payment to settle...```
@limosek
Copy link
Contributor

limosek commented Jun 28, 2019

Client has no chance to know how much to pay because it does not know how long to stay connected.
Maybe to add parameter for client, how long to connect and compute payment?

@valiant1x
Copy link
Contributor Author

Just informing the user of the per-minute cost (as stated in SDP) would be sufficient. Anything using lthnvpnc can calculate the total on its own.

@ronnylov
Copy link

ronnylov commented Jul 3, 2019

I think the problem was that if I did pay less than the amount for the whole first payment period (as example 3 LTHN if price is 0.1/min and 30 mins) then it never connected. The CLI client could inform user of minimum payment to be able to connect. sdp.json have the info needed to calculate this.

@valiant1x
Copy link
Contributor Author

PR created, see #115. Sample output:

proxy client

lthnvpnc connect 9f6b6575a10a0ab2879b535513c58204e15548c1624432ee54175ae4fea048c1/1C
INFO:audit:action=START,type=SERVICE,obj=lthnvpnc,
WARNING:lthnvpnc:Waiting for local proxy...
WARNING:lthnvpnc:Local proxy OK
WARNING:lthnvpnc:Waiting for remote proxy...
WARNING:lthnvpnc:Remote proxy is connected.
WARNING:lthnvpnc:Now you need to pay to provider's wallet. The cost of service is 0.05000000 LTHN per minute. The minimum initial payment is 30 minutes, for a total of 1.50000000 LTHN.
INFO:audit:action=NEED_PAYMENT,type=PROVIDER_WALLET,wallet=iz68Yp2ymS64Dh11aoAUYyVsJzeHkYN5iKSR4fxhSVVR5m5YLbPuMJti3SWz9g446iWTiRvqJ4Z32LiRzSMuQukM2nVsUWe7y,paymentid=1CAC5FFCAF7B68F0,cost_per_min=0.05000000,
WARNING:lthnvpnc:Waiting for payment to settle...

vpn client

lthnvpnc connect 9f6b6575a10a0ab2879b535513c58204e15548c1624432ee54175ae4fea048c1/2A
INFO:audit:action=START,type=SERVICE,obj=lthnvpnc,
WARNING:lthnvpnc:Started service BASIC no malware[9F6B6575A10A0AB2879B535513C58204E15548C1624432EE54175AE4FEA048C1_2A]
WARNING:lthnvpnc:Now you need to pay to provider's wallet. The cost of service is 0.10000000 LTHN per minute. The minimum initial payment is 30 minutes, for a total of 3.00000000 LTHN.
INFO:audit:action=NEED_PAYMENT,type=PROVIDER_WALLET,wallet=iz68Yp2ymS64Dh11aoAUYyVsJzeHkYN5iKSR4fxhSVVR5m5YLbPuMJti3SWz9g446iWTiRvqJ4Z32LiRzSMuQukM2nVsUWe7y,paymentid=2A96E4760E13B1F0,cost_per_min=0.10000000,

@valiant1x valiant1x added the pr label Jul 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants