satstack icon indicating copy to clipboard operation
satstack copied to clipboard

Account scan repeating

Open dannuttall opened this issue 3 years ago • 24 comments

When setting up Satstack for the first time, after it syncs, it then runs an "account scan". After reaching 100% on the account scan it just repeats. It's taking a very long time! Is this normal? Does it need to repeat for each account (there's only 4 on my ledger)? Maybe I'm just being impatient, but if it does need to repeat for each account, the instructions don't mention it so it's not obvious.

dannuttall avatar Oct 31 '22 11:10 dannuttall

Ledger Live seems to add 10 accounts for every single script type to the config. So it'll run through all of them and take quite a long time.

It doesn't persist between lss launches, not sure if this is the intended behavior. It will repeat the process in its entirety with every lss service restart / reboot.

SkanderHelali avatar Nov 01 '22 22:11 SkanderHelali

It's now been running for 48 hours, each account scan repeat takes 4hrs 30mins so that's over 10 scans so I'm assuming there's an issue here.

Steps to reproduce:

  1. Running raspiblitz on a rp4 on my local network.
  2. Running Ledger Live on my desktop on the same network.
  3. Node connection from Ledger live successful.
  4. Downloaded SatStack to a folder on my desktop.
  5. Run lss via command prompt (as administrator) and the descriptor import begins.
  6. No lss.json file is created as far as I can tell (unless it's created elsewhere), so no descriptors are being saved so I'm assuming that's where the issue lies? Just guessing after reviewing issue #86

dannuttall avatar Nov 02 '22 10:11 dannuttall

hi @dannuttall if you use Ledger Live to generate the lss.json, please locate it and use it.

adrienlacombe avatar Nov 02 '22 10:11 adrienlacombe

@adrienlacombe-ledger ok I found it in the appdata folder. What do you mean by "use it"? Looking at the json file, it lists 44 accounts. 11 beginning "wpkh", "tr", "sh" and "pkh". (not sure what they mean). I only have the one bitcoin account in ledger live so not sure why there's so many. Does this mean I should input 44 (or 11?) accounts into the setup before scanning for accounts?

dannuttall avatar Nov 02 '22 10:11 dannuttall

@adrienlacombe-ledger Ledger Live adds 10/11 accounts for every script type in the conf regardless of how many accounts you select during setup.

And once all of them are imported after an eternity; the process has to repeat all over again with every lss restart.

SkanderHelali avatar Nov 02 '22 14:11 SkanderHelali

ok @dannuttall @SkanderHelali please edit the file manually to keep it simple, pkh is for legacy, sh for segwit, wpkh for native segwit and tr for taproot, feel free to delete what's not needed.

adrienlacombe avatar Nov 02 '22 14:11 adrienlacombe

@adrienlacombe-ledger just noticed in the readme that the "simple" way won't work if the node is behind Tor (which mine is), so I suspect that's where my issue lies, even if I delete the unnecessary stuff from the lss.json file, unless Tor is now supported via the simple route?

dannuttall avatar Nov 02 '22 14:11 dannuttall

@dannuttall good catch! No, it is not, you would need to edit the file manually as explained in the advanced part.

adrienlacombe avatar Nov 02 '22 16:11 adrienlacombe

Is someone able to explain what is supposed to happen with SatStack - I have just one TR account in lss.json and the "Account scan in progress" message reaches 100% and then just starts again with lss just spitting out endless 200 success REST calls to /blockchain/v3/explorer/status in 7 call blocks with an "Importing descriptors" message in between.

plk avatar Nov 06 '22 17:11 plk

is Ledger Live stating that it is synchronized successfully @plk ?

adrienlacombe avatar Nov 06 '22 17:11 adrienlacombe

@adrienlacombe-ledger - No, it just reaches 100% and starts again from 0% ... I am just now trying the manual approach using the descriptors returned from getdescriptor and a much more recent birthday value in lss.json

Or do you mean the usual green "synchronised" check at the top of the app? That's green and fine - it's the "Account scan in progress" thing in the experimental features|bitcoin full node that seems to go in a circle, confirmed by the terminal output of lss which seems to just go back to 0% and continues making the same REST calls.

plk avatar Nov 06 '22 17:11 plk

Update - same thing with manual getdescriptor generated lss.json. With a more recent birthday setting, it was much faster but it still got to 100% and then just started again immediately at 0%.

plk avatar Nov 06 '22 18:11 plk

ok, I meant the check indeed. The REST calls are made by Ledger Live, not satstack. If you leave aside the experimental features screen, can you add Bitcoin accounts in Ledger Live?

adrienlacombe avatar Nov 06 '22 18:11 adrienlacombe

Ah, it did finished after a few 0-100% runs and now says "Ready". My bitcoin accounts are still in LL - they were not removed but the sync sign in the "accounts" pane is a little DB icon and checkmark instead of just a checkmark - does this mean they are connected via my node or do I have to remove and re-add? According to the docs, it seems that the accounts should have been removed and I need to re-add ...

plk avatar Nov 06 '22 18:11 plk

No need to remove and re-add. The doc assumed you started with 0 account but in your case you should be good to go to start using LL while enjoying not doxxing your txs to Ledger :)

adrienlacombe avatar Nov 06 '22 18:11 adrienlacombe

Hmm, I removed and re-added before I saw this and it found the accounts but they report 0 balance?

plk avatar Nov 06 '22 19:11 plk

if the account has a positive balance it could mean that the descriptors use a different scheme and/or there are sync issues.

adrienlacombe avatar Nov 06 '22 19:11 adrienlacombe

Presumably I can switch back to the Ledger explorer anyway and re-add?

plk avatar Nov 06 '22 19:11 plk

Seems fine with the ledger explorer, just my node shows an empty balance for the account. I used the descriptor from the manual script output.

plk avatar Nov 06 '22 19:11 plk

Are you sure you are on the same scheme?

adrienlacombe avatar Nov 06 '22 19:11 adrienlacombe

By scheme you mean Segwit/Taproot etc.? I am only trying to sync the taproot account which works fine with Ledger explorers.

plk avatar Nov 06 '22 19:11 plk

Correct, ok, this is strange then.

adrienlacombe avatar Nov 06 '22 19:11 adrienlacombe

When I try to sync the taproot account via SatStack, I see the REST requests being made from LL but the balance remains 0. Delete, disable full-node connectivity, re-add via LL nodes - all fine. Using latest full node (22.0), SatStack and LL.

plk avatar Nov 06 '22 19:11 plk

I think I am a bit confused as to what is in the lss.json - Adding accounts seems to find a few (I had some Segwit etc., now empty) but there is only the taproot account in lss.json. I set the birthday in lss.json to just before this TR account was created, which I assume is correct.

plk avatar Nov 06 '22 19:11 plk