[repl] Revert back the repl example to use Electrum
This commit is contained in:
parent
5d977bc617
commit
24fcb38565
@ -37,8 +37,9 @@ use log::{debug, error, info, trace, LevelFilter};
|
|||||||
use bitcoin::Network;
|
use bitcoin::Network;
|
||||||
|
|
||||||
use magical::bitcoin;
|
use magical::bitcoin;
|
||||||
use magical::blockchain::compact_filters::*;
|
use magical::blockchain::ElectrumBlockchain;
|
||||||
use magical::cli;
|
use magical::cli;
|
||||||
|
use magical::electrum_client::Client;
|
||||||
use magical::sled;
|
use magical::sled;
|
||||||
use magical::Wallet;
|
use magical::Wallet;
|
||||||
|
|
||||||
@ -88,17 +89,19 @@ fn main() {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
debug!("database opened successfully");
|
debug!("database opened successfully");
|
||||||
|
|
||||||
let num_threads = 1;
|
let client = Client::new(
|
||||||
|
matches.value_of("server").unwrap(),
|
||||||
let mempool = Arc::new(Mempool::default());
|
matches.value_of("proxy"),
|
||||||
let peers = (0..num_threads)
|
)
|
||||||
.map(|_| Peer::connect("192.168.1.136:8333", Arc::clone(&mempool), Network::Bitcoin))
|
.unwrap();
|
||||||
.collect::<Result<_, _>>()
|
let wallet = Wallet::new(
|
||||||
.unwrap();
|
descriptor,
|
||||||
let blockchain =
|
change_descriptor,
|
||||||
CompactFiltersBlockchain::new(peers, "./wallet-filters", Some(500_000)).unwrap();
|
network,
|
||||||
|
tree,
|
||||||
let wallet = Wallet::new(descriptor, change_descriptor, network, tree, blockchain).unwrap();
|
ElectrumBlockchain::from(client),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
let wallet = Arc::new(wallet);
|
let wallet = Arc::new(wallet);
|
||||||
|
|
||||||
if let Some(_sub_matches) = matches.subcommand_matches("repl") {
|
if let Some(_sub_matches) = matches.subcommand_matches("repl") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user