Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor hersir: pull out all keys generation and allow to define external wallets or committess and voteplans, this will allow external clients to create their own keys which will be used for tally operations. * update tests with hersir changes * Refactor explorer module. Extract configuration struct for explorer. Added extension to multiaddr struct for better address formatting and finally make ExplorerProcess constructor return error * added simple explorer client which is capable to send simple sanity request to explorer server * update usages for ExplorerProcess new constructor impl * added possibility to start explorer by hersir
- Loading branch information
Showing
31 changed files
with
389 additions
and
76 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use crate::{builder::NodeSetting, config::ExplorerTemplate}; | ||
use jormungandr_automation::{ | ||
jormungandr::{explorer::configuration::ExplorerConfiguration, get_available_port, NodeAlias}, | ||
utils::MultiaddrExtension, | ||
}; | ||
use std::{collections::HashMap, path::Path}; | ||
|
||
pub fn generate_explorer( | ||
nodes: &HashMap<NodeAlias, NodeSetting>, | ||
explorer_template: &ExplorerTemplate, | ||
) -> Result<ExplorerConfiguration, Error> { | ||
let settings = nodes | ||
.get(&explorer_template.connect_to) | ||
.ok_or_else(|| Error::CannotFindAlias(explorer_template.connect_to.clone()))?; | ||
|
||
Ok(ExplorerConfiguration { | ||
explorer_port: get_available_port(), | ||
explorer_listen_address: "127.0.0.1".to_string(), | ||
node_address: settings.config.p2p.public_address.clone().to_http_addr(), | ||
logs_dir: Some(Path::new("C:\\work\\iohk\\logs.txt").to_path_buf()), | ||
storage_dir: None, | ||
params: explorer_template.to_explorer_params(), | ||
}) | ||
} | ||
|
||
#[derive(thiserror::Error, Debug)] | ||
pub enum Error { | ||
#[error("cannot find alias '{0}' for any defined node")] | ||
CannotFindAlias(NodeAlias), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.