Commit Graph

13 Commits

Author SHA1 Message Date
Braydon Fuller
fed7f2997b
Merge pull request #789 from bucko13/indexer-listeners
add ability to track listeners and remove them on close for indexer
2019-07-03 09:26:39 -07:00
Buck Perley
f4b74003c4
indexer: add ability to track listeners and remove them on close for indexer 2019-07-03 10:55:20 -05:00
Buck Perley
b14cd52070
indexer: move hasRaw check to txindexer 2019-07-03 10:51:08 -05:00
Braydon Fuller
34e8f22b9b
indexer: update and fix documentation 2019-05-16 10:25:58 -07:00
Braydon Fuller
ed06c2184d
indexer: check that blocks are connected
There was a rare case that a block could be incorrectly added to
the indexer if the indexer was disabled during a reorg to a height
that matched the height that was expected, and the `sync` method
for the indexer wasn't called that would detect the reorg.
2019-05-15 12:11:37 -07:00
Braydon Fuller
cede31d86f
indexer: cleanup and check pruned and index options 2019-05-15 12:11:37 -07:00
Braydon Fuller
5d18f9ba2e
indexer: index the genesis block 2019-05-15 12:11:37 -07:00
Braydon Fuller
efb2551555
indexer: fix reset and reorg handling 2019-05-15 12:11:37 -07:00
Braydon Fuller
fae647b9e9
indexer: simplify block meta and remove records 2019-05-15 12:11:05 -07:00
Braydon Fuller
93c6ff845e
indexer: fix, simplify and rewrite indexer base
- Write indexer state and index atomically.
- Simplify chain state with current height.
- Roll forward to best height.
- Synchronize the index with the chain with common method `sync` for
  the events 'connect', 'disconnect' and 'reset'. This will prevent
  any of the events from conflicting with each other.
- Fix the chain rollback and reset.
- Make sure blocks are connected in the correct order.
- Improve logging to log similar to chain.
2019-05-15 12:02:50 -07:00
Braydon Fuller
8bff122253
indexer: use chain and blocks for indexer, remove chain client 2019-05-15 12:02:47 -07:00
Braydon Fuller
f9aab08c46
indexer: add block position to tx 2019-05-15 12:02:47 -07:00
Javed Khan
05794f5cb3
indexer: add module indexer
module indexer introduces a extensible architecture for indexing the
chain. It provides a base class which handles syncing with the chain,
handling re-orgs, interruptions, dynamic toggling, etc. TXIndexer
and AddrIndexer are provided for indexing transactions and addresses,
using the same flags as before i.e --index-tx and --index-address.
Indexes are stored in a different database and can be maintained
independently of the chain.
2019-05-15 12:02:41 -07:00