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]
name = "electrs"
name = "addrindexrs"
version = "0.8.0"
authors = ["Roman Zeyde <me@romanzey.de>"]
description = "An efficient re-implementation of Electrum Server in Rust"
authors = ["Roman Zeyde <me@romanzey.de>", "kenshin-samourai <kenshin_samourai@tutanota.com>"]
description = "An efficient address indexer in Rust"
license = "MIT"
homepage = "https://github.com/romanz/electrs"
repository = "https://github.com/romanz/electrs"
keywords = ["bitcoin", "electrum", "server", "index", "database"]
documentation = "https://docs.rs/electrs/"
homepage = "https://github.com/Samourai-Wallet/addrindexrs"
repository = "https://github.com/Samourai-Wallet/addrindexrs"
keywords = ["bitcoin", "server", "index", "database"]
documentation = "https://github.com/Samourai-Wallet/addrindexrs/blob/master/doc/usage.md"
readme = "README.md"
edition = "2018"
build = "build.rs"
......
[general]
env_prefix = "ELECTRS"
env_prefix = "ADDRINDEXRS"
conf_file_param = "conf"
conf_dir_param = "conf_dir"
doc = """
An efficient re-implementation of Electrum Server, inspired by ElectrumX, Electrum Personal Server and bitcoincore-indexd.
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."""
An efficient addresses indexer based on Electrs.
"""
[[switch]]
name = "verbose"
......@@ -42,9 +41,9 @@ doc = "Select Bitcoin network type ('mainnet', 'testnet' or 'regtest')"
default = "Default::default()"
[[param]]
name = "electrum_rpc_addr"
name = "indexer_rpc_addr"
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]]
name = "daemon_rpc_addr"
......
[Unit]
Description=Electrum Rust Server
Description=addrindexrs rust server
[Service]
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
RestartSec=60
Environment="RUST_BACKTRACE=1"
......
......@@ -3,7 +3,7 @@ set -eu
trap 'kill $(jobs -p)' EXIT
DELAY=5
LOG=/tmp/electrs.log
LOG=/tmp/addrindexrs.log
CARGO="cargo +stable"
tail -v -n0 -F "$LOG" &
......
extern crate electrs;
extern crate addrindexrs;
extern crate error_chain;
#[macro_use]
......@@ -10,7 +10,7 @@ use std::sync::Arc;
use std::time::Duration;
use electrs::{
use addrindexrs::{
app::App,
bulk,
cache::BlockTxIDsCache,
......@@ -66,7 +66,7 @@ fn run_server(config: &Config) -> Result<()> {
loop {
app.update(&signal)?;
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)) {
info!("stopping server: {}", err);
break;
......
......@@ -141,7 +141,7 @@ pub struct Config {
pub daemon_dir: PathBuf,
pub daemon_rpc_addr: SocketAddr,
pub cookie: Option<String>,
pub electrum_rpc_addr: SocketAddr,
pub indexer_rpc_addr: SocketAddr,
pub jsonrpc_import: bool,
pub index_batch_size: usize,
pub bulk_index_threads: usize,
......@@ -165,14 +165,14 @@ impl Config {
pub fn from_args() -> Config {
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| {
dir.extend(&[".electrs", "config.toml"]);
dir.extend(&[".addrindexrs", "config.toml"]);
dir
});
let cwd_config: &OsStr = "electrs.toml".as_ref();
let cwd_config: &OsStr = "addrindexrs.toml".as_ref();
let configs = std::iter::once(cwd_config)
.chain(home_config.as_ref().map(AsRef::as_ref))
.chain(std::iter::once(system_config));
......@@ -195,7 +195,7 @@ impl Config {
Network::Regtest => 18443,
};
let default_electrum_port = match config.network {
let default_indexer_port = match config.network {
Network::Bitcoin => 50001,
Network::Testnet => 60001,
Network::Regtest => 60401,
......@@ -206,8 +206,8 @@ impl Config {
ResolvAddr::resolve_or_exit,
);
let electrum_rpc_addr: SocketAddr = config.electrum_rpc_addr.map_or(
(DEFAULT_SERVER_ADDRESS, default_electrum_port).into(),
let indexer_rpc_addr: SocketAddr = config.indexer_rpc_addr.map_or(
(DEFAULT_SERVER_ADDRESS, default_indexer_port).into(),
ResolvAddr::resolve_or_exit,
);
......@@ -222,7 +222,7 @@ impl Config {
config
.verbose
.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 {
......@@ -251,7 +251,7 @@ impl Config {
daemon_dir: config.daemon_dir,
daemon_rpc_addr,
cookie: config.cookie,
electrum_rpc_addr,
indexer_rpc_addr,
jsonrpc_import: config.jsonrpc_import,
index_batch_size: config.index_batch_size,
bulk_index_threads: config.bulk_index_threads,
......
......@@ -13,7 +13,7 @@ use crate::query::Query;
use crate::util::{spawn_thread, Channel, SyncChannel};
// Indexer version
const ELECTRS_VERSION: &str = env!("CARGO_PKG_VERSION");
const ADDRINDEXRS_VERSION: &str = env!("CARGO_PKG_VERSION");
// Version of the simulated electrum protocol
const PROTOCOL_VERSION: &str = "1.4";
......@@ -54,7 +54,7 @@ impl Connection {
fn server_version(&self) -> Result<Value> {
Ok(json!([
format!("addrindexrs {}", ELECTRS_VERSION),
format!("addrindexrs {}", ADDRINDEXRS_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