Blockstream / electrs

An efficient re-implementation of Electrum Server in Rust
MIT License
324 stars 131 forks source link

enable build with nix flakes #80

Closed RCasatta closed 7 months ago

RCasatta commented 7 months ago

By default runs the bitcoin version

$ nix run .
Config { log: StdErrLog { verbosity: Error, quiet: false, show_level: true, timestamp: Off, modules: [], writer: "stderr", color_choice: Auto, show_module_names: false }, network_type: Bitcoin, db_path: "./db/mainnet", daemon_dir: "/home/casatta/.bitcoin", blocks_dir: "/home/casatta/.bitcoin/blocks", daemon_rpc_addr: 127.0.0.1:8332, cookie: None, electrum_rpc_addr: 127.0.0.1:50001, http_addr: 127.0.0.1:3000, http_socket_file: None, monitoring_addr: 127.0.0.1:4224, jsonrpc_import: false, light_mode: false, address_search: false, index_unspendables: false, cors: None, precache_scripts: None, utxos_limit: 500, electrum_txs_limit: 500, electrum_banner: "Welcome to electrs-esplora 0.4.1", electrum_rpc_logging: None }

But it contains also a package with the liquid variant:

$ nix run .#blockstream-electrs-liquid -- --network liquid
Config { log: StdErrLog { verbosity: Error, quiet: false, show_level: true, timestamp: Off, modules: [], writer: "stderr", color_choice: Auto, show_module_names: false }, network_type: Liquid, db_path: "./db/liquid", daemon_dir: "/home/casatta/.bitcoin/liquidv1", blocks_dir: "/home/casatta/.bitcoin/liquidv1/blocks", daemon_rpc_addr: 127.0.0.1:7041, cookie: None, electrum_rpc_addr: 127.0.0.1:51000, http_addr: 127.0.0.1:3000, http_socket_file: None, monitoring_addr: 127.0.0.1:34224, jsonrpc_import: false, light_mode: false, address_search: false, index_unspendables: false, cors: None, precache_scripts: None, utxos_limit: 500, electrum_txs_limit: 500, electrum_banner: "Welcome to electrs-esplora 0.4.1", electrum_rpc_logging: None, parent_network: Bitcoin, asset_db_path: None }

on top of #79

replaces #78

shesek commented 7 months ago

I don't know enough about nix to code review, but Concept ACK

RCasatta commented 7 months ago

I don't know enough about nix to code review, but Concept ACK

maybe @delta1 can have a look too

delta1 commented 7 months ago

maybe you want to add nix build to CI using something like this: https://github.com/DeterminateSystems/nix-installer-action?tab=readme-ov-file#usage

shesek commented 7 months ago

Is this safe to ignore?

warning: could not update mtime for file '/home/runner/.cache/nix/gitv3/1a9qlk1vly20pxx9fra5qvv9d3fs0xczy6jczzj52wj2bsbiqn5h/refs/heads/202201-nonarray': No such file or directory

shesek/rust-jsonrpc#202201-nonarray is a dependency of electrumd.

RCasatta commented 7 months ago

Is this safe to ignore?

I guess so?

Probably will be fixed with https://github.com/NixOS/nix/pull/10241 or by using a dep released on crates

shesek commented 7 months ago

All right, seems good to me! Thanks for the PR :+1: