BlueWallet / LndHub

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

After funding wallet no balance displays #235

Closed viperperidot closed 2 years ago

viperperidot commented 3 years ago

I have connected my BlueWallet to my LNDHub over Tor and setup a new lightning wallet. I used Manage Funds to deposit funds to the bitcoin address. After the tx was confirmed no balance displays in the wallet, it still shows up at 0 sats.

xraid commented 3 years ago

if You do a lncli listunspent can You se the funds ?

also in your config.js do You have bitcoind configured

viperperidot commented 3 years ago

Do I need inbound capacity to be able to fund my LNDHub wallet? If so then that is my problem, I wasn't sure exactly how it happens, when you deposit to the on-chain address does it do a loop in via lightning labs into an in-bound channel?

xraid commented 3 years ago

if You send to an on-chain address that is where funds will be

if You use loop service from Lightning Labs ? then You need check the loop documentation.

Your LND connected from LndHub need inbound to be able receive LN-sats

BlueWallet can have a bitcoin address that should be able display funds sent to address.

in Your BlueWallet Lightning wallet(account card) do a "mange funds" and refill with external wallet ? is that what You tried ?

viperperidot commented 3 years ago

Yes I did manage funds and deposited utxos into the on-chain address displayed by the lightning wallet connected to LNDHub. After doing that no balance appeared like I described in my original post. How do the utxos go from the on-chain address onto the lightning network and be able to send in your BlueWallet lightning wallet?

If you need inbound liquidity in order for LNDHub to work then that is what I was saying might be my problem. I thought I would be able to still send sats using LNDHub even if I had no inbound liquidity though.

lndhub-admin commented 3 years ago

did You solve this ?

there seems be some sync issues with understanding that Yes LndHub need be connected to a functional and activated LND = has funds and channels proven to work before LndHub can work.

i would like to make a descriptive image of all moving connected parts . after my list of things in TODO shrinks some

Overtorment commented 3 years ago

how is your Lndhub configured? is it with bitcoind or not? for your purposes you probably can remove bitcoind part from config.js so the wallet for onchain addresses is gonna be LND itself

viperperidot commented 3 years ago

did You solve this ?

there seems be some sync issues with understanding that Yes LndHub need be connected to a functional and activated LND = has funds and channels proven to work before LndHub can work.

i would like to make a descriptive image of all moving connected parts . after my list of things in TODO shrinks some

Haven't solved it yet but also haven't gave it another try since this happened. The LNDHub is connected to a functional LND, I have funds on chain and in a channel and have tested that the channel is working.

An image would be helpful, if I understand what is supposed to happen in the background when I deposit to the on-chain address I would be better able to try and solve this myself.

how is your Lndhub configured? is it with bitcoind or not? for your purposes you probably can remove bitcoind part from config.js so the wallet for onchain addresses is gonna be LND itself

Not sure what my config is but I am using the default settings on myNode if that helps.

Overtorment commented 3 years ago

well, if you deposited onchain to an address that was displayed in bluewallet interface (when you chose to top up the lightning wallet) then after 3 confirmations that exact amount should have been credited to this specific lightning wallet.

if that didn't happen then it might be a misconfiguration issue somewhere. i'd first find my config.json and looked whether there is a configuration section that's called bitcoind there

MG-ng commented 2 years ago

I can confirm this behaviour. The top-up transaction to the on-chain address is visible in lncli listunspent and has more than 3 confirmations. But the account amount still shows 0 sats. So fortunately no funds are lost because lncli can manage them but it is unusable for other participants on the hub.

I have tried it with "Refill" and "Refill with external wallet". This is maybe a result from my channels having no inbound liquidity but I'm not yet sure.

However this is printed out by sudo journalctl -f -u lndhub

Sep 23 17:53:16 raspi node[28905]: updateLightning()
Sep 23 17:53:16 raspi node[28905]: updated
Sep 23 17:54:16 raspi node[28905]: updateLightning()
Sep 23 17:54:16 raspi node[28905]: updated
Sep 23 17:54:50 raspi node[28905]: 2021-09-23T15:54:50.059Z : info: [/balance] : ["38fcc81c-01cb-4eba-bc6d-fd36134c1f01"]
Sep 23 17:54:50 raspi node[28905]: 2021-09-23T15:54:50.061Z : info: [/balance] : ["38fcc81c-01cb-4eba-bc6d-fd36134c1f01","userid: b675b155aad21625265d760bbcc384e8d4cd289bfd5c91c9"]
Sep 23 17:54:50 raspi node[28905]: listtransactions error: Error: {"result":null,"error":{"code":-18,"message":"Requested wallet does not exist or is not loaded"},"id":"cb3e4d1a-a144-4f62-b8fe-586883753c20"}
Sep 23 17:54:50 raspi node[28905]:     at IncomingMessage.<anonymous> (/home/bitcoin/LndHub/build/node_modules/jayson/lib/client/http.js:78:23)
Sep 23 17:54:50 raspi node[28905]:     at IncomingMessage.emit (node:events:406:35)
Sep 23 17:54:50 raspi node[28905]:     at endReadableNT (node:internal/streams/readable:1343:12)
Sep 23 17:54:50 raspi node[28905]:     at processTicksAndRejections (node:internal/process/task_queues:83:21) {
Sep 23 17:54:50 raspi node[28905]:   code: 500
Sep 23 17:54:50 raspi node[28905]: }
Sep 23 17:54:50 raspi node[28905]: 38fcc81c-01cb-4eba-bc6d-fd36134c1f01 192.168.0.10 - - [23/Sep/2021:15:54:50 +0000] "GET /balance HTTP/1.1" 304 - "-" "BlueWallet/625 CFNetwork/1240.0.4 Darwin/20.6.0"
Sep 23 17:54:50 raspi node[28905]: 2021-09-23T15:54:50.091Z : info: [/gettxs] : ["1a0568fc-d2d8-47d5-b260-2f5beae45337"]
Sep 23 17:54:50 raspi node[28905]: 2021-09-23T15:54:50.093Z : info: [/gettxs] : ["1a0568fc-d2d8-47d5-b260-2f5beae45337","userid: b675b155aad21625265d760bbcc384e8d4cd289bfd5c91c9"]
Sep 23 17:54:50 raspi node[28905]: listtransactions error: Error: {"result":null,"error":{"code":-18,"message":"Requested wallet does not exist or is not loaded"},"id":"89eec7cf-37ba-44f2-b20d-8203e9a84756"}
Sep 23 17:54:50 raspi node[28905]:     at IncomingMessage.<anonymous> (/home/bitcoin/LndHub/build/node_modules/jayson/lib/client/http.js:78:23)
Sep 23 17:54:50 raspi node[28905]:     at IncomingMessage.emit (node:events:406:35)
Sep 23 17:54:50 raspi node[28905]:     at endReadableNT (node:internal/streams/readable:1343:12)
Sep 23 17:54:50 raspi node[28905]:     at processTicksAndRejections (node:internal/process/task_queues:83:21) {
Sep 23 17:54:50 raspi node[28905]:   code: 500
Sep 23 17:54:50 raspi node[28905]: }
Sep 23 17:54:50 raspi node[28905]: 1a0568fc-d2d8-47d5-b260-2f5beae45337 192.168.0.10 - - [23/Sep/2021:15:54:50 +0000] "GET /gettxs?limit=10&offset=0 HTTP/1.1" 304 - "-" "BlueWallet/625 CFNetwork/1240.0.4 Darwin/20.6.0"
Sep 23 17:54:50 raspi node[28905]: 2021-09-23T15:54:50.114Z : info: [/getpending] : ["564c7cdf-d576-4852-8c42-04c640e76f71"]
Sep 23 17:54:50 raspi node[28905]: 2021-09-23T15:54:50.116Z : info: [/getpending] : ["564c7cdf-d576-4852-8c42-04c640e76f71","userid: b675b155aad21625265d760bbcc384e8d4cd289bfd5c91c9"]
Sep 23 17:54:50 raspi node[28905]: listtransactions error: Error: {"result":null,"error":{"code":-18,"message":"Requested wallet does not exist or is not loaded"},"id":"4f902315-67cd-4193-bc2c-3d7ec804b046"}
Sep 23 17:54:50 raspi node[28905]:     at IncomingMessage.<anonymous> (/home/bitcoin/LndHub/build/node_modules/jayson/lib/client/http.js:78:23)
Sep 23 17:54:50 raspi node[28905]:     at IncomingMessage.emit (node:events:406:35)
Sep 23 17:54:50 raspi node[28905]:     at endReadableNT (node:internal/streams/readable:1343:12)
Sep 23 17:54:50 raspi node[28905]:     at processTicksAndRejections (node:internal/process/task_queues:83:21) {
Sep 23 17:54:50 raspi node[28905]:   code: 500
Sep 23 17:54:50 raspi node[28905]: }
Sep 23 17:54:50 raspi node[28905]: 564c7cdf-d576-4852-8c42-04c640e76f71 192.168.0.10 - - [23/Sep/2021:15:54:50 +0000] "GET /getpending HTTP/1.1" 304 - "-" "BlueWallet/625 CFNetwork/1240.0.4 Darwin/20.6.0"
Sep 23 17:54:50 raspi node[28905]: 2021-09-23T15:54:50.134Z : info: [/getuserinvoices] : ["09046074-c9c2-4145-b267-5c3cb13ed232"]
Sep 23 17:54:50 raspi node[28905]: 2021-09-23T15:54:50.136Z : info: [/getuserinvoices] : ["09046074-c9c2-4145-b267-5c3cb13ed232","userid: b675b155aad21625265d760bbcc384e8d4cd289bfd5c91c9"]
Sep 23 17:54:50 raspi node[28905]: 09046074-c9c2-4145-b267-5c3cb13ed232 192.168.0.10 - - [23/Sep/2021:15:54:50 +0000] "GET /getuserinvoices HTTP/1.1" 304 - "-" "BlueWallet/625 CFNetwork/1240.0.4 Darwin/20.6.0"
Sep 23 17:55:16 raspi node[28905]: updateLightning()
Sep 23 17:55:16 raspi node[28905]: updated
Sep 23 17:56:16 raspi node[28905]: updateLightning()
Sep 23 17:56:16 raspi node[28905]: updated

While redis-cli clearly knows this account:


127.0.0.1:6379> keys *
 1) "userid_for_b0c65e59a7a12205706136f488eaf0ca4d9cd44f"
 2) "userid_for_aafc93a374e8afbb8d79c53b83b7a0731c2a8f7e"
 3) "userid_for_75b74b60350739f19a41ab7738960144994b4a8c"
 4) "bitcoin_address_for_b675b155aad21625265d760bbcc384e8d4cd289bfd5c91c9"
 5) "user_de7fa6be101f7f3678ba_ee34931db7e2ba0b760702f012638cdde53b2a388e85a058775f16559407e3cb"
 6) "userid_for_181f6966c24ba017cb4062e205cb2436f461fc9a"
 7) "balance_for_b675b155aad21625265d760bbcc384e8d4cd289bfd5c91c9"
 8) "refresh_token_for_b675b155aad21625265d760bbcc384e8d4cd289bfd5c91c9"
 9) "access_token_for_b675b155aad21625265d760bbcc384e8d4cd289bfd5c91c9"
10) "metadata_for_b675b155aad21625265d760bbcc384e8d4cd289bfd5c91c9"
127.0.0.1:6379>
``
Overtorment commented 2 years ago

@MG-ng heres your problem:

"result":null,"error":{"code":-18,"message":"Requested wallet does not exist or is not loaded"},"id":"cb3e4d1a-a144-4f62-b8fe-586883753c20"}

bitcoin core is misconfigured in lndhub

MG-ng commented 2 years ago

Ahh, okay, thank you very much. I will try out a different config 👍

MG-ng commented 2 years ago

Like it's said here the /wallet/wallet.dat was causing the error.

Additionally I didn't even have a bitcoind wallet (only a LND one), so I created one.

bitcoin-cli -rpcuser=uuu -rpcpassword=ppp -rpcconnect=x.x.x.x listwallets writing the output wallet name in, solved the error! Thanks!

20a8vnf30 commented 1 year ago

[FIXED, edit for future reference] [The problem was having a bitcoind section in the config.js at all, removing it an refreshing Bluewallet made the LN balance update right away]

I'm having the same issue and was unable to solve it with the info in this thread. Refill does not increase the available Lightning sats in Bluewallet. I'm running LNDhub 1.4.1, LND 0.15.4, Bitcoind 24.0, Electrumx 1.16.0 and Bluewallet 6.3.2.

The LND has channels with a few million sats in capacity, Bluewallet is connected to my own LNDhub and Electrumx server through a domain name I own so I can use https. It generally works for doing LN payments and receiving LN payments.

However when I use the refill option the LN balance in Bluewallet is not increased even after 3+ confirmations. When paying the refill address I can see the output appear through lncli -listunspent, and the LND onchain balance increased accordingly.

The bitcoind has a default wallet loaded and the LNDhub log is not throwing any errors when I refresh Bluewallet. There must be some fault in my settings, this is what I use, passwords are redacted.

lndhub/config.js

"use strict";

let config = {
  enableUpdateDescribeGraph: false,
  postRateLimit: 100,
  rateLimit: 200,
  forwardReserveFee: 0.0, // default 0.01
  intraHubFee: 0.0, // default 0.003
  bitcoind: {
    rpc: 'http://[REDACTED]:[REDACTED]@127.0.0.1:8332',
  },
  redis: {
    port: 6379,
    host: '127.0.0.1',
    family: 4,
    password: '[REDACTED]',
    db: 0
  },
  lnd: {
    url: '127.0.0.1:10009',
    password: ''
  }
};

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

module.exports = config;

What am I doing wrong?