MCPcopy Create free account
hub / github.com/BitVM/BitVM / fund_input_by_cli

Method fund_input_by_cli

bridge/tests/bridge/faucet.rs:96–111  ·  view source on GitHub ↗
(&self, address: &Address, amount: Amount)

Source from the content-addressed store, hash-verified

94 }
95
96 fn fund_input_by_cli(&self, address: &Address, amount: Amount) -> Txid {
97 let funding_command = format!("/srv/explorer/bitcoin/bin/bitcoin-cli -conf=/data/.bitcoin.conf -datadir=/data/bitcoin sendtoaddress {} {}", address, amount.to_btc());
98 let command = format!(
99 r#"docker exec $(docker ps | grep blockstream/esplora | awk '{}') /bin/bash -c "{}""#,
100 "{print $1}", funding_command
101 );
102 let output = Command::new("/bin/bash")
103 .args(["-c", command.as_str()])
104 .output()
105 .unwrap_or_else(|_| panic!("failed to execute command: {}", command));
106
107 let txid = String::from_utf8_lossy(&output.stdout);
108 txid.trim()
109 .parse()
110 .unwrap_or_else(|_| panic!("error: {:?}", output))
111 }
112
113 async fn fund_input_with_retry(&self, address: &Address, amount: Amount) -> Txid {
114 let client_err_handler = |e: Error| {

Callers 2

fund_inputMethod · 0.80
fund_inputsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected