Skip to content

Import electrsd crate #542

Open
tcharding wants to merge 12 commits intorust-bitcoin:masterfrom
tcharding:push-zmvsryxpluvy
Open

Import electrsd crate #542
tcharding wants to merge 12 commits intorust-bitcoin:masterfrom
tcharding:push-zmvsryxpluvy

Conversation

@tcharding
Copy link
Copy Markdown
Member

This is another attempt at #403. That one was so long ago I'm keeping it for the record and opening a new one.

This was done while electrsd is at commit: d2fd8af upgrade electrs esplora. The full commit hash is in the git log.

@tcharding
Copy link
Copy Markdown
Member Author

This will need #541 before electrsd can be released.

@tcharding
Copy link
Copy Markdown
Member Author

tcharding commented Apr 8, 2026

cc @RCasatta when you have time please mate (after I get CI green though). Needs explicit concept ACK too please same as on the old one (#403).

Are you ok to do the releases of electrsd and bitcoind if/when this merges?

Copy link
Copy Markdown

@RCasatta RCasatta left a comment

Choose a reason for hiding this comment

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

Concept ACK a8e89e4

@tcharding About the publishing, note you are already an owner of electrsd on crates.io and I sent you an invite for bitcoind , so you can also publish

Copy link
Copy Markdown
Collaborator

@jamillambert jamillambert left a comment

Choose a reason for hiding this comment

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

I had a look and got it to pass CI with the below fixes and then updating the lock files.

justfile:9 and contrib/update-lock-files.sh:13 replace node with bitcoind
integration_test/tests/signer.rs:72 and bitcoind/README.md:31 replace Node with BitcoinD

In .github/workflows/rust.yaml

  • Replace all cases of corepc-node with bitcoind
  • AI fix for test-electrs-no-download error (the Install LLVM and Clang bit):
  test-electrs-no-download:
    name: Test Electrs no auto-download features
    runs-on: ubuntu-24.04
    env:
      CARGO_TERM_COLOR: always
      ELECTRS_EXEC: "/home/runner/.cargo-install/electrs/bin/electrs"
    steps:
      - uses: dtolnay/rust-toolchain@stable
      - name: Install LLVM and Clang
        run: |
          sudo apt-get update -y
          sudo apt-get install -y clang libclang-dev llvm-dev

          llvm_config="$(command -v llvm-config || true)"
          if [[ -z "$llvm_config" ]]; then
            llvm_config="$(command -v llvm-config-18 || true)"
          fi

          if [[ -z "$llvm_config" ]]; then
            echo "llvm-config not found after installing LLVM packages" >&2
            exit 1
          fi

          echo "LLVM_CONFIG_PATH=$llvm_config" >> "$GITHUB_ENV"
          echo "LIBCLANG_PATH=$($llvm_config --libdir)" >> "$GITHUB_ENV"
      - name: Install electrs
        # Automatically cache installed binaries to avoid compiling them each run
        uses: baptiste0928/cargo-install@v2
        with:
          crate: electrs
      - run: "echo $ELECTRS_EXEC"
      - name: Checkout Crate
        uses: actions/checkout@v3
      - uses: Swatinem/rust-cache@v2
      - run: cd electrsd && cargo test --features 'bitcoind_25_2'

@tcharding
Copy link
Copy Markdown
Member Author

About the publishing, note you are already an owner of electrsd on crates.io and I sent you an invite for bitcoind , so you can also publish

Accepted, cheers. Would you like me to wait for you to ack release tracking PRs or are you ok for me and @jamillambert to just hack wildly and handle what we can?

This repository already has `corepc-node` (formerly `bitcoind`) for
integration testing. BDK users do integration testing with `electrsd`
as well and the two crates are coupled but during migration of
`bitcoind` here I did not realise this. In an attempt to remedy this
mistake import `electrsd` here as well. Next we will revert the name
change of `corepc-node` back to `bitcoind`.

Details of import:

repository: https://github.com/RCasatta/electrsd
commit: `d2fd8af upgrade electrs esplora`
full hash: d2fd8afc3b5b79304dd669250df325a54024f374

Import excludes the `.git` and `.github` directories. Which means git
history and CI. CI will be re-added manually.

Note crate is excluded from the workspace in this patch.
`corepc-node` and `corepc-client` `v0.11.0` are unreleased but ready
to go. Update to use `path` dependency.
@tcharding tcharding force-pushed the push-zmvsryxpluvy branch 2 times, most recently from a781b56 to 6cab9b1 Compare April 10, 2026 01:47
Copy the CI jobs from the old `electrsd` repository. Modify the calls
to `cargo` to first `cd electsd`.

This is a dirty hack but we have a re-write of CI to use `cargo rbmt`
in flight anyways.
Add a feature to use `node` Core 30.2 support.
When the `corepc-` nomenclature was adopted we renamed `bitcoind` to
`corepc-node` (and the main type from `BitcoinD` to `Node`). In
hindsight this was a bad move because it broke the API uniformity
between `bitcoind` and `electrsd` and hurt users that used both.

Revert the name changes back to `bitcoind` and `BitcoinD`.

While we are at it bump the version number to `0.37.0` ready for
release.
We use `path =` in all the manifests to pick up local deps. No need
for the `patch` section anymore.
In preparation for release bump the version. FWIW the version of
`bitcoind` has already been bumped to `0.37.0` also.
For `electrs` to build in CI it needs a `contrib` directory.
No code changes required. Just document it in the manifest. This is
the same MSRV as the rest of the repository.

Includes usage of `bitreq` instead of `minreq` because `bitreq` is on
the same MSRV (and it lives in this repo). FTR `bitreq` is our fork of
`minreq`.
Install LLVM and Clang as suggested by an LLM.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants