From 51ac4a720bc44252917bc53dc1ac8c1ee5204e41 Mon Sep 17 00:00:00 2001 From: Javed Khan Date: Fri, 22 Mar 2019 16:57:56 -0700 Subject: [PATCH] changelog: add indexer to changelog --- CHANGELOG.md | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6821a499..7ba6922a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -112,6 +112,72 @@ for downloading the blocks again. - Updates to dependencies including `bcrypto` to version > 3. - Various small fixes to run bcoin in a browser. +## v1.x.x + +### Migration + +The chain indexing subsystem has been refactored to be more modular and +flexible. + +A migration is required to cleanup the old indexes, if present. + +``` bash +$ ./migrate/chaindb4to5.js ~/.bcoin/chain +``` + +**Note**: if enabled, tx and addr indexes will be regenerated by rescanning the +chain on next startup, this process might take a while. Please take the +potential downtime in re-indexing into account before upgrading. + +Indexing has been made extensible so that new indexers such as a filter index +for BIP 157 can be implemented easily. + +Users can toggle any indexing on/off anytime before or after the initial sync. +The indexer will start resyncing the chain state and replaying blocks to +process them for indexing. Once caught up, it will just index new blocks. + +An index can be dropped by just deleting the corresponding database. + +### Notable Changes + +- `__lib/indexer__` `Indexer` implements the base methods which are common to + all indexers, including setting up the database, handling chain events such + as new block etc. + +- By default, bcoin ships `TXIndexer`, `AddrIndexer` implementations. These + indexers preserve all the existing indexing functionality and can be enabled + via the same flags i.e. `--index-tx` `--index-address`, for compatibility. + +- `Indexer` emits a `chain tip` with `[tip]`, where tip is an instance of + `BlockMeta`, when it is caught up with the chain. + +- Database location can be configured via `--index-prefix` config option. + Default locations are `prefix` + `/index` e.g.: `~/.bcoin/testnet/index/tx`, + `~/.bcoin/testnet/index/addr`. + +- `__/lib/blockchain/chain__` - `getSpentView` accepts a `TXMeta` insted of `TX` + +- `__/lib/blockchain/chain__` - the following methods have been moved out of + the chain to the indexers. Using the methods on the chain is deprecated: + + `node.txindex` implements: + + + `getMeta(hash)` + + `getTX(hash)` + + `hasTX(hash)` + + `getSpentView(tx)` + + `node.addrindex` implements: + + + `getCoinsByAddress(addrs)` + + `getHashesByAddress(addrs)` + + The following methods require `getHashesByAddress` in conjunction with + `node.txindex.getTX` and `node.txindex.getMeta` respectively. + + + `getTXByAddress(addrs)` + + `getMetaByAddress(addrs)` + ## v1.0.0 ### Migration