Commit 891f18ce authored by kenshin-samourai's avatar kenshin-samourai
Browse files

renaming to avoid confusion about the features provided by the indexer

parent 4f469a1e
[package] [package]
name = "electrs" name = "addrindexrs"
version = "0.8.0" version = "0.8.0"
authors = ["Roman Zeyde <me@romanzey.de>"] authors = ["Roman Zeyde <me@romanzey.de>", "kenshin-samourai <kenshin_samourai@tutanota.com>"]
description = "An efficient re-implementation of Electrum Server in Rust" description = "An efficient address indexer in Rust"
license = "MIT" license = "MIT"
homepage = "https://github.com/romanz/electrs" homepage = "https://github.com/Samourai-Wallet/addrindexrs"
repository = "https://github.com/romanz/electrs" repository = "https://github.com/Samourai-Wallet/addrindexrs"
keywords = ["bitcoin", "electrum", "server", "index", "database"] keywords = ["bitcoin", "server", "index", "database"]
documentation = "https://docs.rs/electrs/" documentation = "https://github.com/Samourai-Wallet/addrindexrs/blob/master/doc/usage.md"
readme = "README.md" readme = "README.md"
edition = "2018" edition = "2018"
build = "build.rs" build = "build.rs"
......
[general] [general]
env_prefix = "ELECTRS" env_prefix = "ADDRINDEXRS"
conf_file_param = "conf" conf_file_param = "conf"
conf_dir_param = "conf_dir" conf_dir_param = "conf_dir"
doc = """ doc = """
An efficient re-implementation of Electrum Server, inspired by ElectrumX, Electrum Personal Server and bitcoincore-indexd. An efficient addresses indexer based on Electrs.
"""
The motivation behind this project is to enable a user to run his own Electrum server, with required hardware resources not much beyond those of a full node. The server indexes the entire Bitcoin blockchain, and the resulting index enables fast queries for any given user wallet, allowing the user to keep real-time track of his balances and his transaction history using the Electrum wallet. Since it runs on the user's own machine, there is no need for the wallet to communicate with external Electrum servers, thus preserving the privacy of the user's addresses and balances."""
[[switch]] [[switch]]
name = "verbose" name = "verbose"
...@@ -42,9 +41,9 @@ doc = "Select Bitcoin network type ('mainnet', 'testnet' or 'regtest')" ...@@ -42,9 +41,9 @@ doc = "Select Bitcoin network type ('mainnet', 'testnet' or 'regtest')"
default = "Default::default()" default = "Default::default()"
[[param]] [[param]]
name = "electrum_rpc_addr" name = "indexer_rpc_addr"
type = "crate::config::ResolvAddr" type = "crate::config::ResolvAddr"
doc = "Electrum server JSONRPC 'addr:port' to listen on (default: '127.0.0.1:50001' for mainnet, '127.0.0.1:60001' for testnet and '127.0.0.1:60401' for regtest)" doc = "Indexer JSONRPC 'addr:port' to listen on (default: '127.0.0.1:50001' for mainnet, '127.0.0.1:60001' for testnet and '127.0.0.1:60401' for regtest)"
[[param]] [[param]]
name = "daemon_rpc_addr" name = "daemon_rpc_addr"
......
[Unit] [Unit]
Description=Electrum Rust Server Description=addrindexrs rust server
[Service] [Service]
Type=simple Type=simple
ExecStart=/path/to/electrs/target/release/electrs -vvvv --db-dir /path/to/electrs/db/ ExecStart=/path/to/addrindexrs/target/release/addrindexrs -vvvv --db-dir /path/to/addrindexrs/db/
Restart=on-failure Restart=on-failure
RestartSec=60 RestartSec=60
Environment="RUST_BACKTRACE=1" Environment="RUST_BACKTRACE=1"
......
...@@ -3,7 +3,7 @@ set -eu ...@@ -3,7 +3,7 @@ set -eu
trap 'kill $(jobs -p)' EXIT trap 'kill $(jobs -p)' EXIT
DELAY=5 DELAY=5
LOG=/tmp/electrs.log LOG=/tmp/addrindexrs.log
CARGO="cargo +stable" CARGO="cargo +stable"
tail -v -n0 -F "$LOG" & tail -v -n0 -F "$LOG" &
......
extern crate electrs; extern crate addrindexrs;
extern crate error_chain; extern crate error_chain;
#[macro_use] #[macro_use]
...@@ -10,7 +10,7 @@ use std::sync::Arc; ...@@ -10,7 +10,7 @@ use std::sync::Arc;
use std::time::Duration; use std::time::Duration;
use electrs::{ use addrindexrs::{
app::App, app::App,
bulk, bulk,
cache::BlockTxIDsCache, cache::BlockTxIDsCache,
...@@ -66,7 +66,7 @@ fn run_server(config: &Config) -> Result<()> { ...@@ -66,7 +66,7 @@ fn run_server(config: &Config) -> Result<()> {
loop { loop {
app.update(&signal)?; app.update(&signal)?;
query.update_mempool()?; query.update_mempool()?;
server.get_or_insert_with(|| RPC::start(config.electrum_rpc_addr, query.clone())); server.get_or_insert_with(|| RPC::start(config.indexer_rpc_addr, query.clone()));
if let Err(err) = signal.wait(Duration::from_secs(5)) { if let Err(err) = signal.wait(Duration::from_secs(5)) {
info!("stopping server: {}", err); info!("stopping server: {}", err);
break; break;
......
...@@ -141,7 +141,7 @@ pub struct Config { ...@@ -141,7 +141,7 @@ pub struct Config {
pub daemon_dir: PathBuf, pub daemon_dir: PathBuf,
pub daemon_rpc_addr: SocketAddr, pub daemon_rpc_addr: SocketAddr,
pub cookie: Option<String>, pub cookie: Option<String>,
pub electrum_rpc_addr: SocketAddr, pub indexer_rpc_addr: SocketAddr,
pub jsonrpc_import: bool, pub jsonrpc_import: bool,
pub index_batch_size: usize, pub index_batch_size: usize,
pub bulk_index_threads: usize, pub bulk_index_threads: usize,
...@@ -165,14 +165,14 @@ impl Config { ...@@ -165,14 +165,14 @@ impl Config {
pub fn from_args() -> Config { pub fn from_args() -> Config {
use internal::ResultExt; use internal::ResultExt;
let system_config: &OsStr = "/etc/electrs/config.toml".as_ref(); let system_config: &OsStr = "/etc/addrindexrs/config.toml".as_ref();
let home_config = home_dir().map(|mut dir| { let home_config = home_dir().map(|mut dir| {
dir.extend(&[".electrs", "config.toml"]); dir.extend(&[".addrindexrs", "config.toml"]);
dir dir
}); });
let cwd_config: &OsStr = "electrs.toml".as_ref(); let cwd_config: &OsStr = "addrindexrs.toml".as_ref();
let configs = std::iter::once(cwd_config) let configs = std::iter::once(cwd_config)
.chain(home_config.as_ref().map(AsRef::as_ref)) .chain(home_config.as_ref().map(AsRef::as_ref))
.chain(std::iter::once(system_config)); .chain(std::iter::once(system_config));
...@@ -195,7 +195,7 @@ impl Config { ...@@ -195,7 +195,7 @@ impl Config {
Network::Regtest => 18443, Network::Regtest => 18443,
}; };
let default_electrum_port = match config.network { let default_indexer_port = match config.network {
Network::Bitcoin => 50001, Network::Bitcoin => 50001,
Network::Testnet => 60001, Network::Testnet => 60001,
Network::Regtest => 60401, Network::Regtest => 60401,
...@@ -206,8 +206,8 @@ impl Config { ...@@ -206,8 +206,8 @@ impl Config {
ResolvAddr::resolve_or_exit, ResolvAddr::resolve_or_exit,
); );
let electrum_rpc_addr: SocketAddr = config.electrum_rpc_addr.map_or( let indexer_rpc_addr: SocketAddr = config.indexer_rpc_addr.map_or(
(DEFAULT_SERVER_ADDRESS, default_electrum_port).into(), (DEFAULT_SERVER_ADDRESS, default_indexer_port).into(),
ResolvAddr::resolve_or_exit, ResolvAddr::resolve_or_exit,
); );
...@@ -222,7 +222,7 @@ impl Config { ...@@ -222,7 +222,7 @@ impl Config {
config config
.verbose .verbose
.try_into() .try_into()
.expect("Overflow: Running electrs on less than 32 bit devices is unsupported"), .expect("Overflow: Running addrindexrs on less than 32 bit devices is unsupported"),
); );
log.timestamp(if config.timestamp { log.timestamp(if config.timestamp {
...@@ -251,7 +251,7 @@ impl Config { ...@@ -251,7 +251,7 @@ impl Config {
daemon_dir: config.daemon_dir, daemon_dir: config.daemon_dir,
daemon_rpc_addr, daemon_rpc_addr,
cookie: config.cookie, cookie: config.cookie,
electrum_rpc_addr, indexer_rpc_addr,
jsonrpc_import: config.jsonrpc_import, jsonrpc_import: config.jsonrpc_import,
index_batch_size: config.index_batch_size, index_batch_size: config.index_batch_size,
bulk_index_threads: config.bulk_index_threads, bulk_index_threads: config.bulk_index_threads,
......
...@@ -13,7 +13,7 @@ use crate::query::Query; ...@@ -13,7 +13,7 @@ use crate::query::Query;
use crate::util::{spawn_thread, Channel, SyncChannel}; use crate::util::{spawn_thread, Channel, SyncChannel};
// Indexer version // Indexer version
const ELECTRS_VERSION: &str = env!("CARGO_PKG_VERSION"); const ADDRINDEXRS_VERSION: &str = env!("CARGO_PKG_VERSION");
// Version of the simulated electrum protocol // Version of the simulated electrum protocol
const PROTOCOL_VERSION: &str = "1.4"; const PROTOCOL_VERSION: &str = "1.4";
...@@ -54,7 +54,7 @@ impl Connection { ...@@ -54,7 +54,7 @@ impl Connection {
fn server_version(&self) -> Result<Value> { fn server_version(&self) -> Result<Value> {
Ok(json!([ Ok(json!([
format!("addrindexrs {}", ELECTRS_VERSION), format!("addrindexrs {}", ADDRINDEXRS_VERSION),
PROTOCOL_VERSION PROTOCOL_VERSION
])) ]))
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment