Compare commits

..

4 Commits

Author SHA1 Message Date
Jędrzej Stuczyński cd29132a45 print underlying error 2024-10-23 12:06:07 +01:00
Jędrzej Stuczyński 38e66f6ddf added 'get_all_described_nodes' to NymApiClient and adjusted return type on api itself (#5016) 2024-10-23 09:48:25 +01:00
Bogdan-Ștefan Neacşu b9fbe0b8f3 Reapply fixes to new branch (#5014) 2024-10-22 18:33:18 +03:00
Bogdan-Ștefan Neacşu daafb5cae4 Consume only positive bandwidth (#5013) 2024-10-22 17:46:46 +03:00
26 changed files with 223 additions and 269 deletions
@@ -1,55 +0,0 @@
name: Build and upload Data observatory container to harbor.nymte.ch
on:
workflow_dispatch:
env:
WORKING_DIRECTORY: "nym-data-observatory"
CONTAINER_NAME: "data-observatory"
jobs:
build-container:
runs-on: arc-ubuntu-22.04-dind
steps:
- name: Login to Harbor
uses: docker/login-action@v3
with:
registry: harbor.nymte.ch
username: ${{ secrets.HARBOR_ROBOT_USERNAME }}
password: ${{ secrets.HARBOR_ROBOT_SECRET }}
- name: Checkout repo
uses: actions/checkout@v4
- name: Configure git identity
run: |
git config --global user.email "lawrence@nymtech.net"
git config --global user.name "Lawrence Stalder"
- name: Get version from cargo.toml
uses: mikefarah/yq@v4.44.3
id: get_version
with:
cmd: yq -oy '.package.version' ${{ env.WORKING_DIRECTORY }}/Cargo.toml
- name: Check if tag exists
run: |
if git rev-parse ${{ steps.get_version.outputs.value }} >/dev/null 2>&1; then
echo "Tag ${{ steps.get_version.outputs.value }} already exists"
fi
- name: Remove existing tag if exists
run: |
if git rev-parse ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }} >/dev/null 2>&1; then
git push --delete origin ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }}
git tag -d ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }}
fi
- name: Create tag
run: |
git tag -a ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }} -m "Version ${{ steps.get_version.outputs.result }}"
git push origin ${{ env.WORKING_DIRECTORY }}-${{ steps.get_version.outputs.result }}
- name: BuildAndPushImageOnHarbor
run: |
docker build -f ${{ env.WORKING_DIRECTORY }}/Dockerfile . -t harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }}:${{ steps.get_version.outputs.result }} -t harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }}:latest
docker push harbor.nymte.ch/nym/${{ env.CONTAINER_NAME }} --all-tags
Generated
+124 -118
View File
@@ -11,7 +11,7 @@ dependencies = [
"macroific", "macroific",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -223,9 +223,9 @@ dependencies = [
[[package]] [[package]]
name = "anyhow" name = "anyhow"
version = "1.0.90" version = "1.0.89"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37bf3594c4c988a53154954629820791dde498571819ae4ca50ca811e060cc95" checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6"
[[package]] [[package]]
name = "arbitrary" name = "arbitrary"
@@ -283,7 +283,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"serde", "serde",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -341,7 +341,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -352,7 +352,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -999,8 +999,10 @@ checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401"
dependencies = [ dependencies = [
"android-tzdata", "android-tzdata",
"iana-time-zone", "iana-time-zone",
"js-sys",
"num-traits", "num-traits",
"serde", "serde",
"wasm-bindgen",
"windows-targets 0.52.5", "windows-targets 0.52.5",
] ]
@@ -1056,9 +1058,9 @@ dependencies = [
[[package]] [[package]]
name = "clap" name = "clap"
version = "4.5.20" version = "4.5.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3"
dependencies = [ dependencies = [
"clap_builder", "clap_builder",
"clap_derive", "clap_derive",
@@ -1066,9 +1068,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_builder" name = "clap_builder"
version = "4.5.20" version = "4.5.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b"
dependencies = [ dependencies = [
"anstream", "anstream",
"anstyle", "anstyle",
@@ -1078,11 +1080,11 @@ dependencies = [
[[package]] [[package]]
name = "clap_complete" name = "clap_complete"
version = "4.5.33" version = "4.5.29"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9646e2e245bf62f45d39a0f3f36f1171ad1ea0d6967fd114bca72cb02a8fcdfb" checksum = "8937760c3f4c60871870b8c3ee5f9b30771f792a7045c48bcbba999d7d6b3b8e"
dependencies = [ dependencies = [
"clap 4.5.20", "clap 4.5.18",
] ]
[[package]] [[package]]
@@ -1091,7 +1093,7 @@ version = "4.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d494102c8ff3951810c72baf96910b980fb065ca5d3101243e6a8dc19747c86b" checksum = "d494102c8ff3951810c72baf96910b980fb065ca5d3101243e6a8dc19747c86b"
dependencies = [ dependencies = [
"clap 4.5.20", "clap 4.5.18",
"clap_complete", "clap_complete",
] ]
@@ -1104,7 +1106,7 @@ dependencies = [
"heck 0.5.0", "heck 0.5.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -1499,7 +1501,7 @@ dependencies = [
"anes", "anes",
"cast", "cast",
"ciborium", "ciborium",
"clap 4.5.20", "clap 4.5.18",
"criterion-plot", "criterion-plot",
"is-terminal", "is-terminal",
"itertools 0.10.5", "itertools 0.10.5",
@@ -1754,7 +1756,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -1912,7 +1914,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"strsim 0.11.1", "strsim 0.11.1",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -1934,7 +1936,7 @@ checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178"
dependencies = [ dependencies = [
"darling_core 0.20.9", "darling_core 0.20.9",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -1985,7 +1987,7 @@ dependencies = [
"macroific", "macroific",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -2028,7 +2030,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -2061,7 +2063,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"proc-macro2-diagnostics", "proc-macro2-diagnostics",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -2129,7 +2131,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -2364,7 +2366,8 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0"
name = "explorer-api" name = "explorer-api"
version = "1.1.41" version = "1.1.41"
dependencies = [ dependencies = [
"clap 4.5.20", "chrono",
"clap 4.5.18",
"dotenvy", "dotenvy",
"humantime-serde", "humantime-serde",
"isocountry", "isocountry",
@@ -2391,7 +2394,6 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"thiserror", "thiserror",
"time",
"tokio", "tokio",
] ]
@@ -2465,7 +2467,7 @@ dependencies = [
"macroific", "macroific",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -2689,7 +2691,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -2784,7 +2786,7 @@ dependencies = [
"proc-macro-error2", "proc-macro-error2",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -3358,7 +3360,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bip39", "bip39",
"clap 4.5.20", "clap 4.5.18",
"dirs", "dirs",
"importer-contract", "importer-contract",
"nym-bin-common", "nym-bin-common",
@@ -3651,9 +3653,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130"
[[package]] [[package]]
name = "js-sys" name = "js-sys"
version = "0.3.72" version = "0.3.70"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a"
dependencies = [ dependencies = [
"wasm-bindgen", "wasm-bindgen",
] ]
@@ -3874,7 +3876,7 @@ dependencies = [
"cfg-if", "cfg-if",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -3885,7 +3887,7 @@ checksum = "13198c120864097a565ccb3ff947672d969932b7975ebd4085732c9f09435e55"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -3898,7 +3900,7 @@ dependencies = [
"macroific_core", "macroific_core",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -4325,7 +4327,7 @@ dependencies = [
"proc-macro-crate", "proc-macro-crate",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -4357,7 +4359,7 @@ dependencies = [
"bloomfilter", "bloomfilter",
"bs58", "bs58",
"cfg-if", "cfg-if",
"clap 4.5.20", "clap 4.5.18",
"console-subscriber", "console-subscriber",
"cosmwasm-std", "cosmwasm-std",
"cw-utils", "cw-utils",
@@ -4472,7 +4474,7 @@ dependencies = [
"bincode", "bincode",
"bs58", "bs58",
"bytes", "bytes",
"clap 4.5.20", "clap 4.5.18",
"defguard_wireguard_rs", "defguard_wireguard_rs",
"fastrand 2.1.1", "fastrand 2.1.1",
"futures", "futures",
@@ -4550,7 +4552,7 @@ dependencies = [
name = "nym-bin-common" name = "nym-bin-common"
version = "0.6.0" version = "0.6.0"
dependencies = [ dependencies = [
"clap 4.5.20", "clap 4.5.18",
"clap_complete", "clap_complete",
"clap_complete_fig", "clap_complete_fig",
"const-str", "const-str",
@@ -4592,7 +4594,7 @@ dependencies = [
"base64 0.22.1", "base64 0.22.1",
"bip39", "bip39",
"bs58", "bs58",
"clap 4.5.20", "clap 4.5.18",
"clap_complete", "clap_complete",
"clap_complete_fig", "clap_complete_fig",
"dotenvy", "dotenvy",
@@ -4618,7 +4620,7 @@ dependencies = [
"bip39", "bip39",
"bs58", "bs58",
"cfg-if", "cfg-if",
"clap 4.5.20", "clap 4.5.18",
"colored", "colored",
"comfy-table", "comfy-table",
"cosmrs 0.17.0-pre", "cosmrs 0.17.0-pre",
@@ -4670,7 +4672,7 @@ name = "nym-client"
version = "1.1.42" version = "1.1.42"
dependencies = [ dependencies = [
"bs58", "bs58",
"clap 4.5.20", "clap 4.5.18",
"dirs", "dirs",
"futures", "futures",
"log", "log",
@@ -4710,7 +4712,7 @@ dependencies = [
"base64 0.22.1", "base64 0.22.1",
"bs58", "bs58",
"cfg-if", "cfg-if",
"clap 4.5.20", "clap 4.5.18",
"comfy-table", "comfy-table",
"futures", "futures",
"gloo-timers", "gloo-timers",
@@ -5097,7 +5099,8 @@ version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"axum 0.7.7", "axum 0.7.7",
"clap 4.5.20", "chrono",
"clap 4.5.18",
"nym-bin-common", "nym-bin-common",
"nym-network-defaults", "nym-network-defaults",
"nym-node-requests", "nym-node-requests",
@@ -5105,7 +5108,6 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"sqlx", "sqlx",
"time",
"tokio", "tokio",
"tokio-util", "tokio-util",
"tower-http", "tower-http",
@@ -5238,7 +5240,7 @@ dependencies = [
"async-trait", "async-trait",
"bip39", "bip39",
"bs58", "bs58",
"clap 4.5.20", "clap 4.5.18",
"colored", "colored",
"dashmap", "dashmap",
"defguard_wireguard_rs", "defguard_wireguard_rs",
@@ -5445,7 +5447,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bs58", "bs58",
"clap 4.5.20", "clap 4.5.18",
"nym-bin-common", "nym-bin-common",
"nym-credential-storage", "nym-credential-storage",
"nym-id", "nym-id",
@@ -5487,7 +5489,7 @@ dependencies = [
"bincode", "bincode",
"bs58", "bs58",
"bytes", "bytes",
"clap 4.5.20", "clap 4.5.18",
"etherparse", "etherparse",
"futures", "futures",
"log", "log",
@@ -5585,7 +5587,7 @@ dependencies = [
"anyhow", "anyhow",
"axum 0.7.7", "axum 0.7.7",
"bs58", "bs58",
"clap 4.5.20", "clap 4.5.18",
"colored", "colored",
"cupid", "cupid",
"dirs", "dirs",
@@ -5686,7 +5688,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"axum 0.7.7", "axum 0.7.7",
"clap 4.5.20", "clap 4.5.18",
"dashmap", "dashmap",
"futures", "futures",
"log", "log",
@@ -5718,7 +5720,7 @@ dependencies = [
"anyhow", "anyhow",
"async-trait", "async-trait",
"bs58", "bs58",
"clap 4.5.20", "clap 4.5.18",
"dirs", "dirs",
"futures", "futures",
"humantime-serde", "humantime-serde",
@@ -5770,7 +5772,7 @@ dependencies = [
"bs58", "bs58",
"cargo_metadata 0.18.1", "cargo_metadata 0.18.1",
"celes", "celes",
"clap 4.5.20", "clap 4.5.18",
"colored", "colored",
"cupid", "cupid",
"humantime-serde", "humantime-serde",
@@ -5917,7 +5919,7 @@ name = "nym-nr-query"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap 4.5.20", "clap 4.5.18",
"log", "log",
"nym-bin-common", "nym-bin-common",
"nym-network-defaults", "nym-network-defaults",
@@ -6056,7 +6058,7 @@ name = "nym-socks5-client"
version = "1.1.42" version = "1.1.42"
dependencies = [ dependencies = [
"bs58", "bs58",
"clap 4.5.20", "clap 4.5.18",
"log", "log",
"nym-bin-common", "nym-bin-common",
"nym-client-core", "nym-client-core",
@@ -6492,7 +6494,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bip39", "bip39",
"clap 4.5.20", "clap 4.5.18",
"cosmwasm-std", "cosmwasm-std",
"futures", "futures",
"humantime 2.1.0", "humantime 2.1.0",
@@ -6562,6 +6564,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"base64 0.22.1", "base64 0.22.1",
"bincode", "bincode",
"chrono",
"dashmap", "dashmap",
"defguard_wireguard_rs", "defguard_wireguard_rs",
"futures", "futures",
@@ -6575,7 +6578,6 @@ dependencies = [
"nym-task", "nym-task",
"nym-wireguard-types", "nym-wireguard-types",
"thiserror", "thiserror",
"time",
"tokio", "tokio",
"tokio-stream", "tokio-stream",
"x25519-dalek", "x25519-dalek",
@@ -6602,7 +6604,7 @@ version = "0.1.8"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",
"clap 4.5.20", "clap 4.5.18",
"dotenvy", "dotenvy",
"flate2", "flate2",
"futures", "futures",
@@ -6911,7 +6913,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"proc-macro2-diagnostics", "proc-macro2-diagnostics",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -6998,7 +7000,7 @@ dependencies = [
"pest_meta", "pest_meta",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -7024,22 +7026,22 @@ dependencies = [
[[package]] [[package]]
name = "pin-project" name = "pin-project"
version = "1.1.6" version = "1.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3"
dependencies = [ dependencies = [
"pin-project-internal", "pin-project-internal",
] ]
[[package]] [[package]]
name = "pin-project-internal" name = "pin-project-internal"
version = "1.1.6" version = "1.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -7254,7 +7256,7 @@ dependencies = [
"proc-macro-error-attr2", "proc-macro-error-attr2",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -7274,7 +7276,7 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
"version_check", "version_check",
"yansi", "yansi",
] ]
@@ -7337,7 +7339,7 @@ dependencies = [
"itertools 0.12.1", "itertools 0.12.1",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -7546,7 +7548,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -7773,7 +7775,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"rocket_http", "rocket_http",
"syn 2.0.82", "syn 2.0.66",
"unicode-xid", "unicode-xid",
"version_check", "version_check",
] ]
@@ -7890,7 +7892,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"rust-embed-utils", "rust-embed-utils",
"syn 2.0.82", "syn 2.0.66",
"walkdir", "walkdir",
] ]
@@ -8138,7 +8140,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"serde_derive_internals 0.29.1", "serde_derive_internals 0.29.1",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -8170,7 +8172,7 @@ checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -8247,9 +8249,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.211" version = "1.0.210"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ac55e59090389fb9f0dd9e0f3c09615afed1d19094284d0b200441f13550793" checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a"
dependencies = [ dependencies = [
"serde_derive", "serde_derive",
] ]
@@ -8296,13 +8298,13 @@ dependencies = [
[[package]] [[package]]
name = "serde_derive" name = "serde_derive"
version = "1.0.211" version = "1.0.210"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54be4f245ce16bc58d57ef2716271d0d4519e0f6defa147f6e081005bcb278ff" checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -8313,7 +8315,7 @@ checksum = "e578a843d40b4189a4d66bba51d7684f57da5bd7c304c64e14bd63efbef49509"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -8324,14 +8326,14 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.132" version = "1.0.128"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8"
dependencies = [ dependencies = [
"itoa", "itoa",
"memchr", "memchr",
@@ -8357,7 +8359,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -8408,7 +8410,7 @@ dependencies = [
"darling 0.20.9", "darling 0.20.9",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -8699,6 +8701,7 @@ dependencies = [
"atoi", "atoi",
"byteorder", "byteorder",
"bytes", "bytes",
"chrono",
"crc", "crc",
"crossbeam-queue", "crossbeam-queue",
"either", "either",
@@ -8782,6 +8785,7 @@ dependencies = [
"bitflags 2.5.0", "bitflags 2.5.0",
"byteorder", "byteorder",
"bytes", "bytes",
"chrono",
"crc", "crc",
"digest 0.10.7", "digest 0.10.7",
"dotenvy", "dotenvy",
@@ -8824,6 +8828,7 @@ dependencies = [
"base64 0.21.7", "base64 0.21.7",
"bitflags 2.5.0", "bitflags 2.5.0",
"byteorder", "byteorder",
"chrono",
"crc", "crc",
"dotenvy", "dotenvy",
"etcetera", "etcetera",
@@ -8860,6 +8865,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b244ef0a8414da0bed4bb1910426e890b19e5e9bccc27ada6b797d05c55ae0aa" checksum = "b244ef0a8414da0bed4bb1910426e890b19e5e9bccc27ada6b797d05c55ae0aa"
dependencies = [ dependencies = [
"atoi", "atoi",
"chrono",
"flume", "flume",
"futures-channel", "futures-channel",
"futures-core", "futures-core",
@@ -8882,7 +8888,7 @@ name = "ssl-inject"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"clap 4.5.20", "clap 4.5.18",
"hex", "hex",
"tokio", "tokio",
] ]
@@ -9009,7 +9015,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"rustversion", "rustversion",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -9052,9 +9058,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.82" version = "2.0.66"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83540f837a8afc019423a8edb95b52a8effe46957ee402287f4292fae35be021" checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -9298,7 +9304,7 @@ dependencies = [
"anyhow", "anyhow",
"bip39", "bip39",
"bs58", "bs58",
"clap 4.5.20", "clap 4.5.18",
"console", "console",
"cw-utils", "cw-utils",
"dkg-bypass-contract", "dkg-bypass-contract",
@@ -9353,7 +9359,7 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -9484,7 +9490,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -9763,7 +9769,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -9921,7 +9927,7 @@ checksum = "0ea0b99e8ec44abd6f94a18f28f7934437809dd062820797c52401298116f70e"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
"termcolor", "termcolor",
] ]
@@ -9948,7 +9954,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"serde_derive_internals 0.28.0", "serde_derive_internals 0.28.0",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -10102,7 +10108,7 @@ checksum = "21345172d31092fd48c47fd56c53d4ae9e41c4b1f559fb8c38c1ab1685fd919f"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"camino", "camino",
"clap 4.5.20", "clap 4.5.18",
"uniffi_bindgen", "uniffi_bindgen",
"uniffi_build", "uniffi_build",
"uniffi_core", "uniffi_core",
@@ -10119,7 +10125,7 @@ dependencies = [
"askama", "askama",
"camino", "camino",
"cargo_metadata 0.15.4", "cargo_metadata 0.15.4",
"clap 4.5.20", "clap 4.5.18",
"fs-err", "fs-err",
"glob", "glob",
"goblin", "goblin",
@@ -10151,7 +10157,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55137c122f712d9330fd985d66fa61bdc381752e89c35708c13ce63049a3002c" checksum = "55137c122f712d9330fd985d66fa61bdc381752e89c35708c13ce63049a3002c"
dependencies = [ dependencies = [
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -10183,7 +10189,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"serde", "serde",
"syn 2.0.82", "syn 2.0.66",
"toml 0.5.11", "toml 0.5.11",
"uniffi_build", "uniffi_build",
"uniffi_meta", "uniffi_meta",
@@ -10315,7 +10321,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"regex", "regex",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -10353,7 +10359,7 @@ checksum = "17e82ab96c5a55263b5bed151b8426410d93aa909a453acdbd4b6792b5af7d64"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -10364,7 +10370,7 @@ checksum = "86b8338dc3c9526011ffaa2aa6bd60ddfda9d49d2123108690755c6e34844212"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
"utoipauto-core", "utoipauto-core",
] ]
@@ -10451,9 +10457,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b"
[[package]] [[package]]
name = "wasm-bindgen" name = "wasm-bindgen"
version = "0.2.95" version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"once_cell", "once_cell",
@@ -10462,24 +10468,24 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-backend" name = "wasm-bindgen-backend"
version = "0.2.95" version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b"
dependencies = [ dependencies = [
"bumpalo", "bumpalo",
"log", "log",
"once_cell", "once_cell",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
[[package]] [[package]]
name = "wasm-bindgen-futures" name = "wasm-bindgen-futures"
version = "0.4.45" version = "0.4.43"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"js-sys", "js-sys",
@@ -10489,9 +10495,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro" name = "wasm-bindgen-macro"
version = "0.2.95" version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf"
dependencies = [ dependencies = [
"quote", "quote",
"wasm-bindgen-macro-support", "wasm-bindgen-macro-support",
@@ -10499,22 +10505,22 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro-support" name = "wasm-bindgen-macro-support"
version = "0.2.95" version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
"wasm-bindgen-backend", "wasm-bindgen-backend",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
[[package]] [[package]]
name = "wasm-bindgen-shared" name = "wasm-bindgen-shared"
version = "0.2.95" version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484"
[[package]] [[package]]
name = "wasm-bindgen-test" name = "wasm-bindgen-test"
@@ -10539,7 +10545,7 @@ checksum = "4b8220be1fa9e4c889b30fd207d4906657e7e90b12e0e6b0c8b8d8709f5de021"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -10635,9 +10641,9 @@ dependencies = [
[[package]] [[package]]
name = "web-sys" name = "web-sys"
version = "0.3.72" version = "0.3.70"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0"
dependencies = [ dependencies = [
"js-sys", "js-sys",
"wasm-bindgen", "wasm-bindgen",
@@ -11066,7 +11072,7 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
@@ -11086,7 +11092,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.82", "syn 2.0.66",
] ]
[[package]] [[package]]
+9 -8
View File
@@ -183,7 +183,7 @@ aes = "0.8.1"
aes-gcm = "0.10.1" aes-gcm = "0.10.1"
aes-gcm-siv = "0.11.1" aes-gcm-siv = "0.11.1"
aead = "0.5.2" aead = "0.5.2"
anyhow = "1.0.90" anyhow = "1.0.89"
argon2 = "0.5.0" argon2 = "0.5.0"
async-trait = "0.1.83" async-trait = "0.1.83"
axum = "0.7.5" axum = "0.7.5"
@@ -206,8 +206,9 @@ celes = "2.4.0"
cfg-if = "1.0.0" cfg-if = "1.0.0"
chacha20 = "0.9.0" chacha20 = "0.9.0"
chacha20poly1305 = "0.10.1" chacha20poly1305 = "0.10.1"
chrono = "0.4.31"
cipher = "0.4.3" cipher = "0.4.3"
clap = "4.5.20" clap = "4.5.18"
clap_complete = "4.5" clap_complete = "4.5"
clap_complete_fig = "4.5" clap_complete_fig = "4.5"
colored = "2.0" colored = "2.0"
@@ -274,7 +275,7 @@ opentelemetry-jaeger = "0.18.0"
parking_lot = "0.12.3" parking_lot = "0.12.3"
pem = "0.8" pem = "0.8"
petgraph = "0.6.5" petgraph = "0.6.5"
pin-project = "1.1" pin-project = "1.0"
pin-project-lite = "0.2.14" pin-project-lite = "0.2.14"
pretty_env_logger = "0.4.0" pretty_env_logger = "0.4.0"
publicsuffix = "2.2.3" publicsuffix = "2.2.3"
@@ -294,10 +295,10 @@ rocket_okapi = "0.8.0"
safer-ffi = "0.1.13" safer-ffi = "0.1.13"
schemars = "0.8.21" schemars = "0.8.21"
semver = "1.0.23" semver = "1.0.23"
serde = "1.0.211" serde = "1.0.210"
serde_bytes = "0.11.15" serde_bytes = "0.11.15"
serde_derive = "1.0" serde_derive = "1.0"
serde_json = "1.0.132" serde_json = "1.0.128"
serde_repr = "0.1" serde_repr = "0.1"
serde_with = "3.9.0" serde_with = "3.9.0"
serde_yaml = "0.9.25" serde_yaml = "0.9.25"
@@ -388,10 +389,10 @@ indexed_db_futures = { git = "https://github.com/TiemenSch/rust-indexed-db", bra
js-sys = "0.3.70" js-sys = "0.3.70"
serde-wasm-bindgen = "0.6.5" serde-wasm-bindgen = "0.6.5"
tsify = "0.4.5" tsify = "0.4.5"
wasm-bindgen = "0.2.95" wasm-bindgen = "0.2.93"
wasm-bindgen-futures = "0.4.45" wasm-bindgen-futures = "0.4.43"
wasmtimer = "0.2.0" wasmtimer = "0.2.0"
web-sys = "0.3.72" web-sys = "0.3.70"
# Profile settings for individual crates # Profile settings for individual crates
@@ -19,7 +19,7 @@ use nym_api_requests::ecash::{
}; };
use nym_api_requests::models::{ use nym_api_requests::models::{
GatewayCoreStatusResponse, MixnodeCoreStatusResponse, MixnodeStatusResponse, GatewayCoreStatusResponse, MixnodeCoreStatusResponse, MixnodeStatusResponse,
RewardEstimationResponse, StakeSaturationResponse, NymNodeDescription, RewardEstimationResponse, StakeSaturationResponse,
}; };
use nym_api_requests::models::{LegacyDescribedGateway, MixNodeBondAnnotated}; use nym_api_requests::models::{LegacyDescribedGateway, MixNodeBondAnnotated};
use nym_api_requests::nym_nodes::SkimmedNode; use nym_api_requests::nym_nodes::SkimmedNode;
@@ -320,7 +320,7 @@ impl NymApiClient {
loop { loop {
let mut res = self let mut res = self
.nym_api .nym_api
.get_all_basic_entry_assigned_nodes( .get_basic_entry_assigned_nodes(
semver_compatibility.clone(), semver_compatibility.clone(),
false, false,
Some(page), Some(page),
@@ -397,6 +397,27 @@ impl NymApiClient {
Ok(self.nym_api.get_gateways_described().await?) Ok(self.nym_api.get_gateways_described().await?)
} }
pub async fn get_all_described_nodes(
&self,
) -> Result<Vec<NymNodeDescription>, ValidatorClientError> {
// TODO: deal with paging in macro or some helper function or something, because it's the same pattern everywhere
let mut page = 0;
let mut descriptions = Vec::new();
loop {
let mut res = self.nym_api.get_nodes_described(Some(page), None).await?;
descriptions.append(&mut res.data);
if descriptions.len() < res.pagination.total {
page += 1
} else {
break;
}
}
Ok(descriptions)
}
pub async fn get_gateway_core_status_count( pub async fn get_gateway_core_status_count(
&self, &self,
identity: IdentityKeyRef<'_>, identity: IdentityKeyRef<'_>,
@@ -11,9 +11,10 @@ use nym_api_requests::ecash::models::{
}; };
use nym_api_requests::ecash::VerificationKeyResponse; use nym_api_requests::ecash::VerificationKeyResponse;
use nym_api_requests::models::{ use nym_api_requests::models::{
AnnotationResponse, LegacyDescribedMixNode, NodePerformanceResponse, AnnotationResponse, LegacyDescribedMixNode, NodePerformanceResponse, NymNodeDescription,
}; };
use nym_api_requests::nym_nodes::PaginatedCachedNodesResponse; use nym_api_requests::nym_nodes::PaginatedCachedNodesResponse;
use nym_api_requests::pagination::PaginatedResponse;
pub use nym_api_requests::{ pub use nym_api_requests::{
ecash::{ ecash::{
models::{ models::{
@@ -119,6 +120,25 @@ pub trait NymApiClientExt: ApiClient {
.await .await
} }
async fn get_nodes_described(
&self,
page: Option<u32>,
per_page: Option<u32>,
) -> Result<PaginatedResponse<NymNodeDescription>, NymAPIError> {
let mut params = Vec::new();
if let Some(page) = page {
params.push(("page", page.to_string()))
}
if let Some(per_page) = per_page {
params.push(("per_page", per_page.to_string()))
}
self.get_json(&[routes::API_VERSION, "nym-nodes", "described"], &params)
.await
}
async fn get_basic_mixnodes( async fn get_basic_mixnodes(
&self, &self,
semver_compatibility: Option<String>, semver_compatibility: Option<String>,
@@ -167,7 +187,7 @@ pub trait NymApiClientExt: ApiClient {
/// retrieve basic information for nodes are capable of operating as an entry gateway /// retrieve basic information for nodes are capable of operating as an entry gateway
/// this includes legacy gateways and nym-nodes /// this includes legacy gateways and nym-nodes
async fn get_all_basic_entry_assigned_nodes( async fn get_basic_entry_assigned_nodes(
&self, &self,
semver_compatibility: Option<String>, semver_compatibility: Option<String>,
no_legacy: bool, no_legacy: bool,
+1
View File
@@ -19,6 +19,7 @@ sqlx = { workspace = true, features = [
"macros", "macros",
"migrate", "migrate",
"time", "time",
"chrono"
] } ] }
time = { workspace = true } time = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
@@ -21,7 +21,7 @@ nym-sphinx-types = { path = "../types" }
nym-topology = { path = "../../topology" } nym-topology = { path = "../../topology" }
[target."cfg(target_arch = \"wasm32\")".dependencies.wasm-bindgen] [target."cfg(target_arch = \"wasm32\")".dependencies.wasm-bindgen]
version = "0.2.95" version = "0.2.93"
[dev-dependencies] [dev-dependencies]
rand_chacha = { workspace = true } rand_chacha = { workspace = true }
+1 -1
View File
@@ -13,7 +13,7 @@ license.workspace = true
[dependencies] [dependencies]
base64 = { workspace = true } base64 = { workspace = true }
bincode = { workspace = true } bincode = { workspace = true }
time = { workspace = true } chrono = { workspace = true }
dashmap = { workspace = true } dashmap = { workspace = true }
defguard_wireguard_rs = { workspace = true } defguard_wireguard_rs = { workspace = true }
futures = { workspace = true } futures = { workspace = true }
+5 -2
View File
@@ -158,10 +158,13 @@ impl<St: Storage + Clone + 'static> PeerController<St> {
.ok_or(Error::MissingClientBandwidthEntry)? .ok_or(Error::MissingClientBandwidthEntry)?
.client_id .client_id
{ {
storage.create_bandwidth_entry(client_id).await?; let bandwidth = storage
.get_available_bandwidth(client_id)
.await?
.ok_or(Error::MissingClientBandwidthEntry)?;
Ok(Some(BandwidthStorageManager::new( Ok(Some(BandwidthStorageManager::new(
storage, storage,
ClientBandwidth::new(Default::default()), ClientBandwidth::new(bandwidth.into()),
client_id, client_id,
BandwidthFlushingBehaviourConfig::default(), BandwidthFlushingBehaviourConfig::default(),
true, true,
+7 -6
View File
@@ -84,12 +84,13 @@ impl<St: Storage + Clone + 'static> PeerHandle<St> {
.ok_or(Error::InconsistentConsumedBytes)? .ok_or(Error::InconsistentConsumedBytes)?
.try_into() .try_into()
.map_err(|_| Error::InconsistentConsumedBytes)?; .map_err(|_| Error::InconsistentConsumedBytes)?;
if bandwidth_manager if spent_bandwidth > 0
.write() && bandwidth_manager
.await .write()
.try_use_bandwidth(spent_bandwidth) .await
.await .try_use_bandwidth(spent_bandwidth)
.is_err() .await
.is_err()
{ {
let success = self.remove_peer().await?; let success = self.remove_peer().await?;
return Ok(!success); return Ok(!success);
-1
View File
@@ -188,7 +188,6 @@ deny = [
# is a direct dependency of the otherwise banned crate # is a direct dependency of the otherwise banned crate
#{ crate = "ansi_term@0.11.0", wrappers = ["this-crate-directly-depends-on-ansi_term"] }, #{ crate = "ansi_term@0.11.0", wrappers = ["this-crate-directly-depends-on-ansi_term"] },
{ name = "openssl" }, { name = "openssl" },
{ name = "chrono" },
] ]
# List of features to allow/deny # List of features to allow/deny
+1 -1
View File
@@ -7,7 +7,7 @@ license.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
time = { workspace = true } chrono = { workspace = true, features = ["serde"] }
clap = { workspace = true, features = ["cargo", "derive"] } clap = { workspace = true, features = ["cargo", "derive"] }
dotenvy = { workspace = true } dotenvy = { workspace = true }
humantime-serde = { workspace = true } humantime-serde = { workspace = true }
+3 -3
View File
@@ -1,10 +1,10 @@
use std::fs::File; use std::fs::File;
use std::path::Path; use std::path::Path;
use chrono::{DateTime, Utc};
use log::info; use log::info;
use nym_mixnet_contract_common::NodeId; use nym_mixnet_contract_common::NodeId;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use time::OffsetDateTime;
use crate::client::ThreadsafeValidatorClient; use crate::client::ThreadsafeValidatorClient;
use crate::geo_ip::location::ThreadsafeGeoIp; use crate::geo_ip::location::ThreadsafeGeoIp;
@@ -49,7 +49,7 @@ pub struct ExplorerApiStateOnDisk {
pub(crate) country_node_distribution: CountryNodesDistribution, pub(crate) country_node_distribution: CountryNodesDistribution,
pub(crate) mixnode_location_cache: MixnodeLocationCache, pub(crate) mixnode_location_cache: MixnodeLocationCache,
pub(crate) gateway_location_cache: GatewayLocationCache, pub(crate) gateway_location_cache: GatewayLocationCache,
pub(crate) as_at: OffsetDateTime, pub(crate) as_at: DateTime<Utc>,
} }
#[derive(Clone)] #[derive(Clone)]
@@ -117,7 +117,7 @@ impl ExplorerApiStateContext {
country_node_distribution: self.inner.country_node_distribution.get_all().await, country_node_distribution: self.inner.country_node_distribution.get_all().await,
mixnode_location_cache: self.inner.mixnodes.get_locations().await, mixnode_location_cache: self.inner.mixnodes.get_locations().await,
gateway_location_cache: self.inner.gateways.get_locations().await, gateway_location_cache: self.inner.gateways.get_locations().await,
as_at: OffsetDateTime::now_utc(), as_at: Utc::now(),
}; };
serde_json::to_writer(file, &state).expect("error writing state to disk"); serde_json::to_writer(file, &state).expect("error writing state to disk");
info!("Saved file to '{:?}'", json_file_path.canonicalize()); info!("Saved file to '{:?}'", json_file_path.canonicalize());
+1 -1
View File
@@ -437,7 +437,7 @@ pub enum NymApiStorageError {
GatewayNotFound { identity: String }, GatewayNotFound { identity: String },
// I don't think we want to expose errors to the user about what really happened // I don't think we want to expose errors to the user about what really happened
#[error("experienced internal database error")] #[error("experienced internal database error: {0}")]
InternalDatabaseError(#[from] sqlx::Error), InternalDatabaseError(#[from] sqlx::Error),
// the same is true here (also note that the message is subtly different so we would be able to distinguish them) // the same is true here (also note that the message is subtly different so we would be able to distinguish them)
+7 -12
View File
@@ -9,7 +9,7 @@ use axum::routing::get;
use axum::{Json, Router}; use axum::{Json, Router};
use nym_api_requests::models::{ use nym_api_requests::models::{
AnnotationResponse, NodeDatePerformanceResponse, NodePerformanceResponse, NoiseDetails, AnnotationResponse, NodeDatePerformanceResponse, NodePerformanceResponse, NoiseDetails,
NymNodeData, PerformanceHistoryResponse, UptimeHistoryResponse, NymNodeDescription, PerformanceHistoryResponse, UptimeHistoryResponse,
}; };
use nym_api_requests::pagination::{PaginatedResponse, Pagination}; use nym_api_requests::pagination::{PaginatedResponse, Pagination};
use nym_contracts_common::NaiveFloat; use nym_contracts_common::NaiveFloat;
@@ -125,32 +125,27 @@ async fn get_bonded_nodes(
path = "/described", path = "/described",
context_path = "/v1/nym-nodes", context_path = "/v1/nym-nodes",
responses( responses(
(status = 200, body = PaginatedResponse<NymNodeData>) (status = 200, body = PaginatedResponse<NymNodeDescription>)
), ),
params(PaginationRequest) params(PaginationRequest)
)] )]
async fn get_described_nodes( async fn get_described_nodes(
State(state): State<AppState>, State(state): State<AppState>,
Query(pagination): Query<PaginationRequest>, Query(pagination): Query<PaginationRequest>,
) -> AxumResult<Json<PaginatedResponse<NymNodeData>>> { ) -> AxumResult<Json<PaginatedResponse<NymNodeDescription>>> {
// TODO: implement it // TODO: implement it
let _ = pagination; let _ = pagination;
let cache = state.described_nodes_cache.get().await?; let cache = state.described_nodes_cache.get().await?;
let descriptions = cache.all_nodes(); let descriptions = cache.all_nodes().cloned().collect::<Vec<_>>();
let data = descriptions
.map(|n| &n.description)
.cloned()
.collect::<Vec<_>>();
Ok(Json(PaginatedResponse { Ok(Json(PaginatedResponse {
pagination: Pagination { pagination: Pagination {
total: data.len(), total: descriptions.len(),
page: 0, page: 0,
size: data.len(), size: descriptions.len(),
}, },
data, data: descriptions,
})) }))
} }
+1 -1
View File
@@ -16,7 +16,7 @@ readme.workspace = true
[dependencies] [dependencies]
anyhow = { workspace = true } anyhow = { workspace = true }
axum = { workspace = true, features = ["tokio"] } axum = { workspace = true, features = ["tokio"] }
time = { workspace = true } chrono = { workspace = true }
clap = { workspace = true, features = ["derive", "env"] } clap = { workspace = true, features = ["derive", "env"] }
nym-bin-common = { path = "../common/bin-common" } nym-bin-common = { path = "../common/bin-common" }
nym-network-defaults = { path = "../common/network-defaults" } nym-network-defaults = { path = "../common/network-defaults" }
-12
View File
@@ -5,18 +5,6 @@ WORKDIR /usr/src/nym/nym-data-observatory
RUN cargo build --release RUN cargo build --release
#-------------------------------------------------------------------
# The following environment variables are required at runtime:
#
# NYM_DATA_OBSERVATORY_CONNECTION_URL
#
# And optionally:
#
# NYM_DATA_OBSERVATORY_HTTP_PORT
#
# see https://github.com/nymtech/nym/blob/develop/nym-data-observatory/src/main.rs for details
#-------------------------------------------------------------------
FROM ubuntu:24.04 FROM ubuntu:24.04
RUN apt update && apt install -yy curl ca-certificates RUN apt update && apt install -yy curl ca-certificates
+1 -7
View File
@@ -18,14 +18,8 @@ services:
dockerfile: nym-data-observatory/Dockerfile dockerfile: nym-data-observatory/Dockerfile
container_name: nym-data-observatory container_name: nym-data-observatory
environment: environment:
NYM_DATA_OBSERVATORY_CONNECTION_USERNAME: "postgres" NYM_DATA_OBSERVATORY_CONNECTION_URL: "postgres://postgres:password@postgres:5432"
NYM_DATA_OBSERVATORY_CONNECTION_PASSWORD: "password"
NYM_DATA_OBSERVATORY_CONNECTION_HOST: "postgres"
NYM_DATA_OBSERVATORY_CONNECTION_PORT: "5432"
NYM_DATA_OBSERVATORY_CONNECTION_DB: ""
NYM_DATA_OBSERVATORY_HTTP_PORT: 8000 NYM_DATA_OBSERVATORY_HTTP_PORT: 8000
env_file:
- ../envs/qa.env
volumes: volumes:
pgdata: pgdata:
+3 -1
View File
@@ -14,7 +14,9 @@ pub(crate) struct Storage {
} }
impl Storage { impl Storage {
pub async fn init(connection_url: String) -> Result<Self> { pub async fn init(connection_url: Option<String>) -> Result<Self> {
let connection_url =
connection_url.ok_or_else(|| anyhow!("Missing the connection url for database!"))?;
let connect_options = let connect_options =
PgConnectOptions::from_str(&connection_url)?.disable_statement_logging(); PgConnectOptions::from_str(&connection_url)?.disable_statement_logging();
+1 -2
View File
@@ -1,5 +1,4 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use time::OffsetDateTime;
use utoipa::ToSchema; use utoipa::ToSchema;
use crate::background_task::Response; use crate::background_task::Response;
@@ -17,7 +16,7 @@ impl From<Response> for JokeDto {
joke_id: value.joke_id, joke_id: value.joke_id,
joke: value.joke, joke: value.joke,
// casting not smart, can implicitly panic, don't do this in prod // casting not smart, can implicitly panic, don't do this in prod
date_created: OffsetDateTime::now_utc().unix_timestamp() as i32, date_created: chrono::offset::Utc::now().timestamp() as i32,
} }
} }
} }
+4 -29
View File
@@ -18,25 +18,9 @@ struct Args {
#[arg(short, long, default_value = None, env = "NYM_DATA_OBSERVATORY_ENV_FILE")] #[arg(short, long, default_value = None, env = "NYM_DATA_OBSERVATORY_ENV_FILE")]
env_file: Option<String>, env_file: Option<String>,
/// DB connection username /// DB connection url
#[arg(long, default_value = None, env = "NYM_DATA_OBSERVATORY_CONNECTION_USERNAME")] #[arg(short, long, default_value = None, env = "NYM_DATA_OBSERVATORY_CONNECTION_URL")]
connection_username: String, connection_url: Option<String>,
/// DB connection password
#[arg(long, default_value = None, env = "NYM_DATA_OBSERVATORY_CONNECTION_PASSWORD")]
connection_password: String,
/// DB connection host
#[arg(long, default_value = None, env = "NYM_DATA_OBSERVATORY_CONNECTION_HOST")]
connection_host: String,
/// DB connection port
#[arg(long, default_value = None, env = "NYM_DATA_OBSERVATORY_CONNECTION_PORT")]
connection_port: String,
/// DB connection database name
#[arg(long, default_value = None, env = "NYM_DATA_OBSERVATORY_CONNECTION_DB")]
connection_db: String,
} }
#[tokio::main] #[tokio::main]
@@ -47,16 +31,7 @@ async fn main() -> anyhow::Result<()> {
setup_env(args.env_file); // Defaults to mainnet if empty setup_env(args.env_file); // Defaults to mainnet if empty
let connection_url = format!( let storage = db::Storage::init(args.connection_url).await?;
"postgres://{}:{}@{}:{}/{}",
args.connection_username,
args.connection_password,
args.connection_host,
args.connection_port,
args.connection_db
);
let storage = db::Storage::init(connection_url).await?;
let db_pool = storage.pool_owned().await; let db_pool = storage.pool_owned().await;
tokio::spawn(async move { tokio::spawn(async move {
background_task::spawn_in_background(db_pool).await; background_task::spawn_in_background(db_pool).await;
+1 -1
View File
@@ -18,6 +18,6 @@ nym-sphinx-anonymous-replies = { path = "../../../common/nymsphinx/anonymous-rep
nym-ffi-shared = { path = "../shared" } nym-ffi-shared = { path = "../shared" }
lazy_static = "1.4.0" lazy_static = "1.4.0"
# error handling # error handling
anyhow = "1.0.90" anyhow = "1.0.75"
# base58 en/decoding # base58 en/decoding
bs58 = "0.5.0" bs58 = "0.5.0"
+1 -1
View File
@@ -20,7 +20,7 @@ nym-ffi-shared = { path = "../shared" }
tokio = { version = "1", features = ["full"] } tokio = { version = "1", features = ["full"] }
lazy_static = "1.4.0" lazy_static = "1.4.0"
# error handling # error handling
anyhow = "1.0.90" anyhow = "1.0.79"
thiserror = "1.0.64" thiserror = "1.0.64"
[build-dependencies] [build-dependencies]
+1 -1
View File
@@ -14,7 +14,7 @@ nym-sphinx-anonymous-replies = { path = "../../../common/nymsphinx/anonymous-rep
# static var macro # static var macro
lazy_static = "1.4.0" lazy_static = "1.4.0"
# error handling # error handling
anyhow = "1.0.90" anyhow = "1.0.75"
# base58 en/decoding # base58 en/decoding
bs58 = "0.5.0" bs58 = "0.5.0"
# UDL test # UDL test
@@ -297,6 +297,10 @@ impl<S: Storage + Clone + 'static> MixnetListener<S> {
credential: CredentialSpendingData, credential: CredentialSpendingData,
client_id: i64, client_id: i64,
) -> Result<i64> { ) -> Result<i64> {
ecash_verifier
.storage()
.create_bandwidth_entry(client_id)
.await?;
let bandwidth = ecash_verifier let bandwidth = ecash_verifier
.storage() .storage()
.get_available_bandwidth(client_id) .get_available_bandwidth(client_id)
@@ -33,7 +33,7 @@ regex = { workspace = true }
reqwest = { workspace = true, features = ["json"] } reqwest = { workspace = true, features = ["json"] }
serde = { workspace = true, features = ["derive"] } serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true } serde_json = { workspace = true }
sqlx = { workspace = true, features = ["runtime-tokio-rustls", "time"]} sqlx = { workspace = true, features = ["runtime-tokio-rustls", "chrono"]}
tap = { workspace = true } tap = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
tokio = { workspace = true, features = [ "net", "rt-multi-thread", "macros" ] } tokio = { workspace = true, features = [ "net", "rt-multi-thread", "macros" ] }