thread::spawn(|| server.run(options, index, ord_server_handle).unwrap());
}
while index.statistic(crate::index::Statistic::Commits) == 0 {
thread::sleep(Duration::from_millis(25));
}
let client = reqwest::blocking::Client::builder()
.redirect(reqwest::redirect::Policy::none())
.build()
.unwrap();
for i in 0.. {
match client.get(format!("http://127.0.0.1:{port}/status")).send() {
Ok(_) => break,
Err(err) => {
if i == 400 {
panic!("server failed to start: {err}");
}
}
}
thread::sleep(Duration::from_millis(25));
}
Self {
bitcoin_rpc_server,
index,
ord_server_handle,
tempdir,
url,
}
}
fn get(&self, path: impl AsRef<str>) -> reqwest::blocking::Response {
if let Err(error) = self.index.update() {
log::error!("{error}");
}
reqwest::blocking::get(self.join_url(path.as_ref())).unwrap()