Closed AaronDewes closed 2 years ago
LndHub-Admin FeeSetting Component do today push up the fees from config to Redis DB, for "read" only.
In the LndHub-Admin Toolbox environment one need a adminPin
to set the fees, but allow other Componenents or API Consumers reference the fees via a Redis read, "one source of truth".
I did not use Redis all the way for the fees from config because in the end i found the globals be a more elegant solution. Less LOC and in this special case speed is of negligible concern unless busy cluster of LndHub's share same LND, and even then would only add a couple of ms to the cpu stack que.
Also globals may have a bad rap in other languages like C etc. because of memory isolation, that we do not have the same constrains with in javascript, consider a module is a global among much more in the Node.js V8 C++ libs.
The maintainers can choose implementation for LndHub proper - but LndHub-Admin will use globals for the FeeSettings forward regardless.
closed in favor of other pr
This provides an alternative to #238 which stores the fees in redis instead of globally in JS. This would allow tools like lndhub-admin to directly access the database and modify things there.