More information in the updater.
This commit is contained in:
parent
44eda379ad
commit
27a8608624
File diff suppressed because one or more lines are too long
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
use std::sync::Weak;
|
use std::sync::Weak;
|
||||||
use util::misc::code_hash;
|
use util::misc::code_hash;
|
||||||
use util::Address;
|
use util::{Address, H160};
|
||||||
use client::operations::Operations;
|
use client::operations::Operations;
|
||||||
use client::client::Client;
|
use client::client::Client;
|
||||||
|
|
||||||
@ -24,6 +24,10 @@ pub struct Updater {
|
|||||||
operations: Operations,
|
operations: Operations,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn platform() -> &'static str {
|
||||||
|
"linux_x64"
|
||||||
|
}
|
||||||
|
|
||||||
impl Updater {
|
impl Updater {
|
||||||
pub fn new(client: Weak<Client>, operations: Address) -> Self {
|
pub fn new(client: Weak<Client>, operations: Address) -> Self {
|
||||||
Updater {
|
Updater {
|
||||||
@ -32,13 +36,24 @@ impl Updater {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn tick(&mut self) {
|
pub fn tick(&mut self) {
|
||||||
match self.operations.is_latest("par", &code_hash().into()) {
|
(|| -> Result<(), String> {
|
||||||
Ok(res) => {
|
let code_hash = H160::from("0x080ec8043f41e25ee8aa4ee6112906ac6d82ea74").into();//code_hash().into();
|
||||||
info!("isLatest returned {}", res);
|
let client = "parity";
|
||||||
},
|
|
||||||
Err(e) => {
|
let (fork, track, semver) = self.operations.find_release(client, &code_hash)?;
|
||||||
warn!(target: "dapps", "Error while calling Operations.isLatest: {:?}", e);
|
let track_name = match track { 1 => "stable", 2 => "beta", 3 => "nightly", _ => "unknown" };
|
||||||
}
|
info!(target: "updater", "Current release ({}) is {}.{}.{}-{} and latest fork it supports is at block #{}", H160::from(code_hash), semver >> 16, (semver >> 8) & 0xff, semver & 0xff, track_name, fork);
|
||||||
}
|
|
||||||
|
let latest_fork = self.operations.latest_fork()?;
|
||||||
|
info!(target: "updater", "Latest fork is at block #{}", latest_fork);
|
||||||
|
|
||||||
|
let latest = self.operations.latest_in_track(client, track)?;
|
||||||
|
let (fork, _, semver) = self.operations.find_release(client, &latest)?;
|
||||||
|
info!(target: "updater", "Latest release in our track is {}.{}.{}-{} ({:?}); supports fork at block #{}", semver >> 16, (semver >> 8) & 0xff, semver & 0xff, track_name, H160::from(latest), fork);
|
||||||
|
|
||||||
|
let exe_hash = self.operations.find_checksum(client, &latest, platform())?;
|
||||||
|
info!(target: "updater", "Latest release's binary on {} is {}", platform(), exe_hash);
|
||||||
|
Ok(())
|
||||||
|
})().unwrap_or_else(|e| warn!("{}", e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user