Commit graph

6679 commits

Author SHA1 Message Date
Nodari Chkuaselidze
46f099f111
wallet: add getBlockHeader method to node and nullclients. 2024-09-10 16:08:08 +04:00
Nodari Chkuaselidze
66ebb3bb4b
wdb: Update wdb version and fix txdb layout.x 2024-09-04 16:42:44 +04:00
Nodari Chkuaselidze
6aeceed719
wdb: Add timeCache to the interactive rescan callback.
test: fix NodeContext usage and update tests.
2024-08-29 15:36:25 +04:00
Nodari Chkuaselidze
de79842af1
wallet-rpc: add new methods for listing history.
wallet-rpc: The following new methods have been added:
  - `listhistory` - List history with a limit and in reverse order.
  - `listhistoryafter` - List history after a txid _(subsequent pages)_.
  - `listhistorybytime` - List history by giving a timestamp in epoch seconds
    _(block median time past)_.
  - `listunconfirmed` - List unconfirmed transactions with a limit and in
    reverse order.
  - `listunconfirmedafter` - List unconfirmed transactions after a txid
    _(subsequent pages)_.
  - `listunconfirmedbytime` - List unconfirmed transactions by time they
    where added.

wallet-rpc: The following methods have been deprecated:
  - `listtransactions` - Use `listhistory` and the related methods and the
    `after` argument for results that do not shift when new blocks arrive.

wallet: Remove getHistory and related methods form wallet and txdb.
2024-08-29 14:15:49 +04:00
Nodari Chkuaselidze
c6c495ed9d
test: use nodeCtx in wallet rpc. 2024-08-29 14:15:48 +04:00
Nodari Chkuaselidze
062d1f6d6b
wallet: deprecate getLast and getRange. Update hsw-cli history and
pending.

hsw-cli:
  - hsw-cli: `history` now accepts new args on top of `--account`: `--reverse`,
    `--limit`, `--after`, `--after`.
  - hsw-cli: `pending` now accepts new args, same as above.

wallet-http:
  - Deprecate and remove: `GET /wallet/:id/tx/range`
  - Deprecate and remove: `GET /wallet/:id/tx/last`
2024-08-29 14:15:47 +04:00
Nodari Chkuaselidze
671494d2db
wallet-http: Update getPending, change parameters and add pagination. 2024-08-29 14:15:45 +04:00
Nodari Chkuaselidze
dc2471c6dd
wallet-http: Change parameters for getHistory and add pagination. 2024-08-29 14:12:27 +04:00
Nodari Chkuaselidze
0f08c66fe2
wallet: switch zap to new indexes. 2024-08-29 14:11:29 +04:00
Nodari Chkuaselidze
4c11a5cfa3
wdb: Pass mtime to the TXRecord.
test: Add tests for the wallet.zap.
2024-08-29 14:10:36 +04:00
Nodari Chkuaselidze
40f7d7fd40
wdb: Add tx history queries for the count and time indexes.
Co-authored-by: Braydon Fuller <courier@braydon.com>
2024-08-29 13:58:43 +04:00
Nodari Chkuaselidze
eb610d8b97
wdb-txdb: Add pagination indexes.
HSD: https://github.com/handshake-org/hsd/pull/888
BCOIN: https://github.com/bcoin-org/bcoin/pull/605

Co-authored-by: Braydon Fuller <courier@braydon.com>
2024-08-29 13:52:05 +04:00
Nodari Chkuaselidze
63776fc1f1
wdb: pass tx index and median time to addTX. 2024-08-29 13:43:27 +04:00
Nodari Chkuaselidze
666c4124fa
wdb: add median time past. 2024-08-29 13:35:19 +04:00
Nodari Chkuaselidze
f233b76a96
walletdb: Write time with blockmeta record. Update wdb version to 3.
This requires full wdb block entry wipe and rescan. That is handled by
PR #889. `layout.h` is looked up by height, so only missing data was
time. Now we can implement walletdb only median time past calculation.
2024-08-29 13:33:27 +04:00
Nodari Chkuaselidze
c38e4b9298
chain: add getEntries, similar to getHashes. 2024-08-29 13:31:02 +04:00
Nodari Chkuaselidze
b01c806758
node-http: Add get median time to node http. 2024-08-29 13:30:39 +04:00
Nodari Chkuaselidze
5294be7eb8
Merge PR #896 from 'nodech/update-bidreveal-entries' 2024-08-29 12:12:29 +04:00
Nodari Chkuaselidze
fd2e57a761
test: fix wallet test case for bidreveal. 2024-08-28 15:46:35 +04:00
Nodari Chkuaselidze
3ae22968fd
pkg: update CHANGELOG. 2024-08-28 13:28:27 +04:00
Nodari Chkuaselidze
fb7ae46cfe
wdb: Migrate bid-reveals.
- Recover bid heights from the TXRecords. Historical not-owned bids will
    have them default (-1) for the migration, as TXRecords for them are not
    recorded.
  - Link owned bid <-> reveals. Historical not-owned bids will have them
    default (null outpoint) for the migration, as TXRecords for them are
    not recorded.
2024-08-28 13:27:43 +04:00
Nodari Chkuaselidze
1109b627b6
txdb: Add bid and reveal mapping.
bid: Add height to the bid entries.
2024-08-28 13:23:27 +04:00
Nodari Chkuaselidze
e88734fb75
Merge PR #901 from 'nodech/mtx-fund-2' 2024-08-27 23:28:43 +04:00
Nodari Chkuaselidze
d754b86386
Merge PR #899 from 'nodech/fix-methods' 2024-08-27 18:17:19 +04:00
Nodari Chkuaselidze
b010abce51
wallet-client: rename createAuctionTxs to createAuctionTXs.
Make style consistent for methods and variables.
2024-08-27 17:32:12 +04:00
Nodari Chkuaselidze
ceab2a817f
Merge PR #900 from 'nodech/update-migrations' 2024-08-27 17:27:14 +04:00
Nodari Chkuaselidze
6cf9817fb1
wdb: use encoding functions in migrations, when original encoder also uses them. 2024-08-27 17:20:51 +04:00
Nodari Chkuaselidze
1cebcd3b08
chain-test: update migrate tree state migration. 2024-08-26 18:50:36 +04:00
Nodari Chkuaselidze
e9a52896be
chain-test: update blockstore migration. 2024-08-26 18:50:35 +04:00
Nodari Chkuaselidze
bdb2464773
chain-test: update chainstate migration and remove chaindb methods. 2024-08-26 18:50:34 +04:00
Nodari Chkuaselidze
34f2949050
chaindb: move chaindb records to records file. 2024-08-26 18:50:33 +04:00
Nodari Chkuaselidze
ebe648f6d9
chain-test: change initial change migration to be selfcontained. 2024-08-26 18:50:32 +04:00
Nodari Chkuaselidze
c5dfced233
wdb-test: rename lookahead migration data. 2024-08-26 18:50:31 +04:00
Nodari Chkuaselidze
006aa97888
wdb: make recalculateTXDB post migration work. 2024-08-26 18:50:30 +04:00
Nodari Chkuaselidze
f263a4dfe8
wdb: use layout back up instead of wdb layout. Generate migration data. 2024-08-26 18:50:29 +04:00
Nodari Chkuaselidze
aa4a1f84b6
wdb: fix change address migration for hsd v2.1.3 and before nodes. 2024-08-26 18:50:27 +04:00
Nodari Chkuaselidze
ce7dc581b1
wdb: fix initial migrations. 2024-08-26 18:28:35 +04:00
Nodari Chkuaselidze
15e9b8ff31
mtx: coinselection - try to resolve input coins from coinview first. 2024-08-26 17:14:58 +04:00
Nodari Chkuaselidze
9ddb69e2b6
Merge PR #883 from 'nodech/wallet-interactive-rescan' 2024-08-20 15:43:43 +04:00
Nodari Chkuaselidze
f46192d3a6
test: Change nodes-context seed ports.
Add stack traces to common test helper timeouts.
Change default timeout to 2000.
2024-08-20 15:36:33 +04:00
Nodari Chkuaselidze
38efb06904
wallet: Use interactive scan on initial sync and rescan.
Check issue #872
2024-08-20 15:36:30 +04:00
Nodari Chkuaselidze
57194f4cd6
http: interactive rescan will now throw on socket.call similar to rescan. 2024-08-20 15:33:49 +04:00
Nodari Chkuaselidze
c8592d121d
wallet: Fix node client interface for hooks.
bsock hooks that nodeclient tries to imitate, are handlers set on
specific event. They are expected to return results to the caller.
2024-08-20 15:33:48 +04:00
Nodari Chkuaselidze
81821ff17a
wallet: add filterUpdated to wallet.add, wdb.addTX and wdb.addBlock. 2024-08-20 15:33:47 +04:00
Nodari Chkuaselidze
4d9127dfb8
test: add rescan and addBlock tests when addresses are gapped. 2024-08-20 15:33:46 +04:00
Nodari Chkuaselidze
a405ea9009
wdb: Add sanity checks to the wdb.addBlock.
wdb/client: fix standalone ChainEntry deserialization and add prevBlock.
2024-08-20 15:33:45 +04:00
Nodari Chkuaselidze
1cf623c804
test: add standalone wallet and alternate chain rescan test for wallet. 2024-08-20 15:33:44 +04:00
Nodari Chkuaselidze
0632bb5027
wdb: add reorg guard in disconnect. 2024-08-20 15:33:43 +04:00
Nodari Chkuaselidze
8affe9570d
node: add fullLock option to the interactive rescan.
Interactive rescan by default does per block scan lock. This enables
parallel rescans, as well as chain sync while rescan is in progress. But
in specific cases, it may be more beneficial to stop the node from
syncing while the rescan is in progress.
2024-08-20 15:33:42 +04:00
Nodari Chkuaselidze
dcafb2046b
wallet: WalletNode now emits 'open' and 'close' events.
wallet-node: fix standalone wallet get entry requests when entry is not found on
chain.
client: expose Wallet class.
2024-08-20 15:33:41 +04:00