Open TheCherry opened 2 years ago
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
where can I find config.js on umbrel directory?
and can I see who gets intrahubfee?
in folder lndhub/config.js You can adjust fees
intrahubfee is for all accounts connected to the LndHub instance
docker exec -it "mycontainer" bash
and nano config.js
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.
Perhaps a more robust check on whether the variable is defined is needed.
yeah a change was made in good faith here : https://github.com/BlueWallet/LndHub/commit/e42ef3a85e3792d61a5c0e4ae124ec4c48797e64
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 umbrel@umbrel.local '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
@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
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?