Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 07cb94218f | |||
| 6ddfc32ebd | |||
| dc72c1eadd | |||
| acb7be7ea2 | |||
| ab0320733e | |||
| 01ebf3677d |
Generated
+276
-6
@@ -2440,7 +2440,7 @@ dependencies = [
|
|||||||
"maxminddb",
|
"maxminddb",
|
||||||
"nym-bin-common 0.6.0",
|
"nym-bin-common 0.6.0",
|
||||||
"nym-contracts-common 0.5.0",
|
"nym-contracts-common 0.5.0",
|
||||||
"nym-explorer-api-requests",
|
"nym-explorer-api-requests 0.1.0",
|
||||||
"nym-mixnet-contract-common 0.6.0",
|
"nym-mixnet-contract-common 0.6.0",
|
||||||
"nym-network-defaults 0.1.0",
|
"nym-network-defaults 0.1.0",
|
||||||
"nym-task",
|
"nym-task",
|
||||||
@@ -4586,6 +4586,34 @@ dependencies = [
|
|||||||
"utoipa",
|
"utoipa",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nym-api-requests"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "git+https://github.com/nymtech/nym?branch=release/2024.13-magura#317f7fffa986dff856e5b980b15872620bc052f0"
|
||||||
|
dependencies = [
|
||||||
|
"bs58",
|
||||||
|
"cosmrs 0.17.0-pre",
|
||||||
|
"cosmwasm-std",
|
||||||
|
"ecdsa",
|
||||||
|
"getset",
|
||||||
|
"nym-compact-ecash 0.1.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"nym-credentials-interface 0.1.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"nym-crypto 0.4.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"nym-ecash-time 0.1.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"nym-mixnet-contract-common 0.6.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"nym-network-defaults 0.1.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"nym-node-requests 0.1.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"nym-serde-helpers 0.1.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"schemars",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"sha2 0.10.8",
|
||||||
|
"tendermint 0.37.0",
|
||||||
|
"thiserror",
|
||||||
|
"time",
|
||||||
|
"utoipa",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-async-file-watcher"
|
name = "nym-async-file-watcher"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -4716,6 +4744,21 @@ dependencies = [
|
|||||||
"vergen",
|
"vergen",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nym-bin-common"
|
||||||
|
version = "0.6.0"
|
||||||
|
source = "git+https://github.com/nymtech/nym?branch=release/2024.13-magura#317f7fffa986dff856e5b980b15872620bc052f0"
|
||||||
|
dependencies = [
|
||||||
|
"const-str",
|
||||||
|
"log",
|
||||||
|
"pretty_env_logger",
|
||||||
|
"schemars",
|
||||||
|
"semver 1.0.23",
|
||||||
|
"serde",
|
||||||
|
"utoipa",
|
||||||
|
"vergen",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-bity-integration"
|
name = "nym-bity-integration"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -4876,7 +4919,7 @@ dependencies = [
|
|||||||
"nym-credentials-interface 0.1.0",
|
"nym-credentials-interface 0.1.0",
|
||||||
"nym-crypto 0.4.0",
|
"nym-crypto 0.4.0",
|
||||||
"nym-ecash-time 0.1.0",
|
"nym-ecash-time 0.1.0",
|
||||||
"nym-explorer-client",
|
"nym-explorer-client 0.1.0",
|
||||||
"nym-gateway-client",
|
"nym-gateway-client",
|
||||||
"nym-gateway-requests",
|
"nym-gateway-requests",
|
||||||
"nym-id",
|
"nym-id",
|
||||||
@@ -5115,6 +5158,29 @@ dependencies = [
|
|||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nym-compact-ecash"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "git+https://github.com/nymtech/nym?branch=release/2024.13-magura#317f7fffa986dff856e5b980b15872620bc052f0"
|
||||||
|
dependencies = [
|
||||||
|
"bincode",
|
||||||
|
"bls12_381",
|
||||||
|
"bs58",
|
||||||
|
"cfg-if",
|
||||||
|
"digest 0.9.0",
|
||||||
|
"ff",
|
||||||
|
"group",
|
||||||
|
"itertools 0.13.0",
|
||||||
|
"nym-network-defaults 0.1.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"nym-pemstore 0.3.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"rand",
|
||||||
|
"serde",
|
||||||
|
"sha2 0.9.9",
|
||||||
|
"subtle 2.5.0",
|
||||||
|
"thiserror",
|
||||||
|
"zeroize",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-config"
|
name = "nym-config"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -5142,6 +5208,20 @@ dependencies = [
|
|||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nym-config"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "git+https://github.com/nymtech/nym?branch=release/2024.13-magura#317f7fffa986dff856e5b980b15872620bc052f0"
|
||||||
|
dependencies = [
|
||||||
|
"dirs",
|
||||||
|
"handlebars",
|
||||||
|
"log",
|
||||||
|
"nym-network-defaults 0.1.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"serde",
|
||||||
|
"toml 0.8.14",
|
||||||
|
"url",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-contracts-common"
|
name = "nym-contracts-common"
|
||||||
version = "0.5.0"
|
version = "0.5.0"
|
||||||
@@ -5172,6 +5252,21 @@ dependencies = [
|
|||||||
"vergen",
|
"vergen",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nym-contracts-common"
|
||||||
|
version = "0.5.0"
|
||||||
|
source = "git+https://github.com/nymtech/nym?branch=release/2024.13-magura#317f7fffa986dff856e5b980b15872620bc052f0"
|
||||||
|
dependencies = [
|
||||||
|
"bs58",
|
||||||
|
"cosmwasm-schema",
|
||||||
|
"cosmwasm-std",
|
||||||
|
"cw-storage-plus",
|
||||||
|
"schemars",
|
||||||
|
"serde",
|
||||||
|
"thiserror",
|
||||||
|
"vergen",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-country-group"
|
name = "nym-country-group"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -5377,6 +5472,22 @@ dependencies = [
|
|||||||
"time",
|
"time",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nym-credentials-interface"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "git+https://github.com/nymtech/nym?branch=release/2024.13-magura#317f7fffa986dff856e5b980b15872620bc052f0"
|
||||||
|
dependencies = [
|
||||||
|
"bls12_381",
|
||||||
|
"nym-compact-ecash 0.1.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"nym-ecash-time 0.1.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"nym-network-defaults 0.1.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"rand",
|
||||||
|
"serde",
|
||||||
|
"strum 0.26.3",
|
||||||
|
"thiserror",
|
||||||
|
"time",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-crypto"
|
name = "nym-crypto"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
@@ -5422,6 +5533,23 @@ dependencies = [
|
|||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nym-crypto"
|
||||||
|
version = "0.4.0"
|
||||||
|
source = "git+https://github.com/nymtech/nym?branch=release/2024.13-magura#317f7fffa986dff856e5b980b15872620bc052f0"
|
||||||
|
dependencies = [
|
||||||
|
"bs58",
|
||||||
|
"ed25519-dalek",
|
||||||
|
"nym-pemstore 0.3.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"nym-sphinx-types 0.2.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"serde",
|
||||||
|
"serde_bytes",
|
||||||
|
"subtle-encoding",
|
||||||
|
"thiserror",
|
||||||
|
"x25519-dalek",
|
||||||
|
"zeroize",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-data-observatory"
|
name = "nym-data-observatory"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -5523,6 +5651,14 @@ dependencies = [
|
|||||||
"time",
|
"time",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nym-ecash-time"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "git+https://github.com/nymtech/nym?branch=release/2024.13-magura#317f7fffa986dff856e5b980b15872620bc052f0"
|
||||||
|
dependencies = [
|
||||||
|
"time",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-execute"
|
name = "nym-execute"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -5555,6 +5691,18 @@ dependencies = [
|
|||||||
"utoipa",
|
"utoipa",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nym-exit-policy"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "git+https://github.com/nymtech/nym?branch=release/2024.13-magura#317f7fffa986dff856e5b980b15872620bc052f0"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"thiserror",
|
||||||
|
"tracing",
|
||||||
|
"utoipa",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-explorer-api-requests"
|
name = "nym-explorer-api-requests"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -5567,11 +5715,23 @@ dependencies = [
|
|||||||
"ts-rs",
|
"ts-rs",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nym-explorer-api-requests"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "git+https://github.com/nymtech/nym?branch=release/2024.13-magura#317f7fffa986dff856e5b980b15872620bc052f0"
|
||||||
|
dependencies = [
|
||||||
|
"nym-api-requests 0.1.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"nym-contracts-common 0.5.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"nym-mixnet-contract-common 0.6.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"schemars",
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-explorer-client"
|
name = "nym-explorer-client"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nym-explorer-api-requests",
|
"nym-explorer-api-requests 0.1.0",
|
||||||
"reqwest 0.12.4",
|
"reqwest 0.12.4",
|
||||||
"serde",
|
"serde",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
@@ -5580,6 +5740,19 @@ dependencies = [
|
|||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nym-explorer-client"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "git+https://github.com/nymtech/nym?branch=release/2024.13-magura#317f7fffa986dff856e5b980b15872620bc052f0"
|
||||||
|
dependencies = [
|
||||||
|
"log",
|
||||||
|
"nym-explorer-api-requests 0.1.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"reqwest 0.12.4",
|
||||||
|
"serde",
|
||||||
|
"thiserror",
|
||||||
|
"url",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-ffi-shared"
|
name = "nym-ffi-shared"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
@@ -6009,6 +6182,27 @@ dependencies = [
|
|||||||
"time",
|
"time",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nym-mixnet-contract-common"
|
||||||
|
version = "0.6.0"
|
||||||
|
source = "git+https://github.com/nymtech/nym?branch=release/2024.13-magura#317f7fffa986dff856e5b980b15872620bc052f0"
|
||||||
|
dependencies = [
|
||||||
|
"bs58",
|
||||||
|
"cosmwasm-schema",
|
||||||
|
"cosmwasm-std",
|
||||||
|
"cw-controllers",
|
||||||
|
"cw-storage-plus",
|
||||||
|
"humantime-serde",
|
||||||
|
"log",
|
||||||
|
"nym-contracts-common 0.5.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"schemars",
|
||||||
|
"serde",
|
||||||
|
"serde-json-wasm",
|
||||||
|
"serde_repr",
|
||||||
|
"thiserror",
|
||||||
|
"time",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-mixnode"
|
name = "nym-mixnode"
|
||||||
version = "1.1.37"
|
version = "1.1.37"
|
||||||
@@ -6140,6 +6334,19 @@ dependencies = [
|
|||||||
"utoipa",
|
"utoipa",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nym-network-defaults"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "git+https://github.com/nymtech/nym?branch=release/2024.13-magura#317f7fffa986dff856e5b980b15872620bc052f0"
|
||||||
|
dependencies = [
|
||||||
|
"dotenvy",
|
||||||
|
"log",
|
||||||
|
"schemars",
|
||||||
|
"serde",
|
||||||
|
"url",
|
||||||
|
"utoipa",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-network-monitor"
|
name = "nym-network-monitor"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -6346,8 +6553,29 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-node-status-agent"
|
name = "nym-node-requests"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
source = "git+https://github.com/nymtech/nym?branch=release/2024.13-magura#317f7fffa986dff856e5b980b15872620bc052f0"
|
||||||
|
dependencies = [
|
||||||
|
"base64 0.22.1",
|
||||||
|
"celes",
|
||||||
|
"humantime 2.1.0",
|
||||||
|
"humantime-serde",
|
||||||
|
"nym-bin-common 0.6.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"nym-crypto 0.4.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"nym-exit-policy 0.1.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"nym-wireguard-types 0.1.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"schemars",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"thiserror",
|
||||||
|
"time",
|
||||||
|
"utoipa",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nym-node-status-agent"
|
||||||
|
version = "0.1.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"clap 4.5.20",
|
"clap 4.5.20",
|
||||||
@@ -6363,7 +6591,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-node-status-api"
|
name = "nym-node-status-api"
|
||||||
version = "0.1.0"
|
version = "0.1.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"axum 0.7.7",
|
"axum 0.7.7",
|
||||||
@@ -6375,7 +6603,7 @@ dependencies = [
|
|||||||
"moka",
|
"moka",
|
||||||
"nym-bin-common 0.6.0",
|
"nym-bin-common 0.6.0",
|
||||||
"nym-common-models",
|
"nym-common-models",
|
||||||
"nym-explorer-client",
|
"nym-explorer-client 0.1.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
"nym-network-defaults 0.1.0 (git+https://github.com/nymtech/nym?branch=pre-dir-v2-fork)",
|
"nym-network-defaults 0.1.0 (git+https://github.com/nymtech/nym?branch=pre-dir-v2-fork)",
|
||||||
"nym-node-requests 0.1.0 (git+https://github.com/nymtech/nym?branch=pre-dir-v2-fork)",
|
"nym-node-requests 0.1.0 (git+https://github.com/nymtech/nym?branch=pre-dir-v2-fork)",
|
||||||
"nym-task",
|
"nym-task",
|
||||||
@@ -6508,6 +6736,14 @@ dependencies = [
|
|||||||
"pem",
|
"pem",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nym-pemstore"
|
||||||
|
version = "0.3.0"
|
||||||
|
source = "git+https://github.com/nymtech/nym?branch=release/2024.13-magura#317f7fffa986dff856e5b980b15872620bc052f0"
|
||||||
|
dependencies = [
|
||||||
|
"pem",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-sdk"
|
name = "nym-sdk"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -6584,6 +6820,17 @@ dependencies = [
|
|||||||
"time",
|
"time",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nym-serde-helpers"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "git+https://github.com/nymtech/nym?branch=release/2024.13-magura#317f7fffa986dff856e5b980b15872620bc052f0"
|
||||||
|
dependencies = [
|
||||||
|
"base64 0.22.1",
|
||||||
|
"bs58",
|
||||||
|
"serde",
|
||||||
|
"time",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-service-provider-requests-common"
|
name = "nym-service-provider-requests-common"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -6897,6 +7144,15 @@ dependencies = [
|
|||||||
"thiserror",
|
"thiserror",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nym-sphinx-types"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "git+https://github.com/nymtech/nym?branch=release/2024.13-magura#317f7fffa986dff856e5b980b15872620bc052f0"
|
||||||
|
dependencies = [
|
||||||
|
"sphinx-packet",
|
||||||
|
"thiserror",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nym-statistics-common"
|
name = "nym-statistics-common"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -7263,6 +7519,20 @@ dependencies = [
|
|||||||
"x25519-dalek",
|
"x25519-dalek",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nym-wireguard-types"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "git+https://github.com/nymtech/nym?branch=release/2024.13-magura#317f7fffa986dff856e5b980b15872620bc052f0"
|
||||||
|
dependencies = [
|
||||||
|
"base64 0.22.1",
|
||||||
|
"log",
|
||||||
|
"nym-config 0.1.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"nym-network-defaults 0.1.0 (git+https://github.com/nymtech/nym?branch=release/2024.13-magura)",
|
||||||
|
"serde",
|
||||||
|
"thiserror",
|
||||||
|
"x25519-dalek",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nymvisor"
|
name = "nymvisor"
|
||||||
version = "0.1.8"
|
version = "0.1.8"
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ use serde::{Deserialize, Serialize};
|
|||||||
|
|
||||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||||
pub struct TestrunAssignment {
|
pub struct TestrunAssignment {
|
||||||
/// has nothing to do with GW identity key. This is PK from `gateways` table
|
|
||||||
pub testrun_id: i64,
|
pub testrun_id: i64,
|
||||||
pub gateway_pk_id: i64,
|
pub gateway_identity_key: String,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "nym-node-status-agent"
|
name = "nym-node-status-agent"
|
||||||
version = "0.1.0"
|
version = "0.1.4"
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
|
|||||||
@@ -31,24 +31,19 @@ pub(crate) enum Command {
|
|||||||
/// path of binary to run
|
/// path of binary to run
|
||||||
#[arg(long, env = "NODE_STATUS_AGENT_PROBE_PATH")]
|
#[arg(long, env = "NODE_STATUS_AGENT_PROBE_PATH")]
|
||||||
probe_path: String,
|
probe_path: String,
|
||||||
#[arg(short, long, env = "NODE_STATUS_AGENT_GATEWAY_ID")]
|
|
||||||
gateway_id: Option<String>,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Args {
|
impl Args {
|
||||||
pub(crate) async fn execute(&self) -> anyhow::Result<()> {
|
pub(crate) async fn execute(&self) -> anyhow::Result<()> {
|
||||||
match &self.command {
|
match &self.command {
|
||||||
Command::RunProbe {
|
Command::RunProbe { probe_path } => self.run_probe(probe_path).await?,
|
||||||
probe_path,
|
|
||||||
gateway_id,
|
|
||||||
} => self.run_probe(probe_path, gateway_id).await?,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn run_probe(&self, probe_path: &str, gateway_id: &Option<String>) -> anyhow::Result<()> {
|
async fn run_probe(&self, probe_path: &str) -> anyhow::Result<()> {
|
||||||
let server_address = format!("{}:{}", &self.server_address, self.server_port);
|
let server_address = format!("{}:{}", &self.server_address, self.server_port);
|
||||||
|
|
||||||
let probe = GwProbe::new(probe_path.to_string());
|
let probe = GwProbe::new(probe_path.to_string());
|
||||||
@@ -58,7 +53,7 @@ impl Args {
|
|||||||
|
|
||||||
let testrun = request_testrun(&server_address).await?;
|
let testrun = request_testrun(&server_address).await?;
|
||||||
|
|
||||||
let log = probe.run_and_get_log(gateway_id);
|
let log = probe.run_and_get_log(&Some(testrun.gateway_identity_key));
|
||||||
|
|
||||||
submit_results(&server_address, testrun.testrun_id, log).await?;
|
submit_results(&server_address, testrun.testrun_id, log).await?;
|
||||||
|
|
||||||
@@ -97,6 +92,7 @@ async fn submit_results(
|
|||||||
) -> anyhow::Result<()> {
|
) -> anyhow::Result<()> {
|
||||||
let target_url = format!("{}/{}/{}", server_addr, URL_BASE, testrun_id);
|
let target_url = format!("{}/{}/{}", server_addr, URL_BASE, testrun_id);
|
||||||
let client = reqwest::Client::new();
|
let client = reqwest::Client::new();
|
||||||
|
|
||||||
let res = client
|
let res = client
|
||||||
.post(target_url)
|
.post(target_url)
|
||||||
.body(probe_outcome)
|
.body(probe_outcome)
|
||||||
|
|||||||
@@ -40,6 +40,12 @@ impl GwProbe {
|
|||||||
match command.spawn() {
|
match command.spawn() {
|
||||||
Ok(child) => {
|
Ok(child) => {
|
||||||
if let Ok(output) = child.wait_with_output() {
|
if let Ok(output) = child.wait_with_output() {
|
||||||
|
if !output.status.success() {
|
||||||
|
let out = String::from_utf8_lossy(&output.stdout);
|
||||||
|
let err = String::from_utf8_lossy(&output.stderr);
|
||||||
|
tracing::error!("Probe exited with {:?}:\n{}\n{}", output.status, out, err);
|
||||||
|
}
|
||||||
|
|
||||||
return String::from_utf8(output.stdout)
|
return String::from_utf8(output.stdout)
|
||||||
.unwrap_or("Unable to get log from test run".to_string());
|
.unwrap_or("Unable to get log from test run".to_string());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "nym-node-status-api"
|
name = "nym-node-status-api"
|
||||||
version = "0.1.0"
|
version = "0.1.4"
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
@@ -23,7 +23,8 @@ futures-util = { workspace = true }
|
|||||||
moka = { workspace = true, features = ["future"] }
|
moka = { workspace = true, features = ["future"] }
|
||||||
nym-bin-common = { path = "../common/bin-common", features = ["models"]}
|
nym-bin-common = { path = "../common/bin-common", features = ["models"]}
|
||||||
nym-common-models = { path = "../common/models" }
|
nym-common-models = { path = "../common/models" }
|
||||||
nym-explorer-client = { path = "../explorer-api/explorer-client" }
|
# nym-explorer-client = { path = "../explorer-api/explorer-client" }
|
||||||
|
nym-explorer-client = { git = "https://github.com/nymtech/nym", branch = "release/2024.13-magura" }
|
||||||
# TODO dz: before Nym API client breaking changes. Update to latest develop once new Nym API is live
|
# TODO dz: before Nym API client breaking changes. Update to latest develop once new Nym API is live
|
||||||
nym-network-defaults = { git = "https://github.com/nymtech/nym", branch = "pre-dir-v2-fork" }
|
nym-network-defaults = { git = "https://github.com/nymtech/nym", branch = "pre-dir-v2-fork" }
|
||||||
nym-validator-client = { git = "https://github.com/nymtech/nym", branch = "pre-dir-v2-fork" }
|
nym-validator-client = { git = "https://github.com/nymtech/nym", branch = "pre-dir-v2-fork" }
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ async fn main() -> Result<()> {
|
|||||||
// not a valid windows path... but hey, it works...
|
// not a valid windows path... but hey, it works...
|
||||||
println!("cargo::rustc-env=DATABASE_URL=sqlite:///{}", &database_path);
|
println!("cargo::rustc-env=DATABASE_URL=sqlite:///{}", &database_path);
|
||||||
|
|
||||||
rerun_if_changed();
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,11 +32,6 @@ fn read_env_var(var: &str) -> Result<String> {
|
|||||||
std::env::var(var).map_err(|_| anyhow!("You need to set {} env var", var))
|
std::env::var(var).map_err(|_| anyhow!("You need to set {} env var", var))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn rerun_if_changed() {
|
|
||||||
println!("cargo::rerun-if-changed=migrations");
|
|
||||||
println!("cargo::rerun-if-changed=src/db/queries");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// use `./enter_db.sh` to inspect DB
|
/// use `./enter_db.sh` to inspect DB
|
||||||
async fn write_db_path_to_file(out_dir: &str, db_filename: &str) -> anyhow::Result<()> {
|
async fn write_db_path_to_file(out_dir: &str, db_filename: &str) -> anyhow::Result<()> {
|
||||||
let mut file = File::create("enter_db.sh").await?;
|
let mut file = File::create("enter_db.sh").await?;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export RUST_LOG=${RUST_LOG:-debug}
|
|||||||
export NYM_API_CLIENT_TIMEOUT=60
|
export NYM_API_CLIENT_TIMEOUT=60
|
||||||
export EXPLORER_CLIENT_TIMEOUT=60
|
export EXPLORER_CLIENT_TIMEOUT=60
|
||||||
|
|
||||||
export ENVIRONMENT="mainnet.env"
|
export ENVIRONMENT="qa.env"
|
||||||
|
|
||||||
function run_bare() {
|
function run_bare() {
|
||||||
# export necessary env vars
|
# export necessary env vars
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ CREATE TABLE
|
|||||||
CREATE TABLE testruns
|
CREATE TABLE testruns
|
||||||
(
|
(
|
||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
gateway_id INTEGER,
|
gateway_id INTEGER NOT NULL,
|
||||||
status INTEGER NOT NULL, -- 0=pending, 1=in-progress, 2=complete
|
status INTEGER NOT NULL, -- 0=pending, 1=in-progress, 2=complete
|
||||||
timestamp_utc INTEGER NOT NULL,
|
timestamp_utc INTEGER NOT NULL,
|
||||||
ip_address VARCHAR NOT NULL,
|
ip_address VARCHAR NOT NULL,
|
||||||
|
|||||||
@@ -300,6 +300,7 @@ pub(crate) mod gateway {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)] // not dead code, this is SQL data model
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct TestRunDto {
|
pub struct TestRunDto {
|
||||||
pub id: i64,
|
pub id: i64,
|
||||||
@@ -315,7 +316,7 @@ pub struct TestRunDto {
|
|||||||
pub(crate) enum TestRunStatus {
|
pub(crate) enum TestRunStatus {
|
||||||
Complete = 2,
|
Complete = 2,
|
||||||
InProgress = 1,
|
InProgress = 1,
|
||||||
Pending = 0,
|
Queued = 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|||||||
@@ -7,8 +7,28 @@ use crate::{
|
|||||||
};
|
};
|
||||||
use futures_util::TryStreamExt;
|
use futures_util::TryStreamExt;
|
||||||
use nym_validator_client::models::DescribedGateway;
|
use nym_validator_client::models::DescribedGateway;
|
||||||
|
use sqlx::{pool::PoolConnection, Sqlite};
|
||||||
use tracing::error;
|
use tracing::error;
|
||||||
|
|
||||||
|
pub(crate) async fn select_gateway_identity(
|
||||||
|
conn: &mut PoolConnection<Sqlite>,
|
||||||
|
gateway_pk: i64,
|
||||||
|
) -> anyhow::Result<String> {
|
||||||
|
let record = sqlx::query!(
|
||||||
|
r#"SELECT
|
||||||
|
gateway_identity_key
|
||||||
|
FROM
|
||||||
|
gateways
|
||||||
|
WHERE
|
||||||
|
id = ?"#,
|
||||||
|
gateway_pk
|
||||||
|
)
|
||||||
|
.fetch_one(conn.as_mut())
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
Ok(record.gateway_identity_key)
|
||||||
|
}
|
||||||
|
|
||||||
pub(crate) async fn insert_gateways(
|
pub(crate) async fn insert_gateways(
|
||||||
pool: &DbPool,
|
pool: &DbPool,
|
||||||
gateways: Vec<GatewayRecord>,
|
gateways: Vec<GatewayRecord>,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ mod summary;
|
|||||||
pub(crate) mod testruns;
|
pub(crate) mod testruns;
|
||||||
|
|
||||||
pub(crate) use gateways::{
|
pub(crate) use gateways::{
|
||||||
ensure_gateways_still_bonded, get_all_gateways, insert_gateways,
|
ensure_gateways_still_bonded, get_all_gateways, insert_gateways, select_gateway_identity,
|
||||||
write_blacklisted_gateways_to_db,
|
write_blacklisted_gateways_to_db,
|
||||||
};
|
};
|
||||||
pub(crate) use misc::insert_summaries;
|
pub(crate) use misc::insert_summaries;
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
|
use crate::db::DbPool;
|
||||||
use crate::http::models::TestrunAssignment;
|
use crate::http::models::TestrunAssignment;
|
||||||
use crate::{
|
use crate::{
|
||||||
db::models::{TestRunDto, TestRunStatus},
|
db::models::{TestRunDto, TestRunStatus},
|
||||||
testruns::now_utc,
|
testruns::now_utc,
|
||||||
};
|
};
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
|
use chrono::Duration;
|
||||||
use sqlx::{pool::PoolConnection, Sqlite};
|
use sqlx::{pool::PoolConnection, Sqlite};
|
||||||
|
|
||||||
pub(crate) async fn get_testrun_by_id(
|
pub(crate) async fn get_in_progress_testrun_by_id(
|
||||||
conn: &mut PoolConnection<Sqlite>,
|
conn: &mut PoolConnection<Sqlite>,
|
||||||
testrun_id: i64,
|
testrun_id: i64,
|
||||||
) -> anyhow::Result<TestRunDto> {
|
) -> anyhow::Result<TestRunDto> {
|
||||||
@@ -20,22 +22,58 @@ pub(crate) async fn get_testrun_by_id(
|
|||||||
ip_address as "ip_address!",
|
ip_address as "ip_address!",
|
||||||
log as "log!"
|
log as "log!"
|
||||||
FROM testruns
|
FROM testruns
|
||||||
WHERE id = ?
|
WHERE
|
||||||
|
id = ?
|
||||||
|
AND
|
||||||
|
status = ?
|
||||||
ORDER BY timestamp_utc"#,
|
ORDER BY timestamp_utc"#,
|
||||||
testrun_id
|
testrun_id,
|
||||||
|
TestRunStatus::InProgress as i64,
|
||||||
)
|
)
|
||||||
.fetch_one(conn.as_mut())
|
.fetch_one(conn.as_mut())
|
||||||
.await
|
.await
|
||||||
.context(format!("Couldn't retrieve testrun {testrun_id}"))
|
.context(format!("Couldn't retrieve testrun {testrun_id}"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) async fn update_testruns_older_than(db: &DbPool, age: Duration) -> anyhow::Result<u64> {
|
||||||
|
let mut conn = db.acquire().await?;
|
||||||
|
let previous_run = now_utc() - age;
|
||||||
|
let cutoff_timestamp = previous_run.timestamp();
|
||||||
|
|
||||||
|
let res = sqlx::query!(
|
||||||
|
r#"UPDATE
|
||||||
|
testruns
|
||||||
|
SET
|
||||||
|
status = ?
|
||||||
|
WHERE
|
||||||
|
status = ?
|
||||||
|
AND
|
||||||
|
timestamp_utc < ?
|
||||||
|
"#,
|
||||||
|
TestRunStatus::Queued as i64,
|
||||||
|
TestRunStatus::InProgress as i64,
|
||||||
|
cutoff_timestamp
|
||||||
|
)
|
||||||
|
.execute(conn.as_mut())
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
let stale_testruns = res.rows_affected();
|
||||||
|
if stale_testruns > 0 {
|
||||||
|
tracing::debug!(
|
||||||
|
"Refreshed {} stale testruns, scheduled before {} but not yet finished",
|
||||||
|
stale_testruns,
|
||||||
|
previous_run
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(stale_testruns)
|
||||||
|
}
|
||||||
|
|
||||||
pub(crate) async fn get_oldest_testrun_and_make_it_pending(
|
pub(crate) async fn get_oldest_testrun_and_make_it_pending(
|
||||||
// TODO dz accept mut reference, repeat in all similar functions
|
conn: &mut PoolConnection<Sqlite>,
|
||||||
conn: PoolConnection<Sqlite>,
|
|
||||||
) -> anyhow::Result<Option<TestrunAssignment>> {
|
) -> anyhow::Result<Option<TestrunAssignment>> {
|
||||||
let mut conn = conn;
|
// find & mark as "In progress" in the same transaction to avoid race conditions
|
||||||
let assignment = sqlx::query_as!(
|
let returning = sqlx::query!(
|
||||||
TestrunAssignment,
|
|
||||||
r#"UPDATE testruns
|
r#"UPDATE testruns
|
||||||
SET status = ?
|
SET status = ?
|
||||||
WHERE rowid =
|
WHERE rowid =
|
||||||
@@ -47,16 +85,36 @@ pub(crate) async fn get_oldest_testrun_and_make_it_pending(
|
|||||||
LIMIT 1
|
LIMIT 1
|
||||||
)
|
)
|
||||||
RETURNING
|
RETURNING
|
||||||
id as "testrun_id!",
|
id as "id!",
|
||||||
gateway_id as "gateway_pk_id!"
|
gateway_id
|
||||||
"#,
|
"#,
|
||||||
TestRunStatus::InProgress as i64,
|
TestRunStatus::InProgress as i64,
|
||||||
TestRunStatus::Pending as i64,
|
TestRunStatus::Queued as i64,
|
||||||
)
|
)
|
||||||
.fetch_optional(&mut *conn)
|
.fetch_optional(conn.as_mut())
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
Ok(assignment)
|
if let Some(testrun) = returning {
|
||||||
|
let gw_identity = sqlx::query!(
|
||||||
|
r#"
|
||||||
|
SELECT
|
||||||
|
id,
|
||||||
|
gateway_identity_key
|
||||||
|
FROM gateways
|
||||||
|
WHERE id = ?
|
||||||
|
LIMIT 1"#,
|
||||||
|
testrun.gateway_id
|
||||||
|
)
|
||||||
|
.fetch_one(conn.as_mut())
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
return Ok(Some(TestrunAssignment {
|
||||||
|
testrun_id: testrun.id,
|
||||||
|
gateway_identity_key: gw_identity.gateway_identity_key,
|
||||||
|
}));
|
||||||
|
} else {
|
||||||
|
return Ok(None);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) async fn update_testrun_status(
|
pub(crate) async fn update_testrun_status(
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
use axum::{response::Redirect, Router};
|
use axum::{response::Redirect, Router};
|
||||||
use tokio::net::ToSocketAddrs;
|
use tokio::net::ToSocketAddrs;
|
||||||
use tower_http::{cors::CorsLayer, trace::TraceLayer};
|
use tower_http::{
|
||||||
|
cors::CorsLayer,
|
||||||
|
trace::{DefaultOnResponse, TraceLayer},
|
||||||
|
};
|
||||||
use utoipa::OpenApi;
|
use utoipa::OpenApi;
|
||||||
use utoipa_swagger_ui::SwaggerUi;
|
use utoipa_swagger_ui::SwaggerUi;
|
||||||
|
|
||||||
@@ -58,7 +61,10 @@ impl RouterBuilder {
|
|||||||
// CORS layer needs to wrap other API layers
|
// CORS layer needs to wrap other API layers
|
||||||
.layer(setup_cors())
|
.layer(setup_cors())
|
||||||
// logger should be outermost layer
|
// logger should be outermost layer
|
||||||
.layer(TraceLayer::new_for_http())
|
.layer(
|
||||||
|
TraceLayer::new_for_http()
|
||||||
|
.on_response(DefaultOnResponse::new().level(tracing::Level::DEBUG)),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
use axum::extract::DefaultBodyLimit;
|
||||||
use axum::Json;
|
use axum::Json;
|
||||||
use axum::{
|
use axum::{
|
||||||
extract::{Path, State},
|
extract::{Path, State},
|
||||||
@@ -23,31 +24,32 @@ pub(crate) fn routes() -> Router<AppState> {
|
|||||||
Router::new()
|
Router::new()
|
||||||
.route("/", axum::routing::get(request_testrun))
|
.route("/", axum::routing::get(request_testrun))
|
||||||
.route("/:testrun_id", axum::routing::post(submit_testrun))
|
.route("/:testrun_id", axum::routing::post(submit_testrun))
|
||||||
|
.layer(DefaultBodyLimit::max(1024 * 1024 * 5))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(level = "debug", skip_all)]
|
#[tracing::instrument(level = "debug", skip_all)]
|
||||||
async fn request_testrun(State(state): State<AppState>) -> HttpResult<Json<TestrunAssignment>> {
|
async fn request_testrun(State(state): State<AppState>) -> HttpResult<Json<TestrunAssignment>> {
|
||||||
// TODO dz log agent's key
|
// TODO dz log agent's key
|
||||||
// TODO dz log agent's network probe version
|
// TODO dz log agent's network probe version
|
||||||
tracing::debug!("Agent X requested testrun");
|
tracing::debug!("Agent requested testrun");
|
||||||
|
|
||||||
let db = state.db_pool();
|
let db = state.db_pool();
|
||||||
let conn = db
|
let mut conn = db
|
||||||
.acquire()
|
.acquire()
|
||||||
.await
|
.await
|
||||||
.map_err(HttpError::internal_with_logging)?;
|
.map_err(HttpError::internal_with_logging)?;
|
||||||
|
|
||||||
return match db::queries::testruns::get_oldest_testrun_and_make_it_pending(conn).await {
|
return match db::queries::testruns::get_oldest_testrun_and_make_it_pending(&mut conn).await {
|
||||||
Ok(res) => {
|
Ok(res) => {
|
||||||
if let Some(testrun) = res {
|
if let Some(testrun) = res {
|
||||||
// TODO dz consider adding a column to testruns table with agent's public key
|
|
||||||
tracing::debug!(
|
tracing::debug!(
|
||||||
"🏃 Assigned testrun row_id {} to agent X",
|
"🏃 Assigned testrun row_id {} gateway {} to agent",
|
||||||
&testrun.testrun_id
|
&testrun.testrun_id,
|
||||||
|
testrun.gateway_identity_key
|
||||||
);
|
);
|
||||||
Ok(Json(testrun))
|
Ok(Json(testrun))
|
||||||
} else {
|
} else {
|
||||||
Err(HttpError::not_found("No testruns available"))
|
Err(HttpError::no_available_testruns())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(err) => Err(HttpError::internal_with_logging(err)),
|
Err(err) => Err(HttpError::internal_with_logging(err)),
|
||||||
@@ -61,25 +63,32 @@ async fn submit_testrun(
|
|||||||
State(state): State<AppState>,
|
State(state): State<AppState>,
|
||||||
body: String,
|
body: String,
|
||||||
) -> HttpResult<StatusCode> {
|
) -> HttpResult<StatusCode> {
|
||||||
tracing::debug!(
|
|
||||||
"Agent submitted testrun {}. Total length: {}",
|
|
||||||
testrun_id,
|
|
||||||
body.len(),
|
|
||||||
);
|
|
||||||
// TODO dz store testrun results
|
|
||||||
|
|
||||||
let db = state.db_pool();
|
let db = state.db_pool();
|
||||||
let mut conn = db
|
let mut conn = db
|
||||||
.acquire()
|
.acquire()
|
||||||
.await
|
.await
|
||||||
.map_err(HttpError::internal_with_logging)?;
|
.map_err(HttpError::internal_with_logging)?;
|
||||||
|
|
||||||
let testrun = queries::testruns::get_testrun_by_id(&mut conn, testrun_id)
|
let testrun = queries::testruns::get_in_progress_testrun_by_id(&mut conn, testrun_id)
|
||||||
.await
|
.await
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
tracing::error!("{e}");
|
tracing::error!("{e}");
|
||||||
HttpError::not_found(testrun_id)
|
HttpError::not_found(testrun_id)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
let gw_identity = db::queries::select_gateway_identity(&mut conn, testrun.gateway_id)
|
||||||
|
.await
|
||||||
|
.map_err(|_| {
|
||||||
|
// should never happen:
|
||||||
|
HttpError::internal_with_logging("No gateway found for testrun")
|
||||||
|
})?;
|
||||||
|
tracing::debug!(
|
||||||
|
"Agent submitted testrun {} for gateway {} ({} bytes)",
|
||||||
|
testrun_id,
|
||||||
|
gw_identity,
|
||||||
|
body.len(),
|
||||||
|
);
|
||||||
|
|
||||||
// TODO dz this should be part of a single transaction: commit after everything is done
|
// TODO dz this should be part of a single transaction: commit after everything is done
|
||||||
queries::testruns::update_testrun_status(&mut conn, testrun_id, TestRunStatus::Complete)
|
queries::testruns::update_testrun_status(&mut conn, testrun_id, TestRunStatus::Complete)
|
||||||
.await
|
.await
|
||||||
@@ -99,7 +108,7 @@ async fn submit_testrun(
|
|||||||
tracing::info!(
|
tracing::info!(
|
||||||
"✅ Testrun row_id {} for gateway {} complete",
|
"✅ Testrun row_id {} for gateway {} complete",
|
||||||
testrun.id,
|
testrun.id,
|
||||||
testrun.gateway_id
|
gw_identity
|
||||||
);
|
);
|
||||||
|
|
||||||
Ok(StatusCode::CREATED)
|
Ok(StatusCode::CREATED)
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ pub(crate) struct HttpError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl HttpError {
|
impl HttpError {
|
||||||
pub(crate) fn invalid_input(message: String) -> Self {
|
pub(crate) fn invalid_input(msg: impl Display) -> Self {
|
||||||
Self {
|
Self {
|
||||||
message,
|
message: serde_json::json!({"message": msg.to_string()}).to_string(),
|
||||||
status: axum::http::StatusCode::BAD_REQUEST,
|
status: axum::http::StatusCode::BAD_REQUEST,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -27,6 +27,12 @@ impl HttpError {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) fn no_available_testruns() -> Self {
|
||||||
|
Self {
|
||||||
|
message: serde_json::json!({"message": "No available testruns"}).to_string(),
|
||||||
|
status: axum::http::StatusCode::SERVICE_UNAVAILABLE,
|
||||||
|
}
|
||||||
|
}
|
||||||
pub(crate) fn not_found(msg: impl Display) -> Self {
|
pub(crate) fn not_found(msg: impl Display) -> Self {
|
||||||
Self {
|
Self {
|
||||||
message: serde_json::json!({"message": msg.to_string()}).to_string(),
|
message: serde_json::json!({"message": msg.to_string()}).to_string(),
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
use crate::db::models::TestRunDto;
|
|
||||||
use nym_node_requests::api::v1::node::models::NodeDescription;
|
use nym_node_requests::api::v1::node::models::NodeDescription;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use utoipa::ToSchema;
|
use utoipa::ToSchema;
|
||||||
@@ -75,12 +74,3 @@ pub(crate) struct SummaryHistory {
|
|||||||
pub value_json: serde_json::Value,
|
pub value_json: serde_json::Value,
|
||||||
pub timestamp_utc: String,
|
pub timestamp_utc: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<TestRunDto> for TestrunAssignment {
|
|
||||||
fn from(value: TestRunDto) -> Self {
|
|
||||||
Self {
|
|
||||||
gateway_pk_id: value.gateway_id,
|
|
||||||
testrun_id: value.id,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ async fn run(
|
|||||||
let explorer_client =
|
let explorer_client =
|
||||||
ExplorerClient::new_with_timeout(default_explorer_url, explorer_client_timeout)?;
|
ExplorerClient::new_with_timeout(default_explorer_url, explorer_client_timeout)?;
|
||||||
let explorer_gateways = explorer_client
|
let explorer_gateways = explorer_client
|
||||||
.get_gateways()
|
.unstable_get_gateways()
|
||||||
.await
|
.await
|
||||||
.log_error("get_gateways")?;
|
.log_error("get_gateways")?;
|
||||||
|
|
||||||
|
|||||||
@@ -11,10 +11,12 @@ pub(crate) use queue::now_utc;
|
|||||||
pub(crate) async fn spawn(pool: DbPool, refresh_interval: Duration) {
|
pub(crate) async fn spawn(pool: DbPool, refresh_interval: Duration) {
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
loop {
|
loop {
|
||||||
tracing::info!("Spawning testruns...");
|
if let Err(e) = refresh_stale_testruns(&pool, refresh_interval).await {
|
||||||
|
tracing::error!("{e}");
|
||||||
|
}
|
||||||
|
|
||||||
if let Err(e) = run(&pool).await {
|
if let Err(e) = run(&pool).await {
|
||||||
tracing::error!("Cron job failed: {}", e);
|
tracing::error!("Assigning testruns failed: {}", e);
|
||||||
}
|
}
|
||||||
tracing::debug!("Sleeping for {}s...", refresh_interval.as_secs());
|
tracing::debug!("Sleeping for {}s...", refresh_interval.as_secs());
|
||||||
tokio::time::sleep(refresh_interval).await;
|
tokio::time::sleep(refresh_interval).await;
|
||||||
@@ -24,9 +26,9 @@ pub(crate) async fn spawn(pool: DbPool, refresh_interval: Duration) {
|
|||||||
|
|
||||||
// TODO dz make number of max agents configurable
|
// TODO dz make number of max agents configurable
|
||||||
|
|
||||||
// TODO dz periodically clean up stale pending testruns
|
|
||||||
#[instrument(level = "debug", name = "testrun_queue", skip_all)]
|
#[instrument(level = "debug", name = "testrun_queue", skip_all)]
|
||||||
async fn run(pool: &DbPool) -> anyhow::Result<()> {
|
async fn run(pool: &DbPool) -> anyhow::Result<()> {
|
||||||
|
tracing::info!("Spawning testruns...");
|
||||||
if pool.is_closed() {
|
if pool.is_closed() {
|
||||||
tracing::debug!("DB pool closed, returning early");
|
tracing::debug!("DB pool closed, returning early");
|
||||||
return Ok(());
|
return Ok(());
|
||||||
@@ -74,3 +76,11 @@ async fn run(pool: &DbPool) -> anyhow::Result<()> {
|
|||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[instrument(level = "debug", skip_all)]
|
||||||
|
async fn refresh_stale_testruns(pool: &DbPool, refresh_interval: Duration) -> anyhow::Result<()> {
|
||||||
|
let chrono_duration = chrono::Duration::from_std(refresh_interval)?;
|
||||||
|
crate::db::queries::testruns::update_testruns_older_than(pool, chrono_duration).await?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ pub(crate) async fn try_queue_testrun(
|
|||||||
//
|
//
|
||||||
// save test run
|
// save test run
|
||||||
//
|
//
|
||||||
let status = TestRunStatus::Pending as u32;
|
let status = TestRunStatus::Queued as u32;
|
||||||
let log = format!(
|
let log = format!(
|
||||||
"Test for {identity_key} requested at {} UTC\n\n",
|
"Test for {identity_key} requested at {} UTC\n\n",
|
||||||
timestamp_pretty
|
timestamp_pretty
|
||||||
@@ -103,7 +103,7 @@ pub(crate) async fn try_queue_testrun(
|
|||||||
Ok(TestRun {
|
Ok(TestRun {
|
||||||
id: id as u32,
|
id: id as u32,
|
||||||
identity_key,
|
identity_key,
|
||||||
status: format!("{}", TestRunStatus::Pending),
|
status: format!("{}", TestRunStatus::Queued),
|
||||||
log,
|
log,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user