Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blockstream-electrs: init at 0.4.1-unstable-2024-11-25 #318195

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions pkgs/by-name/bl/blockstream-electrs/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
bitcoind,
electrum,
fetchFromGitHub,
lib,
rocksdb_8_3,
rustPlatform,
stdenv,
}:

rustPlatform.buildRustPackage rec {
pname = "blockstream-electrs";
version = "0.4.1-unstable-2024-11-25";

src = fetchFromGitHub {
owner = "Blockstream";
repo = "electrs";
rev = "680eacaa8360d5f46eaae9611a3097ba183795c6";
hash = "sha256-oDM4arH3aplgcS49t/hy5Rqt36glrVufd3F4tw3j1zo=";
};

useFetchCargoVendor = true;
cargoHash = "sha256-X2C69ui3XiYP1cg9FgfBbJlLLMq1SCw+oAL20B1Fs30=";

nativeBuildInputs = [
# Needed for librocksdb-sys
rustPlatform.bindgenHook
];

env = {
# Dynamically link rocksdb
ROCKSDB_INCLUDE_DIR = "${rocksdb_8_3}/include";
ROCKSDB_LIB_DIR = "${rocksdb_8_3}/lib";

# External binaries for integration tests are provided via nixpkgs. Skip
# trying to download them.
BITCOIND_SKIP_DOWNLOAD = true;
ELECTRUMD_SKIP_DOWNLOAD = true;
ELEMENTSD_SKIP_DOWNLOAD = true;
};

# Only build the service
cargoBuildFlags = [
"--package=electrs"
"--bin=electrs"
];

# Some upstream dev-dependencies (electrumd, elementsd) currently fail to
# build on non-x86_64-linux platforms, even if downloading is skipped.
# TODO(phlip9): submit a PR to fix this
doCheck = stdenv.hostPlatform.system == "x86_64-linux";

# Build tests in debug mode to reduce build time
checkType = "debug";

# Integration tests require us to pass in some external deps via env.
preCheck = lib.optionalString doCheck ''
export BITCOIND_EXE=${bitcoind}/bin/bitcoind
export ELECTRUMD_EXE=${electrum}/bin/electrum
'';

# Make sure the final binary actually runs
doInstallCheck = true;
installCheckPhase = ''
$out/bin/electrs --version
'';

meta = {
description = "Efficient re-implementation of Electrum Server in Rust";
longDescription = ''
A blockchain index engine and HTTP API written in Rust based on
[romanz/electrs](https://github.com/romanz/electrs).

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

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

Documentation for the database schema and indexing process [is available here](https://github.com/Blockstream/electrs/blob/new-index/doc/schema.md).
'';
homepage = "https://github.com/Blockstream/electrs";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ phlip9 ];
mainProgram = "electrs";
};
}
Loading