Skip to content

Commit

Permalink
Update README and rename lib to mempool-electrs
Browse files Browse the repository at this point in the history
  • Loading branch information
junderw committed Oct 14, 2023
1 parent 18e041c commit 911ed78
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 69 deletions.
86 changes: 43 additions & 43 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
[package]
name = "electrs"
name = "mempool-electrs"
version = "3.0.0-dev"
authors = ["Roman Zeyde <[email protected]>"]
authors = [
"Roman Zeyde <[email protected]>",
"Nadav Ivgi <[email protected]>",
"wiz <[email protected]>",
"junderw <[email protected]>"
]
description = "An efficient re-implementation of Electrum Server in Rust"
license = "MIT"
homepage = "https://github.com/mempool/electrs"
repository = "https://github.com/mempool/electrs"
publish = false
keywords = ["bitcoin", "electrum", "server", "index", "database"]
documentation = "https://docs.rs/electrs/"
readme = "README.md"
edition = "2018"

Expand Down
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Esplora - Electrs backend API
# Mempool - Electrs backend API

A block chain index engine and HTTP API written in Rust based on [romanz/electrs](https://github.com/romanz/electrs).
A block chain index engine and HTTP API written in Rust based on [romanz/electrs](https://github.com/romanz/electrs) and [Blockstream/electrs](https://github.com/Blockstream/electrs).

Used as the backend for the [Esplora block explorer](https://github.com/Blockstream/esplora) powering [blockstream.info](https://blockstream.info/).
Used as the backend for the [mempool block explorer](https://github.com/mempool/mempool) powering [mempool.space](https://mempool.space/).

API documentation [is available here](https://github.com/blockstream/esplora/blob/master/API.md).
API documentation [is available here](https://mempool.space/docs/api/rest).

Documentation for the database schema and indexing process [is available here](doc/schema.md).

Expand All @@ -13,8 +13,8 @@ Documentation for the database schema and indexing process [is available here](d
Install Rust, Bitcoin Core (no `txindex` needed) and the `clang` and `cmake` packages, then:

```bash
$ git clone https://github.com/blockstream/electrs && cd electrs
$ git checkout new-index
$ git clone https://github.com/mempool/electrs && cd electrs
$ git checkout mempool
$ cargo run --release --bin electrs -- -vvvv --daemon-dir ~/.bitcoin

# Or for liquid:
Expand All @@ -24,11 +24,9 @@ $ cargo run --features liquid --release --bin electrs -- -vvvv --network liquid
See [electrs's original documentation](https://github.com/romanz/electrs/blob/master/doc/usage.md) for more detailed instructions.
Note that our indexes are incompatible with electrs's and has to be created separately.

The indexes require 610GB of storage after running compaction (as of June 2020), but you'll need to have
The indexes require 1.3TB of storage after running compaction (as of October 2023), but you'll need to have
free space of about double that available during the index compaction process.
Creating the indexes should take a few hours on a beefy machine with SSD.

To deploy with Docker, follow the [instructions here](https://github.com/Blockstream/esplora#how-to-build-the-docker-image).
Creating the indexes should take a few hours on a beefy machine with high speed NVMe SSD(s).

### Light mode

Expand Down Expand Up @@ -78,7 +76,7 @@ Additional options with the `electrum-discovery` feature:
- `--electrum-hosts <json>` - a json map of the public hosts where the electrum server is reachable, in the [`server.features` format](https://electrumx.readthedocs.io/en/latest/protocol-methods.html#server.features).
- `--electrum-announce` - announce the electrum server on the electrum p2p server discovery network.

See `$ cargo run --release --bin electrs -- --help` for the full list of options.
See `$ cargo run --bin electrs -- --help` for the full list of options.

## License

Expand Down
2 changes: 1 addition & 1 deletion scripts/checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ cargo clippy $@ -q -F electrum-discovery,liquid

TESTNAME="Running cargo test with all features"
echo "$TESTNAME"
cargo test $@ -q --package electrs --lib --all-features
cargo test $@ -q --lib --all-features
12 changes: 6 additions & 6 deletions src/bin/electrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ extern crate error_chain;
#[macro_use]
extern crate log;

extern crate electrs;
extern crate mempool_electrs;

use error_chain::ChainedError;
use std::process;
use std::sync::{Arc, RwLock};
use std::time::Duration;

use electrs::{
use mempool_electrs::{
config::Config,
daemon::Daemon,
electrum::RPC as ElectrumRPC,
Expand All @@ -21,7 +21,7 @@ use electrs::{
};

#[cfg(feature = "liquid")]
use electrs::elements::AssetRegistry;
use mempool_electrs::elements::AssetRegistry;

fn fetch_from(config: &Config, store: &Store) -> FetchFrom {
let mut jsonrpc_import = config.jsonrpc_import;
Expand Down Expand Up @@ -110,12 +110,12 @@ fn run_server(config: Arc<Config>) -> Result<()> {
if let Err(err) = signal.wait(Duration::from_millis(500), true) {
info!("stopping server: {}", err);

electrs::util::spawn_thread("shutdown-thread-checker", || {
mempool_electrs::util::spawn_thread("shutdown-thread-checker", || {
let mut counter = 40;
let interval_ms = 500;

while counter > 0 {
electrs::util::with_spawned_threads(|threads| {
mempool_electrs::util::with_spawned_threads(|threads| {
debug!("Threads during shutdown: {:?}", threads);
});
std::thread::sleep(std::time::Duration::from_millis(interval_ms));
Expand Down Expand Up @@ -151,7 +151,7 @@ fn main() {
error!("server failed: {}", e.display_chain());
process::exit(1);
}
electrs::util::with_spawned_threads(|threads| {
mempool_electrs::util::with_spawned_threads(|threads| {
debug!("Threads before closing: {:?}", threads);
});
}
4 changes: 2 additions & 2 deletions src/bin/popular-scripts.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
extern crate electrs;
extern crate mempool_electrs;

use std::{convert::TryInto, thread::ThreadId, time::Instant};

use electrs::{config::Config, new_index::db::open_raw_db};
use lazy_static::lazy_static;
use mempool_electrs::{config::Config, new_index::db::open_raw_db};

/*
// How to run:
Expand Down
4 changes: 2 additions & 2 deletions src/bin/tx-fingerprint-stats.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
extern crate electrs;
extern crate mempool_electrs;

#[cfg(not(feature = "liquid"))]
#[macro_use]
Expand All @@ -11,7 +11,7 @@ fn main() {

use bitcoin::blockdata::script::Script;
use bitcoin::consensus::encode::deserialize;
use electrs::{
use mempool_electrs::{
chain::Transaction,
config::Config,
daemon::Daemon,
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl Config {
pub fn from_args() -> Config {
let network_help = format!("Select network type ({})", Network::names().join(", "));

let args = App::new("Electrum Rust Server")
let args = App::new("Mempool Electrum Rust Server")
.version(crate_version!())
.arg(
Arg::with_name("version")
Expand Down

0 comments on commit 911ed78

Please sign in to comment.