Skip to content

Commit 09ebe7f

Browse files
Support mnemonic in the NS agent (#5883)
Co-authored-by: benedettadavico <benedetta.davico@gmail.com>
1 parent b72915c commit 09ebe7f

File tree

5 files changed

+16
-1
lines changed

5 files changed

+16
-1
lines changed

documentation/docs/pages/apis/ns-api/ns-api-run-deploy.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ export RUST_LOG="info"
306306
export NODE_STATUS_AGENT_SERVER_ADDRESS="http://127.0.0.1"
307307
export NODE_STATUS_AGENT_SERVER_PORT="8000"
308308
export NODE_STATUS_AGENT_AUTH_KEY=<NS_AGENT_PRIVATE_KEY>
309+
export NODE_STATUS_AGENT_PROBE_MNEMONIC=<NS_AGENT_MNEMONIC>
309310
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"
310311

311312
workers=${1:-1}

nym-node-status-api/nym-node-status-agent/run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export NODE_STATUS_AGENT_SERVER_ADDRESS="http://127.0.0.1"
2121
export NODE_STATUS_AGENT_SERVER_PORT="8000"
2222
export NODE_STATUS_AGENT_PROBE_PATH="$crate_root/nym-gateway-probe"
2323
export NODE_STATUS_AGENT_AUTH_KEY="BjyC9SsHAZUzPRkQR4sPTvVrp4GgaquTh5YfSJksvvWT"
24+
export NODE_STATUS_AGENT_PROBE_MNEMONIC="$MNEMONIC"
2425
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"
2526

2627
workers=${1:-1}

nym-node-status-api/nym-node-status-agent/src/cli/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ pub(crate) enum Command {
3636
#[arg(long, env = "NODE_STATUS_AGENT_PROBE_PATH")]
3737
probe_path: String,
3838

39+
/// mnemonic for acquiring zk-nyms
40+
#[arg(long, env = "NYM_NODE_MNEMONICS")]
41+
mnemonic: String,
42+
3943
#[arg(
4044
long,
4145
env = "NODE_STATUS_AGENT_PROBE_EXTRA_ARGS",
@@ -58,12 +62,14 @@ impl Args {
5862
server_port,
5963
ns_api_auth_key,
6064
probe_path,
65+
mnemonic,
6166
probe_extra_args,
6267
} => run_probe::run_probe(
6368
server_address,
6469
server_port.to_owned(),
6570
ns_api_auth_key,
6671
probe_path,
72+
mnemonic,
6773
probe_extra_args,
6874
)
6975
.await

nym-node-status-api/nym-node-status-agent/src/cli/run_probe.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pub(crate) async fn run_probe(
77
server_port: u16,
88
ns_api_auth_key: &str,
99
probe_path: &str,
10+
mnemonic: &str,
1011
probe_extra_args: &Vec<String>,
1112
) -> anyhow::Result<()> {
1213
let auth_key = PrivateKey::from_base58_string(ns_api_auth_key)
@@ -20,7 +21,11 @@ pub(crate) async fn run_probe(
2021
tracing::info!("Probe version:\n{}", version);
2122

2223
if let Some(testrun) = ns_api_client.request_testrun().await? {
23-
let log = probe.run_and_get_log(&Some(testrun.gateway_identity_key), probe_extra_args);
24+
let log = probe.run_and_get_log(
25+
&Some(testrun.gateway_identity_key),
26+
mnemonic,
27+
probe_extra_args,
28+
);
2429

2530
ns_api_client
2631
.submit_results(testrun.testrun_id, log, testrun.assigned_at_utc)

nym-node-status-api/nym-node-status-agent/src/probe.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ impl GwProbe {
7373
pub(crate) fn run_and_get_log(
7474
&self,
7575
gateway_key: &Option<String>,
76+
mnemonic: &str,
7677
probe_extra_args: &Vec<String>,
7778
) -> String {
7879
let mut command = std::process::Command::new(&self.path);
@@ -81,6 +82,7 @@ impl GwProbe {
8182
if let Some(gateway_id) = gateway_key {
8283
command.arg("--gateway").arg(gateway_id);
8384
}
85+
command.arg("--mnemonic").arg(mnemonic);
8486

8587
tracing::info!("Extra args for the probe:");
8688
for arg in probe_extra_args {

0 commit comments

Comments
 (0)