1
0
mirror of https://github.com/romanz/electrs.git synced 2024-11-19 09:54:09 +01:00
Commit Graph

28 Commits

Author SHA1 Message Date
Roman Zeyde
87752803ae
Allow setting RocksDB log directory
Following https://github.com/romanz/electrs/issues/680#issuecomment-1824841535.
2023-11-24 16:16:31 +02:00
Roman Zeyde
3c6028ed4d
Return first txid-matching transaction (#933) 2023-09-01 16:27:42 +03:00
Riccardo Casatta
acb49973f6
Optimize index querying via bitcoin_slices (#913)
Co-authored-by: Roman Zeyde <me@romanzey.de>
2023-08-22 20:46:53 +03:00
Roman Zeyde
59143fdd7c
Allow exiting mempool sync on SIGINT (#917) 2023-08-15 20:46:10 +03:00
Roman Zeyde
ca2841f432 Fix txid index collision handling 2022-01-09 20:48:34 +02:00
Roman Zeyde
d68869a962 Support basic RPC handling during initial sync
Following https://github.com/romanz/electrs/issues/534#issuecomment-935982984
2021-11-19 08:52:19 +02:00
Roman Zeyde
8c28579ea9 Drop cache_merkle_proofs configuration
https://github.com/romanz/electrs/pull/610#issuecomment-962973917
2021-11-08 12:45:27 +02:00
Roman Zeyde
2d09854f9d Allow skipping merkle proofs' during subscription
We still support them (by computing them on-demand) and caching them with `--cache-merkle-proofs`.

Also, don't compute block's txids if we don't cache merkle proofs during subscription

3ce23ae01e (r59562642)
2021-11-07 16:41:19 +02:00
Roman Zeyde
f4afe88464 Collect RPC events into batches
Related to https://github.com/romanz/electrs/issues/464
2021-10-26 13:09:03 +03:00
Roman Zeyde
121a4bcc91 Re-introduce mempool vsize and txs' count metrics' -m Fixes 2021-10-15 10:51:05 +03:00
Roman Zeyde
e4256a0d2f Rename fee histogram struct 2021-10-15 10:45:14 +03:00
Roman Zeyde
2a10f5fd99 Allow reindexing last blocks, mainly for sync logic testing
Also, added clippy exception for:
```
warning: the function has a cognitive complexity of (26/25)
   --> ./electrs/target/release/build/electrs-600a795995255594/out/configure_me_config.rs:453:9
    |
453 | /         pub fn merge_args<I: IntoIterator<Item=::std::ffi::OsString>>(&mut self, args: I) -> Result<impl Iterator<Item=::std::ffi::OsString>, super::Error> {
454 | |             let mut iter = args.into_iter().fuse();
455 | |             self._program_path = iter.next().map(Into::into);
456 | |
...   |
571 | |             Ok(None.into_iter().chain(iter))
572 | |         }
    | |_________^
    |
    = note: `#[warn(clippy::cognitive_complexity)]` on by default
    = help: you could split it up into multiple smaller functions
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cognitive_complexity
```
2021-10-11 11:10:23 +03:00
Roman Zeyde
8b9d412fb8 Fix duplicate history computation
Also, simplify the relevant code a bit.
2021-10-04 11:02:48 +03:00
Roman Zeyde
f5bd245569 Close index DB if interrupted during initial sync
It should allow resuming initial sync (fixing #494).
2021-09-23 17:40:14 +03:00
Roman Zeyde
c7133dd9e7 Refactor index_batch_size usage 2021-09-23 17:40:14 +03:00
Martin Habovstiak
577f54195b Auto reindex when old database is detected
This implements automatic reindexing of old database, turned on by
default. When an old database is detected and `auto_reindex` is turned
on the database will be destroyed so that `electrs` can re-sync. The
user can still turn this off to check db format.

The help message says "or inconsistent" - this is not implemented but we
could in the future and it seems reasonable to explicitly state that
this option will control that thing as well.

Note: 0.8.x versions of `electrs` didn't contain format information -
so we check if the database is empty and assuming it's legacy if it's
not empty but without format information.

The code is also restructured a bit and a few tests are added.
2021-09-17 15:20:54 +03:00
Roman Zeyde
0a04888673 Implement 'blockchain.scripthash.listunspent' RPC
Following #475
2021-09-17 14:01:15 +03:00
Roman Zeyde
844723f5f4 Simplify 'blockchain.scripthash.get_balance' implementation 2021-09-15 20:50:57 +03:00
Roman Zeyde
8d12df353c Use try_from for explicit type conversion (instead of try_into) 2021-09-12 16:22:32 +03:00
Roman Zeyde
3090866fdd Drop helper binaries and some APIs 2021-09-08 19:14:44 +03:00
Roman Zeyde
31765e3e49 Limit index lookups to prevent DoS for "popular" addresses 2021-08-21 18:25:31 +03:00
Roman Zeyde
27e7541644 Rename scripthash status 2021-08-13 20:34:32 +03:00
Roman Zeyde
2ab5fb1da6 Use HistoryEntry instead of {Confirmed,Mempool}Entry
Should simplify JSON serialization and height computation.
2021-08-13 20:34:14 +03:00
Roman Zeyde
2510531d16 Fixup some nightly clippy lints 2021-07-20 18:56:43 +03:00
Roman Zeyde
c754485320 Add blockchain.scripthash.get_balance RPC 2021-07-04 18:30:23 +03:00
Roman Zeyde
23c775fb47 Don't fail on mempool sync errors 2021-06-04 12:49:37 +03:00
Roman Zeyde
d1d6db450c Allow disabling mempool sync 2021-05-08 11:14:12 +03:00
Roman Zeyde
3780d7d48b Refactor and sync using p2p protocol 2021-04-14 18:38:59 +03:00