#integration-tests #environment #process #testing #elements #rpc #liquidregtest

elementsd

Utility to run a liquidregtest elements process, useful in integration testing environment

12 releases (breaking)

0.11.0 Aug 19, 2024
0.10.0 Jul 29, 2024
0.9.2 Aug 19, 2024
0.9.1 Apr 4, 2024
0.3.0 Dec 3, 2021

#70 in #integration-tests

Download history 495/week @ 2024-07-28 95/week @ 2024-08-04 63/week @ 2024-08-11 310/week @ 2024-08-18 53/week @ 2024-08-25 79/week @ 2024-09-01 146/week @ 2024-09-08 165/week @ 2024-09-15 179/week @ 2024-09-22 186/week @ 2024-09-29 80/week @ 2024-10-06 35/week @ 2024-10-13 53/week @ 2024-10-20 28/week @ 2024-10-27 45/week @ 2024-11-03 22/week @ 2024-11-10

151 downloads per month

MIT license

17KB
286 lines

MIT license Crates

ElementsD

Utility to run a liquidregtest elementsd process, useful in integration testing environment.

use elementsd::bitcoincore_rpc::RpcApi;
let exe = elementsd::exe_path().expect("elementsd executable must be provided in ELEMENTSD_EXE, or with a feature like '0_21_0', or be in PATH");
let elementsd = elementsd::ElementsD::new(exe).unwrap();
let info = elementsd
    .client()
    .call::<bitcoind::bitcoincore_rpc::jsonrpc::serde_json::Value>("getblockchaininfo", &[])
    .unwrap();
assert_eq!(info.get("chain").unwrap(), "liquidregtest");

Validate pegin

You can also start elementsd with validate pegin capability by connecting an instance of bitcoind. See test test_elementsd_with_validatepegin

See the similar BitcoinD for details

Nix

For determinisim, in nix you cannot hit the internet within the build.rs. Moreover, some downstream crates cannot remove the auto-download feature from their dev-deps. In this case you can set the ELEMENTSD_SKIP_DOWNLOAD env var and provide the elementsd executable in the PATH (or skip the test execution).

Doc

To build docs:

RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --features download,doc --open

MSRV

  • 1.57.0 with one of the auto download features
  • 1.56.1 without features

MSRV 1.56.1 may require downgrading dependencies. See our .github/workflows/test.yml file for a complete list.

Dependencies

~10–20MB
~257K SLoC