Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 43d443f9b6 |
@@ -104,9 +104,12 @@ jobs:
|
||||
name: nym-binaries-artifacts
|
||||
path: |
|
||||
target/release/nym-client
|
||||
target/release/nym-gateway
|
||||
target/release/nym-mixnode
|
||||
target/release/nym-socks5-client
|
||||
target/release/nym-api
|
||||
target/release/nym-network-requester
|
||||
target/release/nym-network-statistics
|
||||
target/release/nym-cli
|
||||
target/release/nymvisor
|
||||
target/release/nym-node
|
||||
@@ -121,9 +124,12 @@ jobs:
|
||||
OUTPUT_DIR: ci-builds/${{ github.ref_name }}
|
||||
run: |
|
||||
cp target/release/nym-client $OUTPUT_DIR
|
||||
cp target/release/nym-gateway $OUTPUT_DIR
|
||||
cp target/release/nym-mixnode $OUTPUT_DIR
|
||||
cp target/release/nym-socks5-client $OUTPUT_DIR
|
||||
cp target/release/nym-api $OUTPUT_DIR
|
||||
cp target/release/nym-network-requester $OUTPUT_DIR
|
||||
cp target/release/nym-network-statistics $OUTPUT_DIR
|
||||
cp target/release/nymvisor $OUTPUT_DIR
|
||||
cp target/release/nym-node $OUTPUT_DIR
|
||||
cp target/release/nym-cli $OUTPUT_DIR
|
||||
|
||||
@@ -6,6 +6,7 @@ on:
|
||||
- 'clients/**'
|
||||
- 'common/**'
|
||||
- 'explorer-api/**'
|
||||
- 'ephemera/**'
|
||||
- 'gateway/**'
|
||||
- 'integrations/**'
|
||||
- 'mixnode/**'
|
||||
@@ -23,6 +24,7 @@ on:
|
||||
- 'clients/**'
|
||||
- 'common/**'
|
||||
- 'explorer-api/**'
|
||||
- 'ephemera/**'
|
||||
- 'gateway/**'
|
||||
- 'integrations/**'
|
||||
- 'mixnode/**'
|
||||
|
||||
@@ -27,17 +27,23 @@ jobs:
|
||||
release_id: ${{ steps.create-release.outputs.id }}
|
||||
release_date: ${{ fromJSON(steps.create-release.outputs.assets)[0].published_at }}
|
||||
client_hash: ${{ steps.binary-hashes.outputs.client_hash }}
|
||||
mixnode_hash: ${{ steps.binary-hashes.outputs.mixnode_hash }}
|
||||
gateway_hash: ${{ steps.binary-hashes.outputs.gateway_hash }}
|
||||
nymvisor_hash: ${{ steps.binary-hashes.outputs.nymvisor_hash }}
|
||||
nymnode_hash: ${{ steps.binary-hashes.outputs.nymnode_hash }}
|
||||
socks5_hash: ${{ steps.binary-hashes.outputs.socks5_hash }}
|
||||
netreq_hash: ${{ steps.binary-hashes.outputs.netreq_hash }}
|
||||
cli_hash: ${{ steps.binary-hashes.outputs.cli_hash }}
|
||||
netstat_hash: ${{ steps.binary-hashes.outputs.netstat_hash }}
|
||||
client_version: ${{ steps.binary-versions.outputs.client_version }}
|
||||
mixnode_version: ${{ steps.binary-versions.outputs.mixnode_version }}
|
||||
gateway_version: ${{ steps.binary-versions.outputs.gateway_version }}
|
||||
nymvisor_version: ${{ steps.binary-versions.outputs.nymvisor_version }}
|
||||
nymnode_version: ${{ steps.binary-versions.outputs.nymnode_version }}
|
||||
socks5_version: ${{ steps.binary-versions.outputs.socks5_version }}
|
||||
netreq_version: ${{ steps.binary-versions.outputs.netreq_version }}
|
||||
cli_version: ${{ steps.binary-versions.outputs.cli_version }}
|
||||
netstat_version: ${{ steps.binary-versions.outputs.netstat_version }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -69,9 +75,12 @@ jobs:
|
||||
path: |
|
||||
target/release/explorer-api
|
||||
target/release/nym-client
|
||||
target/release/nym-gateway
|
||||
target/release/nym-mixnode
|
||||
target/release/nym-socks5-client
|
||||
target/release/nym-api
|
||||
target/release/nym-network-requester
|
||||
target/release/nym-network-statistics
|
||||
target/release/nym-cli
|
||||
target/release/nymvisor
|
||||
target/release/nym-node
|
||||
@@ -85,9 +94,12 @@ jobs:
|
||||
files: |
|
||||
target/release/explorer-api
|
||||
target/release/nym-client
|
||||
target/release/nym-gateway
|
||||
target/release/nym-mixnode
|
||||
target/release/nym-socks5-client
|
||||
target/release/nym-api
|
||||
target/release/nym-network-requester
|
||||
target/release/nym-network-statistics
|
||||
target/release/nym-cli
|
||||
target/release/nymvisor
|
||||
target/release/nym-node
|
||||
|
||||
@@ -4,78 +4,6 @@ Post 1.0.0 release, the changelog format is based on [Keep a Changelog](https://
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [2024.7-doubledecker] (2024-07-04)
|
||||
|
||||
- Add an early return in `parse_raw_str_logs` for empty raw log strings. ([#4686])
|
||||
- Bump braces from 3.0.2 to 3.0.3 in /wasm/mix-fetch/internal-dev ([#4672])
|
||||
- add expiry returned on import ([#4670])
|
||||
- [bugfix] missing rustls feature ([#4666])
|
||||
- Bump ws from 8.13.0 to 8.17.1 in /wasm/client/internal-dev-node ([#4665])
|
||||
- Bump braces from 3.0.2 to 3.0.3 in /clients/native/examples/js-examples/websocket ([#4663])
|
||||
- Bump ws from 8.14.2 to 8.17.1 in /sdk/typescript/packages/nodejs-client ([#4662])
|
||||
- Update setup.md ([#4661])
|
||||
- New clippy lints ([#4660])
|
||||
- Bump braces from 3.0.2 to 3.0.3 in /nym-api/tests ([#4659])
|
||||
- Bump braces from 3.0.2 to 3.0.3 in /docker/typescript_client/upload_contract ([#4658])
|
||||
- Update vps-setup.md ([#4656])
|
||||
- Update configuration.md ([#4655])
|
||||
- Remove old PR template ([#4639])
|
||||
|
||||
[#4686]: https://github.com/nymtech/nym/pull/4686
|
||||
[#4672]: https://github.com/nymtech/nym/pull/4672
|
||||
[#4670]: https://github.com/nymtech/nym/pull/4670
|
||||
[#4666]: https://github.com/nymtech/nym/pull/4666
|
||||
[#4665]: https://github.com/nymtech/nym/pull/4665
|
||||
[#4663]: https://github.com/nymtech/nym/pull/4663
|
||||
[#4662]: https://github.com/nymtech/nym/pull/4662
|
||||
[#4661]: https://github.com/nymtech/nym/pull/4661
|
||||
[#4660]: https://github.com/nymtech/nym/pull/4660
|
||||
[#4659]: https://github.com/nymtech/nym/pull/4659
|
||||
[#4658]: https://github.com/nymtech/nym/pull/4658
|
||||
[#4656]: https://github.com/nymtech/nym/pull/4656
|
||||
[#4655]: https://github.com/nymtech/nym/pull/4655
|
||||
[#4639]: https://github.com/nymtech/nym/pull/4639
|
||||
|
||||
## [2024.6-chomp] (2024-06-25)
|
||||
|
||||
- Remove additional code as part of Ephemera Purge and SP and contracts ([#4650])
|
||||
- bugfix: make sure nym-api can handle non-cw2 (or without detailed build info) compliant contracts ([#4648])
|
||||
- introduced a flag to accept toc and exposed it via self-described API ([#4647])
|
||||
- bugfix: make sure to return an error on invalid public ip ([#4646])
|
||||
- Add ci check for PR having an assigned milestone ([#4644])
|
||||
- Removed ephemera code ([#4642])
|
||||
- Remove stale peers ([#4640])
|
||||
- Add generic wg private network routing ([#4636])
|
||||
- Feature/new node endpoints ([#4635])
|
||||
- standarised ContractBuildInformation and added it to all contracts ([#4631])
|
||||
- validate nym-node public ips on startup ([#4630])
|
||||
- Bump defguard wg ([#4625])
|
||||
- Fix cargo warnings ([#4624])
|
||||
- Update kernel peers on peer modification ([#4622])
|
||||
- Handle v6 and v7 requests in the IPR, but reply with v6 ([#4620])
|
||||
- fix typo ([#4619])
|
||||
- Update crypto and rand crates ([#4607])
|
||||
- Purge name service and service provider directory contracts ([#4603])
|
||||
|
||||
[#4650]: https://github.com/nymtech/nym/pull/4650
|
||||
[#4648]: https://github.com/nymtech/nym/pull/4648
|
||||
[#4647]: https://github.com/nymtech/nym/pull/4647
|
||||
[#4646]: https://github.com/nymtech/nym/pull/4646
|
||||
[#4644]: https://github.com/nymtech/nym/pull/4644
|
||||
[#4642]: https://github.com/nymtech/nym/pull/4642
|
||||
[#4640]: https://github.com/nymtech/nym/pull/4640
|
||||
[#4636]: https://github.com/nymtech/nym/pull/4636
|
||||
[#4635]: https://github.com/nymtech/nym/pull/4635
|
||||
[#4631]: https://github.com/nymtech/nym/pull/4631
|
||||
[#4630]: https://github.com/nymtech/nym/pull/4630
|
||||
[#4625]: https://github.com/nymtech/nym/pull/4625
|
||||
[#4624]: https://github.com/nymtech/nym/pull/4624
|
||||
[#4622]: https://github.com/nymtech/nym/pull/4622
|
||||
[#4620]: https://github.com/nymtech/nym/pull/4620
|
||||
[#4619]: https://github.com/nymtech/nym/pull/4619
|
||||
[#4607]: https://github.com/nymtech/nym/pull/4607
|
||||
[#4603]: https://github.com/nymtech/nym/pull/4603
|
||||
|
||||
## [2024.5-ragusa] (2024-05-22)
|
||||
|
||||
- Feature/nym node api location ([#4605])
|
||||
|
||||
Generated
+17
-8
@@ -2093,7 +2093,7 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0"
|
||||
|
||||
[[package]]
|
||||
name = "explorer-api"
|
||||
version = "1.1.36"
|
||||
version = "1.1.34"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"clap 4.5.4",
|
||||
@@ -3630,6 +3630,15 @@ dependencies = [
|
||||
"wasm-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mixnet-authenticator"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"nym-bin-common",
|
||||
"nym-client-core",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "multer"
|
||||
version = "2.1.0"
|
||||
@@ -3858,7 +3867,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-api"
|
||||
version = "1.1.40"
|
||||
version = "1.1.38"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
@@ -4018,7 +4027,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-cli"
|
||||
version = "1.1.38"
|
||||
version = "1.1.36"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"base64 0.13.1",
|
||||
@@ -4097,7 +4106,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-client"
|
||||
version = "1.1.37"
|
||||
version = "1.1.35"
|
||||
dependencies = [
|
||||
"bs58 0.5.1",
|
||||
"clap 4.5.4",
|
||||
@@ -4910,7 +4919,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-network-requester"
|
||||
version = "1.1.38"
|
||||
version = "1.1.36"
|
||||
dependencies = [
|
||||
"addr",
|
||||
"anyhow",
|
||||
@@ -4979,7 +4988,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-node"
|
||||
version = "1.1.4"
|
||||
version = "1.1.2"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bip39",
|
||||
@@ -5241,7 +5250,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nym-socks5-client"
|
||||
version = "1.1.37"
|
||||
version = "1.1.35"
|
||||
dependencies = [
|
||||
"bs58 0.5.1",
|
||||
"clap 4.5.4",
|
||||
@@ -5767,7 +5776,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nymvisor"
|
||||
version = "0.1.3"
|
||||
version = "0.1.1"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bytes",
|
||||
|
||||
@@ -96,6 +96,7 @@ members = [
|
||||
"mixnode",
|
||||
"sdk/lib/socks5-listener",
|
||||
"sdk/rust/nym-sdk",
|
||||
"service-providers/authenticator",
|
||||
"service-providers/common",
|
||||
"service-providers/ip-packet-router",
|
||||
"service-providers/network-requester",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nym-client"
|
||||
version = "1.1.37"
|
||||
version = "1.1.35"
|
||||
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>", "Jędrzej Stuczyński <andrew@nymtech.net>"]
|
||||
description = "Implementation of the Nym Client"
|
||||
edition = "2021"
|
||||
|
||||
+236
-78
@@ -744,18 +744,6 @@
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/braces": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
|
||||
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"fill-range": "^7.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/browserslist": {
|
||||
"version": "4.20.2",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.2.tgz",
|
||||
@@ -874,6 +862,51 @@
|
||||
"fsevents": "~2.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/chokidar/node_modules/braces": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"fill-range": "^7.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/chokidar/node_modules/fill-range": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"to-regex-range": "^5.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/chokidar/node_modules/is-number": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/chokidar/node_modules/to-regex-range": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"is-number": "^7.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/chrome-trace-event": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz",
|
||||
@@ -1560,6 +1593,39 @@
|
||||
"node": ">=8.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/fast-glob/node_modules/braces": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"fill-range": "^7.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/fast-glob/node_modules/fill-range": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"to-regex-range": "^5.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/fast-glob/node_modules/is-number": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/fast-glob/node_modules/micromatch": {
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz",
|
||||
@@ -1573,6 +1639,18 @@
|
||||
"node": ">=8.6"
|
||||
}
|
||||
},
|
||||
"node_modules/fast-glob/node_modules/to-regex-range": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"is-number": "^7.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/fast-json-stable-stringify": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
|
||||
@@ -1605,18 +1683,6 @@
|
||||
"node": ">=0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/fill-range": {
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
|
||||
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"to-regex-range": "^5.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/finalhandler": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
|
||||
@@ -2071,6 +2137,39 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/http-proxy-middleware/node_modules/braces": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"fill-range": "^7.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/http-proxy-middleware/node_modules/fill-range": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"to-regex-range": "^5.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/http-proxy-middleware/node_modules/is-number": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/http-proxy-middleware/node_modules/micromatch": {
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz",
|
||||
@@ -2084,6 +2183,18 @@
|
||||
"node": ">=8.6"
|
||||
}
|
||||
},
|
||||
"node_modules/http-proxy-middleware/node_modules/to-regex-range": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"is-number": "^7.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/human-signals": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
|
||||
@@ -2250,15 +2361,6 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/is-number": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/is-path-cwd": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz",
|
||||
@@ -3751,18 +3853,6 @@
|
||||
"integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/to-regex-range": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"is-number": "^7.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/toidentifier": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
|
||||
@@ -5123,15 +5213,6 @@
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"braces": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
|
||||
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fill-range": "^7.1.1"
|
||||
}
|
||||
},
|
||||
"browserslist": {
|
||||
"version": "4.20.2",
|
||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.20.2.tgz",
|
||||
@@ -5202,6 +5283,41 @@
|
||||
"is-glob": "~4.0.1",
|
||||
"normalize-path": "~3.0.0",
|
||||
"readdirp": "~3.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"braces": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fill-range": "^7.0.1"
|
||||
}
|
||||
},
|
||||
"fill-range": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"to-regex-range": "^5.0.1"
|
||||
}
|
||||
},
|
||||
"is-number": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
||||
"dev": true
|
||||
},
|
||||
"to-regex-range": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-number": "^7.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"chrome-trace-event": {
|
||||
@@ -5736,6 +5852,30 @@
|
||||
"micromatch": "^4.0.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"braces": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fill-range": "^7.0.1"
|
||||
}
|
||||
},
|
||||
"fill-range": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"to-regex-range": "^5.0.1"
|
||||
}
|
||||
},
|
||||
"is-number": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
||||
"dev": true
|
||||
},
|
||||
"micromatch": {
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz",
|
||||
@@ -5745,6 +5885,15 @@
|
||||
"braces": "^3.0.1",
|
||||
"picomatch": "^2.2.3"
|
||||
}
|
||||
},
|
||||
"to-regex-range": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-number": "^7.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -5777,15 +5926,6 @@
|
||||
"websocket-driver": ">=0.5.1"
|
||||
}
|
||||
},
|
||||
"fill-range": {
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
|
||||
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"to-regex-range": "^5.0.1"
|
||||
}
|
||||
},
|
||||
"finalhandler": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
|
||||
@@ -6107,6 +6247,30 @@
|
||||
"micromatch": "^4.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"braces": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fill-range": "^7.0.1"
|
||||
}
|
||||
},
|
||||
"fill-range": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"to-regex-range": "^5.0.1"
|
||||
}
|
||||
},
|
||||
"is-number": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
||||
"dev": true
|
||||
},
|
||||
"micromatch": {
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz",
|
||||
@@ -6116,6 +6280,15 @@
|
||||
"braces": "^3.0.1",
|
||||
"picomatch": "^2.2.3"
|
||||
}
|
||||
},
|
||||
"to-regex-range": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-number": "^7.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -6234,12 +6407,6 @@
|
||||
"is-extglob": "^2.1.1"
|
||||
}
|
||||
},
|
||||
"is-number": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
||||
"dev": true
|
||||
},
|
||||
"is-path-cwd": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz",
|
||||
@@ -7357,15 +7524,6 @@
|
||||
"integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==",
|
||||
"dev": true
|
||||
},
|
||||
"to-regex-range": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-number": "^7.0.0"
|
||||
}
|
||||
},
|
||||
"toidentifier": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
|
||||
|
||||
@@ -73,7 +73,6 @@ impl From<Init> for OverrideConfig {
|
||||
fn from(init_config: Init) -> Self {
|
||||
OverrideConfig {
|
||||
nym_apis: init_config.common_args.nym_apis,
|
||||
fronting_domains: init_config.common_args.fronting_domains,
|
||||
disable_socket: init_config.disable_socket,
|
||||
port: init_config.port,
|
||||
host: init_config.host,
|
||||
|
||||
@@ -97,7 +97,6 @@ pub(crate) enum Commands {
|
||||
// Configuration that can be overridden.
|
||||
pub(crate) struct OverrideConfig {
|
||||
nym_apis: Option<Vec<url::Url>>,
|
||||
fronting_domains: Option<Vec<url::Url>>,
|
||||
disable_socket: Option<bool>,
|
||||
port: Option<u16>,
|
||||
host: Option<IpAddr>,
|
||||
@@ -134,10 +133,6 @@ pub(crate) fn override_config(config: Config, args: OverrideConfig) -> Config {
|
||||
.with_base(BaseClientConfig::with_disabled_cover_traffic, args.no_cover)
|
||||
.with_optional(Config::with_port, args.port)
|
||||
.with_optional(Config::with_host, args.host)
|
||||
.with_optional_ext(
|
||||
BaseClientConfig::with_fronting_domains,
|
||||
args.fronting_domains,
|
||||
)
|
||||
.with_optional_custom_env_ext(
|
||||
BaseClientConfig::with_custom_nym_apis,
|
||||
args.nym_apis,
|
||||
|
||||
@@ -36,7 +36,6 @@ impl From<Run> for OverrideConfig {
|
||||
fn from(run_config: Run) -> Self {
|
||||
OverrideConfig {
|
||||
nym_apis: run_config.common_args.nym_apis,
|
||||
fronting_domains: run_config.common_args.fronting_domains,
|
||||
disable_socket: run_config.disable_socket,
|
||||
port: run_config.port,
|
||||
host: run_config.host,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nym-socks5-client"
|
||||
version = "1.1.37"
|
||||
version = "1.1.35"
|
||||
authors = ["Dave Hrycyszyn <futurechimp@users.noreply.github.com>"]
|
||||
description = "A SOCKS5 localhost proxy that converts incoming messages to Sphinx and sends them to a Nym address"
|
||||
edition = "2021"
|
||||
|
||||
@@ -117,11 +117,6 @@ impl Config {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_fronting_domains(mut self, fronting_domains: Vec<Url>) -> Self {
|
||||
self.client.fronting_domains = Some(fronting_domains);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn set_custom_nym_apis(&mut self, nym_api_urls: Vec<Url>) {
|
||||
self.client.nym_api_urls = nym_api_urls;
|
||||
}
|
||||
@@ -294,10 +289,6 @@ impl Config {
|
||||
pub fn get_nym_api_endpoints(&self) -> Vec<Url> {
|
||||
self.client.nym_api_urls.clone()
|
||||
}
|
||||
|
||||
pub fn get_fronting_domains(&self) -> Option<Vec<Url>> {
|
||||
self.client.fronting_domains.clone()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, PartialEq, Eq, Serialize)]
|
||||
@@ -323,9 +314,6 @@ pub struct Client {
|
||||
/// Addresses to APIs running on validator from which the client gets the view of the network.
|
||||
#[serde(alias = "validator_api_urls")]
|
||||
pub nym_api_urls: Vec<Url>,
|
||||
|
||||
/// Domain to use for domain fronting censorship circumvention
|
||||
pub fronting_domains: Option<Vec<Url>>,
|
||||
}
|
||||
|
||||
impl Client {
|
||||
@@ -352,7 +340,6 @@ impl Client {
|
||||
disabled_credentials_mode: true,
|
||||
nyxd_urls,
|
||||
nym_api_urls,
|
||||
fronting_domains: None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -362,7 +349,6 @@ impl Client {
|
||||
disabled_credentials_mode: bool,
|
||||
nyxd_urls: Vec<Url>,
|
||||
nym_api_urls: Vec<Url>,
|
||||
fronting_domains: Option<Vec<Url>>,
|
||||
) -> Self {
|
||||
Client {
|
||||
version: version.into(),
|
||||
@@ -370,7 +356,6 @@ impl Client {
|
||||
disabled_credentials_mode,
|
||||
nyxd_urls,
|
||||
nym_api_urls,
|
||||
fronting_domains,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,6 @@ impl From<ConfigV5> for Config {
|
||||
id: value.client.id,
|
||||
disabled_credentials_mode: value.client.disabled_credentials_mode,
|
||||
nyxd_urls: value.client.nyxd_urls,
|
||||
fronting_domains: None, //SW need proper migrations if it gets applied
|
||||
nym_api_urls: value.client.nym_api_urls,
|
||||
},
|
||||
debug: DebugConfig {
|
||||
|
||||
@@ -111,7 +111,7 @@ where
|
||||
hardcoded_topology.get_gateways()
|
||||
} else {
|
||||
let mut rng = rand::thread_rng();
|
||||
crate::init::helpers::current_gateways(&mut rng, &core.client.nym_api_urls, None).await?
|
||||
crate::init::helpers::current_gateways(&mut rng, &core.client.nym_api_urls).await?
|
||||
};
|
||||
|
||||
// since we're registering with a brand new gateway,
|
||||
|
||||
@@ -70,13 +70,6 @@ pub struct CommonClientInitArgs {
|
||||
)]
|
||||
pub nym_apis: Option<Vec<url::Url>>,
|
||||
|
||||
///Comma separated list of urls to use for domain fronting
|
||||
#[cfg_attr(
|
||||
feature = "cli",
|
||||
clap(long, value_delimiter = ',', requires = "nym_apis", hide = true)
|
||||
)]
|
||||
pub fronting_domains: Option<Vec<url::Url>>,
|
||||
|
||||
/// Path to .json file containing custom network specification.
|
||||
#[cfg_attr(feature = "cli", clap(long, group = "network", hide = true))]
|
||||
pub custom_mixnet: Option<PathBuf>,
|
||||
@@ -151,16 +144,6 @@ where
|
||||
.collect::<Vec<&str>>()
|
||||
.join(",")
|
||||
);
|
||||
if let Some(fronting_domains) = &core.client.fronting_domains {
|
||||
log::info!(
|
||||
"fronted by : {}",
|
||||
fronting_domains
|
||||
.iter()
|
||||
.map(|url| url.host_str().unwrap_or_default())
|
||||
.collect::<Vec<&str>>()
|
||||
.join(",")
|
||||
);
|
||||
}
|
||||
|
||||
let key_store = OnDiskKeys::new(paths.keys.clone());
|
||||
let details_store = setup_fs_gateways_storage(&paths.gateway_registrations).await?;
|
||||
@@ -180,12 +163,7 @@ where
|
||||
hardcoded_topology.get_gateways()
|
||||
} else {
|
||||
let mut rng = rand::thread_rng();
|
||||
crate::init::helpers::current_gateways(
|
||||
&mut rng,
|
||||
&core.client.nym_api_urls,
|
||||
core.client.fronting_domains.as_ref(),
|
||||
)
|
||||
.await?
|
||||
crate::init::helpers::current_gateways(&mut rng, &core.client.nym_api_urls).await?
|
||||
};
|
||||
|
||||
let gateway_setup = GatewaySetup::New {
|
||||
|
||||
@@ -35,13 +35,6 @@ pub struct CommonClientRunArgs {
|
||||
)]
|
||||
pub nym_apis: Option<Vec<url::Url>>,
|
||||
|
||||
///Comma separated list of urls to use for domain fronting
|
||||
#[cfg_attr(
|
||||
feature = "cli",
|
||||
clap(long, value_delimiter = ',', requires = "nym_apis", hide = true)
|
||||
)]
|
||||
pub fronting_domains: Option<Vec<url::Url>>,
|
||||
|
||||
/// Path to .json file containing custom network specification.
|
||||
#[cfg_attr(feature = "cli", clap(long, group = "network", hide = true))]
|
||||
pub custom_mixnet: Option<PathBuf>,
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
use super::packet_statistics_control::PacketStatisticsReporter;
|
||||
use super::received_buffer::ReceivedBufferMessage;
|
||||
use super::topology_control::fronted_api_provider::FrontedApiTopologyProvider;
|
||||
use super::topology_control::geo_aware_provider::GeoAwareTopologyProvider;
|
||||
use crate::client::base_client::storage::helpers::store_client_keys;
|
||||
use crate::client::base_client::storage::MixnetClientStorage;
|
||||
@@ -468,29 +467,17 @@ where
|
||||
custom_provider: Option<Box<dyn TopologyProvider + Send + Sync>>,
|
||||
config_topology: config::Topology,
|
||||
nym_api_urls: Vec<Url>,
|
||||
fronting_domains: Option<Vec<Url>>,
|
||||
) -> Box<dyn TopologyProvider + Send + Sync> {
|
||||
// if no custom provider was ... provided ..., create one using nym-api
|
||||
custom_provider.unwrap_or_else(|| match config_topology.topology_structure {
|
||||
config::TopologyStructure::NymApi => match fronting_domains {
|
||||
Some(domains) => Box::new(FrontedApiTopologyProvider::new(
|
||||
nym_api_provider::Config {
|
||||
min_mixnode_performance: config_topology.minimum_mixnode_performance,
|
||||
min_gateway_performance: config_topology.minimum_gateway_performance,
|
||||
},
|
||||
nym_api_urls,
|
||||
domains,
|
||||
env!("CARGO_PKG_VERSION").to_string(),
|
||||
)),
|
||||
None => Box::new(NymApiTopologyProvider::new(
|
||||
nym_api_provider::Config {
|
||||
min_mixnode_performance: config_topology.minimum_mixnode_performance,
|
||||
min_gateway_performance: config_topology.minimum_gateway_performance,
|
||||
},
|
||||
nym_api_urls,
|
||||
env!("CARGO_PKG_VERSION").to_string(),
|
||||
)),
|
||||
},
|
||||
config::TopologyStructure::NymApi => Box::new(NymApiTopologyProvider::new(
|
||||
nym_api_provider::Config {
|
||||
min_mixnode_performance: config_topology.minimum_mixnode_performance,
|
||||
min_gateway_performance: config_topology.minimum_gateway_performance,
|
||||
},
|
||||
nym_api_urls,
|
||||
env!("CARGO_PKG_VERSION").to_string(),
|
||||
)),
|
||||
config::TopologyStructure::GeoAware(group_by) => {
|
||||
Box::new(GeoAwareTopologyProvider::new(
|
||||
nym_api_urls,
|
||||
@@ -702,7 +689,6 @@ where
|
||||
self.custom_topology_provider.take(),
|
||||
self.config.debug.topology,
|
||||
self.config.get_nym_api_endpoints(),
|
||||
self.config.get_fronting_domains(),
|
||||
);
|
||||
|
||||
// needs to be started as the first thing to block if required waiting for the gateway
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
// Copyright 2023 - Nym Technologies SA <contact@nymtech.net>
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use async_trait::async_trait;
|
||||
use log::{debug, error, warn};
|
||||
use nym_topology::provider_trait::TopologyProvider;
|
||||
use nym_topology::{NymTopology, NymTopologyError};
|
||||
use rand::prelude::SliceRandom;
|
||||
use rand::thread_rng;
|
||||
use url::Url;
|
||||
|
||||
use super::nym_api_provider::Config;
|
||||
|
||||
pub(crate) struct FrontedApiTopologyProvider {
|
||||
config: Config,
|
||||
|
||||
validator_client: nym_validator_client::client::NymApiClient,
|
||||
nym_api_urls: Vec<Url>,
|
||||
fronting_domains: Vec<Url>,
|
||||
shuffling: Vec<usize>,
|
||||
|
||||
client_version: String,
|
||||
currently_used_api: usize,
|
||||
}
|
||||
|
||||
impl FrontedApiTopologyProvider {
|
||||
pub(crate) fn new(
|
||||
config: Config,
|
||||
nym_api_urls: Vec<Url>,
|
||||
fronting_domains: Vec<Url>,
|
||||
client_version: String,
|
||||
) -> Self {
|
||||
//SW for the PoC, we assume same lenght between fronting domains and api_urls
|
||||
let mut shuffling = (0..nym_api_urls.len()).collect::<Vec<_>>();
|
||||
shuffling.shuffle(&mut thread_rng());
|
||||
|
||||
FrontedApiTopologyProvider {
|
||||
config,
|
||||
validator_client: nym_validator_client::client::NymApiClient::new_fronted(
|
||||
nym_api_urls[shuffling[0]].clone(),
|
||||
fronting_domains[shuffling[0]].clone(),
|
||||
),
|
||||
nym_api_urls,
|
||||
fronting_domains,
|
||||
shuffling,
|
||||
client_version,
|
||||
currently_used_api: 0,
|
||||
}
|
||||
}
|
||||
|
||||
fn use_next_nym_api(&mut self) {
|
||||
if self.nym_api_urls.len() == 1 {
|
||||
warn!("There's only a single nym API available - it won't be possible to use a different one");
|
||||
return;
|
||||
}
|
||||
|
||||
self.currently_used_api = (self.currently_used_api + 1) % self.nym_api_urls.len();
|
||||
self.validator_client.change_nym_api_with_fronting(
|
||||
self.nym_api_urls[self.shuffling[self.currently_used_api]].clone(),
|
||||
self.fronting_domains[self.shuffling[self.currently_used_api]].clone(),
|
||||
);
|
||||
}
|
||||
|
||||
/// Verifies whether nodes a reasonably distributed among all mix layers.
|
||||
///
|
||||
/// In ideal world we would have 33% nodes on layer 1, 33% on layer 2 and 33% on layer 3.
|
||||
/// However, this is a rather unrealistic expectation, instead we check whether there exists
|
||||
/// a layer with more than 66% of nodes or with fewer than 15% and if so, we trigger a failure.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `topology`: active topology constructed from validator api data
|
||||
fn check_layer_distribution(
|
||||
&self,
|
||||
active_topology: &NymTopology,
|
||||
) -> Result<(), NymTopologyError> {
|
||||
let lower_threshold = 0.15;
|
||||
let upper_threshold = 0.66;
|
||||
active_topology.ensure_even_layer_distribution(lower_threshold, upper_threshold)
|
||||
}
|
||||
|
||||
async fn get_current_compatible_topology(&mut self) -> Option<NymTopology> {
|
||||
let mixnodes = match self
|
||||
.validator_client
|
||||
.get_basic_mixnodes(Some(self.client_version.clone()))
|
||||
.await
|
||||
{
|
||||
Err(err) => {
|
||||
error!("failed to get network mixnodes - {err}");
|
||||
return None;
|
||||
}
|
||||
Ok(mixes) => mixes,
|
||||
};
|
||||
|
||||
let gateways = match self
|
||||
.validator_client
|
||||
.get_basic_gateways(Some(self.client_version.clone()))
|
||||
.await
|
||||
{
|
||||
Err(err) => {
|
||||
error!("failed to get network gateways - {err}");
|
||||
return None;
|
||||
}
|
||||
Ok(gateways) => gateways,
|
||||
};
|
||||
|
||||
debug!(
|
||||
"there are {} mixnodes and {} gateways in total (before performance filtering)",
|
||||
mixnodes.len(),
|
||||
gateways.len()
|
||||
);
|
||||
|
||||
let topology = NymTopology::from_unordered(
|
||||
mixnodes.iter().filter(|m| {
|
||||
m.performance.round_to_integer() >= self.config.min_mixnode_performance
|
||||
}),
|
||||
gateways.iter().filter(|g| {
|
||||
g.performance.round_to_integer() >= self.config.min_gateway_performance
|
||||
}),
|
||||
);
|
||||
|
||||
if let Err(err) = self.check_layer_distribution(&topology) {
|
||||
warn!("The current filtered active topology has extremely skewed layer distribution. It cannot be used: {err}");
|
||||
self.use_next_nym_api();
|
||||
None
|
||||
} else {
|
||||
Some(topology)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// hehe, wasm
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[async_trait]
|
||||
impl TopologyProvider for FrontedApiTopologyProvider {
|
||||
async fn get_new_topology(&mut self) -> Option<NymTopology> {
|
||||
self.get_current_compatible_topology().await
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
#[async_trait(?Send)]
|
||||
impl TopologyProvider for FrontedApiTopologyProvider {
|
||||
async fn get_new_topology(&mut self) -> Option<NymTopology> {
|
||||
self.get_current_compatible_topology().await
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,6 @@ use tokio::time::sleep;
|
||||
use wasmtimer::tokio::sleep;
|
||||
|
||||
mod accessor;
|
||||
pub(crate) mod fronted_api_provider;
|
||||
pub mod geo_aware_provider;
|
||||
pub(crate) mod nym_api_provider;
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ use nym_crypto::asymmetric::identity;
|
||||
use nym_gateway_client::GatewayClient;
|
||||
use nym_topology::{filter::VersionFilterable, gateway, mix};
|
||||
use nym_validator_client::client::IdentityKeyRef;
|
||||
use rand::seq::IteratorRandom;
|
||||
use rand::{seq::SliceRandom, Rng};
|
||||
use std::{sync::Arc, time::Duration};
|
||||
use tungstenite::Message;
|
||||
@@ -60,29 +59,13 @@ impl<'a> GatewayWithLatency<'a> {
|
||||
pub async fn current_gateways<R: Rng>(
|
||||
rng: &mut R,
|
||||
nym_apis: &[Url],
|
||||
fronting_domains: Option<&Vec<Url>>,
|
||||
) -> Result<Vec<gateway::Node>, ClientCoreError> {
|
||||
let client = match fronting_domains {
|
||||
Some(domains) => {
|
||||
let (api_url, fronting_url) = nym_apis
|
||||
.iter()
|
||||
.zip(domains)
|
||||
.choose(rng)
|
||||
.ok_or(ClientCoreError::ListOfNymApisIsEmpty)?;
|
||||
let nym_api = nym_apis
|
||||
.choose(rng)
|
||||
.ok_or(ClientCoreError::ListOfNymApisIsEmpty)?;
|
||||
let client = nym_validator_client::client::NymApiClient::new(nym_api.clone());
|
||||
|
||||
nym_validator_client::client::NymApiClient::new_fronted(
|
||||
api_url.clone(),
|
||||
fronting_url.clone(),
|
||||
)
|
||||
}
|
||||
None => {
|
||||
let nym_api = nym_apis
|
||||
.choose(rng)
|
||||
.ok_or(ClientCoreError::ListOfNymApisIsEmpty)?;
|
||||
nym_validator_client::client::NymApiClient::new(nym_api.clone())
|
||||
}
|
||||
};
|
||||
log::debug!("Fetching list of gateways from: {}", client.api_url());
|
||||
log::debug!("Fetching list of gateways from: {nym_api}");
|
||||
|
||||
let gateways = client.get_cached_described_gateways().await?;
|
||||
log::debug!("Found {} gateways", gateways.len());
|
||||
|
||||
@@ -258,12 +258,6 @@ impl NymApiClient {
|
||||
NymApiClient { nym_api }
|
||||
}
|
||||
|
||||
pub fn new_fronted(api_url: Url, fronting_url: Url) -> Self {
|
||||
let nym_api = nym_api::Client::new_fronted(api_url, fronting_url, None);
|
||||
|
||||
NymApiClient { nym_api }
|
||||
}
|
||||
|
||||
pub fn api_url(&self) -> &Url {
|
||||
self.nym_api.current_url()
|
||||
}
|
||||
@@ -272,15 +266,6 @@ impl NymApiClient {
|
||||
self.nym_api.change_base_url(new_endpoint);
|
||||
}
|
||||
|
||||
pub fn change_nym_api_with_fronting(
|
||||
&mut self,
|
||||
new_api_endpoint: Url,
|
||||
new_fronting_domain: Url,
|
||||
) {
|
||||
self.nym_api
|
||||
.change_fronted_url(new_api_endpoint, new_fronting_domain);
|
||||
}
|
||||
|
||||
pub async fn get_basic_mixnodes(
|
||||
&self,
|
||||
semver_compatibility: Option<String>,
|
||||
|
||||
@@ -9,12 +9,16 @@ pub use nym_coconut_bandwidth_contract_common::event_attributes::*;
|
||||
pub use nym_coconut_dkg_common::event_attributes::*;
|
||||
|
||||
// it seems that currently validators just emit stringified events (which are also returned as part of deliverTx response)
|
||||
// as their logs
|
||||
// as theirs logs
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct Log {
|
||||
#[serde(default)]
|
||||
// weird thing is that the first msg_index seems to always be undefined on the raw logs
|
||||
pub msg_index: usize,
|
||||
// unless I'm missing something obvious, the "log" type in cosmjs is always an empty string
|
||||
// and launchpad cosmos validator was setting it to what essentially is just the raw version of what
|
||||
// we received (and we don't care about launchpad, we, as the time of writing this, work on the stargate)
|
||||
// log: String,
|
||||
pub events: Vec<cosmwasm_std::Event>,
|
||||
}
|
||||
|
||||
@@ -33,12 +37,8 @@ pub fn find_attribute<'a>(
|
||||
.find(|attr| attr.key == attribute_key)
|
||||
}
|
||||
|
||||
// these two functions were separated so that the internal logic could actually be tested
|
||||
// those two functions were separated so that the internal logic could actually be tested
|
||||
fn parse_raw_str_logs(raw: &str) -> Result<Vec<Log>, NyxdError> {
|
||||
if raw.is_empty() {
|
||||
return Ok(Vec::new());
|
||||
}
|
||||
|
||||
let logs: Vec<Log> = serde_json::from_str(raw).map_err(|_| NyxdError::MalformedLogString)?;
|
||||
if logs.len() != logs.iter().unique_by(|log| log.msg_index).count() {
|
||||
// this check is only here because I don't yet fully understand raw log string generation and
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use async_trait::async_trait;
|
||||
use http::header;
|
||||
use reqwest::header::HeaderValue;
|
||||
use reqwest::{RequestBuilder, Response, StatusCode};
|
||||
use serde::de::DeserializeOwned;
|
||||
@@ -97,13 +96,6 @@ impl ClientBuilder {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_host_header(mut self, host: &str) -> Self {
|
||||
let mut headers = header::HeaderMap::new();
|
||||
headers.insert(header::HOST, HeaderValue::from_str(host).unwrap()); //SW Handle this unwrap later
|
||||
self.reqwest_client_builder = self.reqwest_client_builder.default_headers(headers);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_user_agent<V>(mut self, value: V) -> Self
|
||||
where
|
||||
V: TryInto<HeaderValue>,
|
||||
@@ -163,23 +155,6 @@ impl Client {
|
||||
)
|
||||
}
|
||||
|
||||
pub fn new_fronted(base_url: Url, fronting_url: Url, timeout: Option<Duration>) -> Self {
|
||||
let host = base_url.host_str().unwrap();
|
||||
let mut fronted_url = base_url.clone();
|
||||
fronted_url.set_host(fronting_url.host_str()).unwrap();
|
||||
let builder = ClientBuilder::new::<_, String>(fronted_url)
|
||||
.expect(
|
||||
"we provided valid url and we were unwrapping previous construction errors anyway",
|
||||
)
|
||||
.with_host_header(host);
|
||||
|
||||
//SW polish that later if needed
|
||||
match timeout {
|
||||
Some(timeout) => builder.with_timeout(timeout).build::<String>().unwrap(),
|
||||
None => builder.build::<String>().unwrap(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_url<U, E>(url: U, timeout: Option<Duration>) -> Result<Self, HttpClientError<E>>
|
||||
where
|
||||
U: IntoUrl,
|
||||
@@ -204,21 +179,6 @@ impl Client {
|
||||
self.base_url = new_url
|
||||
}
|
||||
|
||||
pub fn change_fronted_url(&mut self, new_api_url: Url, new_fronting_url: Url) {
|
||||
let host = new_api_url.host_str().unwrap();
|
||||
let mut new_fronted_url = new_api_url.clone();
|
||||
new_fronted_url
|
||||
.set_host(new_fronting_url.host_str())
|
||||
.unwrap();
|
||||
let mut headers = header::HeaderMap::new();
|
||||
headers.insert(header::HOST, HeaderValue::from_str(host).unwrap()); //SW Handle this unwrap later
|
||||
self.reqwest_client = reqwest::ClientBuilder::new()
|
||||
.default_headers(headers)
|
||||
.build()
|
||||
.unwrap();
|
||||
self.base_url = new_fronted_url
|
||||
}
|
||||
|
||||
pub fn current_url(&self) -> &Url {
|
||||
&self.base_url
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ pub struct NymContracts {
|
||||
pub group_contract_address: Option<String>,
|
||||
pub multisig_contract_address: Option<String>,
|
||||
pub coconut_dkg_contract_address: Option<String>,
|
||||
pub service_provider_directory_contract_address: Option<String>,
|
||||
pub name_service_contract_address: Option<String>,
|
||||
}
|
||||
|
||||
// I wanted to use the simpler `NetworkDetails` name, but there's a clash
|
||||
@@ -125,6 +127,10 @@ impl NymNetworkDetails {
|
||||
.with_group_contract(get_optional_env(var_names::GROUP_CONTRACT_ADDRESS))
|
||||
.with_multisig_contract(get_optional_env(var_names::MULTISIG_CONTRACT_ADDRESS))
|
||||
.with_coconut_dkg_contract(get_optional_env(var_names::COCONUT_DKG_CONTRACT_ADDRESS))
|
||||
.with_service_provider_directory_contract(get_optional_env(
|
||||
var_names::SERVICE_PROVIDER_DIRECTORY_CONTRACT_ADDRESS,
|
||||
))
|
||||
.with_name_service_contract(get_optional_env(var_names::NAME_SERVICE_CONTRACT_ADDRESS))
|
||||
.with_explorer_api(get_optional_env(var_names::EXPLORER_API))
|
||||
}
|
||||
|
||||
@@ -153,6 +159,8 @@ impl NymNetworkDetails {
|
||||
coconut_dkg_contract_address: parse_optional_str(
|
||||
mainnet::COCONUT_DKG_CONTRACT_ADDRESS,
|
||||
),
|
||||
service_provider_directory_contract_address: None,
|
||||
name_service_contract_address: None,
|
||||
},
|
||||
explorer_api: parse_optional_str(mainnet::EXPLORER_API),
|
||||
}
|
||||
@@ -258,6 +266,21 @@ impl NymNetworkDetails {
|
||||
self
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn with_service_provider_directory_contract<S: Into<String>>(
|
||||
mut self,
|
||||
contract: Option<S>,
|
||||
) -> Self {
|
||||
self.contracts.service_provider_directory_contract_address = contract.map(Into::into);
|
||||
self
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn with_name_service_contract<S: Into<String>>(mut self, contract: Option<S>) -> Self {
|
||||
self.contracts.name_service_contract_address = contract.map(Into::into);
|
||||
self
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn with_explorer_api<S: Into<String>>(mut self, endpoint: Option<S>) -> Self {
|
||||
self.explorer_api = endpoint.map(Into::into);
|
||||
@@ -421,13 +444,22 @@ pub fn setup_env<P: AsRef<Path>>(config_env_file: Option<P>) {
|
||||
}
|
||||
}
|
||||
|
||||
// Name of the event triggered by the eth contract. If the event name is changed,
|
||||
// this would also need to be changed; It is currently tested against the json abi
|
||||
pub const ETH_EVENT_NAME: &str = "BBCredentialPurchased";
|
||||
pub const ETH_BURN_FUNCTION_NAME: &str = "generateBasicBandwidthCredential";
|
||||
pub const ETH_ERC20_APPROVE_FUNCTION_NAME: &str = "approve";
|
||||
|
||||
// Ethereum constants used for token bridge
|
||||
/// How much bandwidth (in bytes) one token can buy
|
||||
pub const BYTES_PER_UTOKEN: u64 = 1024;
|
||||
|
||||
/// How much bandwidth (in bytes) one freepass provides
|
||||
pub const BYTES_PER_FREEPASS: u64 = 1024 * 1024 * 1024; // 1GB
|
||||
|
||||
/// Threshold for claiming more bandwidth: 1 MB
|
||||
pub const REMAINING_BANDWIDTH_THRESHOLD: i64 = 1024 * 1024;
|
||||
/// How many tokens should be burned to buy bandwidth
|
||||
/// How many ERC20 tokens should be burned to buy bandwidth
|
||||
pub const TOKENS_TO_BURN: u64 = 1;
|
||||
/// How many ERC20 utokens should be burned to buy bandwidth
|
||||
pub const UTOKENS_TO_BURN: u64 = TOKENS_TO_BURN * 1000000;
|
||||
|
||||
@@ -20,6 +20,9 @@ pub const MULTISIG_CONTRACT_ADDRESS: &str = "MULTISIG_CONTRACT_ADDRESS";
|
||||
pub const COCONUT_DKG_CONTRACT_ADDRESS: &str = "COCONUT_DKG_CONTRACT_ADDRESS";
|
||||
pub const REWARDING_VALIDATOR_ADDRESS: &str = "REWARDING_VALIDATOR_ADDRESS";
|
||||
pub const STATISTICS_SERVICE_DOMAIN_ADDRESS: &str = "STATISTICS_SERVICE_DOMAIN_ADDRESS";
|
||||
pub const SERVICE_PROVIDER_DIRECTORY_CONTRACT_ADDRESS: &str =
|
||||
"SERVICE_PROVIDER_DIRECTORY_CONTRACT_ADDRESS";
|
||||
pub const NAME_SERVICE_CONTRACT_ADDRESS: &str = "NAME_SERVICE_CONTRACT_ADDRESS";
|
||||
pub const NYXD: &str = "NYXD";
|
||||
pub const NYM_API: &str = "NYM_API";
|
||||
pub const NYXD_WEBSOCKET: &str = "NYXD_WS";
|
||||
|
||||
@@ -6,7 +6,6 @@ use nym_credential_storage::models::StorableIssuedCredential;
|
||||
use nym_credential_storage::storage::Storage;
|
||||
use nym_credentials::coconut::bandwidth::issued::BandwidthCredentialIssuedDataVariant;
|
||||
use nym_credentials::IssuedBandwidthCredential;
|
||||
use time::OffsetDateTime;
|
||||
use tracing::{debug, warn};
|
||||
use zeroize::Zeroizing;
|
||||
|
||||
@@ -14,7 +13,7 @@ pub async fn import_credential<S>(
|
||||
credentials_store: S,
|
||||
raw_credential: Vec<u8>,
|
||||
credential_version: impl Into<Option<u8>>,
|
||||
) -> Result<Option<OffsetDateTime>, NymIdError>
|
||||
) -> Result<(), NymIdError>
|
||||
where
|
||||
S: Storage,
|
||||
<S as Storage>::StorageError: Send + Sync + 'static,
|
||||
@@ -30,10 +29,9 @@ where
|
||||
credential.typ()
|
||||
);
|
||||
|
||||
let expiry_date = match credential.variant_data() {
|
||||
match credential.variant_data() {
|
||||
BandwidthCredentialIssuedDataVariant::Voucher(voucher_info) => {
|
||||
debug!("with value of {}", voucher_info.value());
|
||||
None
|
||||
debug!("with value of {}", voucher_info.value())
|
||||
}
|
||||
BandwidthCredentialIssuedDataVariant::FreePass(freepass_info) => {
|
||||
debug!("with expiry at {}", freepass_info.expiry_date());
|
||||
@@ -44,11 +42,9 @@ where
|
||||
return Err(NymIdError::ExpiredCredentialImport {
|
||||
expiration: freepass_info.expiry_date(),
|
||||
});
|
||||
} else {
|
||||
Some(freepass_info.expiry_date())
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// SAFETY:
|
||||
// for the epoch to run over u32::MAX, we'd have to advance it for few centuries every block...
|
||||
@@ -71,5 +67,5 @@ where
|
||||
.map_err(|source| NymIdError::StorageError {
|
||||
source: Box::new(source),
|
||||
})?;
|
||||
Ok(expiry_date)
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -300,8 +300,8 @@ impl Fragment {
|
||||
#[derive(PartialEq, Clone, Debug)]
|
||||
pub(crate) struct FragmentHeader {
|
||||
/// ID associated with `FragmentSet` to which this particular `Fragment` belongs.
|
||||
/// Its value is restricted to (0, i32::MAX].
|
||||
/// Note that it *excludes* 0, but *includes* i32::MAX.
|
||||
/// Its value is restricted to (0, i32::max_value()].
|
||||
/// Note that it *excludes* 0, but *includes* i32::max_value().
|
||||
/// This allows the field to be represented using 31 bits.
|
||||
id: i32,
|
||||
|
||||
@@ -319,7 +319,7 @@ pub(crate) struct FragmentHeader {
|
||||
previous_fragments_set_id: Option<i32>,
|
||||
|
||||
/// Optional ID of next `FragmentSet` into which the original message was split.
|
||||
/// Note, this option is only valid of `current_fragment == total_fragments == u8::MAX`
|
||||
/// Note, this option is only valid of `current_fragment == total_fragments == u8::max_value()`
|
||||
next_fragments_set_id: Option<i32>,
|
||||
}
|
||||
|
||||
@@ -414,7 +414,7 @@ impl FragmentHeader {
|
||||
|
||||
if current_fragment == 1 {
|
||||
previous_fragments_set_id = Some(linked_id);
|
||||
} else if total_fragments == current_fragment && current_fragment == u8::MAX {
|
||||
} else if total_fragments == current_fragment && current_fragment == u8::max_value() {
|
||||
next_fragments_set_id = Some(linked_id);
|
||||
} else {
|
||||
return Err(ChunkingError::MalformedHeaderError);
|
||||
@@ -585,7 +585,14 @@ mod fragment_tests {
|
||||
rng.fill_bytes(&mut msg);
|
||||
|
||||
let fragment = Fragment {
|
||||
header: FragmentHeader::try_new(12345, u8::MAX, u8::MAX, None, Some(1234)).unwrap(),
|
||||
header: FragmentHeader::try_new(
|
||||
12345,
|
||||
u8::max_value(),
|
||||
u8::max_value(),
|
||||
None,
|
||||
Some(1234),
|
||||
)
|
||||
.unwrap(),
|
||||
payload: msg,
|
||||
};
|
||||
let packet_bytes = fragment.clone().into_bytes();
|
||||
@@ -595,7 +602,14 @@ mod fragment_tests {
|
||||
rng.fill_bytes(&mut msg);
|
||||
|
||||
let fragment = Fragment {
|
||||
header: FragmentHeader::try_new(12345, u8::MAX, u8::MAX, None, Some(1234)).unwrap(),
|
||||
header: FragmentHeader::try_new(
|
||||
12345,
|
||||
u8::max_value(),
|
||||
u8::max_value(),
|
||||
None,
|
||||
Some(1234),
|
||||
)
|
||||
.unwrap(),
|
||||
payload: msg,
|
||||
};
|
||||
let packet_bytes = fragment.clone().into_bytes();
|
||||
@@ -808,8 +822,8 @@ mod fragment_tests {
|
||||
assert!(Fragment::try_new(
|
||||
&full_payload,
|
||||
id,
|
||||
u8::MAX,
|
||||
u8::MAX,
|
||||
u8::max_value(),
|
||||
u8::max_value(),
|
||||
None,
|
||||
Some(link_id),
|
||||
max_plaintext_size(),
|
||||
@@ -870,8 +884,8 @@ mod fragment_tests {
|
||||
assert!(Fragment::try_new(
|
||||
&non_full_payload,
|
||||
id,
|
||||
u8::MAX,
|
||||
u8::MAX,
|
||||
u8::max_value(),
|
||||
u8::max_value(),
|
||||
None,
|
||||
Some(link_id),
|
||||
max_plaintext_size(),
|
||||
@@ -880,8 +894,8 @@ mod fragment_tests {
|
||||
assert!(Fragment::try_new(
|
||||
&non_full_payload2,
|
||||
id,
|
||||
u8::MAX,
|
||||
u8::MAX,
|
||||
u8::max_value(),
|
||||
u8::max_value(),
|
||||
None,
|
||||
Some(link_id),
|
||||
max_plaintext_size(),
|
||||
@@ -891,8 +905,8 @@ mod fragment_tests {
|
||||
assert!(Fragment::try_new(
|
||||
&too_much_payload,
|
||||
id,
|
||||
u8::MAX,
|
||||
u8::MAX,
|
||||
u8::max_value(),
|
||||
u8::max_value(),
|
||||
None,
|
||||
Some(link_id),
|
||||
max_plaintext_size(),
|
||||
@@ -994,7 +1008,14 @@ mod fragment_header {
|
||||
fn fragmented_header_cannot_be_created_with_zero_id() {
|
||||
assert!(FragmentHeader::try_new(0, 10, 5, None, None).is_err());
|
||||
assert!(FragmentHeader::try_new(12345, 10, 5, Some(0), None).is_err());
|
||||
assert!(FragmentHeader::try_new(12345, u8::MAX, u8::MAX, None, Some(0),).is_err());
|
||||
assert!(FragmentHeader::try_new(
|
||||
12345,
|
||||
u8::max_value(),
|
||||
u8::max_value(),
|
||||
None,
|
||||
Some(0),
|
||||
)
|
||||
.is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -1045,7 +1066,14 @@ mod fragment_header {
|
||||
#[test]
|
||||
fn can_only_be_post_linked_for_last_fragment() {
|
||||
assert!(FragmentHeader::try_new(12345, 10, 10, None, Some(1234)).is_ok());
|
||||
assert!(FragmentHeader::try_new(12345, u8::MAX, u8::MAX, None, Some(1234),).is_ok());
|
||||
assert!(FragmentHeader::try_new(
|
||||
12345,
|
||||
u8::max_value(),
|
||||
u8::max_value(),
|
||||
None,
|
||||
Some(1234),
|
||||
)
|
||||
.is_ok());
|
||||
assert!(FragmentHeader::try_new(12345, 10, 2, Some(1234), None).is_err());
|
||||
}
|
||||
|
||||
@@ -1089,7 +1117,8 @@ mod fragment_header {
|
||||
#[test]
|
||||
fn post_linked_can_be_converted_to_and_from_bytes_for_exact_number_of_bytes_provided() {
|
||||
let fragmented_header =
|
||||
FragmentHeader::try_new(12345, u8::MAX, u8::MAX, None, Some(1234)).unwrap();
|
||||
FragmentHeader::try_new(12345, u8::max_value(), u8::max_value(), None, Some(1234))
|
||||
.unwrap();
|
||||
|
||||
let header_bytes = fragmented_header.to_bytes();
|
||||
let (recovered_header, bytes_used) =
|
||||
@@ -1101,7 +1130,8 @@ mod fragment_header {
|
||||
#[test]
|
||||
fn post_linked_can_be_converted_to_and_from_bytes_for_more_than_required_number_of_bytes() {
|
||||
let fragmented_header =
|
||||
FragmentHeader::try_new(12345, u8::MAX, u8::MAX, None, Some(1234)).unwrap();
|
||||
FragmentHeader::try_new(12345, u8::max_value(), u8::max_value(), None, Some(1234))
|
||||
.unwrap();
|
||||
|
||||
let mut header_bytes = fragmented_header.to_bytes();
|
||||
header_bytes.append(vec![1, 2, 3, 4, 5].as_mut());
|
||||
|
||||
@@ -41,7 +41,7 @@ pub mod set;
|
||||
/// (or implicitly the only one), it has no lower bound on the number of `Fragment`s.
|
||||
/// (Apart from the restriction of containing at least a single one). If the set is located
|
||||
/// somewhere in the middle, *it must be* full. Finally, regardless of its position, it must also be
|
||||
/// true that it contains no more than `u8::MAX`, i.e. 255 `Fragment`s.
|
||||
/// true that it contains no more than `u8::max_value()`, i.e. 255 `Fragment`s.
|
||||
/// Again, the reasoning for this is further explained in `set.rs` file. However, you might
|
||||
/// also want to look at `fragment.rs` to understand the full context behind that design choice.
|
||||
///
|
||||
@@ -151,7 +151,7 @@ mod tests {
|
||||
- MAX_NODE_ADDRESS_UNPADDED_LEN;
|
||||
|
||||
let plaintext_lens = vec![17, used_plaintext_len, 20, 42, 10000];
|
||||
const SET_LEN: usize = u8::MAX as usize;
|
||||
const SET_LEN: usize = u8::max_value() as usize;
|
||||
|
||||
for plaintext_len in plaintext_lens {
|
||||
let unlinked_len = unlinked_fragment_payload_max_len(plaintext_len);
|
||||
|
||||
@@ -24,7 +24,7 @@ struct ReconstructionBuffer {
|
||||
previous_fragments_set_id: Option<i32>,
|
||||
/// Once all fragments are received, the value of `next_fragments_set_id` is copied
|
||||
/// from the last `Fragment` in the set (assuming the set is full, i.e. it contains
|
||||
/// `u8::MAX` elements).
|
||||
/// `u8::max_value()` elements).
|
||||
next_fragments_set_id: Option<i32>,
|
||||
|
||||
/// The actual `Fragment` data held by the `ReconstructionBuffer`. When created it is already
|
||||
@@ -40,7 +40,7 @@ pub type ReconstructedMessage = (Vec<u8>, Vec<i32>);
|
||||
impl ReconstructionBuffer {
|
||||
/// Initialises new instance of a `ReconstructionBuffer` with given size, i.e.
|
||||
/// number of expected `Fragment`s in the set.
|
||||
/// The `u8` input type of `size` argument ensures it has the `u8::MAX` upper bound.
|
||||
/// The `u8` input type of `size` argument ensures it has the `u8::max_value()` upper bound.
|
||||
fn new(size: u8) -> Self {
|
||||
// Note: `new` should have never been called with size 0 in the first place
|
||||
// as `size` value is based on the first recovered `Fragment` in the set.
|
||||
@@ -122,8 +122,8 @@ impl ReconstructionBuffer {
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.previous_fragments_set_id();
|
||||
self.next_fragments_set_id = if self.fragments.len() == u8::MAX as usize {
|
||||
self.fragments[u8::MAX as usize - 1]
|
||||
self.next_fragments_set_id = if self.fragments.len() == u8::max_value() as usize {
|
||||
self.fragments[u8::max_value() as usize - 1]
|
||||
.as_ref()
|
||||
.unwrap()
|
||||
.next_fragments_set_id()
|
||||
@@ -313,8 +313,8 @@ mod reconstruction_buffer {
|
||||
assert_eq!(None, frag);
|
||||
}
|
||||
|
||||
let buf = ReconstructionBuffer::new(u8::MAX);
|
||||
assert_eq!(u8::MAX as usize, buf.fragments.len());
|
||||
let buf = ReconstructionBuffer::new(u8::max_value());
|
||||
assert_eq!(u8::max_value() as usize, buf.fragments.len());
|
||||
for frag in buf.fragments {
|
||||
assert_eq!(None, frag);
|
||||
}
|
||||
@@ -358,11 +358,11 @@ mod reconstruction_buffer {
|
||||
buf.insert_fragment(Fragment::try_from_bytes(&raw_fragments[2]).unwrap());
|
||||
assert_eq!(message.to_vec(), buf.reconstruct_set_data());
|
||||
|
||||
let mut buf = ReconstructionBuffer::new(u8::MAX);
|
||||
let mut buf = ReconstructionBuffer::new(u8::max_value());
|
||||
let message = vec![
|
||||
42u8;
|
||||
unlinked_fragment_payload_max_len(AVAILABLE_PLAINTEXT_SIZE)
|
||||
* u8::MAX as usize
|
||||
* u8::max_value() as usize
|
||||
];
|
||||
let raw_fragments: Vec<_> =
|
||||
crate::split_into_sets(&mut rand::rngs::OsRng, &message, AVAILABLE_PLAINTEXT_SIZE)
|
||||
@@ -445,7 +445,7 @@ mod reconstruction_buffer {
|
||||
.map(|x| x.into_bytes())
|
||||
.collect();
|
||||
|
||||
for raw_fragment in raw_fragments.iter().take(u8::MAX as usize - 1) {
|
||||
for raw_fragment in raw_fragments.iter().take(u8::max_value() as usize - 1) {
|
||||
buf.insert_fragment(Fragment::try_from_bytes(raw_fragment).unwrap());
|
||||
}
|
||||
|
||||
@@ -563,7 +563,7 @@ mod message_reconstructor {
|
||||
.map(|x| x.into_bytes())
|
||||
.collect();
|
||||
|
||||
for raw_fragment in raw_fragments.iter().take(u8::MAX as usize) {
|
||||
for raw_fragment in raw_fragments.iter().take(u8::max_value() as usize) {
|
||||
assert!(reconstructor
|
||||
.insert_new_fragment(
|
||||
reconstructor
|
||||
@@ -611,7 +611,7 @@ mod message_reconstructor {
|
||||
.collect();
|
||||
|
||||
// note that first set is not fully inserted
|
||||
for raw_fragment in raw_fragments.iter().take(u8::MAX as usize - 1) {
|
||||
for raw_fragment in raw_fragments.iter().take(u8::max_value() as usize - 1) {
|
||||
assert!(reconstructor
|
||||
.insert_new_fragment(
|
||||
reconstructor
|
||||
@@ -657,7 +657,7 @@ mod message_reconstructor {
|
||||
.map(|x| x.into_bytes())
|
||||
.collect();
|
||||
|
||||
for raw_fragment in raw_fragments.iter().take(u8::MAX as usize) {
|
||||
for raw_fragment in raw_fragments.iter().take(u8::max_value() as usize) {
|
||||
assert!(reconstructor
|
||||
.insert_new_fragment(
|
||||
reconstructor
|
||||
@@ -699,7 +699,7 @@ mod message_reconstructor {
|
||||
.map(|x| x.into_bytes())
|
||||
.collect();
|
||||
|
||||
for raw_fragment in raw_fragments.iter().take(u8::MAX as usize) {
|
||||
for raw_fragment in raw_fragments.iter().take(u8::max_value() as usize) {
|
||||
assert!(reconstructor
|
||||
.insert_new_fragment(
|
||||
reconstructor
|
||||
@@ -738,7 +738,7 @@ mod message_reconstructor {
|
||||
.collect();
|
||||
|
||||
// note that first set is not fully inserted
|
||||
for raw_fragment in raw_fragments.iter().take(u8::MAX as usize - 1) {
|
||||
for raw_fragment in raw_fragments.iter().take(u8::max_value() as usize - 1) {
|
||||
assert!(reconstructor
|
||||
.insert_new_fragment(
|
||||
reconstructor
|
||||
@@ -779,7 +779,7 @@ mod message_reconstructor {
|
||||
.map(|x| x.into_bytes())
|
||||
.collect();
|
||||
|
||||
for raw_fragment in raw_fragments.iter().take(u8::MAX as usize * 2) {
|
||||
for raw_fragment in raw_fragments.iter().take(u8::max_value() as usize * 2) {
|
||||
assert!(reconstructor
|
||||
.insert_new_fragment(
|
||||
reconstructor
|
||||
@@ -793,7 +793,7 @@ mod message_reconstructor {
|
||||
assert!(reconstructor
|
||||
.insert_new_fragment(
|
||||
reconstructor
|
||||
.recover_fragment(raw_fragments[(u8::MAX as usize) * 2].clone())
|
||||
.recover_fragment(raw_fragments[(u8::max_value() as usize) * 2].clone())
|
||||
.unwrap()
|
||||
)
|
||||
.is_none());
|
||||
@@ -822,7 +822,11 @@ mod message_reconstructor {
|
||||
.collect();
|
||||
|
||||
// note that first set is not fully inserted
|
||||
for raw_fragment in raw_fragments.iter().skip(1).take(u8::MAX as usize * 2 - 1) {
|
||||
for raw_fragment in raw_fragments
|
||||
.iter()
|
||||
.skip(1)
|
||||
.take(u8::max_value() as usize * 2 - 1)
|
||||
{
|
||||
assert!(reconstructor
|
||||
.insert_new_fragment(
|
||||
reconstructor
|
||||
@@ -835,7 +839,7 @@ mod message_reconstructor {
|
||||
assert!(reconstructor
|
||||
.insert_new_fragment(
|
||||
reconstructor
|
||||
.recover_fragment(raw_fragments[(u8::MAX as usize) * 2].clone())
|
||||
.recover_fragment(raw_fragments[(u8::max_value() as usize) * 2].clone())
|
||||
.unwrap()
|
||||
)
|
||||
.is_none());
|
||||
@@ -892,7 +896,7 @@ mod message_reconstructor {
|
||||
.collect();
|
||||
|
||||
// note that first set is not fully inserted
|
||||
for raw_fragment in raw_fragments1.iter().take(u8::MAX as usize - 1) {
|
||||
for raw_fragment in raw_fragments1.iter().take(u8::max_value() as usize - 1) {
|
||||
assert!(reconstructor
|
||||
.insert_new_fragment(
|
||||
reconstructor
|
||||
@@ -926,7 +930,7 @@ mod message_reconstructor {
|
||||
.map(|x| x.into_bytes())
|
||||
.collect();
|
||||
|
||||
for raw_fragment in raw_fragments2.iter().take(u8::MAX as usize) {
|
||||
for raw_fragment in raw_fragments2.iter().take(u8::max_value() as usize) {
|
||||
assert!(reconstructor
|
||||
.insert_new_fragment(
|
||||
reconstructor
|
||||
@@ -966,7 +970,7 @@ mod message_reconstructor {
|
||||
.map(|x| x.into_bytes())
|
||||
.collect();
|
||||
|
||||
for raw_fragment in raw_fragments.iter().take(u8::MAX as usize) {
|
||||
for raw_fragment in raw_fragments.iter().take(u8::max_value() as usize) {
|
||||
assert!(reconstructor
|
||||
.insert_new_fragment(
|
||||
reconstructor
|
||||
@@ -1248,7 +1252,7 @@ mod message_reconstructor {
|
||||
//
|
||||
// we're inserting this via the buffer approach as not to trigger immediate re-assembly
|
||||
let mut reconstructor = MessageReconstructor::default();
|
||||
let mut set_buf1 = ReconstructionBuffer::new(u8::MAX);
|
||||
let mut set_buf1 = ReconstructionBuffer::new(u8::max_value());
|
||||
let mut set_buf2 = ReconstructionBuffer::new(1);
|
||||
|
||||
let mut rng = thread_rng();
|
||||
@@ -1263,7 +1267,7 @@ mod message_reconstructor {
|
||||
.map(|x| x.into_bytes())
|
||||
.collect();
|
||||
|
||||
for raw_fragment in raw_fragments.iter().take(u8::MAX as usize) {
|
||||
for raw_fragment in raw_fragments.iter().take(u8::max_value() as usize) {
|
||||
set_buf1.insert_fragment(Fragment::try_from_bytes(raw_fragment).unwrap());
|
||||
}
|
||||
|
||||
@@ -1626,19 +1630,19 @@ mod message_reconstruction {
|
||||
.into_iter()
|
||||
.flat_map(|fragment_set| fragment_set.into_iter())
|
||||
.collect();
|
||||
assert_eq!(fragments1.len(), u8::MAX as usize);
|
||||
assert_eq!(fragments1.len(), u8::max_value() as usize);
|
||||
let mut fragments2: Vec<_> =
|
||||
crate::split_into_sets(&mut rand::rngs::OsRng, &message2, AVAILABLE_PLAINTEXT_SIZE)
|
||||
.into_iter()
|
||||
.flat_map(|fragment_set| fragment_set.into_iter())
|
||||
.collect();
|
||||
assert_eq!(fragments2.len(), u8::MAX as usize);
|
||||
assert_eq!(fragments2.len(), u8::max_value() as usize);
|
||||
|
||||
// combine and shuffle fragments
|
||||
fragments1.append(fragments2.as_mut());
|
||||
fragments1.shuffle(&mut rng);
|
||||
let fragments = fragments1;
|
||||
assert_eq!(fragments.len(), (u8::MAX as usize) * 2);
|
||||
assert_eq!(fragments.len(), (u8::max_value() as usize) * 2);
|
||||
|
||||
let mut message_reconstructor = MessageReconstructor::default();
|
||||
for fragment in fragments.into_iter() {
|
||||
@@ -1758,7 +1762,7 @@ mod message_reconstruction {
|
||||
.flat_map(|fragment_set| fragment_set.into_iter())
|
||||
.map(|x| x.into_bytes())
|
||||
.collect();
|
||||
assert_eq!(fragments.len(), 4 * (u8::MAX as usize));
|
||||
assert_eq!(fragments.len(), 4 * (u8::max_value() as usize));
|
||||
// shuffle the fragments
|
||||
fragments.shuffle(&mut rng);
|
||||
|
||||
@@ -1807,19 +1811,19 @@ mod message_reconstruction {
|
||||
.into_iter()
|
||||
.flat_map(|fragment_set| fragment_set.into_iter())
|
||||
.collect();
|
||||
assert_eq!(fragments1.len(), 4 * (u8::MAX as usize));
|
||||
assert_eq!(fragments1.len(), 4 * (u8::max_value() as usize));
|
||||
let mut fragments2: Vec<_> =
|
||||
crate::split_into_sets(&mut rand::rngs::OsRng, &message2, AVAILABLE_PLAINTEXT_SIZE)
|
||||
.into_iter()
|
||||
.flat_map(|fragment_set| fragment_set.into_iter())
|
||||
.collect();
|
||||
assert_eq!(fragments2.len(), 4 * (u8::MAX as usize));
|
||||
assert_eq!(fragments2.len(), 4 * (u8::max_value() as usize));
|
||||
|
||||
// combine and shuffle fragments
|
||||
fragments1.append(fragments2.as_mut());
|
||||
fragments1.shuffle(&mut rng);
|
||||
let fragments = fragments1;
|
||||
assert_eq!(fragments.len(), (u8::MAX as usize) * 8);
|
||||
assert_eq!(fragments.len(), (u8::max_value() as usize) * 8);
|
||||
|
||||
let mut message_reconstructor = MessageReconstructor::default();
|
||||
for fragment in fragments.into_iter() {
|
||||
|
||||
@@ -11,7 +11,7 @@ use rand::Rng;
|
||||
/// on its payload length of the maximum number of `Fragment`s multiplied by their maximum,
|
||||
/// fragmented, length.
|
||||
pub const fn max_unlinked_set_payload_length(max_plaintext_size: usize) -> usize {
|
||||
u8::MAX as usize * unlinked_fragment_payload_max_len(max_plaintext_size)
|
||||
u8::max_value() as usize * unlinked_fragment_payload_max_len(max_plaintext_size)
|
||||
}
|
||||
|
||||
/// If the set is being linked to another one, by either being the very first set, or the very last,
|
||||
@@ -52,8 +52,8 @@ pub const fn two_way_linked_set_payload_length(max_plaintext_size: usize) -> usi
|
||||
pub(crate) type FragmentSet = Vec<Fragment>;
|
||||
|
||||
/// Generate a pseudo-random id for a `FragmentSet`.
|
||||
/// Its value is restricted to (0, i32::MAX].
|
||||
/// Note that it *excludes* 0, but *includes* i32::MAX.
|
||||
/// Its value is restricted to (0, i32::max_value()].
|
||||
/// Note that it *excludes* 0, but *includes* i32::max_value().
|
||||
/// This particular range allows for the id to be represented using 31bits, rather than
|
||||
/// the full length of 32 while still providing more than enough variability to
|
||||
/// distinguish different `FragmentSet`s.
|
||||
@@ -89,13 +89,13 @@ fn prepare_unlinked_fragmented_set(
|
||||
/ unlinked_fragment_payload_max_len(max_plaintext_size) as f64)
|
||||
.ceil() as usize;
|
||||
|
||||
debug_assert!(pre_casted_frags <= u8::MAX as usize);
|
||||
debug_assert!(pre_casted_frags <= u8::max_value() as usize);
|
||||
let num_fragments = pre_casted_frags as u8;
|
||||
|
||||
let mut fragments = Vec::with_capacity(num_fragments as usize);
|
||||
|
||||
for i in 1..(pre_casted_frags + 1) {
|
||||
// we can't use u8 directly here as upper (NON-INCLUSIVE, so it would always fit) bound could be u8::MAX + 1
|
||||
// we can't use u8 directly here as upper (NON-INCLUSIVE, so it would always fit) bound could be u8::max_value() + 1
|
||||
let lb = (i - 1) * unlinked_fragment_payload_max_len(max_plaintext_size);
|
||||
let ub = usize::min(
|
||||
message.len(),
|
||||
@@ -131,7 +131,7 @@ fn prepare_linked_fragment_set(
|
||||
) -> FragmentSet {
|
||||
// determine number of fragments in the set:
|
||||
let num_frags_usize = if next_link_id.is_some() {
|
||||
u8::MAX as usize
|
||||
u8::max_value() as usize
|
||||
} else {
|
||||
// we know this set is linked, if it's not post-linked then it MUST BE pre-linked
|
||||
let tail_len = if message.len() >= linked_fragment_payload_max_len(max_plaintext_size) {
|
||||
@@ -142,7 +142,7 @@ fn prepare_linked_fragment_set(
|
||||
let pre_casted_frags = 1
|
||||
+ (tail_len as f64 / unlinked_fragment_payload_max_len(max_plaintext_size) as f64)
|
||||
.ceil() as usize;
|
||||
if pre_casted_frags > u8::MAX as usize {
|
||||
if pre_casted_frags > u8::max_value() as usize {
|
||||
panic!("message would produce too many fragments!")
|
||||
};
|
||||
pre_casted_frags
|
||||
@@ -162,7 +162,7 @@ fn prepare_linked_fragment_set(
|
||||
|
||||
let mut fragments = Vec::with_capacity(num_frags_usize);
|
||||
for i in 1..(num_frags_usize + 1) {
|
||||
// we can't use u8 directly here as upper (NON-INCLUSIVE, so i would always fit) bound could be u8::MAX + 1
|
||||
// we can't use u8 directly here as upper (NON-INCLUSIVE, so i would always fit) bound could be u8::max_value() + 1
|
||||
let fragment = Fragment::try_new(
|
||||
&message[lb..ub],
|
||||
id,
|
||||
@@ -343,7 +343,7 @@ mod tests {
|
||||
fn verify_post_linked_set_payload(mut set: FragmentSet, payload: &[u8]) {
|
||||
for i in (0..set.len()).rev() {
|
||||
let lb = i * unlinked_fragment_payload_max_len(max_plaintext_size());
|
||||
let ub = if i == (u8::MAX as usize - 1) {
|
||||
let ub = if i == (u8::max_value() as usize - 1) {
|
||||
i * unlinked_fragment_payload_max_len(max_plaintext_size())
|
||||
+ linked_fragment_payload_max_len(max_plaintext_size())
|
||||
} else {
|
||||
@@ -365,7 +365,7 @@ mod tests {
|
||||
(i - 1) * unlinked_fragment_payload_max_len(max_plaintext_size())
|
||||
+ linked_fragment_payload_max_len(max_plaintext_size())
|
||||
};
|
||||
let ub = if i == (u8::MAX as usize - 1) {
|
||||
let ub = if i == (u8::max_value() as usize - 1) {
|
||||
(i - 1) * unlinked_fragment_payload_max_len(max_plaintext_size())
|
||||
+ 2 * linked_fragment_payload_max_len(max_plaintext_size())
|
||||
} else {
|
||||
@@ -434,7 +434,7 @@ mod tests {
|
||||
id,
|
||||
max_plaintext_size(),
|
||||
);
|
||||
assert_eq!(u8::MAX as usize, max_fragment_set.len());
|
||||
assert_eq!(u8::max_value() as usize, max_fragment_set.len());
|
||||
verify_unlinked_set_payload(max_fragment_set, &max_fragments_set_payload);
|
||||
|
||||
let mut full_set_payload =
|
||||
@@ -442,7 +442,7 @@ mod tests {
|
||||
rng.fill_bytes(&mut full_set_payload);
|
||||
let full_fragment_set =
|
||||
prepare_unlinked_fragmented_set(&full_set_payload, id, max_plaintext_size());
|
||||
assert_eq!(u8::MAX as usize, full_fragment_set.len());
|
||||
assert_eq!(u8::max_value() as usize, full_fragment_set.len());
|
||||
verify_unlinked_set_payload(full_fragment_set, &full_set_payload);
|
||||
}
|
||||
|
||||
@@ -515,7 +515,7 @@ mod tests {
|
||||
None,
|
||||
max_plaintext_size(),
|
||||
);
|
||||
assert_eq!(u8::MAX as usize, max_fragment_set.len());
|
||||
assert_eq!(u8::max_value() as usize, max_fragment_set.len());
|
||||
verify_pre_linked_set_payload(max_fragment_set, &max_fragments_set_payload);
|
||||
|
||||
let mut full_set_payload =
|
||||
@@ -528,7 +528,7 @@ mod tests {
|
||||
None,
|
||||
max_plaintext_size(),
|
||||
);
|
||||
assert_eq!(u8::MAX as usize, full_fragment_set.len());
|
||||
assert_eq!(u8::max_value() as usize, full_fragment_set.len());
|
||||
verify_pre_linked_set_payload(full_fragment_set, &full_set_payload);
|
||||
}
|
||||
|
||||
@@ -561,7 +561,7 @@ mod tests {
|
||||
Some(link_id),
|
||||
max_plaintext_size(),
|
||||
);
|
||||
assert_eq!(u8::MAX as usize, full_fragment_set.len());
|
||||
assert_eq!(u8::max_value() as usize, full_fragment_set.len());
|
||||
verify_post_linked_set_payload(full_fragment_set, &full_set_payload);
|
||||
}
|
||||
|
||||
@@ -608,7 +608,7 @@ mod tests {
|
||||
Some(post_link_id),
|
||||
max_plaintext_size(),
|
||||
);
|
||||
assert_eq!(u8::MAX as usize, full_fragment_set.len());
|
||||
assert_eq!(u8::max_value() as usize, full_fragment_set.len());
|
||||
verify_two_way_linked_set_payload(full_fragment_set, &full_set_payload);
|
||||
}
|
||||
|
||||
@@ -700,8 +700,8 @@ mod tests {
|
||||
|
||||
let mut sets = split_into_sets(&mut rng, &message, max_plaintext_size());
|
||||
assert_eq!(2, sets.len());
|
||||
assert_eq!(sets[0].len(), u8::MAX as usize);
|
||||
assert_eq!(sets[1].len(), u8::MAX as usize);
|
||||
assert_eq!(sets[0].len(), u8::max_value() as usize);
|
||||
assert_eq!(sets[1].len(), u8::max_value() as usize);
|
||||
verify_correct_link(&sets[0], &sets[1]);
|
||||
verify_pre_linked_set_payload(
|
||||
sets.pop().unwrap(),
|
||||
@@ -726,9 +726,9 @@ mod tests {
|
||||
rng.fill_bytes(&mut message);
|
||||
let mut sets = split_into_sets(&mut rng, &message, max_plaintext_size());
|
||||
assert_eq!(4, sets.len());
|
||||
assert_eq!(sets[0].len(), u8::MAX as usize);
|
||||
assert_eq!(sets[1].len(), u8::MAX as usize);
|
||||
assert_eq!(sets[2].len(), u8::MAX as usize);
|
||||
assert_eq!(sets[0].len(), u8::max_value() as usize);
|
||||
assert_eq!(sets[1].len(), u8::max_value() as usize);
|
||||
assert_eq!(sets[2].len(), u8::max_value() as usize);
|
||||
|
||||
verify_correct_link(&sets[0], &sets[1]);
|
||||
verify_correct_link(&sets[1], &sets[2]);
|
||||
@@ -766,10 +766,10 @@ mod tests {
|
||||
|
||||
let mut sets = split_into_sets(&mut rng, &message, max_plaintext_size());
|
||||
assert_eq!(4, sets.len());
|
||||
assert_eq!(sets[0].len(), u8::MAX as usize);
|
||||
assert_eq!(sets[1].len(), u8::MAX as usize);
|
||||
assert_eq!(sets[2].len(), u8::MAX as usize);
|
||||
assert_eq!(sets[3].len(), u8::MAX as usize);
|
||||
assert_eq!(sets[0].len(), u8::max_value() as usize);
|
||||
assert_eq!(sets[1].len(), u8::max_value() as usize);
|
||||
assert_eq!(sets[2].len(), u8::max_value() as usize);
|
||||
assert_eq!(sets[3].len(), u8::max_value() as usize);
|
||||
|
||||
verify_correct_link(&sets[0], &sets[1]);
|
||||
verify_correct_link(&sets[1], &sets[2]);
|
||||
|
||||
@@ -122,7 +122,7 @@ pub async fn setup_gateway_from_api(
|
||||
nym_apis: &[Url],
|
||||
) -> Result<InitialisationResult, WasmCoreError> {
|
||||
let mut rng = thread_rng();
|
||||
let gateways = current_gateways(&mut rng, nym_apis, None).await?;
|
||||
let gateways = current_gateways(&mut rng, nym_apis).await?;
|
||||
setup_gateway_wasm(client_store, force_tls, chosen_gateway, &gateways).await
|
||||
}
|
||||
|
||||
|
||||
Generated
+188
-51
@@ -81,6 +81,12 @@ version = "1.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b"
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "1.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
||||
|
||||
[[package]]
|
||||
name = "blake2"
|
||||
version = "0.8.1"
|
||||
@@ -151,35 +157,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9"
|
||||
|
||||
[[package]]
|
||||
name = "camino"
|
||||
version = "1.1.7"
|
||||
name = "cc"
|
||||
version = "1.0.94"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239"
|
||||
checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cargo-platform"
|
||||
version = "0.1.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cargo_metadata"
|
||||
version = "0.18.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037"
|
||||
dependencies = [
|
||||
"camino",
|
||||
"cargo-platform",
|
||||
"semver",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thiserror",
|
||||
"jobserver",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -574,7 +558,6 @@ dependencies = [
|
||||
"cw3-fixed-multisig",
|
||||
"cw4",
|
||||
"cw4-group",
|
||||
"nym-contracts-common",
|
||||
"nym-group-contract-common",
|
||||
"nym-multisig-contract-common",
|
||||
]
|
||||
@@ -603,7 +586,6 @@ dependencies = [
|
||||
"cw-utils",
|
||||
"cw2",
|
||||
"cw4",
|
||||
"nym-contracts-common",
|
||||
"nym-group-contract-common",
|
||||
"schemars",
|
||||
"serde",
|
||||
@@ -797,6 +779,26 @@ dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "enum-iterator"
|
||||
version = "1.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "45a0ac4aeb3a18f92eaf09c6bb9b3ac30ff61ca95514fc58cbead1c9a6bf5401"
|
||||
dependencies = [
|
||||
"enum-iterator-derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "enum-iterator-derive"
|
||||
version = "1.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "03cdc46ec28bd728e67540c528013c6a10eb69a02eb31078a1bda695438cbfb8"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.59",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ff"
|
||||
version = "0.12.1"
|
||||
@@ -823,6 +825,15 @@ version = "0.2.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c007b1ae3abe1cb6f85a16305acd418b7ca6343b953633fee2b76d8f108b830f"
|
||||
|
||||
[[package]]
|
||||
name = "form_urlencoded"
|
||||
version = "1.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456"
|
||||
dependencies = [
|
||||
"percent-encoding",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "forward_ref"
|
||||
version = "1.0.0"
|
||||
@@ -860,6 +871,31 @@ dependencies = [
|
||||
"wasi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "getset"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9"
|
||||
dependencies = [
|
||||
"proc-macro-error",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "git2"
|
||||
version = "0.14.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d0155506aab710a86160ddb504a480d2964d7ab5b9e62419be69e0032bc5931c"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"libc",
|
||||
"libgit2-sys",
|
||||
"log",
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "group"
|
||||
version = "0.12.1"
|
||||
@@ -931,6 +967,16 @@ dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "idna"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6"
|
||||
dependencies = [
|
||||
"unicode-bidi",
|
||||
"unicode-normalization",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "inout"
|
||||
version = "0.1.3"
|
||||
@@ -955,6 +1001,15 @@ version = "1.0.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
|
||||
|
||||
[[package]]
|
||||
name = "jobserver"
|
||||
version = "0.1.30"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "685a7d121ee3f65ae4fddd72b25a04bb36b6af81bc0828f7d5434c0fe60fa3a2"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "k256"
|
||||
version = "0.11.6"
|
||||
@@ -993,12 +1048,36 @@ version = "0.2.153"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
|
||||
|
||||
[[package]]
|
||||
name = "libgit2-sys"
|
||||
version = "0.13.5+1.4.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "51e5ea06c26926f1002dd553fded6cfcdc9784c1f60feeb58368b4d9b07b6dba"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
"libz-sys",
|
||||
"pkg-config",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libm"
|
||||
version = "0.2.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058"
|
||||
|
||||
[[package]]
|
||||
name = "libz-sys"
|
||||
version = "1.1.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5e143b5e666b2695d28f6bca6497720813f699c9602dd7f5cac91008b8ada7f9"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
"pkg-config",
|
||||
"vcpkg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lioness"
|
||||
version = "0.1.2"
|
||||
@@ -1055,15 +1134,6 @@ dependencies = [
|
||||
"libm",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num_threads"
|
||||
version = "0.1.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nym-coconut-bandwidth"
|
||||
version = "0.1.0"
|
||||
@@ -1103,8 +1173,8 @@ dependencies = [
|
||||
"cw4",
|
||||
"cw4-group",
|
||||
"nym-coconut-dkg-common",
|
||||
"nym-contracts-common",
|
||||
"nym-group-contract-common",
|
||||
"semver",
|
||||
"serde",
|
||||
"thiserror",
|
||||
]
|
||||
@@ -1129,11 +1199,9 @@ dependencies = [
|
||||
"bs58 0.5.1",
|
||||
"cosmwasm-schema",
|
||||
"cosmwasm-std",
|
||||
"cw-storage-plus",
|
||||
"schemars",
|
||||
"serde",
|
||||
"thiserror",
|
||||
"vergen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1178,9 +1246,11 @@ dependencies = [
|
||||
"nym-mixnet-contract-common",
|
||||
"nym-vesting-contract-common",
|
||||
"rand_chacha",
|
||||
"semver",
|
||||
"serde",
|
||||
"thiserror",
|
||||
"time",
|
||||
"vergen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1248,9 +1318,11 @@ dependencies = [
|
||||
"nym-mixnet-contract-common",
|
||||
"nym-vesting-contract-common",
|
||||
"rand_chacha",
|
||||
"semver",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thiserror",
|
||||
"vergen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1295,6 +1367,12 @@ dependencies = [
|
||||
"regex",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "percent-encoding"
|
||||
version = "2.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
|
||||
|
||||
[[package]]
|
||||
name = "pkcs8"
|
||||
version = "0.9.0"
|
||||
@@ -1315,6 +1393,12 @@ dependencies = [
|
||||
"spki 0.7.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pkg-config"
|
||||
version = "0.3.30"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec"
|
||||
|
||||
[[package]]
|
||||
name = "platforms"
|
||||
version = "3.4.0"
|
||||
@@ -1333,6 +1417,30 @@ version = "0.2.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-error"
|
||||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
|
||||
dependencies = [
|
||||
"proc-macro-error-attr",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-error-attr"
|
||||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.81"
|
||||
@@ -1548,9 +1656,6 @@ name = "semver"
|
||||
version = "1.0.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
@@ -1774,9 +1879,7 @@ checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
|
||||
dependencies = [
|
||||
"deranged",
|
||||
"itoa",
|
||||
"libc",
|
||||
"num-conv",
|
||||
"num_threads",
|
||||
"powerfmt",
|
||||
"serde",
|
||||
"time-core",
|
||||
@@ -1820,6 +1923,12 @@ version = "1.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-bidi"
|
||||
version = "0.3.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
version = "1.0.12"
|
||||
@@ -1827,17 +1936,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
||||
|
||||
[[package]]
|
||||
name = "vergen"
|
||||
version = "8.3.1"
|
||||
name = "unicode-normalization"
|
||||
version = "0.1.23"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e27d6bdd219887a9eadd19e1c34f32e47fa332301184935c6d9bca26f3cca525"
|
||||
checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5"
|
||||
dependencies = [
|
||||
"tinyvec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "url"
|
||||
version = "2.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633"
|
||||
dependencies = [
|
||||
"form_urlencoded",
|
||||
"idna",
|
||||
"percent-encoding",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "vcpkg"
|
||||
version = "0.2.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
|
||||
|
||||
[[package]]
|
||||
name = "vergen"
|
||||
version = "7.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "447f9238a4553957277b3ee09d80babeae0811f1b3baefb093de1c0448437a37"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"cargo_metadata",
|
||||
"cfg-if",
|
||||
"regex",
|
||||
"enum-iterator",
|
||||
"getset",
|
||||
"git2",
|
||||
"rustc_version",
|
||||
"rustversion",
|
||||
"thiserror",
|
||||
"time",
|
||||
]
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
- [Performance Monitoring & Testing](testing/performance.md)
|
||||
<!--- [Node Setup](testing/node-setup.md)-->
|
||||
- [Gateway Probe](testing/gateway-probe.md)
|
||||
- [Node API Check](testing/node-api-check.md)
|
||||
- [Prometheus & Grafana](testing/prometheus-grafana.md)
|
||||
- [ExploreNYM scripts](testing/explorenym-scripts.md)
|
||||
<!-- - [Run in a Docker](testing/docker-monitor.md) -->
|
||||
|
||||
@@ -143,7 +143,7 @@ As part of the transition, `allowed.list` on Exit Gateway embedded Network Reque
|
||||
./nym-node run --init-only --mode exit-gateway
|
||||
|
||||
# with a custom `--id` and other options
|
||||
./nym-node run --id <ID> --init-only --mode exit-gateway --public-ips "$(curl -4 https://ifconfig.me)" --hostname "<YOUR_DOMAIN>" --http-bind-address 0.0.0.0:8080 --mixnet-bind-address 0.0.0.0:1789 --location <COUNTRY_FULL_NAME> --wireguard-enabled false
|
||||
./nym-node run --id <ID> --init-only --mode exit-gateway --public-ips "$(curl -4 https://ifconfig.me)" --hostname "<YOUR_DOMAIN>" --http-bind-address 0.0.0.0:8080 --mixnet-bind-address 0.0.0.0:1789 true --location <COUNTRY_FULL_NAME> --wireguard-enabled false
|
||||
|
||||
# <YOUR_DOMAIN> is in format without 'https://' prefix
|
||||
# <COUNTRY_FULL_NAME> is format like 'Jamaica', or two-letter alpha2 (e.g. 'JM'), three-letter alpha3 (e.g. 'JAM') or three-digit numeric-3 (e.g. '388') can be provided.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Release Cycle
|
||||
|
||||
The Nym operator community is growing in quality and quantity. With node operators and developers joining the effort to make the Mixnet more robust and scalable, testing new features, sharing integration pull requests and generally taking an active part in Nym development, more transparency on the release cycle is required.
|
||||
Nym operators community grows in quality and quantity. With node operators and developers joining the efforts to build Mixnet more robust and scalable, testing new features, sharing integration pull requests and generally taking an active part in Nym development, more transparency on the release cycle is required.
|
||||
|
||||
The core team therefore established a flow with different environments:
|
||||
|
||||
@@ -11,7 +11,7 @@ The core team therefore established a flow with different environments:
|
||||
|
||||
## Release Flow
|
||||
|
||||
Frequency of releases to mainnet is aimed to be every ~14 days. This time window is an optimal compromise between periodicity and quality assurance/testing, key factors playing an essential role in development.
|
||||
Frequency of releases to mainnet is aimed to be every ~14 days. This time time window is an optimal compromise between periodicity and qualty assurance/testing, key factors playing an essential role in the development.
|
||||
|
||||
| **Stage** | **Environment** | **Branch** | **Ownership** |
|
||||
| :-- | :-- | :-- | :-- |
|
||||
@@ -80,7 +80,7 @@ ENVs
|
||||
To track changes easily, builders and operators can visit one of the following:
|
||||
|
||||
- [*CHANGELOG.md*](https://github.com/nymtech/nym/blob/master/CHANGELOG.md): Raw changelog of the merged feauters in Nym's monorepo, managed by devs and QA.
|
||||
- [*Changelog page*](changelog.md): A copy of *CHANGELOG.md* with more detailed explanation, testing steps and updated summary of documentation changes, managed by devrels.
|
||||
- [*Changelog page*](changelog.md): A copy of *CHANGELOG.md* with more detailed explanation, testing steps and update on documentation changes, managed by devrels.
|
||||
|
||||
In case you want to propose changes or resolve some of the existing [issues](https://github.com/nymtech/nym/issues), start [here](https://github.com/nymtech/nym/issues/new/choose). If you want to add content to the Operators Guide, visit [this page](legal/add-content.md).
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
# Sandbox Testnet
|
||||
|
||||
Nym node operators can run their nodes in Nym Sandbox testnet environment. Whether it's testing new configuration, hot features from Nym developers or just trying to setup a node for the first time, this environment is for you.
|
||||
|
||||
Below are steps to [setup your environment](#sandbox-environment-setup) and an introduction to [Sandbox token faucet](#sandbox-token-faucet).
|
||||
Nym node operators can run their nodes on Nym Sandbox testnet environment. Whether it's testing new configuration, hot features from Nym developers or just trying to setup a node for the first time, this environment is for you. Below are steps to [setup your environment](#sandbox-environment-setup) and an introduction to [Sandbox token faucet](#sandbox-token-faucet).
|
||||
|
||||
```admonish warning title=""
|
||||
This page is for Nym node operators. If you want to run NymVPN CLI over Sandbox testnet, visit our [developers portal](https://nymtech.net/developers/nymvpn/cli.html#testnet-environment).
|
||||
@@ -12,24 +10,21 @@ This page is for Nym node operators. If you want to run NymVPN CLI over Sandbox
|
||||
|
||||
> Any syntax in `<>` brackets is a user's unique variable. Exchange with a corresponding name without the `<>` brackets.
|
||||
|
||||
To run Nym binaries in Sandbox testnet, you need to get `sandbox.env` configuration file and point your binary to it. Follow the steps below:
|
||||
To run Nym binaries in Sandbox Testnet you need to get the `.env` configuration file and point your binary to it. Follow the steps below:
|
||||
|
||||
|
||||
1. Create Sandbox environment config file by saving [this](https://raw.githubusercontent.com/nymtech/nym/develop/envs/sandbox.env) as `sandbox.env` in the same directory as your binaries:
|
||||
```sh
|
||||
curl -o sandbox.env -L https://raw.githubusercontent.com/nymtech/nym/develop/envs/sandbox.env
|
||||
|
||||
# In case you want to save the file elswhere, change the path in '-o' flag
|
||||
```
|
||||
|
||||
2. Run your `nym-node` with an additional flag `-c` or `--config-env-file` with a path to `sandbox.env` file followed by all needed commands and options. For example:
|
||||
2. Run your `nym-node` with an additional flag `-c` or `--config-env-file` with a path to `sanbox.env` file followed by all needed commands and options. For example:
|
||||
```sh
|
||||
# this example is for nym-node in mixnode mode
|
||||
# this example is for mixnode mode
|
||||
./nym-node --config-env-file <PATH/TO/>sandbox.env run --mode mixnode
|
||||
|
||||
# this example is for nym-node in exit-gateway mode
|
||||
# this example is for exit-gateway mode
|
||||
./nym-node --config-file-env <PATH/TO/>sandbox.env run --mode exit-gateway --id <ID> --public-ips "$(curl -4 https://ifconfig.me)" --hostname "<YOUR_DOMAIN>" --http-bind-address 0.0.0.0:8080 --mixnet-bind-address 0.0.0.0:1789 true --location <COUNTRY_FULL_NAME>
|
||||
|
||||
# In case you downloaded sandbox.env to the same directory, <PATH> is not needed
|
||||
```
|
||||
|
||||
3. Bond your node to Nym Sandbox environment:
|
||||
@@ -40,7 +35,7 @@ curl -o sandbox.env -L https://raw.githubusercontent.com/nymtech/nym/develop/env
|
||||

|
||||
|
||||
~~~admonish tip
|
||||
1. If you [built Nym from source](building-nym.md), you already have `sanbox.env` as a part of the monorepo (`nym/envs/sandbox.env`). Giving that you are likely to run `nym-node` from `nym/target/release`, the flag will look like this `--config-env-file ../../envs/sandbox.env`
|
||||
1. If you [built Nym from source](building-nym.md), you already have `sanbox.env` as a part of the monorepo (`nym/envs/sandbox.env`). Giving that you likely to run `nym-node` from `nym/target/release`, the flag will look like this `--config-env-file ../../envs/sandbox.env`
|
||||
|
||||
2. You can export the path to `sanbox.env` to your enviromental variables:
|
||||
```sh
|
||||
@@ -50,6 +45,6 @@ export NYMNODE_CONFIG_ENV_FILE_ARG=<PATH/TO/sandbox.env>
|
||||
|
||||
## Sandbox Token Faucet
|
||||
|
||||
To run your nodes in Sandbox environment, you need testnet version of NYM token, that can be aquired from [faucet.nymtech.net](https://faucet.nymtech.net).
|
||||
To run your nodes in the sandbox environment, you need testnet version of NYM token, that can be aquired at [faucet.nymtech.net](https://faucet.nymtech.net).
|
||||
|
||||
To prevent abuse, the faucet is rate-limited - your request will fail if the requesting wallet already has 101 NYM tokens.
|
||||
|
||||
@@ -1,118 +0,0 @@
|
||||
# Node API Check
|
||||
|
||||
> Any syntax in `<>` brackets is a user's unique variable/version. Exchange with a corresponding name without the `<>` brackets.
|
||||
|
||||
Operating a `nym-node` is not a *"set and forget"* endeavor, it takes some work. To diagnose node performance querying APIs is a good knowledge to have. There are two main places to look for API endpoints regarding `nym-node`:
|
||||
|
||||
- [`openapi.json`](https://validator.nymtech.net/api/v1/openapi.json): a list of all endpoints
|
||||
- [Swagger UI page](https://validator.nymtech.net/api/swagger/index.html)
|
||||
|
||||
Besides that, Gateway operators can check out their node performance, connectivity and much more on [harbourmaster.nymtech.net](https://harbourmaster.nymtech.net/).
|
||||
|
||||
### Basic API usage
|
||||
|
||||
For information about available endpoints and their status, you can refer to:
|
||||
```
|
||||
# for http
|
||||
http://<IP>:8080/api/v1/swagger/#/
|
||||
|
||||
# for https reversed proxy
|
||||
https://<DOMAIN>/api/v1/swagger/#/
|
||||
```
|
||||
|
||||
For example to determine which mode your node is running, you can check `:8080/api/v1/roles` endpoint:
|
||||
```
|
||||
# for http
|
||||
http://<IP_ADDRESS>:8080/api/v1/roles
|
||||
|
||||
# for https reversed proxy
|
||||
https://<DOMAIN>/api/v1/roles
|
||||
```
|
||||
|
||||
## `node_api_check.py`
|
||||
|
||||
To make this a bit easier, we made a CLI tool quering all vailable API endpoints based on node `Identity Key` (further denoted as `<ID_KEY>`) called `node_api_check.py`. To diagnose your node performance, whether by yourself or by sharing an output in our [operator channel](https://matrix.to/#/#operators:nymtech.chat), this tool provides you with a quick overview of live data. We recommend to run this checker alongside [`nym_gateway_probe`](gateway-probe.md) to triage both performance and an actual routing.
|
||||
|
||||
Besides querying any bonded node APIs, `nym_api_check` has a function counting all existing nodes in provided version.
|
||||
|
||||
### Setup
|
||||
|
||||
#### Pre-requsities
|
||||
|
||||
**Python3**
|
||||
|
||||
1. Start with installing Python3:
|
||||
```sh
|
||||
sudo apt install Python3
|
||||
```
|
||||
|
||||
2. Make sure Python3 is your default Python version:
|
||||
```sh
|
||||
update-alternatives --install /usr/bin/python python /usr/bin/python3 1
|
||||
|
||||
# controll
|
||||
python --version
|
||||
# should return higher than 3
|
||||
```
|
||||
|
||||
3. Install Python modules `tabulate`, `pandas` and `argparse`:
|
||||
- either using [`pip`](https://python.land/virtual-environments/installing-packages-with-pip) and then running:
|
||||
```sh
|
||||
pip install tabulate pandas argparse
|
||||
```
|
||||
- or if you installed Python3 system-wide you can install modules directly:
|
||||
```sh
|
||||
sudo apt install python3-tabulate python3-pandas python3-argparse
|
||||
```
|
||||
|
||||
**Installation**
|
||||
|
||||
4. Get [`node_api_check.py`](https://github.com/nymtech/nym/tree/develop/scripts/node_api_check.py) and [`api_endpoints.json`](https://github.com/nymtech/nym/tree/develop/scripts/api_endpoints.json). If you [compiled from source](../binaries/building-nym.md), you already have both of these files. If you prefer to download them individually, do it by opening terminal in your desired location and running:
|
||||
```sh
|
||||
wget https://raw.githubusercontent.com/nymtech/nym/tree/develop/node_api_check.py
|
||||
|
||||
wget https://raw.githubusercontent.com/nymtech/nym/tree/develop/api_endpoints.json
|
||||
```
|
||||
|
||||
5. Make executable:
|
||||
```sh
|
||||
chmod u+x node_api_check.py
|
||||
```
|
||||
|
||||
Now you are ready to check your node.
|
||||
|
||||
### Usage
|
||||
|
||||
Run with `--help` flag to see the available commands:
|
||||
|
||||
~~~admonish example collapsible=true title="./node_api_check.py --help"
|
||||
```python
|
||||
<!--cmdrun cd ../../../../scripts && python ./node_api_check.py --help-->
|
||||
```
|
||||
~~~
|
||||
|
||||
#### `query_stats`
|
||||
|
||||
When you want to see all the options connected to a command, add a `--help` flag after the command of your choice, like in this example:
|
||||
~~~admonish example collapsible=true title="./node_api_check.py query_stats --help"
|
||||
```python
|
||||
<!--cmdrun cd ../../../../scripts && python ./node_api_check.py query_stats --help-->
|
||||
```
|
||||
~~~
|
||||
|
||||
The most common usage may be `./node_api_check.py query_stats <ID_KEY>` where `<ID_KEY>` is required, sustitute it with node Identity Key.
|
||||
|
||||
**Optional arguments**
|
||||
|
||||
| Flag | Shortcut | Description |
|
||||
| :--- | :--- | :--- |
|
||||
| `--markdown` | `-m` | returns output in markdown format |
|
||||
| `--no_routing_history` | `-n` | returns output without routing history which can be lenghty |
|
||||
| `--output` | `-o` | exports output to a file, possible to add a target path |
|
||||
|
||||
#### `version_count`
|
||||
|
||||
Another command is `version_count` where at least one `nym-node` version is required. In case of multiple version count, separate the versions with space. We recommend to run this command with `--markdown` flag for a nicer output. This is an example where we want to look up how many registered nodes are on versions `1.1.0`, `1.1.1`, `1.1.2` and `1.1.3`:
|
||||
```sh
|
||||
./node_api_check version_count 1.1.0 1.1.1 1.1.2 1.1.3 --markdown
|
||||
```
|
||||
@@ -1,22 +0,0 @@
|
||||
CONFIGURED=true
|
||||
|
||||
RUST_LOG=info
|
||||
RUST_BACKTRACE=1
|
||||
NETWORK_NAME=sandbox
|
||||
BECH32_PREFIX=n
|
||||
MIX_DENOM=unym
|
||||
MIX_DENOM_DISPLAY=nym
|
||||
STAKE_DENOM=unyx
|
||||
STAKE_DENOM_DISPLAY=nyx
|
||||
DENOMS_EXPONENT=6
|
||||
|
||||
REWARDING_VALIDATOR_ADDRESS=n1duuyj2th2y0z4u4f4wtljpdz9s3pxtu0xx6zdz
|
||||
MIXNET_CONTRACT_ADDRESS=n14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sjyvg3g
|
||||
COCONUT_BANDWIDTH_CONTRACT_ADDRESS=n1mf6ptkssddfmxvhdx0ech0k03ktp6kf9yk59renau2gvht3nq2gqt5tdrk
|
||||
GROUP_CONTRACT_ADDRESS=n1qg5ega6dykkxc307y25pecuufrjkxkaggkkxh7nad0vhyhtuhw3sa07c47
|
||||
MULTISIG_CONTRACT_ADDRESS=n1zwv6feuzhy6a9wekh96cd57lsarmqlwxdypdsplw6zhfncqw6ftqx5a364
|
||||
COCONUT_DKG_CONTRACT_ADDRESS=n1aakfpghcanxtc45gpqlx8j3rq0zcpyf49qmhm9mdjrfx036h4z5sy2vfh9
|
||||
|
||||
EXPLORER_API=https://canary-explorer.performance.nymte.ch/api
|
||||
NYXD="https://canary-validator.performance.nymte.ch"
|
||||
NYM_API="https://canary-api.performance.nymte.ch/api"
|
||||
@@ -17,6 +17,7 @@ COCONUT_BANDWIDTH_CONTRACT_ADDRESS=n1lp5zex6685kd22agzskhqsylpnssxnweyuvsz4edr4p
|
||||
GROUP_CONTRACT_ADDRESS=n1rw8fw2mpcpzzq3jpa4e52ufawnmj5a4u68p35umvgskewuw0nlzsaa5w4m
|
||||
MULTISIG_CONTRACT_ADDRESS=n1rw8fw2mpcpzzq3jpa4e52ufawnmj5a4u68p35umvgskewuw0nlzsaa5w4m
|
||||
COCONUT_DKG_CONTRACT_ADDRESS=n1vwtgazgpancsfel04y7syc95ausmat47cjtldqzkdmx6phyrwx2qvkv32p
|
||||
EPHEMERA_CONTRACT_ADDRESS=n1vwtgazgpancsfel04y7syc95ausmat47cjtldqzkdmx6phyrwx2qvkv32p
|
||||
REWARDING_VALIDATOR_ADDRESS=n1tfzd4qz3a45u8p4mr5zmzv66457uwjgcl05jdq
|
||||
STATISTICS_SERVICE_DOMAIN_ADDRESS="http://0.0.0.0"
|
||||
NYXD="http://127.0.0.1:26657"
|
||||
|
||||
+10
-8
@@ -10,17 +10,19 @@ STAKE_DENOM=unyx
|
||||
STAKE_DENOM_DISPLAY=nyx
|
||||
DENOMS_EXPONENT=6
|
||||
|
||||
MIXNET_CONTRACT_ADDRESS=n1hm4y6fzgxgu688jgf7ek66px6xkrtmn3gyk8fax3eawhp68c2d5qujz296
|
||||
COCONUT_BANDWIDTH_CONTRACT_ADDRESS=n14y2x8a60knc5jjfeztt84kw8x8l5pwdgnqg256v0p9v4p7t2q6eswxyusw
|
||||
GROUP_CONTRACT_ADDRESS=n1qp35fcj0v9u3trhaps5v9q0lc42t4m6aty2wryss75ee8zuqnsqqdcreyq
|
||||
MULTISIG_CONTRACT_ADDRESS=n1qa4hswlcjmttulj0q9qa46jf64f93pecl6tydcsjldfe0hy5ju0sdmwzya
|
||||
COCONUT_DKG_CONTRACT_ADDRESS=n1ayrk6wp6w5lf6njtnfjwljmtcc9vevv5sxwkz7uq24rp2pw67t0qhmmxdd
|
||||
VESTING_CONTRACT_ADDRESS=n1jlzdxnyces4hrhqz68dqk28mrw5jgwtcfq0c2funcwrmw0dx9l9s8nnnvj
|
||||
MIXNET_CONTRACT_ADDRESS=n14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sjyvg3g
|
||||
VESTING_CONTRACT_ADDRESS=n1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrq73f2nw
|
||||
COCONUT_BANDWIDTH_CONTRACT_ADDRESS=n1aht6sekk0302hh30eje9a4lq84juwehw2hxv65kjh863ptay0sxs84mhx8
|
||||
GROUP_CONTRACT_ADDRESS=n17akgf5y2t775k27kulyw8durzsgfedym9wemg0qv3msc4ry0cg2senyl36
|
||||
MULTISIG_CONTRACT_ADDRESS=n1075wwvq8ypag74tmzeu7a05mplwsa95g2p8wnxhhctv7hlp6y3wq9ttqcg
|
||||
COCONUT_DKG_CONTRACT_ADDRESS=n1hk7jy0m6ec5gventvgsx8skrz8mrudhqhun0ufg5gaa3mrr83qyq45v2zk
|
||||
REWARDING_VALIDATOR_ADDRESS=n1rfvpsynktze6wvn6ldskj8xgwfzzk5v6pnff39
|
||||
NAME_SERVICE_CONTRACT_ADDRESS=n1qum2tr7hh4y7ruzew68c64myjec0dq2s2njf6waja5t0w879lutqadamme
|
||||
SERVICE_PROVIDER_DIRECTORY_CONTRACT_ADDRESS=n13ehuhysn5mqjeaheeuew2gjs785f6k7jm8vfsqg3jhtpkwppcmzq6m2hmz
|
||||
|
||||
STATISTICS_SERVICE_DOMAIN_ADDRESS="https://mainnet-stats.nymte.ch:8090"
|
||||
EXPLORER_API=https://qa-network-explorer.qa.nymte.ch/api
|
||||
NYXD="https://qa-validator.qa.nymte.ch"
|
||||
NYM_API="https://qa-nym-api.qa.nymte.ch/api"
|
||||
|
||||
DKG_TIME_CONFIGURATION="600,300,300,60,60,1209600"
|
||||
EXIT_POLICY="https://nymtech.net/.wellknown/network-requester/exit-policy.txt"
|
||||
EXIT_POLICY="https://nymtech.net/.wellknown/network-requester/exit-policy.txt"
|
||||
+3
-1
@@ -17,7 +17,9 @@ COCONUT_BANDWIDTH_CONTRACT_ADDRESS=n1ljlwey4xdj0zs7zueepc48nkr033fca6fjgvurfvttq
|
||||
GROUP_CONTRACT_ADDRESS=n10v3rjnq4cjyccfykyams68ztce337gksuu6f0lvtl4meuwvkewaqru4uav
|
||||
MULTISIG_CONTRACT_ADDRESS=n1cemnu8as0ls45v3caunpesl8jlsfw2ff9rlwnltlecp7zrxct4dsqc2y42
|
||||
COCONUT_DKG_CONTRACT_ADDRESS=n1zx96qgd88vqlzcxkpwzks7kqs5ctrx36xtzfc58p7q6c4ng9anlqzc4nh8
|
||||
|
||||
NAME_SERVICE_CONTRACT_ADDRESS=n12ne7qtmdwd0j03t9t5es8md66wq4e5xg9neladrsag8fx3y89rcs36asfp
|
||||
SERVICE_PROVIDER_DIRECTORY_CONTRACT_ADDRESS=n1ps5yutd7sufwg058qd7ac7ldnlazsvmhzqwucsfxmm445d70u8asqxpur4
|
||||
EPHEMERA_CONTRACT_ADDRESS=n19lc9u84cz0yz3fww5283nucc9yvr8gsjmgeul0
|
||||
|
||||
STATISTICS_SERVICE_DOMAIN_ADDRESS="http://0.0.0.0"
|
||||
EXPLORER_API=https://sandbox-explorer.nymtech.net/api
|
||||
|
||||
@@ -18,7 +18,8 @@ COCONUT_BANDWIDTH_CONTRACT_ADDRESS=n16a32stm6kknhq5cc8rx77elr66pygf2hfszw7wvpq74
|
||||
GROUP_CONTRACT_ADDRESS=n1pd7kfgvr5tpcv0xnlv46c4jsq9jg2r799xxrcwqdm4l2jhq2pjwqrmz5ju
|
||||
MULTISIG_CONTRACT_ADDRESS=n14ph4e660eyqz0j36zlkaey4zgzexm5twkmjlqaequxr2cjm9eprqsmad6k
|
||||
COCONUT_DKG_CONTRACT_ADDRESS=n1ahg0erc2fs6xx3j5m8sfx3ryuzdjh6kf6qm9plsf865fltekyrfsesac6a
|
||||
|
||||
NAME_SERVICE_CONTRACT_ADDRESS=n12ne7qtmdwd0j03t9t5es8md66wq4e5xg9neladrsag8fx3y89rcs36asfp
|
||||
SERVICE_PROVIDER_DIRECTORY_CONTRACT_ADDRESS=n1ps5yutd7sufwg058qd7ac7ldnlazsvmhzqwucsfxmm445d70u8asqxpur4
|
||||
|
||||
STATISTICS_SERVICE_DOMAIN_ADDRESS="http://0.0.0.0"
|
||||
NYXD="https://rpc.sandbox.nymtech.net"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "explorer-api"
|
||||
version = "1.1.36"
|
||||
version = "1.1.34"
|
||||
edition = "2021"
|
||||
license.workspace = true
|
||||
|
||||
|
||||
@@ -15,9 +15,7 @@ const HM_SIZE: u8 = 100;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum GetSpError {
|
||||
#[allow(dead_code)]
|
||||
ReqwestError(ReqwestError),
|
||||
#[allow(dead_code)]
|
||||
Error(String),
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use crate::node::client_handling::websocket::connection_handler::authenticated::RequestHandlingError;
|
||||
use nym_bandwidth_claim_contract::msg::ExecuteMsg;
|
||||
use nym_bandwidth_claim_contract::payment::LinkPaymentData;
|
||||
use nym_credentials::token::bandwidth::TokenCredential;
|
||||
use nym_crypto::asymmetric::identity::{PublicKey, Signature, SIGNATURE_LENGTH};
|
||||
use nym_network_defaults::{ETH_EVENT_NAME, ETH_MIN_BLOCK_DEPTH};
|
||||
use nym_validator_client::nxmd::traits::MixnetQueryClient;
|
||||
use nym_validator_client::nyxd::{AccountId, NyxdClient, SigningNyxdClient};
|
||||
use std::str::FromStr;
|
||||
use web3::contract::tokens::Detokenize;
|
||||
use web3::contract::{Contract, Error};
|
||||
use web3::transports::Http;
|
||||
use web3::types::{BlockNumber, FilterBuilder, H256};
|
||||
use web3::Web3;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Burned {
|
||||
/// The bandwidth bought by the client
|
||||
pub bandwidth: u64,
|
||||
/// Client public verification key
|
||||
pub verification_key: PublicKey,
|
||||
/// Signed verification key
|
||||
pub signed_verification_key: Signature,
|
||||
/// Address for the owner of the gateway
|
||||
pub cosmos_recipient: String,
|
||||
}
|
||||
|
||||
impl Burned {
|
||||
pub fn verify(&self, verification_key: PublicKey) -> bool {
|
||||
self.verification_key == verification_key
|
||||
&& verification_key
|
||||
.verify(
|
||||
&self.verification_key.to_bytes(),
|
||||
&self.signed_verification_key,
|
||||
)
|
||||
.is_ok()
|
||||
}
|
||||
}
|
||||
|
||||
impl Detokenize for Burned {
|
||||
fn from_tokens(tokens: Vec<Token>) -> Result<Self, Error>
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
if tokens.len() != 4 {
|
||||
return Err(Error::InvalidOutputType(format!(
|
||||
"Expected three elements, got: {:?}",
|
||||
tokens
|
||||
)));
|
||||
}
|
||||
let bandwidth = tokens
|
||||
.get(0)
|
||||
.unwrap()
|
||||
.clone()
|
||||
.into_uint()
|
||||
.ok_or_else(|| Error::InvalidOutputType(String::from("Expected Uint for bandwidth")))?
|
||||
.as_u64();
|
||||
let verification_key: [u8; 32] = tokens
|
||||
.get(1)
|
||||
.unwrap()
|
||||
.clone()
|
||||
.into_uint()
|
||||
.ok_or_else(|| {
|
||||
Error::InvalidOutputType(String::from("Expected Uint for verification key"))
|
||||
})?
|
||||
.into();
|
||||
let verification_key = PublicKey::from_bytes(&verification_key).map_err(|_| {
|
||||
Error::InvalidOutputType(format!(
|
||||
"Expected verification key of 32 bytes, got: {}",
|
||||
verification_key.len()
|
||||
))
|
||||
})?;
|
||||
let signed_verification_key =
|
||||
tokens.get(2).unwrap().clone().into_bytes().ok_or_else(|| {
|
||||
Error::InvalidOutputType(String::from("Expected Bytes for the last two fields"))
|
||||
})?;
|
||||
let signed_verification_key =
|
||||
Signature::from_bytes(&signed_verification_key[..SIGNATURE_LENGTH]).map_err(|_| {
|
||||
Error::InvalidOutputType(format!(
|
||||
"Expected signature of {} bytes, got: {}",
|
||||
SIGNATURE_LENGTH,
|
||||
signed_verification_key.len()
|
||||
))
|
||||
})?;
|
||||
let cosmos_recipient = tokens
|
||||
.get(3)
|
||||
.unwrap()
|
||||
.clone()
|
||||
.into_string()
|
||||
.ok_or_else(|| {
|
||||
Error::InvalidOutputType(String::from("Expected utf8 encoded owner address"))
|
||||
})?;
|
||||
|
||||
Ok(Burned {
|
||||
bandwidth,
|
||||
verification_key,
|
||||
signed_verification_key,
|
||||
cosmos_recipient,
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -318,7 +318,6 @@ impl<St> Gateway<St> {
|
||||
.with_shutdown(shutdown)
|
||||
.with_custom_gateway_transceiver(Box::new(transceiver))
|
||||
.with_wait_for_gateway(true)
|
||||
.with_minimum_gateway_performance(0)
|
||||
.with_on_start(on_start_tx);
|
||||
|
||||
if let Some(custom_mixnet) = &nr_opts.custom_mixnet_path {
|
||||
@@ -383,7 +382,6 @@ impl<St> Gateway<St> {
|
||||
.with_shutdown(shutdown)
|
||||
.with_custom_gateway_transceiver(Box::new(transceiver))
|
||||
.with_wait_for_gateway(true)
|
||||
.with_minimum_gateway_performance(0)
|
||||
.with_on_start(on_start_tx);
|
||||
|
||||
if let Some(custom_mixnet) = &ip_opts.custom_mixnet_path {
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
[package]
|
||||
name = "nym-api"
|
||||
license = "GPL-3.0"
|
||||
version = "1.1.40"
|
||||
version = "1.1.38"
|
||||
authors = [
|
||||
"Dave Hrycyszyn <futurechimp@users.noreply.github.com>",
|
||||
"Jędrzej Stuczyński <andrew@nymtech.net>",
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
CREATE TABLE contract_mixnode_reward
|
||||
(
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
mix_id INTEGER NOT NULL,
|
||||
epoch INTEGER NOT NULL,
|
||||
nym_api_id INTEGER NOT NULL,
|
||||
reliability INTEGER NOT NULL,
|
||||
timestamp INTEGER NOT NULL,
|
||||
UNIQUE (mix_id, epoch)
|
||||
);
|
||||
|
||||
CREATE TABLE epoch_info
|
||||
(
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
epoch_id INTEGER NOT NULL,
|
||||
start_time INTEGER NOT NULL,
|
||||
duration INTEGER NOT NULL,
|
||||
UNIQUE (epoch_id)
|
||||
);
|
||||
@@ -0,0 +1,23 @@
|
||||
CREATE TABLE mixnode_status
|
||||
(
|
||||
mix_id INTEGER NOT NULL,
|
||||
reliability INTEGER NOT NULL,
|
||||
timestamp INTEGER NOT NULL,
|
||||
UNIQUE (mix_id, timestamp)
|
||||
);
|
||||
|
||||
CREATE TABLE rewarding_report
|
||||
(
|
||||
epoch_id INTEGER NOT NULL,
|
||||
eligible_mixnodes INTEGER NOT NULL,
|
||||
timestamp INTEGER NOT NULL,
|
||||
UNIQUE (epoch_id)
|
||||
);
|
||||
|
||||
CREATE TABLE epoch_blocks
|
||||
(
|
||||
epoch_id INTEGER NOT NULL,
|
||||
block_id INTEGER NOT NULL,
|
||||
timestamp INTEGER NOT NULL,
|
||||
UNIQUE (epoch_id, block_id)
|
||||
);
|
||||
@@ -0,0 +1,6 @@
|
||||
CREATE TABLE mixnode_status
|
||||
(
|
||||
mix_id INTEGER NOT NULL,
|
||||
reliability INTEGER NOT NULL,
|
||||
timestamp INTEGER NOT NULL
|
||||
);
|
||||
@@ -84,9 +84,7 @@ impl From<GatewayDetails> for TestNode {
|
||||
|
||||
pub struct TestedMixnodeStatus {
|
||||
pub db_id: i64,
|
||||
#[allow(dead_code)]
|
||||
pub mix_id: i64,
|
||||
#[allow(dead_code)]
|
||||
pub identity_key: String,
|
||||
pub reliability: Option<u8>,
|
||||
pub timestamp: i64,
|
||||
@@ -100,7 +98,6 @@ pub struct TestedMixnodeStatus {
|
||||
|
||||
pub struct TestedGatewayStatus {
|
||||
pub db_id: i64,
|
||||
#[allow(dead_code)]
|
||||
pub identity_key: String,
|
||||
pub reliability: Option<u8>,
|
||||
pub timestamp: i64,
|
||||
|
||||
@@ -30,6 +30,9 @@ export interface Contracts {
|
||||
group_contract_address: string;
|
||||
multisig_contract_address: string;
|
||||
coconut_dkg_contract_address: string;
|
||||
ephemera_contract_address: string;
|
||||
service_provider_directory_contract_address: string;
|
||||
name_service_contract_address: string;
|
||||
}
|
||||
|
||||
export interface Endpoint {
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
[package]
|
||||
name = "nym-node"
|
||||
version = "1.1.4"
|
||||
version = "1.1.2"
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
homepage.workspace = true
|
||||
|
||||
@@ -179,5 +179,5 @@ pub struct AuxiliaryDetails {
|
||||
/// as defined at <https://nymtech.net/terms-and-conditions/operators/v1.0.0>
|
||||
// make sure to include the default deserialisation as this field hasn't existed when the struct was first created
|
||||
#[serde(default)]
|
||||
pub accepted_operator_terms_and_conditions: bool,
|
||||
pub accepted_toc: bool,
|
||||
}
|
||||
|
||||
@@ -22,12 +22,12 @@ pub(crate) struct Args {
|
||||
/// as defined at <https://nymtech.net/terms-and-conditions/operators/v1.0.0>
|
||||
#[clap(
|
||||
long,
|
||||
env = NYMNODE_ACCEPT_OPERATOR_TERMS,
|
||||
env = NYMNODE_ACCEPT_TOC,
|
||||
alias = "accept-toc",
|
||||
alias = "accept-t&c",
|
||||
alias = "accept-operator-terms",
|
||||
alias = "accept-operator-t&c",
|
||||
alias = "accept-operator-terms-and-conditions"
|
||||
)]
|
||||
pub(crate) accept_operator_terms_and_conditions: bool,
|
||||
pub(crate) accept_operator_terms: bool,
|
||||
|
||||
/// Forbid a new node from being initialised if configuration file for the provided specification doesn't already exist
|
||||
#[clap(
|
||||
|
||||
@@ -46,11 +46,11 @@ pub(crate) async fn execute(mut args: Args) -> Result<(), NymNodeError> {
|
||||
let bonding_info_path = args.bonding_information_output.clone();
|
||||
let init_only = args.init_only;
|
||||
let local = args.local;
|
||||
let accepted_operator_terms_and_conditions = args.accept_operator_terms_and_conditions;
|
||||
let accepted_toc = args.accept_operator_terms;
|
||||
|
||||
if !accepted_operator_terms_and_conditions {
|
||||
if !accepted_toc {
|
||||
warn!("you don't seem to have accepted the terms and conditions of a Nym node operator");
|
||||
warn!("please familiarise yourself with <https://nymtech.net/terms-and-conditions/operators/v1.0.0> and run the binary with '--accept-operator-terms-and-conditions' flag if you agree with them");
|
||||
warn!("please familiarise yourself with <https://nymtech.net/terms-and-conditions/operators/v1.0.0> and run the binary with '--accept-toc' flag if you agree with them");
|
||||
}
|
||||
|
||||
let config = if !config_path.exists() {
|
||||
@@ -85,9 +85,7 @@ pub(crate) async fn execute(mut args: Args) -> Result<(), NymNodeError> {
|
||||
}
|
||||
check_public_ips(&config.host.public_ips, local)?;
|
||||
|
||||
let nym_node = NymNode::new(config)
|
||||
.await?
|
||||
.with_accepted_operator_terms_and_conditions(accepted_operator_terms_and_conditions);
|
||||
let nym_node = NymNode::new(config).await?.with_accepted_toc(accepted_toc);
|
||||
|
||||
// if requested, write bonding info
|
||||
if let Some(bonding_info_path) = bonding_info_path {
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ pub mod vars {
|
||||
|
||||
pub const NYMNODE_MODE_ARG: &str = "NYMNODE_MODE";
|
||||
|
||||
pub const NYMNODE_ACCEPT_OPERATOR_TERMS: &str = "NYMNODE_ACCEPT_OPERATOR_TERMS";
|
||||
pub const NYMNODE_ACCEPT_TOC: &str = "NYMNODE_ACCEPT_TOC";
|
||||
|
||||
// host:
|
||||
pub const NYMNODE_PUBLIC_IPS_ARG: &str = "NYMNODE_PUBLIC_IPS";
|
||||
|
||||
@@ -293,7 +293,7 @@ impl From<WireguardData> for nym_wireguard::WireguardData {
|
||||
|
||||
pub(crate) struct NymNode {
|
||||
config: Config,
|
||||
accepted_operator_terms_and_conditions: bool,
|
||||
accepted_toc: bool,
|
||||
|
||||
description: NodeDescription,
|
||||
|
||||
@@ -394,15 +394,12 @@ impl NymNode {
|
||||
exit_gateway: ExitGatewayData::new(&config.exit_gateway)?,
|
||||
wireguard: wireguard_data,
|
||||
config,
|
||||
accepted_operator_terms_and_conditions: false,
|
||||
accepted_toc: false,
|
||||
})
|
||||
}
|
||||
|
||||
pub(crate) fn with_accepted_operator_terms_and_conditions(
|
||||
mut self,
|
||||
accepted_operator_terms_and_conditions: bool,
|
||||
) -> Self {
|
||||
self.accepted_operator_terms_and_conditions = accepted_operator_terms_and_conditions;
|
||||
pub(crate) fn with_accepted_toc(mut self, accepted_toc: bool) -> Self {
|
||||
self.accepted_toc = accepted_toc;
|
||||
self
|
||||
}
|
||||
|
||||
@@ -541,7 +538,7 @@ impl NymNode {
|
||||
|
||||
let auxiliary_details = api_requests::v1::node::models::AuxiliaryDetails {
|
||||
location: self.config.host.location,
|
||||
accepted_operator_terms_and_conditions: self.accepted_operator_terms_and_conditions,
|
||||
accepted_toc: self.accepted_toc,
|
||||
};
|
||||
|
||||
// mixnode info
|
||||
|
||||
@@ -64,6 +64,7 @@ use curve25519_dalek::montgomery::MontgomeryPoint;
|
||||
use curve25519_dalek::scalar::Scalar;
|
||||
|
||||
use std::ops::Range;
|
||||
use std::u8;
|
||||
|
||||
use crate::constants::groupelementbytes;
|
||||
use crate::constants::tagbytes;
|
||||
|
||||
Generated
+15
-39
@@ -293,6 +293,8 @@ dependencies = [
|
||||
"bs58 0.5.1",
|
||||
"hmac",
|
||||
"k256",
|
||||
"once_cell",
|
||||
"pbkdf2",
|
||||
"rand_core 0.6.4",
|
||||
"ripemd",
|
||||
"sha2 0.10.8",
|
||||
@@ -513,38 +515,6 @@ dependencies = [
|
||||
"system-deps 6.1.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "camino"
|
||||
version = "1.1.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cargo-platform"
|
||||
version = "0.1.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cargo_metadata"
|
||||
version = "0.18.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037"
|
||||
dependencies = [
|
||||
"camino",
|
||||
"cargo-platform",
|
||||
"semver 1.0.22",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cargo_toml"
|
||||
version = "0.13.3"
|
||||
@@ -1636,6 +1606,7 @@ version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449"
|
||||
dependencies = [
|
||||
"bitvec",
|
||||
"rand_core 0.6.4",
|
||||
"subtle 2.5.0",
|
||||
]
|
||||
@@ -3193,11 +3164,9 @@ dependencies = [
|
||||
"bs58 0.5.1",
|
||||
"cosmwasm-schema",
|
||||
"cosmwasm-std",
|
||||
"cw-storage-plus",
|
||||
"schemars",
|
||||
"serde",
|
||||
"thiserror",
|
||||
"vergen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3779,6 +3748,16 @@ version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd"
|
||||
|
||||
[[package]]
|
||||
name = "pbkdf2"
|
||||
version = "0.12.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2"
|
||||
dependencies = [
|
||||
"digest 0.10.7",
|
||||
"hmac",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "peg"
|
||||
version = "0.7.0"
|
||||
@@ -6127,14 +6106,11 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
|
||||
|
||||
[[package]]
|
||||
name = "vergen"
|
||||
version = "8.3.1"
|
||||
version = "8.2.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e27d6bdd219887a9eadd19e1c34f32e47fa332301184935c6d9bca26f3cca525"
|
||||
checksum = "1290fd64cc4e7d3c9b07d7f333ce0ce0007253e32870e632624835cc80b83939"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"cargo_metadata",
|
||||
"cfg-if",
|
||||
"regex",
|
||||
"rustc_version",
|
||||
"rustversion",
|
||||
"time",
|
||||
|
||||
@@ -12,9 +12,9 @@ pub(crate) const STAKE_DENOM: DenomDetails = DenomDetails::new("unyx", "nyx", 6)
|
||||
// -- Contract addresses --
|
||||
|
||||
pub(crate) const MIXNET_CONTRACT_ADDRESS: &str =
|
||||
"n1hm4y6fzgxgu688jgf7ek66px6xkrtmn3gyk8fax3eawhp68c2d5qujz296";
|
||||
"n14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sjyvg3g";
|
||||
pub(crate) const VESTING_CONTRACT_ADDRESS: &str =
|
||||
"n1jlzdxnyces4hrhqz68dqk28mrw5jgwtcfq0c2funcwrmw0dx9l9s8nnnvj";
|
||||
"n1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrq73f2nw";
|
||||
pub(crate) const COCONUT_BANDWIDTH_CONTRACT_ADDRESS: &str =
|
||||
"n1w798gp0zqv3s9hjl3jlnwxtwhykga6rn93p46q2crsdqhaj3y4gs68f74j";
|
||||
pub(crate) const GROUP_CONTRACT_ADDRESS: &str =
|
||||
@@ -23,6 +23,10 @@ pub(crate) const MULTISIG_CONTRACT_ADDRESS: &str =
|
||||
"n1sr06m8yqg0wzqqyqvzvp5t07dj4nevx9u8qc7j4qa72qu8e3ct8qledthy";
|
||||
pub(crate) const COCONUT_DKG_CONTRACT_ADDRESS: &str =
|
||||
"n1udfs22xpxle475m2nz7u47jfa3vngncdegmczwwdx00cmetypa3s7uyuqn";
|
||||
pub(crate) const SERVICE_PROVIDER_DIRECTORY_CONTRACT_ADDRESS: &str =
|
||||
"n13ehuhysn5mqjeaheeuew2gjs785f6k7jm8vfsqg3jhtpkwppcmzq6m2hmz";
|
||||
pub(crate) const NAME_SERVICE_CONTRACT_ADDRESS: &str =
|
||||
"n1qum2tr7hh4y7ruzew68c64myjec0dq2s2njf6waja5t0w879lutqadamme";
|
||||
|
||||
// -- Constructor functions --
|
||||
|
||||
@@ -54,6 +58,10 @@ pub(crate) fn network_details() -> nym_network_defaults::NymNetworkDetails {
|
||||
group_contract_address: parse_optional_str(GROUP_CONTRACT_ADDRESS),
|
||||
multisig_contract_address: parse_optional_str(MULTISIG_CONTRACT_ADDRESS),
|
||||
coconut_dkg_contract_address: parse_optional_str(COCONUT_DKG_CONTRACT_ADDRESS),
|
||||
service_provider_directory_contract_address: parse_optional_str(
|
||||
SERVICE_PROVIDER_DIRECTORY_CONTRACT_ADDRESS,
|
||||
),
|
||||
name_service_contract_address: parse_optional_str(NAME_SERVICE_CONTRACT_ADDRESS),
|
||||
},
|
||||
explorer_api: parse_optional_str(EXPLORER_API),
|
||||
}
|
||||
|
||||
@@ -54,6 +54,8 @@ pub(crate) fn network_details() -> nym_network_defaults::NymNetworkDetails {
|
||||
group_contract_address: parse_optional_str(GROUP_CONTRACT_ADDRESS),
|
||||
multisig_contract_address: parse_optional_str(MULTISIG_CONTRACT_ADDRESS),
|
||||
coconut_dkg_contract_address: parse_optional_str(COCONUT_DKG_CONTRACT_ADDRESS),
|
||||
service_provider_directory_contract_address: None,
|
||||
name_service_contract_address: None,
|
||||
},
|
||||
explorer_api: parse_optional_str(EXPLORER_API),
|
||||
}
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
{
|
||||
"mixnode":[
|
||||
"/status/mixnode/{mix_id}/report",
|
||||
"/status/mixnode/{mix_id}/history",
|
||||
"/status/mixnode/{mix_id}/core-status-count",
|
||||
"/status/mixnode/{mix_id}/status",
|
||||
"/status/mixnode/{mix_id}/reward-estimation",
|
||||
"/status/mixnode/{mix_id}/compute-reward-estimation",
|
||||
"/status/mixnode/{mix_id}/stake-saturation",
|
||||
"/status/mixnode/{mix_id}/inclusion-probability",
|
||||
"/status/mixnode/{mix_id}/avg_uptime"
|
||||
|
||||
|
||||
|
||||
],
|
||||
"gateway":[
|
||||
"/status/gateway/{identity}/report",
|
||||
"/status/gateway/{identity}/history",
|
||||
"/status/gateway/{identity}/core-status-count",
|
||||
"/status/gateway/{identity}/avg_uptime"
|
||||
|
||||
],
|
||||
|
||||
"swagger":[
|
||||
"/roles",
|
||||
"/build-information",
|
||||
"/description",
|
||||
"/host-information",
|
||||
"/system-info",
|
||||
"/gateway",
|
||||
"/gateway/client-interfaces",
|
||||
"/gateway/client-interfaces/mixnet-websockets",
|
||||
"/gateway/client-interfaces/wireguard",
|
||||
"/health",
|
||||
"/ip-packet-router",
|
||||
"/metrics/mixing",
|
||||
"/metrics/prometheus",
|
||||
"/metrics/verloc",
|
||||
"/mixnode",
|
||||
"/network-requester",
|
||||
"/network-requester/exit-policy"
|
||||
]
|
||||
}
|
||||
@@ -1,401 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
# TODO (in later versions)
|
||||
# - make option to run in sandbox env
|
||||
# - pull endpoints from: https://validator.nymtech.net/api/v1/openapi.json
|
||||
# - try this https://stackoverflow.com/questions/15431044/can-i-set-max-retries-for-requests-request/35504626#35504626
|
||||
|
||||
import requests as r
|
||||
import argparse
|
||||
import sys
|
||||
import os
|
||||
import pandas as pd
|
||||
import json
|
||||
import urllib3
|
||||
import time
|
||||
from json import JSONDecodeError
|
||||
from tabulate import tabulate
|
||||
|
||||
|
||||
class MainFunctions:
|
||||
|
||||
def __init__(self):
|
||||
self.api_url = "https://validator.nymtech.net/api/v1"
|
||||
self.api_endpoints_json = "api_endpoints.json"
|
||||
self.output = Output()
|
||||
|
||||
def display_results(self, args):
|
||||
id_key = args.id
|
||||
mode, host, version, mix_id, role, node_df, node_dict, api_data, swagger_data, routing_history = self.collect_all_results(args)
|
||||
print("\n============================================================")
|
||||
print("\nNYM NODE INFO\n")
|
||||
print(f"Type = {mode}")
|
||||
if role:
|
||||
print(f"Mode = {role}")
|
||||
print(f"Identity Key = {id_key}")
|
||||
print(f"Host = {host}")
|
||||
print(f"Version = {version}")
|
||||
if mix_id:
|
||||
print(f"Mix ID = {mix_id}")
|
||||
print("\n\nNODE RESULTS FROM UNFILTERED QUERY\n")
|
||||
if args.markdown:
|
||||
node_markdown = self._dataframe_to_markdown(node_df, ["RESULT"], ["API EDNPOINT"])
|
||||
print(node_markdown, "\n")
|
||||
else:
|
||||
self.print_neat_dict(node_dict)
|
||||
print(f"\n\nNODE RESULTS FROM {self.api_url.upper()}\n")
|
||||
if args.markdown:
|
||||
api_df = self._json_to_dataframe(api_data)
|
||||
node_markdown = self._dataframe_to_markdown(api_df, ["RESULT"], ["API EDNPOINT"])
|
||||
print(node_markdown, "\n")
|
||||
else:
|
||||
self.print_neat_dict(api_data)
|
||||
if swagger_data:
|
||||
print(f"\n\nNODE RESULTS FROM SWAGGER PAGE\n")
|
||||
if args.markdown:
|
||||
swagger_df = self._json_to_dataframe(swagger_data)
|
||||
node_markdown = self._dataframe_to_markdown(swagger_df, ["RESULT"], ["API EDNPOINT"])
|
||||
print(node_markdown, "\n")
|
||||
else:
|
||||
swagger_data = self._json_neat_format(swagger_data)
|
||||
print(swagger_data)
|
||||
else:
|
||||
swagger_data = f"\nSwagger API endpoints of node {id_key} hosted on IP: {host} are not responding. Maybe you querying a deprecated version of nym-mixnode or the VPS ports are not open correctly.\n"
|
||||
if routing_history:
|
||||
print(f"\n\nNODE UPTIME HISTORY\n")
|
||||
if args.markdown:
|
||||
routing_history_df = self._json_to_dataframe(routing_history)
|
||||
print(routing_history_df.to_markdown(index = False))
|
||||
else:
|
||||
self.print_neat_dict(routing_history)
|
||||
routing_history = self._json_neat_format(routing_history)
|
||||
else:
|
||||
routing_history = " "
|
||||
if args.output or args.output == "":
|
||||
node_dict = self._json_neat_format(node_dict)
|
||||
api_data = self._json_neat_format(api_data)
|
||||
if role:
|
||||
data_list = [f"Id. Key = {id_key}", f"Host = {host}", f"Type = {mode}", f"Mode = {role}", node_dict, api_data, swagger_data, routing_history]
|
||||
else:
|
||||
data_list = [f"Id. Key = {id_key}", f"Host = {host}", f"Type = {mode}", node_dict, api_data, swagger_data, routing_history]
|
||||
self.output.concat_to_file(args, data_list)
|
||||
|
||||
def collect_all_results(self,args):
|
||||
id_key = args.id
|
||||
gateways_unfiltered, mixnodes_unfiltered = self.get_unfiltered_data()
|
||||
gateways_df = self._json_to_dataframe(gateways_unfiltered)
|
||||
gateways_df = self._set_index_to_empty(gateways_df)
|
||||
mixnodes_df = self._json_to_dataframe(mixnodes_unfiltered)
|
||||
mixnodes_df = self._set_index_to_empty(mixnodes_df)
|
||||
mode, node_df, node_dict = self.get_node_df(id_key, gateways_df, mixnodes_df, gateways_unfiltered, mixnodes_unfiltered)
|
||||
host, version, mix_id, role, api_data, swagger_data, routing_history = self.get_node_data(mode, node_dict, id_key, args)
|
||||
return mode, host, version, mix_id, role, node_df, node_dict, api_data, swagger_data, routing_history
|
||||
|
||||
def get_node_df(self,id_key, gateways_df, mixnodes_df, gateways_unfiltered,mixnodes_unfiltered):
|
||||
if id_key in mixnodes_df['mixnode_details.bond_information.mix_node.identity_key'].values:
|
||||
node_df = mixnodes_df.loc[mixnodes_df['mixnode_details.bond_information.mix_node.identity_key'] == id_key]
|
||||
node_dict = next((mn for mn in mixnodes_unfiltered if mn['mixnode_details']['bond_information']['mix_node']['identity_key'] == f"{id_key}"), None)
|
||||
mode = "mixnode"
|
||||
elif id_key in gateways_df["gateway_bond.gateway.identity_key"].values:
|
||||
node_df = gateways_df.loc[gateways_df["gateway_bond.gateway.identity_key"] == id_key]
|
||||
node_dict = next((gw for gw in gateways_unfiltered if gw['gateway_bond']['gateway']['identity_key'] == f"{id_key}"), None)
|
||||
mode = "gateway"
|
||||
else:
|
||||
print(f"The identity key '{id_key}' does not exist.")
|
||||
return mode, node_df, node_dict
|
||||
|
||||
def get_unfiltered_data(self):
|
||||
print("INFO: Starting to query /detailed-unfiltered endpoint...")
|
||||
gateways_unfiltered = r.get(f"{self.api_url}/status/gateways/detailed-unfiltered").json()
|
||||
mixnodes_unfiltered = r.get(f"{self.api_url}/status/mixnodes/detailed-unfiltered").json()
|
||||
return gateways_unfiltered, mixnodes_unfiltered
|
||||
|
||||
def get_node_data(self,mode, node_dict, id_key, args):
|
||||
print("INFO: Sorting out data from the unfiltered endpoint...")
|
||||
identity = id_key
|
||||
endpoint_json = self.api_endpoints_json
|
||||
with open(endpoint_json, "r") as f:
|
||||
dicts = json.load(f)
|
||||
endpoints = dicts[mode]
|
||||
swagger = dicts["swagger"]
|
||||
api_data = {}
|
||||
swagger_data = {}
|
||||
routing_history = {}
|
||||
mix_id = None
|
||||
role = None
|
||||
if mode == "gateway":
|
||||
host = node_dict["gateway_bond"]["gateway"]["host"]
|
||||
version = node_dict["gateway_bond"]["gateway"]["version"]
|
||||
for key in endpoints:
|
||||
endpoint = key.replace("{identity}", identity)
|
||||
url = f"{self.api_url}{endpoint}"
|
||||
print(f"Querying {url}")
|
||||
value = r.get(url).json()
|
||||
api_data[endpoint] = value
|
||||
routing_history = api_data[f"/status/gateway/{identity}/history"]["history"]
|
||||
del api_data[f"/status/gateway/{identity}/history"]["history"]
|
||||
swagger_data = self.get_swagger_data(host,swagger,swagger_data)
|
||||
if swagger_data["/roles"]["network_requester_enabled"]== True and swagger_data["/roles"]["ip_packet_router_enabled"] == True:
|
||||
role = "exit-gateway"
|
||||
else:
|
||||
role = "entry-gateway"
|
||||
elif mode == "mixnode":
|
||||
mix_id = str(node_dict["mixnode_details"]["bond_information"]["mix_id"])
|
||||
for key in endpoints:
|
||||
endpoint = key.replace("{mix_id}", mix_id)
|
||||
url = f"{self.api_url}{endpoint}"
|
||||
print(f"Querying {url}")
|
||||
try:
|
||||
value = r.get(url).json()
|
||||
api_data[endpoint] = value
|
||||
except (JSONDecodeError, json.JSONDecodeError, r.exceptions.JSONDecodeError):
|
||||
print(f"Error: Endpoint {url} results in 404: Not Found!")
|
||||
host = node_dict["mixnode_details"]["bond_information"]["mix_node"]["host"]
|
||||
version = node_dict["mixnode_details"]["bond_information"]["mix_node"]["version"]
|
||||
routing_history = api_data[f"/status/mixnode/{mix_id}/history"]["history"]
|
||||
del api_data[f"/status/mixnode/{mix_id}/history"]["history"]
|
||||
swagger_data = self.get_swagger_data(host,swagger,swagger_data)
|
||||
else:
|
||||
print(f"The mode type {mode} is not recognized!")
|
||||
sys.exit(-1)
|
||||
host = str(host)
|
||||
|
||||
if args.no_routing_history == True:
|
||||
routing_history = None
|
||||
else:
|
||||
routing_history = routing_history
|
||||
|
||||
return host, version, mix_id, role, api_data, swagger_data, routing_history
|
||||
|
||||
def get_swagger_data(self,host,swagger,swagger_data):
|
||||
print("INFO: Starting to query SWAGGER API endpoints...")
|
||||
urls = [
|
||||
f"http://{host}:8080/api/v1",
|
||||
f"https://{host}/api/v1",
|
||||
f"http://{host}/api/v1"
|
||||
]
|
||||
responding_url = self.get_swagger_response(urls)
|
||||
if responding_url:
|
||||
for endpoint in swagger:
|
||||
print(f"Querying {responding_url}{endpoint}")
|
||||
value = self.try_query_swagger(responding_url,endpoint)
|
||||
if value:
|
||||
swagger_data[endpoint] = value
|
||||
else:
|
||||
swagger_data = {}
|
||||
|
||||
return swagger_data
|
||||
|
||||
def try_query_swagger(self, base_url, endpoint):
|
||||
url = f"{base_url}{endpoint}"
|
||||
value = None
|
||||
try:
|
||||
value = r.get(url, timeout=2).json()
|
||||
except (r.exceptions.ConnectionError, urllib3.exceptions.ProtocolError) as e:
|
||||
print(f"Error: Connection error when querying {url}: {e}") # No break because you could be dealing with a different protocol
|
||||
except (JSONDecodeError, json.JSONDecodeError, r.exceptions.JSONDecodeError, ConnectionResetError) as e:
|
||||
print(f"Error: JSON decode error when querying {url}: {e}")
|
||||
except r.exceptions.ConnectTimeout as e:
|
||||
print(f"Error: Connection timeout when querying {url}: {e}")
|
||||
except Exception as e:
|
||||
print(f"Error: An unexpected error occurred when querying {url}: {e}")
|
||||
return value
|
||||
|
||||
def get_swagger_response(self,urls):
|
||||
responding_url = None
|
||||
for base_url in urls:
|
||||
endpoint = "/health"
|
||||
value = self.try_query_swagger(base_url, endpoint)
|
||||
if value:
|
||||
responding_url = base_url
|
||||
print(f"INFO: Swagger API is accessible via {responding_url}, we are going to proceed with querying Swagger endpoints...")
|
||||
break
|
||||
else:
|
||||
print(f"Swagger API was unreachable via {base_url}, we cannot proceed with querying Swagger end points!")
|
||||
return responding_url
|
||||
|
||||
|
||||
def _set_index_to_empty(self, df):
|
||||
index_len = pd.RangeIndex(len(df.index))
|
||||
new_index = []
|
||||
for x in index_len:
|
||||
x = ""
|
||||
new_index.append(x)
|
||||
df.index = new_index
|
||||
return df
|
||||
|
||||
def _dataframe_to_markdown(self,df,col_names, index_names=""):
|
||||
df = df.T
|
||||
df.index.names = index_names
|
||||
df.columns = col_names
|
||||
markdown = df.to_markdown()
|
||||
return markdown
|
||||
|
||||
def format_dataframe(self, df):
|
||||
df = self._json_to_dataframe(df)
|
||||
df = df.T
|
||||
return df
|
||||
|
||||
def print_neat_dict(self, dictionary, indent=4):
|
||||
neat_dictionary = self._json_neat_format(dictionary)
|
||||
print(neat_dictionary)
|
||||
|
||||
def _json_neat_format(self,dictionary,indent=4):
|
||||
dictionary = json.dumps(dictionary, indent = indent)
|
||||
return dictionary
|
||||
|
||||
def _json_to_dataframe(self,json):
|
||||
df = pd.json_normalize(json)
|
||||
return df
|
||||
|
||||
|
||||
class Output():
|
||||
|
||||
def __init__(self):
|
||||
self.home = os.path.expanduser('~')
|
||||
self.pwd = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
def concat_to_file(self,args, data_list):
|
||||
filename = self.init_output_file(args)
|
||||
with open(f"{filename}", "w") as output_file:
|
||||
for name in data_list:
|
||||
output_file.write(name)
|
||||
output_file.write("\n")
|
||||
|
||||
print(f"\nResults were exported to {filename}.")
|
||||
|
||||
def init_output_file(self,args):
|
||||
filename = self.get_filename(args)
|
||||
os.system(f"touch {filename}")
|
||||
return filename
|
||||
|
||||
def get_filename(self,args):
|
||||
path = args.output
|
||||
id_key = args.id
|
||||
file = f"api_output_{id_key}.txt"
|
||||
if path == "":
|
||||
filename = file
|
||||
else:
|
||||
if path[-1] != "/":
|
||||
path = path + "/"
|
||||
if path[0] == "~":
|
||||
path = self.home + path[1:]
|
||||
filename = f"{path}{file}"
|
||||
return filename
|
||||
|
||||
|
||||
class VersionCount():
|
||||
|
||||
def __init__(self):
|
||||
self.functions = MainFunctions()
|
||||
self.mixnodes_version_column = 'mixnode_details.bond_information.mix_node.version'
|
||||
self.gateways_version_column = 'gateway_bond.gateway.version'
|
||||
|
||||
def display_results(self, args):
|
||||
df_final = self.fetch_results(args)
|
||||
if args.markdown:
|
||||
table = df_final.to_markdown(index=False)
|
||||
else:
|
||||
table = tabulate(df_final)
|
||||
print(table)
|
||||
|
||||
def fetch_results(self, args):
|
||||
gateways_unfiltered, mixnodes_unfiltered = self.functions.get_unfiltered_data()
|
||||
df_gateways = self.functions._json_to_dataframe(gateways_unfiltered)
|
||||
df_mixnodes = self.functions._json_to_dataframe(mixnodes_unfiltered)
|
||||
versions = list(args.version)
|
||||
mixnodes_version_column = self.mixnodes_version_column
|
||||
gateways_version_column = self.gateways_version_column
|
||||
mixnodes_sum = self.version_count(df_mixnodes, mixnodes_version_column, versions, "mixnode")
|
||||
gateways_sum = self.version_count(df_gateways, gateways_version_column, versions, "gateway")
|
||||
df_final = self.final_summary(mixnodes_sum, gateways_sum, versions)
|
||||
return df_final
|
||||
|
||||
def version_count(self, df, column, versions, mode):
|
||||
count_all = []
|
||||
for version in versions:
|
||||
version_sum = df[f'{column}'].value_counts()[f'{version}']
|
||||
result = {"Node type": mode, "Version": version, "Summary":version_sum}
|
||||
count_all.append(result)
|
||||
return count_all
|
||||
|
||||
def final_summary(self, mixnodes_sum, gateways_sum, versions):
|
||||
list_final = mixnodes_sum + gateways_sum
|
||||
df_final = pd.DataFrame(list_final)
|
||||
col_names = df_final.columns
|
||||
total_summary = df_final['Summary'].sum()
|
||||
if len(versions) > 1:
|
||||
mixnodes_total = df_final.loc[df_final['Node type'] == 'mixnode', 'Summary'].sum()
|
||||
gateways_total = df_final.loc[df_final['Node type'] == 'gateway', 'Summary'].sum()
|
||||
df_append = pd.DataFrame([["mixnodes",f"versions: {versions}", f"{mixnodes_total}"],["gateways",f"versions: {versions}",f"{gateways_total}"]],columns=col_names)
|
||||
df_final = pd.concat([df_final, df_append], ignore_index=True)
|
||||
for version in versions:
|
||||
version_total = df_final.loc[df_final['Version'] == f'{version}', 'Summary'].sum()
|
||||
df_append = pd.DataFrame([["all nodes",f"{version}", f"{version_total}"]],columns=col_names)
|
||||
df_final = pd.concat([df_final, df_append], ignore_index=True)
|
||||
df_append = pd.DataFrame([["TOTAL SUMMARY",f"{versions}", f"{total_summary}"]],columns=col_names)
|
||||
df_final = pd.concat([df_final, df_append], ignore_index=True)
|
||||
return df_final
|
||||
|
||||
|
||||
class ArgParser:
|
||||
|
||||
def __init__(self):
|
||||
"""init for parser"""
|
||||
self.functions = MainFunctions()
|
||||
self.version_count = VersionCount()
|
||||
|
||||
def parser_main(self):
|
||||
"""Main function initializing ArgumentParser, storing arguments and executing commands."""
|
||||
# Top level parser
|
||||
parser = argparse.ArgumentParser(
|
||||
prog= "Nym-node API check",
|
||||
description='''Run through all endpoints and print results.'''
|
||||
)
|
||||
parser.add_argument("-V","--version", action="version", version='%(prog)s 0.1.1')
|
||||
|
||||
# sub-command parsers
|
||||
subparsers = parser.add_subparsers()
|
||||
parser_pull_stats = subparsers.add_parser('query_stats',help='Get all nodes API endpoints', aliases=['q','query'])
|
||||
parser_version_count = subparsers.add_parser('version_count', help='Sum of nodes in given version(s)', aliases=['v','version'])
|
||||
|
||||
# pull_stats arguments
|
||||
parser_pull_stats.add_argument("id", help="supply nym-node identity key")
|
||||
parser_pull_stats.add_argument("-n","--no_routing_history", help="Display node stats without routing history", action="store_true")
|
||||
parser_pull_stats.add_argument("-m","--markdown",help="Display results in markdown format", action="store_true")
|
||||
parser_pull_stats.add_argument("-o","--output",help="Save results to file (in current dir or supply with path without filename)", nargs='?',const="", type=str)
|
||||
parser_pull_stats.set_defaults(func=self.functions.display_results)
|
||||
|
||||
|
||||
# version_count arguments
|
||||
parser_version_count.add_argument('version', help="supply node versions separated with space", nargs='+')
|
||||
parser_version_count.add_argument("-m","--markdown",help="Display results in markdown format", action="store_true")
|
||||
parser_version_count.set_defaults(func=self.version_count.display_results)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
try:
|
||||
func = args.func
|
||||
try:
|
||||
args.func(args)
|
||||
except (AttributeError, KeyError) as e:
|
||||
msg = f"{e}.\nPlease run python {__file__} --help"
|
||||
self.panic(msg)
|
||||
except UnboundLocalError as e:
|
||||
msg = f"{e}.\nPlease provide a correct node identity key."
|
||||
self.panic(msg)
|
||||
except FileNotFoundError as e:
|
||||
msg = f"{e}.\nMake sure your <PATH> supplied to --output is correct."
|
||||
self.panic(msg)
|
||||
except AttributeError:
|
||||
parser.print_help(sys.stderr)
|
||||
|
||||
|
||||
def panic(self,msg):
|
||||
"""Error message print"""
|
||||
print(f"error: {msg}", file=sys.stderr)
|
||||
sys.exit(-1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
node_check = ArgParser()
|
||||
node_check.parser_main()
|
||||
@@ -274,7 +274,7 @@ where
|
||||
specification: GatewaySelectionSpecification::UniformRemote {
|
||||
must_use_tls: false,
|
||||
},
|
||||
available_gateways: current_gateways(&mut rng, &nym_apis, None).await?,
|
||||
available_gateways: current_gateways(&mut rng, &nym_apis).await?,
|
||||
wg_tun_address: None,
|
||||
});
|
||||
|
||||
|
||||
@@ -459,7 +459,7 @@ where
|
||||
);
|
||||
|
||||
let mut rng = OsRng;
|
||||
let available_gateways = current_gateways(&mut rng, &nym_api_endpoints, None).await?;
|
||||
let available_gateways = current_gateways(&mut rng, &nym_api_endpoints).await?;
|
||||
|
||||
Ok(GatewaySetup::New {
|
||||
specification: selection_spec,
|
||||
|
||||
@@ -13,10 +13,11 @@ import type { SetupMixFetchOps } from '@nymproject/mix-fetch';
|
||||
const defaultUrl = 'https://nymtech.net/favicon.svg';
|
||||
const args = { mode: 'unsafe-ignore-cors' };
|
||||
|
||||
|
||||
const mixFetchOptions: SetupMixFetchOps = {
|
||||
preferredGateway: '6Gb7ftQdKveMjPyrxDXeAtfYAX7Zg5mVZHtnRC5MmZ1B', // with WSS
|
||||
preferredGateway: '983r9LKDT9UUxx4Zsn2AH49poJ7Ep24ueR8ENfWFgCX6', // with WSS
|
||||
preferredNetworkRequester:
|
||||
'8rRGWy54oC8drFL9DepMegBt2DLrsqQwCoHMXt9nsnTo.2XjCPVbb4FpQ9hNRcXwb9mTzEAVVk1zf1tcch3wdtNEA@6Gb7ftQdKveMjPyrxDXeAtfYAX7Zg5mVZHtnRC5MmZ1B',
|
||||
'DxAc9J4eqREc8hYfDobkSc81JLkmmrhJ77zJvHShUPoi.92bnebXtBuwKiYycrpioaAiYgta5hHWkys5aSGBQg5av@983r9LKDT9UUxx4Zsn2AH49poJ7Ep24ueR8ENfWFgCX6',
|
||||
mixFetchOverride: {
|
||||
requestTimeoutMs: 60_000,
|
||||
},
|
||||
@@ -81,4 +82,5 @@ export const MixFetch = () => {
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
```
|
||||
|
||||
@@ -13,14 +13,13 @@ const defaultUrl = 'https://nymtech.net/favicon.svg';
|
||||
const args = { mode: 'unsafe-ignore-cors' };
|
||||
|
||||
const mixFetchOptions: SetupMixFetchOps = {
|
||||
preferredGateway: '6Gb7ftQdKveMjPyrxDXeAtfYAX7Zg5mVZHtnRC5MmZ1B', // with WSS
|
||||
preferredGateway: '983r9LKDT9UUxx4Zsn2AH49poJ7Ep24ueR8ENfWFgCX6', // with WSS
|
||||
preferredNetworkRequester:
|
||||
'8rRGWy54oC8drFL9DepMegBt2DLrsqQwCoHMXt9nsnTo.2XjCPVbb4FpQ9hNRcXwb9mTzEAVVk1zf1tcch3wdtNEA@6Gb7ftQdKveMjPyrxDXeAtfYAX7Zg5mVZHtnRC5MmZ1B',
|
||||
'DxAc9J4eqREc8hYfDobkSc81JLkmmrhJ77zJvHShUPoi.92bnebXtBuwKiYycrpioaAiYgta5hHWkys5aSGBQg5av@983r9LKDT9UUxx4Zsn2AH49poJ7Ep24ueR8ENfWFgCX6',
|
||||
mixFetchOverride: {
|
||||
requestTimeoutMs: 60_000,
|
||||
},
|
||||
forceTls: true, // force WSS
|
||||
extra: {},
|
||||
};
|
||||
|
||||
export const MixFetch = () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Callout } from 'nextra/components';
|
||||
import { Callout } from 'nextra/components'
|
||||
|
||||
# `mixFetch`
|
||||
|
||||
@@ -7,27 +7,32 @@ An easy way to secure parts or all of your web app is to replace calls to [`fetc
|
||||
MixFetch works the same as vanilla `fetch` as it's a proxied wrapper around the original function.
|
||||
Sounds great, are there any catches? Well, there are a few (for now):
|
||||
|
||||
1. Currently, the operators of Network Requesters that make the final request at the egress part of the Nym mixnet to the internet use a [standard allow list](https://nymtech.net/.wellknown/network-requester/standard-allowed-list.txt) in combination with their own configuration. If you are trying to access something that is not on the allow list, please check the FAQ page.
|
||||
1. Currently, the operators of Network Requesters that make the final request at the egress part of the Nym mixnet to
|
||||
the internet use a [standard allow list](https://nymtech.net/.wellknown/network-requester/standard-allowed-list.txt)
|
||||
in combination with their own configuration. If you are trying to access something that is not on the allow list, please check the FAQ page.
|
||||
|
||||
2. CA certificates in `mixFetch` are periodically updated, so if you get a certificate error, the root certificate you need might not be valid. If that's the case, [send a PR](https://github.com/nymtech/nym/pulls) if you need changes to the Certificates.
|
||||
|
||||
3. If you are using `mixFetch` in a web app with HTTPS you will need to use a gateway that has Secure Websockets to avoid getting a [mixed content](https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content) error.
|
||||
3. If you are using `mixFetch` in a web app with HTTPS you will need to use a gateway that has Secure Websockets to
|
||||
avoid getting a [mixed content](https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content) error.
|
||||
|
||||
4. For now, mixfetch doesn't work with SURBS, altough this may change in the future.
|
||||
|
||||
|
||||
Read [this article](https://blog.nymtech.net/mixfetch-like-the-fetch-api-but-via-the-mixnet-82acfd435c62) to learn more about mixFetch.
|
||||
|
||||
<Callout type="info" emoji="ℹ️">
|
||||
Right now Gateways are not required to run a Secure Websocket (WSS) listener, so only a subset of nodes running in Gateway mode have configured their nodes to do so.
|
||||
|
||||
For the moment you have to select a Gateway that has WSS enabled and Network Requester from [Harbourmaster Gateways for mixFetch list](https://harbourmaster.nymtech.net/).
|
||||
For the moment you have to select a Gateway that has WSS enabled from [this list](https://harbourmaster.nymtech.net/v1/services?wss=true).
|
||||
|
||||
```
|
||||
You can also find WSS-enabled nodes by querying the `gateways/described` endpoint on the Nym API, either via the [Swagger webpage](https://validator.nymtech.net/api/swagger/index.html) or with `curl`:
|
||||
|
||||
```
|
||||
curl -X 'GET' \
|
||||
'https://validator.nymtech.net/api/v1/gateways/described' \
|
||||
-H 'accept: application/json'
|
||||
```
|
||||
|
||||
'https://validator.nymtech.net/api/v1/gateways/described' \
|
||||
-H 'accept: application/json'
|
||||
```
|
||||
</Callout>
|
||||
|
||||
```ts
|
||||
@@ -35,9 +40,9 @@ curl -X 'GET' \
|
||||
import type { SetupMixFetchOps } from '@nymproject/mix-fetch';
|
||||
|
||||
const mixFetchOptions: SetupMixFetchOps = {
|
||||
preferredGateway: '6Gb7ftQdKveMjPyrxDXeAtfYAX7Zg5mVZHtnRC5MmZ1B', // with WSS
|
||||
preferredGateway: '983r9LKDT9UUxx4Zsn2AH49poJ7Ep24ueR8ENfWFgCX6', // with WSS
|
||||
preferredNetworkRequester:
|
||||
'8rRGWy54oC8drFL9DepMegBt2DLrsqQwCoHMXt9nsnTo.2XjCPVbb4FpQ9hNRcXwb9mTzEAVVk1zf1tcch3wdtNEA@6Gb7ftQdKveMjPyrxDXeAtfYAX7Zg5mVZHtnRC5MmZ1B',
|
||||
'DxAc9J4eqREc8hYfDobkSc81JLkmmrhJ77zJvHShUPoi.92bnebXtBuwKiYycrpioaAiYgta5hHWkys5aSGBQg5av@983r9LKDT9UUxx4Zsn2AH49poJ7Ep24ueR8ENfWFgCX6',
|
||||
mixFetchOverride: {
|
||||
requestTimeoutMs: 60_000,
|
||||
},
|
||||
@@ -47,7 +52,6 @@ const mixFetchOptions: SetupMixFetchOps = {
|
||||
```
|
||||
|
||||
##### Environment Setup
|
||||
|
||||
Begin by creating a directory and configuring your application environment:
|
||||
|
||||
```bash
|
||||
@@ -55,7 +59,6 @@ npm create vite@latest
|
||||
```
|
||||
|
||||
During the environment setup, choose React and subsequently opt for Typescript if you want your application to function smoothly following this tutorial. Next, navigate to your application directory and run the following commands:
|
||||
|
||||
```bash
|
||||
cd < YOUR_APP >
|
||||
npm i
|
||||
@@ -63,36 +66,33 @@ npm run dev
|
||||
```
|
||||
|
||||
##### Installation
|
||||
|
||||
Install the required package:
|
||||
|
||||
```bash
|
||||
npm install @nymproject/mix-fetch-full-fat
|
||||
```
|
||||
|
||||
##### Imports
|
||||
|
||||
In the `src` folder, open the `App.tsx` file and delete all the code.
|
||||
|
||||
Import the client in your app:
|
||||
````js
|
||||
import { mixFetch } from "@nymproject/mix-fetch-full-fat";
|
||||
````
|
||||
|
||||
```js
|
||||
import { mixFetch } from '@nymproject/mix-fetch-full-fat';
|
||||
```
|
||||
|
||||
##### Example: using the `mixFetch` client:
|
||||
|
||||
`Get` and `Post` outputs will be observable from your console.
|
||||
|
||||
```ts
|
||||
import './App.css';
|
||||
import "./App.css";
|
||||
import { mixFetch, SetupMixFetchOps } from '@nymproject/mix-fetch-full-fat';
|
||||
import React from 'react';
|
||||
|
||||
const mixFetchOptions: SetupMixFetchOps = {
|
||||
preferredGateway: '6Gb7ftQdKveMjPyrxDXeAtfYAX7Zg5mVZHtnRC5MmZ1B', // with WSS
|
||||
preferredGateway: '983r9LKDT9UUxx4Zsn2AH49poJ7Ep24ueR8ENfWFgCX6', // with WSS
|
||||
preferredNetworkRequester:
|
||||
'8rRGWy54oC8drFL9DepMegBt2DLrsqQwCoHMXt9nsnTo.2XjCPVbb4FpQ9hNRcXwb9mTzEAVVk1zf1tcch3wdtNEA@6Gb7ftQdKveMjPyrxDXeAtfYAX7Zg5mVZHtnRC5MmZ1B',
|
||||
'DxAc9J4eqREc8hYfDobkSc81JLkmmrhJ77zJvHShUPoi.92bnebXtBuwKiYycrpioaAiYgta5hHWkys5aSGBQg5av@983r9LKDT9UUxx4Zsn2AH49poJ7Ep24ueR8ENfWFgCX6',
|
||||
mixFetchOverride: {
|
||||
requestTimeoutMs: 60_000,
|
||||
},
|
||||
@@ -100,62 +100,48 @@ const mixFetchOptions: SetupMixFetchOps = {
|
||||
extra: {},
|
||||
};
|
||||
|
||||
|
||||
export function HttpGET() {
|
||||
const [html, setHtml] = React.useState('');
|
||||
async function get() {
|
||||
//Make sure the URL is whitelisted (see 'standard allowed list') otherwise you will get a network requester filter check error
|
||||
const response = await mixFetch('https://nymtech.net/favicon.svg', { mode: 'unsafe-ignore-cors' }, mixFetchOptions);
|
||||
const text = await response.text();
|
||||
console.log('response was', text);
|
||||
setHtml(html);
|
||||
}
|
||||
const [html, setHtml] = React.useState('')
|
||||
async function get () {
|
||||
//Make sure the URL is whitelisted (see 'standard allowed list') otherwise you will get a network requester filter check error
|
||||
const response = await mixFetch('https://nymtech.net/favicon.svg', { mode: 'unsafe-ignore-cors' }, mixFetchOptions)
|
||||
const text = await response.text()
|
||||
console.log('response was', text)
|
||||
setHtml(html)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<button
|
||||
onClick={() => {
|
||||
get();
|
||||
}}
|
||||
>
|
||||
Get
|
||||
</button>
|
||||
<button onClick={() => { get() }}>Get</button>
|
||||
</>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
export function HttpPOST() {
|
||||
async function post() {
|
||||
//Make sure the URL is whitelisted (see 'standard allowed list') otherwise you will get a network requester filter check error
|
||||
const apiResponse = await mixFetch(
|
||||
'https://httpbin.org/post',
|
||||
{
|
||||
async function post () {
|
||||
//Make sure the URL is whitelisted (see 'standard allowed list') otherwise you will get a network requester filter check error
|
||||
const apiResponse = await mixFetch('https://httpbin.org/post', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ foo: 'bar' }),
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
},
|
||||
mixFetchOptions,
|
||||
);
|
||||
console.log(apiResponse);
|
||||
}
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
}, mixFetchOptions)
|
||||
console.log(apiResponse)
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<button
|
||||
onClick={() => {
|
||||
post();
|
||||
}}
|
||||
>
|
||||
Post
|
||||
</button>
|
||||
<button onClick={() => { post() }}>Post</button>
|
||||
</>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<>
|
||||
<HttpGET />
|
||||
<HttpPOST />
|
||||
<HttpGET/>
|
||||
<HttpPOST/>
|
||||
</>
|
||||
);
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ import { appendOutput, appendImageOutput } from './utils';
|
||||
async function main() {
|
||||
// options for mixFetch (you can also set these with the `createMixFetch` function
|
||||
const mixFetchOptions = {
|
||||
preferredGateway: '6Gb7ftQdKveMjPyrxDXeAtfYAX7Zg5mVZHtnRC5MmZ1B', // with WSS
|
||||
preferredGateway: 'E3mvZTHQCdBvhfr178Swx9g4QG3kkRUun7YnToLMcMbM', // with WSS
|
||||
preferredNetworkRequester:
|
||||
'8rRGWy54oC8drFL9DepMegBt2DLrsqQwCoHMXt9nsnTo.2XjCPVbb4FpQ9hNRcXwb9mTzEAVVk1zf1tcch3wdtNEA@6Gb7ftQdKveMjPyrxDXeAtfYAX7Zg5mVZHtnRC5MmZ1B',
|
||||
'GiRjFWrMxt58pEMuusm4yT3RxoMD1MMPrR9M2N4VWRJP.3CNZBPq4vg7v7qozjGjdPMXcvDmkbWPCgbGCjQVw9n6Z@2xU4CBE6QiiYt6EyBXSALwxkNvM7gqJfjHXaMkjiFmYW',
|
||||
mixFetchOverride: {
|
||||
requestTimeoutMs: 60_000,
|
||||
},
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
"comlink": "^4.3.1",
|
||||
"fake-indexeddb": "^4.0.2",
|
||||
"rollup-plugin-polyfill": "^4.2.0",
|
||||
"ws": "^8.17.1"
|
||||
"ws": "^8.14.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-commonjs": "^24.0.1",
|
||||
|
||||
@@ -2847,10 +2847,10 @@ wrappy@1:
|
||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==
|
||||
|
||||
ws@^8.17.1:
|
||||
version "8.17.1"
|
||||
resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b"
|
||||
integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==
|
||||
ws@^8.14.2:
|
||||
version "8.14.2"
|
||||
resolved "https://registry.yarnpkg.com/ws/-/ws-8.14.2.tgz#6c249a806eb2db7a20d26d51e7709eab7b2e6c7f"
|
||||
integrity sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==
|
||||
|
||||
ws@~8.11.0:
|
||||
version "8.11.0"
|
||||
|
||||
@@ -29,9 +29,9 @@ async function main() {
|
||||
const args = { mode: 'unsafe-ignore-cors' };
|
||||
|
||||
const resp = await mixFetch(url, args, {
|
||||
preferredGateway: '6Gb7ftQdKveMjPyrxDXeAtfYAX7Zg5mVZHtnRC5MmZ1B', // with WSS
|
||||
preferredGateway: '2BuMSfMW3zpeAjKXyKLhmY4QW1DXurrtSPEJ6CjX3SEh',
|
||||
preferredNetworkRequester:
|
||||
'8rRGWy54oC8drFL9DepMegBt2DLrsqQwCoHMXt9nsnTo.2XjCPVbb4FpQ9hNRcXwb9mTzEAVVk1zf1tcch3wdtNEA@6Gb7ftQdKveMjPyrxDXeAtfYAX7Zg5mVZHtnRC5MmZ1B',
|
||||
'GiRjFWrMxt58pEMuusm4yT3RxoMD1MMPrR9M2N4VWRJP.3CNZBPq4vg7v7qozjGjdPMXcvDmkbWPCgbGCjQVw9n6Z@2xU4CBE6QiiYt6EyBXSALwxkNvM7gqJfjHXaMkjiFmYW',
|
||||
});
|
||||
console.log({ resp });
|
||||
const text = await resp.text();
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
[package]
|
||||
name = "mixnet-authenticator"
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
homepage.workspace = true
|
||||
documentation.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
[dependencies]
|
||||
serde = { workspace = true, features = ["derive"] }
|
||||
|
||||
nym-bin-common = { path = "../../common/bin-common" }
|
||||
nym-client-core = { path = "../../common/client-core" }
|
||||
@@ -0,0 +1,21 @@
|
||||
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, PartialEq, Serialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct Config {
|
||||
#[serde(flatten)]
|
||||
pub base: BaseClientConfig,
|
||||
|
||||
#[serde(default)]
|
||||
pub network_requester: NetworkRequester,
|
||||
|
||||
pub storage_paths: NetworkRequesterPaths,
|
||||
|
||||
#[serde(default)]
|
||||
pub network_requester_debug: Debug,
|
||||
|
||||
pub logging: LoggingSettings,
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use nym_client_core::config::disk_persistence::CommonClientPaths;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
pub const DEFAULT_DESCRIPTION_FILENAME: &str = "description.toml";
|
||||
|
||||
#[derive(Debug, Deserialize, PartialEq, Eq, Serialize, Clone)]
|
||||
pub struct IpPacketRouterPaths {
|
||||
#[serde(flatten)]
|
||||
pub common_paths: CommonClientPaths,
|
||||
|
||||
/// Location of the file containing our description
|
||||
pub ip_packet_router_description: PathBuf,
|
||||
}
|
||||
|
||||
impl IpPacketRouterPaths {
|
||||
pub fn new_base<P: AsRef<Path>>(base_data_directory: P) -> Self {
|
||||
let base_dir = base_data_directory.as_ref();
|
||||
|
||||
Self {
|
||||
common_paths: CommonClientPaths::new_base(base_dir),
|
||||
ip_packet_router_description: base_dir.join(DEFAULT_DESCRIPTION_FILENAME),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
pub mod config;
|
||||
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
||||
@@ -36,7 +36,6 @@ impl OnStartData {
|
||||
pub struct IpPacketRouter {
|
||||
#[allow(unused)]
|
||||
config: Config,
|
||||
|
||||
wait_for_gateway: bool,
|
||||
custom_topology_provider: Option<Box<dyn TopologyProvider + Send + Sync>>,
|
||||
custom_gateway_transceiver: Option<Box<dyn GatewayTransceiver + Send + Sync>>,
|
||||
@@ -80,12 +79,6 @@ impl IpPacketRouter {
|
||||
self
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn with_minimum_gateway_performance(mut self, minimum_gateway_performance: u8) -> Self {
|
||||
self.config.base.debug.topology.minimum_gateway_performance = minimum_gateway_performance;
|
||||
self
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
#[allow(unused)]
|
||||
pub fn with_on_start(mut self, on_start: oneshot::Sender<OnStartData>) -> Self {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
[package]
|
||||
name = "nym-network-requester"
|
||||
license = "GPL-3.0"
|
||||
version = "1.1.38"
|
||||
version = "1.1.36"
|
||||
authors.workspace = true
|
||||
edition.workspace = true
|
||||
rust-version = "1.70"
|
||||
|
||||
@@ -51,7 +51,6 @@ pub(crate) fn new_legacy_request_version() -> RequestVersion<Socks5Request> {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub struct OnStartData {
|
||||
// to add more fields as required
|
||||
pub address: Recipient,
|
||||
@@ -222,15 +221,6 @@ impl NRServiceProviderBuilder {
|
||||
self
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
// this is a false positive, this method is actually called when used as a library
|
||||
// but clippy complains about it when building the binary
|
||||
#[allow(unused)]
|
||||
pub fn with_minimum_gateway_performance(mut self, minimum_gateway_performance: u8) -> Self {
|
||||
self.config.base.debug.topology.minimum_gateway_performance = minimum_gateway_performance;
|
||||
self
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
// this is a false positive, this method is actually called when used as a library
|
||||
// but clippy complains about it when building the binary
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nym-cli"
|
||||
version = "1.1.38"
|
||||
version = "1.1.36"
|
||||
authors.workspace = true
|
||||
edition = "2021"
|
||||
license.workspace = true
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "nymvisor"
|
||||
version = "0.1.3"
|
||||
version = "0.1.1"
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
homepage.workspace = true
|
||||
@@ -21,7 +21,7 @@ hex = { workspace = true }
|
||||
humantime = { workspace = true }
|
||||
humantime-serde = { workspace = true }
|
||||
nix = { workspace = true, features = ["signal", "fs"] }
|
||||
reqwest = { workspace = true, features = ["json", "stream", "rustls-tls"] }
|
||||
reqwest = { workspace = true, features = ["json", "stream"] }
|
||||
serde = { workspace = true, features = ["derive"] }
|
||||
serde_json = { workspace = true }
|
||||
sha2 = "0.10.8"
|
||||
|
||||
@@ -11,6 +11,6 @@
|
||||
"dependencies": {
|
||||
"@nymproject/nym-client-wasm": "file:../../../dist/node/wasm/client",
|
||||
"indexeddbshim": "^13.0.0-pre.1",
|
||||
"ws": "^8.17.1"
|
||||
"ws": "^8.13.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -888,10 +888,10 @@ wrappy@1:
|
||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==
|
||||
|
||||
ws@^8.17.1:
|
||||
version "8.17.1"
|
||||
resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b"
|
||||
integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==
|
||||
ws@^8.13.0:
|
||||
version "8.13.0"
|
||||
resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0"
|
||||
integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==
|
||||
|
||||
yallist@^4.0.0:
|
||||
version "4.0.0"
|
||||
|
||||
@@ -497,11 +497,11 @@ brace-expansion@^1.1.7:
|
||||
concat-map "0.0.1"
|
||||
|
||||
braces@^3.0.2, braces@~3.0.2:
|
||||
version "3.0.3"
|
||||
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789"
|
||||
integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
|
||||
integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
|
||||
dependencies:
|
||||
fill-range "^7.1.1"
|
||||
fill-range "^7.0.1"
|
||||
|
||||
browserslist@^4.14.5:
|
||||
version "4.21.5"
|
||||
@@ -903,10 +903,10 @@ faye-websocket@^0.11.3:
|
||||
dependencies:
|
||||
websocket-driver ">=0.5.1"
|
||||
|
||||
fill-range@^7.1.1:
|
||||
version "7.1.1"
|
||||
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292"
|
||||
integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==
|
||||
fill-range@^7.0.1:
|
||||
version "7.0.1"
|
||||
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
|
||||
integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==
|
||||
dependencies:
|
||||
to-regex-range "^5.0.1"
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ pub trait HarbourMasterApiClientExt: ApiClient {
|
||||
impl HarbourMasterApiClientExt for Client {}
|
||||
|
||||
// https://gitlab.nymte.ch/nym/shipyard-test-and-earn/-/blob/main/harbour-master/src/http/mod.rs#L13
|
||||
#[allow(dead_code)]
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct PagedResult<T> {
|
||||
pub page: u32,
|
||||
@@ -48,7 +47,6 @@ pub struct PagedResult<T> {
|
||||
}
|
||||
|
||||
// https://gitlab.nymte.ch/nym/shipyard-test-and-earn/-/blob/main/harbour-master/src/http/services.rs#L32
|
||||
#[allow(dead_code)]
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct ServiceNew {
|
||||
pub service_provider_client_id: String,
|
||||
|
||||
Reference in New Issue
Block a user