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

remove %1 fee by internal invoice #294

Open
TheCherry opened this issue Sep 20, 2021 · 9 comments
Open

remove %1 fee by internal invoice #294

TheCherry opened this issue Sep 20, 2021 · 9 comments

Comments

@TheCherry
Copy link

What will happen if we move the if statement:

https://github.com/BlueWallet/LndHub/blob/master/controllers/api.js#L238

to the regular lightning network logic:

https://github.com/BlueWallet/LndHub/blob/master/controllers/api.js#L290

In the end we don't need to check internal for the fee, am I right?

@xraid
Copy link
Contributor

xraid commented Sep 23, 2021

You can now set fees in the config.js file on version 1.4.0

forwardReserveFee: 0.01, // default 0.01
intraHubFee: 0.003, // default 0.003

@Blazerinho
Copy link

where can I find config.js on umbrel directory?

@Blazerinho
Copy link

and can I see who gets intrahubfee?

@xraid
Copy link
Contributor

xraid commented Dec 10, 2021

in folder lndhub/config.js You can adjust fees

intrahubfee is for all accounts connected to the LndHub instance

@xraid
Copy link
Contributor

xraid commented Dec 10, 2021

docker exec -it "mycontainer" bash

and nano config.js

@hazrulnizam
Copy link

You can now set fees in the config.js file on version 1.4.0

forwardReserveFee: 0.01, // default 0.01
intraHubFee: 0.003, // default 0.003

As the code stands right now, we cannot set the internal hub fee to zero. Setting intraHubFee: 0.000 in config.js does not change the fee to zero because the code does not catch it due to simple using the OR operator in order to set default values.

/****** START SET FEES FROM CONFIG AT STARTUP ******/
/** GLOBALS */
global.forwardFee = config.forwardReserveFee || 0.01;
global.internalFee = config.intraHubFee || 0.003;
/****** END SET FEES FROM CONFIG AT STARTUP ******/

Perhaps a more robust check on whether the variable is defined is needed.

@xraid
Copy link
Contributor

xraid commented Dec 30, 2021

yeah a change was made in good faith here :
e42ef3a

@Blazerinho
Copy link

Finally I found a workaround to set fees to zero. dirty but it works as long you don't restart umbrel.
'login to umbrel using
cmd
'Enter following command to get into umbrel
SSH -t [email protected]
'Enter "your umbrel password"
'find out and note container ID of bluewalletorganization/lndhub:v1.4.1 with
Docker ps
'get into Container
docker exec -u 0 -it "Bluewallet Container ID" /bin/sh
'update library
apt-get update
'install nano
apt-get install nano
'edit file api.js
nano /lndhub/controllers/api.js
'modify line of fees
global.forwardFee = 0.00;
global.internalFee = 0.000;
'CTRL + X to save
'restart docker
docker restart "Bluewallet Container ID"
exit

@Blazerinho
Copy link

Blazerinho commented Feb 11, 2022

@hazrulnizam you are right.
Due to || being a boolean logical operator, the left hand-side operand was coerced to a boolean for the evaluation and any falsy value (0, '', NaN, null, undefined) was not returned. This behavior may cause unexpected consequences if you consider 0, '', or NaN as valid values.
I guess that 0.00 is also a falsy value. Can anybody debug that behavior?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator

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

No branches or pull requests

4 participants