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

enable build with nix flakes #80

Merged
merged 5 commits into from
Apr 10, 2024
Merged

enable build with nix flakes #80

merged 5 commits into from
Apr 10, 2024

Conversation

RCasatta
Copy link
Collaborator

@RCasatta RCasatta commented Apr 6, 2024

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 added 2 commits April 5, 2024 20:43
All minor. Including an update from rust-bitcoin v0.31.1 to v0.31.2.
@shesek
Copy link
Collaborator

shesek commented Apr 6, 2024

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

flake.nix Outdated Show resolved Hide resolved
By default runs the bitcoin version

```shell
$ 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:

```shell
$ 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 }
```
@RCasatta
Copy link
Collaborator Author

RCasatta commented Apr 6, 2024

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

maybe @delta1 can have a look too

with this fix, on nixos you can build the project by doing:

```shell
$ nix develop # ensure dependencies to build
$ cargo build # succesfully build
```

otherwise there is an error in building rocksdb
Copy link

@delta1 delta1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems fine to me 🤷

flake.nix Show resolved Hide resolved
@delta1
Copy link

delta1 commented Apr 8, 2024

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
Copy link
Collaborator

shesek commented Apr 9, 2024

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
Copy link
Collaborator Author

Is this safe to ignore?

I guess so?

Probably will be fixed with NixOS/nix#10241 or by using a dep released on crates

@shesek
Copy link
Collaborator

shesek commented Apr 10, 2024

All right, seems good to me! Thanks for the PR 👍

@shesek shesek merged commit 4ff496a into new-index Apr 10, 2024
4 checks passed
junderw pushed a commit to junderw/electrs that referenced this pull request May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants