Skip to content

Support mnemonic in the NS agent #5883

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ export RUST_LOG="info"
export NODE_STATUS_AGENT_SERVER_ADDRESS="http://127.0.0.1"
export NODE_STATUS_AGENT_SERVER_PORT="8000"
export NODE_STATUS_AGENT_AUTH_KEY=<NS_AGENT_PRIVATE_KEY>
export NODE_STATUS_AGENT_PROBE_MNEMONIC=<NS_AGENT_MNEMONIC>
export NODE_STATUS_AGENT_PROBE_EXTRA_ARGS="netstack-download-timeout-sec=30,netstack-num-ping=2,netstack-send-timeout-sec=1,netstack-recv-timeout-sec=1"

workers=${1:-1}
Expand Down
1 change: 1 addition & 0 deletions nym-node-status-api/nym-node-status-agent/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export NODE_STATUS_AGENT_SERVER_ADDRESS="http://127.0.0.1"
export NODE_STATUS_AGENT_SERVER_PORT="8000"
export NODE_STATUS_AGENT_PROBE_PATH="$crate_root/nym-gateway-probe"
export NODE_STATUS_AGENT_AUTH_KEY="BjyC9SsHAZUzPRkQR4sPTvVrp4GgaquTh5YfSJksvvWT"
export NODE_STATUS_AGENT_PROBE_MNEMONIC="$MNEMONIC"
export NODE_STATUS_AGENT_PROBE_EXTRA_ARGS="netstack-download-timeout-sec=30,netstack-num-ping=2,netstack-send-timeout-sec=1,netstack-recv-timeout-sec=1"

workers=${1:-1}
Expand Down
6 changes: 6 additions & 0 deletions nym-node-status-api/nym-node-status-agent/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ pub(crate) enum Command {
#[arg(long, env = "NODE_STATUS_AGENT_PROBE_PATH")]
probe_path: String,

/// mnemonic for acquiring zk-nyms
#[arg(long, env = "NYM_NODE_MNEMONICS")]
mnemonic: String,

#[arg(
long,
env = "NODE_STATUS_AGENT_PROBE_EXTRA_ARGS",
Expand All @@ -58,12 +62,14 @@ impl Args {
server_port,
ns_api_auth_key,
probe_path,
mnemonic,
probe_extra_args,
} => run_probe::run_probe(
server_address,
server_port.to_owned(),
ns_api_auth_key,
probe_path,
mnemonic,
probe_extra_args,
)
.await
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pub(crate) async fn run_probe(
server_port: u16,
ns_api_auth_key: &str,
probe_path: &str,
mnemonic: &str,
probe_extra_args: &Vec<String>,
) -> anyhow::Result<()> {
let auth_key = PrivateKey::from_base58_string(ns_api_auth_key)
Expand All @@ -20,7 +21,11 @@ pub(crate) async fn run_probe(
tracing::info!("Probe version:\n{}", version);

if let Some(testrun) = ns_api_client.request_testrun().await? {
let log = probe.run_and_get_log(&Some(testrun.gateway_identity_key), probe_extra_args);
let log = probe.run_and_get_log(
&Some(testrun.gateway_identity_key),
mnemonic,
probe_extra_args,
);

ns_api_client
.submit_results(testrun.testrun_id, log, testrun.assigned_at_utc)
Expand Down
2 changes: 2 additions & 0 deletions nym-node-status-api/nym-node-status-agent/src/probe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ impl GwProbe {
pub(crate) fn run_and_get_log(
&self,
gateway_key: &Option<String>,
mnemonic: &str,
probe_extra_args: &Vec<String>,
) -> String {
let mut command = std::process::Command::new(&self.path);
Expand All @@ -81,6 +82,7 @@ impl GwProbe {
if let Some(gateway_id) = gateway_key {
command.arg("--gateway").arg(gateway_id);
}
command.arg("--mnemonic").arg(mnemonic);

tracing::info!("Extra args for the probe:");
for arg in probe_extra_args {
Expand Down
Loading