dgarage / NBXplorer

NBitcoin Explorer
MIT License
320 stars 211 forks source link

Help with rescan on a btc node #404

Closed bitcoinbrisbane closed 4 months ago

bitcoinbrisbane commented 1 year ago

I've had to resetup NBXplorer against a full node. However, I cant rescan to get old txs.

Then try rescan:

./run.sh --chains=btc --btcrescan --btcstartheight=500000

Has the result

info: Configuration:  Data Directory: /root/.nbxplorer/Main
info: Configuration:  Configuration File: /root/.nbxplorer/Main/settings.config
info: Configuration:  Network: Mainnet
info: Configuration:  Supported chains: BTC
info: Configuration:  DBCache: 50 MB
info: Configuration:  Network: Mainnet
info: Configuration:  Supported chains: BTC
info: Configuration:  DBCache: 50 MB
info: NBXplorer.DatabaseSetup: Postgres services activated
info: NBXplorer.Indexer.BTC: TCP Connection succeed, handshaking...
Hosting environment: Production
Content root path: /root/NBXplorer/NBXplorer/bin/Release/net6.0/
Now listening on: http://x.x.x.x:24444
Application started. Press Ctrl+C to shut down.
info: NBXplorer.Indexer.BTC: Handshaked
info: NBXplorer.Indexer.BTC: Testing RPC connection to http://x.x.x.x:8332/
info: NBXplorer.Indexer.BTC: RPC connection successful
info: NBXplorer.Indexer.BTC: Full node version detected: 210000
info: NBXplorer.Indexer.BTC: NBXplorer is correctly whitelisted by the node
info: NBXplorer.Events: BTC: Node state changed: NotStarted => NBXplorerSynching
info: NBXplorer.Events: BTC: Node state changed: NBXplorerSynching => Ready
NicolasDorier commented 1 year ago

@bitcoinbrisbane try --btcrescan=1, that said, NBXplorer will probably be way too slow. imho you shouldn't rescan with it, and rather rescan utxout set (see the API) so you can restore the balance, utxos and make the rest working.

bitcoinbrisbane commented 1 year ago

@bitcoinbrisbane try --btcrescan=1, that said, NBXplorer will probably be way too slow. imho you shouldn't rescan with it, and rather rescan utxout set (see the API) so you can restore the balance, utxos and make the rest working.

Thanks for the fast reply as always. --btcrescan=1 didnt seem to work. There have been hundreds for txs from this xpubkey too.

If the utxout rescan doesnt work, ill try migrate the old dbtrie

bitcoinbrisbane commented 1 year ago

Update:

All seems fine, connects to the full node and postres. Now trying to import the old dbtrie following https://github.com/dgarage/NBXplorer/blob/master/docs/Postgres-Migration.md, but not seeing the balance. Seems to do it too quick.

./run.sh --automigrate=1
bitcoinbrisbane commented 1 year ago

Update 2:

This has allowed my to get the balances correctly. I'd still like to swap to Postgres as its a managed db, but cant seem to migrate.

bitcoinbrisbane commented 4 months ago

Going to close this issue.