Skip to content

Commit

Permalink
Merge pull request #18 from karnotxyz/campaign_patches
Browse files Browse the repository at this point in the history
logs, prometheus expose
  • Loading branch information
apoorvsadana authored Jan 26, 2024
2 parents bac2cc1 + 450d2e8 commit abfbe77
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/cli/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub enum RunError {
#[error(transparent)]
Other(#[from] eyre::Error),
}

pub async fn run() {
match start_app_chain().await {
Ok(_) => {
Expand Down
8 changes: 6 additions & 2 deletions src/da/avail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,13 @@ impl DaClient for AvailClient {
log::info!("🔑 Secret phrase stored in app home: {}", file_path_str);
log::info!("💧 Avail address: {}", pair.public());
log::info!(
"=> Please fund your Avail address to be able to submit blobs to the goldberg network. Docs: {}",
"📕 Please fund your Avail address to be able to submit blobs to the goldberg network. Docs: {}.",
AVAIL_DOCS
)
);
log::info!(
"🛠️ If you want to use a custom Avail address, please enter your seed and address in the config file: {}.",
file_path_str
);
}

generate_config(file_path_str.as_str(), &seed_str, pair.public().to_string().as_str())?;
Expand Down
12 changes: 9 additions & 3 deletions src/utils/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ use std::path::PathBuf;
use std::process::{Command, Output, Stdio};

pub fn execute_cmd(program: &str, args: &[&str], dir: &PathBuf) -> Result<Output, Error> {
let output = execute_cmd_stdout(program, args, dir, Stdio::inherit())?;
let output = execute_cmd_stdio(program, args, dir, Stdio::inherit(), Stdio::inherit())?;
Ok(output)
}

pub fn execute_cmd_stdout(program: &str, args: &[&str], dir: &PathBuf, out: Stdio) -> Result<Output, Error> {
let result = Command::new(program).current_dir(dir).args(args).stdout(out).stderr(Stdio::inherit()).output();
pub fn execute_cmd_stdio<T: Into<Stdio>>(
program: &str,
args: &[&str],
dir: &PathBuf,
out: T,
err: T,
) -> Result<Output, Error> {
let result = Command::new(program).current_dir(dir).args(args).stdout(out).stderr(err).output();

match result {
Ok(output) => {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ pub async fn container_exists(container_name: &str) -> bool {
log::debug!("❌ Container {} does not exist!", container_name);
false
}
Err(_) => {
panic!("Failed to fetch containers, panicking");
Err(e) => {
panic!("Failed to fetch containers, panicking {}", e);
}
}
}
Expand Down
11 changes: 9 additions & 2 deletions src/utils/madara.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,15 @@ pub fn setup_and_run_madara(config: AppChainConfig) -> Result<(), MadaraError> {
let da_conf = format!("--da-conf={}", da_config_path);
let base_path = format!("--base-path={}", config.base_path);

let mut args =
vec!["--chain=dev", "--alice", "--force-authoring", "--rpc-cors=all", "--tx-ban-seconds=0", &base_path];
let mut args = vec![
"--chain=dev",
"--alice",
"--force-authoring",
"--rpc-cors=all",
"--tx-ban-seconds=0",
"--prometheus-external",
&base_path,
];

match config.da_layer {
DALayer::Ethereum => {
Expand Down

0 comments on commit abfbe77

Please sign in to comment.