BlueWallet / LndHub

Wrapper for Lightning Network Daemon. It provides separate accounts for end-users
http://LndHub.io
MIT License
777 stars 196 forks source link

"Refill" or "Refill with external wallet" not working #346

Closed Javihache closed 2 years ago

Javihache commented 2 years ago

I have tried to refill my lightning wallet connected to my fully functioning LND using BlueWallet.

I have tried both methods "Refill" and "Refill with external wallet". None of them work.

When looking at the LNDhub logs I see

listtransactions error: { Error: {"result":null,"error":{"code":-32601,"message":"Method not found"}

I have removed bitcoind entry from config.js.

I restarted the service and created a new Lightning Wallet.

When I try to refresh this new Lightning Wallet, the logs still show listtransactions error: { Error: {"result":null,"error":{"code":-32601,"message":"Method not found"} when I try to update the transactions on the Lightning Wallets.

In my bitcoin.conf I have disablewallet=1

What could be causing the problem and how can I fix this?

My config.js: `let config = { redis: { port: 6379, host: '127.0.0.1', family: 4, db: 0, }, lnd: { url: '127.0.0.1:10009', }, };

if (process.env.CONFIG) { console.log('using config from env'); config = JSON.parse(process.env.CONFIG); } module.exports = config;`

LNDhub logs:

Dec 30 12:11:02 hachepi npm[3652]: 42466108-d298-4441-8d3a-d1689c6340ec ::ffff:127.0.0.1 - - [30/Dec/2021:12:11:02 +0000] "GET /getpending HTTP/1.1" 200 2 "-" "BlueWallet/1639420276 CFNetwork/1325.0.1 Darwin/21.1.0" Dec 30 12:11:03 hachepi npm[3652]: 2021-12-30T12:11:03.069Z : info: [/balance] : ["a61a61cd-56fc-4d14-adad-203bb2087ed7"] Dec 30 12:11:03 hachepi npm[3652]: 2021-12-30T12:11:03.072Z : info: [/balance] : ["a61a61cd-56fc-4d14-adad-203bb2087ed7","userid: 4c34e16b94158de2a48d1cfe0210faf015e0ac351f8430b9"] Dec 30 12:11:03 hachepi npm[3652]: listtransactions error: { Error: {"result":null,"error":{"code":-32601,"message":"Method not found"},"id":"69643cef-2f34-4f31-adb6-615718f83239"} Dec 30 12:11:03 hachepi npm[3652]: at IncomingMessage.<anonymous> (/home/bitcoin/LndHub/node_modules/jayson/lib/client/http.js:76:23) Dec 30 12:11:03 hachepi npm[3652]: at IncomingMessage.emit (events.js:203:15) Dec 30 12:11:03 hachepi npm[3652]: at IncomingMessage.EventEmitter.emit (domain.js:448:20) Dec 30 12:11:03 hachepi npm[3652]: at endReadableNT (_stream_readable.js:1145:12) Dec 30 12:11:03 hachepi npm[3652]: at process._tickCallback (internal/process/next_tick.js:63:19) code: 404 } Dec 30 12:11:03 hachepi npm[3652]: a61a61cd-56fc-4d14-adad-203bb2087ed7 ::ffff:127.0.0.1 - - [30/Dec/2021:12:11:03 +0000] "GET /balance HTTP/1.1" 200 30 "-" "BlueWallet/1639420276 CFNetwork/1325.0.1 Darwin/21.1.0" Dec 30 12:11:03 hachepi npm[3652]: 2021-12-30T12:11:03.728Z : info: [/getuserinvoices] : ["0a5efa08-349c-4620-90c5-7cec56b1c82e"] Dec 30 12:11:03 hachepi npm[3652]: 2021-12-30T12:11:03.730Z : info: [/getuserinvoices] : ["0a5efa08-349c-4620-90c5-7cec56b1c82e","userid: 93d5379c76148c3bd77612d4acba81a3fb478a338609e7e5"] Dec 30 12:11:03 hachepi npm[3652]: 0a5efa08-349c-4620-90c5-7cec56b1c82e ::ffff:127.0.0.1 - - [30/Dec/2021:12:11:03 +0000] "GET /getuserinvoices HTTP/1.1" 200 918 "-" "BlueWallet/1639420276 CFNetwork/1325.0.1 Darwin/21.1.0" Dec 30 12:11:04 hachepi npm[3652]: 2021-12-30T12:11:04.789Z : info: [/gettxs] : ["643cc6df-c435-4ace-9d5b-f6955370991f"] Dec 30 12:11:04 hachepi npm[3652]: 2021-12-30T12:11:04.791Z : info: [/gettxs] : ["643cc6df-c435-4ace-9d5b-f6955370991f","userid: 4c34e16b94158de2a48d1cfe0210faf015e0ac351f8430b9"] Dec 30 12:11:04 hachepi npm[3652]: listtransactions error: { Error: {"result":null,"error":{"code":-32601,"message":"Method not found"},"id":"3700e8aa-744f-401b-8829-f9115d534a42"} Dec 30 12:11:04 hachepi npm[3652]: at IncomingMessage.<anonymous> (/home/bitcoin/LndHub/node_modules/jayson/lib/client/http.js:76:23) Dec 30 12:11:04 hachepi npm[3652]: at IncomingMessage.emit (events.js:203:15) Dec 30 12:11:04 hachepi npm[3652]: at IncomingMessage.EventEmitter.emit (domain.js:448:20) Dec 30 12:11:04 hachepi npm[3652]: at endReadableNT (_stream_readable.js:1145:12) Dec 30 12:11:04 hachepi npm[3652]: at process._tickCallback (internal/process/next_tick.js:63:19) code: 404 } Dec 30 12:11:04 hachepi npm[3652]: 643cc6df-c435-4ace-9d5b-f6955370991f ::ffff:127.0.0.1 - - [30/Dec/2021:12:11:04 +0000] "GET /gettxs?limit=10&offset=0 HTTP/1.1" 200 2 "-" "BlueWallet/1639420276 CFNetwork/1325.0.1 Darwin/21.1.0" Dec 30 12:11:04 hachepi npm[3652]: updateDescribeGraph() Dec 30 12:11:05 hachepi npm[3652]: updateLightning() Dec 30 12:11:05 hachepi npm[3652]: updated Dec 30 12:11:05 hachepi npm[3652]: 2021-12-30T12:11:05.669Z : info: [/getpending] : ["ebb3865e-2d25-41a0-bfa5-2a41f8d24832"] Dec 30 12:11:05 hachepi npm[3652]: 2021-12-30T12:11:05.671Z : info: [/getpending] : ["ebb3865e-2d25-41a0-bfa5-2a41f8d24832","userid: 4c34e16b94158de2a48d1cfe0210faf015e0ac351f8430b9"] Dec 30 12:11:05 hachepi npm[3652]: listtransactions error: { Error: {"result":null,"error":{"code":-32601,"message":"Method not found"},"id":"e13c026e-636c-45c2-8af8-8b121298aa1a"} Dec 30 12:11:05 hachepi npm[3652]: at IncomingMessage.<anonymous> (/home/bitcoin/LndHub/node_modules/jayson/lib/client/http.js:76:23) Dec 30 12:11:05 hachepi npm[3652]: at IncomingMessage.emit (events.js:203:15) Dec 30 12:11:05 hachepi npm[3652]: at IncomingMessage.EventEmitter.emit (domain.js:448:20) Dec 30 12:11:05 hachepi npm[3652]: at endReadableNT (_stream_readable.js:1145:12) Dec 30 12:11:05 hachepi npm[3652]: at process._tickCallback (internal/process/next_tick.js:63:19) code: 404 } Dec 30 12:11:05 hachepi npm[3652]: ebb3865e-2d25-41a0-bfa5-2a41f8d24832 ::ffff:127.0.0.1 - - [30/Dec/2021:12:11:05 +0000] "GET /getpending HTTP/1.1" 200 2 "-" "BlueWallet/1639420276 CFNetwork/1325.0.1 Darwin/21.1.0" Dec 30 12:11:06 hachepi npm[3652]: 2021-12-30T12:11:06.421Z : info: [/getuserinvoices] : ["7805a982-4f26-4431-9c9c-8d1e70247a1e"] Dec 30 12:11:06 hachepi npm[3652]: 2021-12-30T12:11:06.423Z : info: [/getuserinvoices] : ["7805a982-4f26-4431-9c9c-8d1e70247a1e","userid: 4c34e16b94158de2a48d1cfe0210faf015e0ac351f8430b9"] Dec 30 12:11:06 hachepi npm[3652]: 7805a982-4f26-4431-9c9c-8d1e70247a1e ::ffff:127.0.0.1 - - [30/Dec/2021:12:11:06 +0000] "GET /getuserinvoices HTTP/1.1" 200 2 "-" "BlueWallet/1639420276 CFNetwork/1325.0.1 Darwin/21.1.0"

xraid commented 2 years ago

lndhub/class/User.js line 406

if (config.bitcoind) { let txs = await this._bitcoindrpc.request('listtransactions', ['*', 100500, 0, true]);

if You restarted with // bitcoind {...} in config.js the above code would not be run !

Javihache commented 2 years ago

That’s exactly what I was wondering myself! I have updated LNDHub. Now config.js comes with a key:value pair in redis section called password. I followed dangeross guide to install LNDhub and don’t remember setting up a password for redis. Do I need to find or setup a password for redis somewhere?

Regarding bitcoind, I restarted Lndhub by systemctl restart lndhub

But I saw in journalctl that npm was still doing its thing updating graphs. Is there a different way to restart lndhub that I am missing? Going to lndhub directory and running some npm command maybe?

Javihache commented 2 years ago

I updated node to v16.13.1 and npm to 8.3.0. I removed the password entry from redis section (redis doesn't require a password in my case) and boom... npm[27634]: Segmentation fault (core dumped)

Guys, is it possible to create some updated document of how to install the npm dependencies and run this thing? I don't wanna install umbrel and start over again... And LNDHub is the last component of my bitcoin/lnd node that I wanted to install. I just want to provide friends and family with access to LN without them having to trust 3rd parties...

Thanks in advance!

Javihache commented 2 years ago

I have removed node and npm completely, removed LNDHub folder and started fresh. It seems to be working now and without the bitcoind option. I will try to refill again and see if it works and report here.

I guess the problem was my installation was outdated and trying to update everything I just broke it. Will close the issue as soon as the refill is notified.

xraid commented 2 years ago

great We want to know and if else solve somehow . thanks ...

xraid commented 2 years ago

if installing LndHub as a umbrel app . there should be some way restart it ? any documentation ? ...

docker ps

docker exec -it bash

and or kill cointainer start cointainer

sorry dont know much of the umbrel app deploys

xraid commented 2 years ago

if installing LndHub outside of umbrel docker-compose app thingy, there is usuall just quit and restart the node.js instance how You quit depends how You started it ?

Javihache commented 2 years ago

Hello! It’s working now. Thanks for the help. If you guys want me to write a quick guide for Ubuntu, it’s basically the same as dangeross guide, but I followed the official nodejs installation guide for Ubuntu. Let me know if I can help with this and you guys can put that guide in the docs. My problem is most likely that my npm dependencies were outdated and the node/npm version too old.