use bitcoind with feature to download the binary
This commit is contained in:
parent
2ecae348ea
commit
8e41c4587d
5
.github/workflows/cont_integration.yml
vendored
5
.github/workflows/cont_integration.yml
vendored
@ -85,7 +85,6 @@ jobs:
|
|||||||
- name: rpc
|
- name: rpc
|
||||||
- name: esplora
|
- name: esplora
|
||||||
env:
|
env:
|
||||||
BITCOIN_VER: 0.21.0
|
|
||||||
ELECTRS_RELEASE_URL: https://github.com/RCasatta/electrsd/releases/download/release_0.3.0
|
ELECTRS_RELEASE_URL: https://github.com/RCasatta/electrsd/releases/download/release_0.3.0
|
||||||
ELECTRS_VER: electrs_ubuntu-20.04_v0.8.10.zip
|
ELECTRS_VER: electrs_ubuntu-20.04_v0.8.10.zip
|
||||||
ELECTRS_ESPLORA_VER: electrs_esplora_ubuntu-20.04_a33e97e1a1fc63fa9c20a116bb92579bbf43b254.zip
|
ELECTRS_ESPLORA_VER: electrs_esplora_ubuntu-20.04_a33e97e1a1fc63fa9c20a116bb92579bbf43b254.zip
|
||||||
@ -115,10 +114,6 @@ jobs:
|
|||||||
run: echo "ELECTRS_EXE=${{ github.workspace }}/electrs" >> $GITHUB_ENV
|
run: echo "ELECTRS_EXE=${{ github.workspace }}/electrs" >> $GITHUB_ENV
|
||||||
- name: Show electrs options
|
- name: Show electrs options
|
||||||
run: ${{ env.ELECTRS_EXE }} --help
|
run: ${{ env.ELECTRS_EXE }} --help
|
||||||
- name: Set BITCOIND_EXE env
|
|
||||||
run: echo "BITCOIND_EXE=${{ github.workspace }}/bitcoin-${{ env.BITCOIN_VER }}/bin/bitcoind" >> $GITHUB_ENV
|
|
||||||
- name: Install bitcoind
|
|
||||||
run: curl https://bitcoincore.org/bin/bitcoin-core-$BITCOIN_VER/bitcoin-$BITCOIN_VER-x86_64-linux-gnu.tar.gz | tar -xvz bitcoin-$BITCOIN_VER/bin/bitcoind
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: $HOME/.cargo/bin/cargo test --features test-${{ matrix.blockchain.name }},test-blockchains --no-default-features ${{ matrix.blockchain.name }}::bdk_blockchain_tests
|
run: $HOME/.cargo/bin/cargo test --features test-${{ matrix.blockchain.name }},test-blockchains --no-default-features ${{ matrix.blockchain.name }}::bdk_blockchain_tests
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ test-md-docs = ["electrum"]
|
|||||||
lazy_static = "1.4"
|
lazy_static = "1.4"
|
||||||
env_logger = "0.7"
|
env_logger = "0.7"
|
||||||
clap = "2.33"
|
clap = "2.33"
|
||||||
electrsd = { version="0.4", features = ["trigger"] }
|
electrsd = { version="0.5", features = ["trigger", "bitcoind_0_21_1"] }
|
||||||
|
|
||||||
[[example]]
|
[[example]]
|
||||||
name = "address_validator"
|
name = "address_validator"
|
||||||
|
@ -6,7 +6,7 @@ use bitcoin::{Address, Amount, Script, Transaction, Txid};
|
|||||||
pub use bitcoincore_rpc::bitcoincore_rpc_json::AddressType;
|
pub use bitcoincore_rpc::bitcoincore_rpc_json::AddressType;
|
||||||
pub use bitcoincore_rpc::{Auth, Client as RpcClient, RpcApi};
|
pub use bitcoincore_rpc::{Auth, Client as RpcClient, RpcApi};
|
||||||
use core::str::FromStr;
|
use core::str::FromStr;
|
||||||
use electrsd::bitcoind::BitcoinD;
|
use electrsd::bitcoind::{downloaded_exe_path, BitcoinD};
|
||||||
use electrsd::ElectrsD;
|
use electrsd::ElectrsD;
|
||||||
pub use electrum_client::{Client as ElectrumClient, ElectrumApi};
|
pub use electrum_client::{Client as ElectrumClient, ElectrumApi};
|
||||||
#[allow(unused_imports)]
|
#[allow(unused_imports)]
|
||||||
@ -309,8 +309,12 @@ impl Deref for TestClient {
|
|||||||
|
|
||||||
impl Default for TestClient {
|
impl Default for TestClient {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
let bitcoind_exe =
|
let bitcoind_exe = env::var("BITCOIND_EXE")
|
||||||
env::var("BITCOIND_EXE").unwrap_or_else(|_| "/root/bitcoind".to_string());
|
.ok()
|
||||||
|
.or(downloaded_exe_path())
|
||||||
|
.expect(
|
||||||
|
"you should provide env var BITCOIND_EXE or specifiy a bitcoind version feature",
|
||||||
|
);
|
||||||
let electrs_exe = env::var("ELECTRS_EXE").unwrap_or_else(|_| "/root/electrs".to_string());
|
let electrs_exe = env::var("ELECTRS_EXE").unwrap_or_else(|_| "/root/electrs".to_string());
|
||||||
Self::new(bitcoind_exe, electrs_exe)
|
Self::new(bitcoind_exe, electrs_exe)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user