Commit graph

33 commits

Author SHA1 Message Date
Roman Zeyde
0fe14fdfd9 Switch to bindex
Some checks failed
electrs / Build (push) Has been cancelled
electrs / Build-1 (push) Has been cancelled
electrs / Build-2 (push) Has been cancelled
electrs / Integration (push) Has been cancelled
2026-05-31 17:53:21 +02:00
Roman Zeyde
c134d64d56 Revert "Support Unix sockets"
This reverts commit 898e57dcdd.
2026-05-10 09:17:14 +02:00
Martin Habovstiak
898e57dcdd Support Unix sockets
Unix sockets provide better security and performance, so it is natural
for electrs to want to support them. Because of how similar they are to
TCP sockets the required changes are theoretically small. However, there
is no crate I know of that provided the abstract API, so I made one.

I originally only wanted to support electrum RPC but it turns out not
having to deal with two sets of `SocketAddr` is easier and it wasn't too
difficult. Unix socket was already supported by `tiny_http` via their
own abstraction and we have no other dependencies requiring TCP.

Because this also required modifying the logic around publishing the
electrum address I added an option to set it explicitly regardless of
whether the user is dealing with Unix or TCP socket because having this
is useful for TCP too - the user might want to publish a different port
number if the port was mapped via NAT or a different address when
tunnelled. In theory, this is still not perfect because the same server
could be tunnelled multiple times but we don't bother with such edge
case until someone requires it.

Another side improvement is reporting if the accept thread ends because
of incoming stream ending rather than error. This should never happen
but is useful for debugging if it ever does.
2026-05-03 20:27:31 +02:00
Roman Zeyde
9d95b13cd9
Merge branch '2025-12-23-magic' 2025-12-27 13:26:51 +01:00
Torkel Rogstad
d846cc7565
multi: expose configurable magic on non-signet
There's no point in limiting this option to signet only. Allowing this
flag to be set outside of signet networks lets electrs be used for
custom testing networks that aren't signets.
2025-12-24 10:33:37 +01:00
Roman Zeyde
ed6f38f476
Allow concurrent DB background operations for SSDs
Full compactions can be done much faster when running with `db_parallelism=8`.
2024-12-31 10:09:35 +02:00
Roman Zeyde
0f5f52e7dd
Support testnet4 (#1104)
Following rust-bitcoin/rust-bitcoin#3453
2024-10-29 21:34:00 +02:00
Roman Zeyde
4f76c630e9
Use Option<> for 'db_log_dir' config
Following https://github.com/romanz/electrs/pull/959#discussion_r1405387423
2023-11-28 20:13:03 +02:00
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
Tobin C. Harding
b6271ba3af
Upgrade bitcoin
Upgrade dependencies required to use the recently released
`rust-bitcoin v0.31.0` release.

Co-authored-by: Roman Zeyde <me@romanzey.de>
2023-11-15 20:31:09 +02:00
Roman Zeyde
f3ef48fea5
Allow not waiting for block download before sync (#888)
Fix #410
2023-06-06 20:23:51 +03:00
hazrulnizam
174f2f0cf4
Fix typo in config_specification.toml (#883)
Changed regtest to signet.
2023-05-29 20:00:06 +03:00
Sosthene00
9a32c77254 Takes signet magic in hex as in bitcoin core logs 2022-09-05 23:15:52 +02:00
Sosthene00
ad864bf8af Add signet-magic to config 2022-08-11 15:42:36 +02:00
Roman Zeyde
dd9a7db081
Merge pull request #686 from Kixunil/skip-default-conf-files
Use configure_me to skip default config files
2022-02-21 23:12:04 +02:00
Martin Habovstiak
081f70323c Use configure_me to skip default config files
This removes the feature for skipping default config files and replaces
it with a configure_me implementation.

Closes #217
2022-02-17 19:10:45 +01:00
Roman Zeyde
e5047a0b10 Disable index_lookup_limit by default 2021-12-04 10:42:01 +02:00
Roman Zeyde
cbdca8c266 Allow setting logging filters via configuration
Similar to `RUST_LOG` environment variable.
2021-11-08 19:46:31 +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
Otto Sabart
6e4dd1575b
Add version command line argument 2021-11-07 21:51:37 +01: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
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
a552a2bb2d Allow disabling Electrum RPC while continuing indexing 2021-10-09 13:49:56 +03:00
Roman Zeyde
34a8549d2e Fix description
Fix https://github.com/romanz/electrs/issues/516
2021-09-30 13:58:49 +03:00
Roman Zeyde
8285cf3fc7 Allow configuration of JSON-RPC timeout
Following https://github.com/romanz/electrs/issues/495.

Also, fix https://github.com/romanz/electrs/issues/443.
2021-09-23 17:21:57 +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
f5df00f631 Allow single-sync invocation using --sync-once commandline flag 2021-09-11 11:01:05 +03:00
Roman Zeyde
1008641838 Increase default index_lookup_limit to 200
Otherwise it fails when mining >100 regtest blocks to the same address.
2021-08-27 12:23:30 +03:00
Roman Zeyde
31765e3e49 Limit index lookups to prevent DoS for "popular" addresses 2021-08-21 18:25:31 +03:00
Roman Zeyde
95134a5157 Drop unused command-line parameters 2021-08-18 17:24:14 +03:00
Roman Zeyde
1d4ab4f325 Remove unused configuration parameters 2021-05-26 15:18:55 +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