Compare commits
161 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7bc2c070e8 | |||
| edce7a5d3f | |||
| 04d09fba7b | |||
| 3f4361cb8a | |||
| b4157a67a2 | |||
| 33deb09da8 | |||
| 5bb59466ab | |||
| da1d7874bb | |||
| 9e692bfba4 | |||
| 38bc98ecc1 | |||
| 937be101d2 | |||
| b514b0a747 | |||
| 0d4979a2f1 | |||
| f15a1d4a9a | |||
| 7527deab1e | |||
| b8eeaa9211 | |||
| a6be529103 | |||
| 04fc39a544 | |||
| 6082e817b7 | |||
| 5fd0ab9325 | |||
| 8ebfa810fa | |||
| 5b3f986602 | |||
| 8c2255bc9c | |||
| f5c262dd7c | |||
| e5b10b3995 | |||
| 434518ca43 | |||
| 1ff7969fed | |||
| d43d01ee75 | |||
| 94ed32d493 | |||
| c4f5642c52 | |||
| de2dca7017 | |||
| 63f86f088c | |||
| a8f36f89ab | |||
| 2e0fa87129 | |||
| 4f45ff6690 | |||
| 54f3ded4e1 | |||
| eeadec80fe | |||
| c86f0a18cc | |||
| 3e233b776e | |||
| 9d0dddb024 | |||
| fc52c64ea7 | |||
| 0f7ac8e694 | |||
| d4d0b71341 | |||
| c47dbf2e11 | |||
| 8ccd0d70e1 | |||
| 271000b0a5 | |||
| eb214a164e | |||
| e0e88d2b80 | |||
| f7d3599b58 | |||
| b55ad654f9 | |||
| 55edf9246a | |||
| fe47b76354 | |||
| efb9dd4e55 | |||
| a2ca65447b | |||
| d7ecdf71ba | |||
| b30465cbae | |||
| 1e58de0e93 | |||
| 68b4d93f94 | |||
| 6219114ac2 | |||
| 6d927c6295 | |||
| 159314d325 | |||
| cc74172e7a | |||
| 1eb6fd8e2a | |||
| c9b570b48e | |||
| a996fbe54d | |||
| ceb8322185 | |||
| b45d45f917 | |||
| 13e8a9fca7 | |||
| ebb9b37786 | |||
| 9e29b71ff5 | |||
| 32684ab456 | |||
| 8e31cea97d | |||
| 02a18fdb43 | |||
| 5551612c8b | |||
| 2919d4cee5 | |||
| 000986eadc | |||
| 8ec308567c | |||
| 9dcebf69c3 | |||
| aac1682414 | |||
| 50a5f8311c | |||
| fac373c1db | |||
| 54282fa098 | |||
| 08f856bb5a | |||
| f28f11ff5d | |||
| 025573b1fc | |||
| 3c307ec2d3 | |||
| 66b1927ace | |||
| 1e7a3d7aca | |||
| 6ff608aafb | |||
| dca54b62d0 | |||
| a6acffc400 | |||
| f6fa071d9d | |||
| 67920ab1bc | |||
| ddadd3c2e9 | |||
| bd31db24b5 | |||
| ca470ab757 | |||
| 561147573b | |||
| 314336a386 | |||
| 92efad3116 | |||
| 1907170e92 | |||
| 044c537a88 | |||
| 7b1a05acda | |||
| 8c7e9501e4 | |||
| c85be2b99b | |||
| 2a4fdc83c4 | |||
| 3445ec88a7 | |||
| c0fd0b7b47 | |||
| fbe4931745 | |||
| 430928d75a | |||
| 4fa3bd4b72 | |||
| 393bbc188e | |||
| 66637be98e | |||
| a6045b7956 | |||
| 93157f5308 | |||
| 24d714c642 | |||
| 6ac2d8939d | |||
| e58c53dd1a | |||
| 1b1373fb2f | |||
| fa0a681529 | |||
| 5ae9510933 | |||
| 927558be73 | |||
| 28c3e3bb6e | |||
| b485085a55 | |||
| 0e6b505d50 | |||
| e0cdb5978f | |||
| ae69ecea54 | |||
| 3bf7ff0870 | |||
| 87bc27daa1 | |||
| cf8910bb72 | |||
| d00fd92d9a | |||
| 21d5ecd4b4 | |||
| 505ba9c83d | |||
| c55499df37 | |||
| cdc8840868 | |||
| 1e17041d8a | |||
| d46c51a966 | |||
| 2f4e74d180 | |||
| 09feaf4fe1 | |||
| 032e990c37 | |||
| 4d7262e051 | |||
| 2a2ecab852 | |||
| f7c39397b3 | |||
| 2c47c932e8 | |||
| 21acab9857 | |||
| e18dd80b36 | |||
| 712fa519e9 | |||
| cf2afc6adf | |||
| 8318c7ff61 | |||
| e36d4f105d | |||
| 14f659337c | |||
| cc2d4c3376 | |||
| d8c3a3f738 | |||
| 7d561bff63 | |||
| 9daa2f6e98 | |||
| 74c3dbe169 | |||
| 8c4f2fde78 | |||
| e5efba2d45 | |||
| 02bfa9a7ab | |||
| cea6ac1d3e | |||
| 1ac262ec90 | |||
| 7c1fca8ce4 |
@@ -0,0 +1,7 @@
|
||||
.git
|
||||
.github
|
||||
.gitignore
|
||||
**/node_modules
|
||||
**/target
|
||||
dist
|
||||
documentation
|
||||
@@ -1,9 +1,10 @@
|
||||
name: ci-sdk-docs-typescript
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
paths:
|
||||
- "sdk/typescript/**"
|
||||
- "documentation/"
|
||||
- "wasm/**"
|
||||
|
||||
jobs:
|
||||
@@ -28,7 +29,7 @@ jobs:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.20'
|
||||
go-version: "1.20"
|
||||
|
||||
- name: Install wasm-pack
|
||||
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
||||
@@ -36,7 +37,7 @@ jobs:
|
||||
- name: Install wasm-opt
|
||||
uses: ./.github/actions/install-wasm-opt
|
||||
with:
|
||||
version: '116'
|
||||
version: "116"
|
||||
|
||||
- name: Build branch WASM packages
|
||||
run: make sdk-wasm-build
|
||||
+4
-1
@@ -48,4 +48,7 @@ foxyfox.env
|
||||
|
||||
.next
|
||||
ppa-private-key.b64
|
||||
ppa-private-key.asc
|
||||
ppa-private-key.asc
|
||||
nym-network-monitor/topology.json
|
||||
nym-network-monitor/__pycache__
|
||||
nym-network-monitor/*.key
|
||||
Generated
+89
@@ -347,6 +347,14 @@ version = "1.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
|
||||
|
||||
[[package]]
|
||||
name = "autodoc"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"env_logger 0.11.5",
|
||||
"log",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "axum"
|
||||
version = "0.6.20"
|
||||
@@ -1858,6 +1866,7 @@ dependencies = [
|
||||
"lock_api",
|
||||
"once_cell",
|
||||
"parking_lot_core 0.9.10",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2184,6 +2193,16 @@ dependencies = [
|
||||
"cfg-if",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "env_filter"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab"
|
||||
dependencies = [
|
||||
"log",
|
||||
"regex",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "env_logger"
|
||||
version = "0.7.1"
|
||||
@@ -2207,6 +2226,19 @@ dependencies = [
|
||||
"regex",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "env_logger"
|
||||
version = "0.11.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d"
|
||||
dependencies = [
|
||||
"anstream",
|
||||
"anstyle",
|
||||
"env_filter",
|
||||
"humantime 2.1.0",
|
||||
"log",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "equivalent"
|
||||
version = "1.0.1"
|
||||
@@ -2397,6 +2429,12 @@ dependencies = [
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fixedbitset"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80"
|
||||
|
||||
[[package]]
|
||||
name = "flate2"
|
||||
version = "1.0.30"
|
||||
@@ -4253,6 +4291,7 @@ dependencies = [
|
||||
"nym-sphinx",
|
||||
"nym-task",
|
||||
"nym-topology",
|
||||
"nym-types",
|
||||
"nym-validator-client",
|
||||
"nym-vesting-contract-common",
|
||||
"okapi",
|
||||
@@ -4579,6 +4618,7 @@ dependencies = [
|
||||
"nym-topology",
|
||||
"nym-validator-client",
|
||||
"rand 0.8.5",
|
||||
"rand_chacha 0.3.1",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2 0.10.8",
|
||||
@@ -5410,6 +5450,36 @@ dependencies = [
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nym-network-monitor"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"axum 0.7.5",
|
||||
"clap 4.5.7",
|
||||
"dashmap",
|
||||
"futures",
|
||||
"log",
|
||||
"nym-bin-common",
|
||||
"nym-crypto",
|
||||
"nym-network-defaults",
|
||||
"nym-sdk",
|
||||
"nym-sphinx",
|
||||
"nym-topology",
|
||||
"nym-types",
|
||||
"nym-validator-client",
|
||||
"petgraph",
|
||||
"rand 0.8.5",
|
||||
"rand_chacha 0.3.1",
|
||||
"reqwest 0.12.4",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
"utoipa",
|
||||
"utoipa-swagger-ui",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nym-network-requester"
|
||||
version = "1.1.40"
|
||||
@@ -5575,6 +5645,7 @@ dependencies = [
|
||||
"nym-task",
|
||||
"nym-topology",
|
||||
"rand 0.8.5",
|
||||
"rand_chacha 0.3.1",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thiserror",
|
||||
@@ -5858,6 +5929,7 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"log",
|
||||
"nym-crypto",
|
||||
"nym-metrics",
|
||||
"nym-mixnet-contract-common",
|
||||
"nym-sphinx-acknowledgements",
|
||||
"nym-sphinx-addressing",
|
||||
@@ -5871,6 +5943,7 @@ dependencies = [
|
||||
"nym-sphinx-types",
|
||||
"nym-topology",
|
||||
"rand 0.8.5",
|
||||
"rand_chacha 0.3.1",
|
||||
"rand_distr",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
@@ -5927,12 +6000,17 @@ dependencies = [
|
||||
name = "nym-sphinx-chunking"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"dashmap",
|
||||
"log",
|
||||
"nym-crypto",
|
||||
"nym-metrics",
|
||||
"nym-sphinx-addressing",
|
||||
"nym-sphinx-params",
|
||||
"nym-sphinx-types",
|
||||
"rand 0.8.5",
|
||||
"serde",
|
||||
"thiserror",
|
||||
"utoipa",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -6046,6 +6124,7 @@ dependencies = [
|
||||
"nym-sphinx-routing",
|
||||
"nym-sphinx-types",
|
||||
"rand 0.8.5",
|
||||
"reqwest 0.12.4",
|
||||
"semver 0.11.0",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -6682,6 +6761,16 @@ dependencies = [
|
||||
"sha2 0.10.8",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "petgraph"
|
||||
version = "0.6.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db"
|
||||
dependencies = [
|
||||
"fixedbitset",
|
||||
"indexmap 2.2.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pin-project"
|
||||
version = "1.1.5"
|
||||
|
||||
+3
-1
@@ -14,7 +14,6 @@ panic = "abort"
|
||||
opt-level = 3
|
||||
|
||||
[workspace]
|
||||
|
||||
resolver = "2"
|
||||
members = [
|
||||
"clients/native",
|
||||
@@ -94,6 +93,7 @@ members = [
|
||||
"common/wasm/utils",
|
||||
"common/wireguard",
|
||||
"common/wireguard-types",
|
||||
"documentation/autodoc",
|
||||
"explorer-api",
|
||||
"explorer-api/explorer-api-requests",
|
||||
"explorer-api/explorer-client",
|
||||
@@ -106,6 +106,7 @@ members = [
|
||||
"service-providers/common",
|
||||
"service-providers/ip-packet-router",
|
||||
"service-providers/network-requester",
|
||||
"nym-network-monitor",
|
||||
"nym-api",
|
||||
"nym-browser-extension/storage",
|
||||
"nym-api/nym-api-requests",
|
||||
@@ -159,6 +160,7 @@ homepage = "https://nymtech.net"
|
||||
documentation = "https://nymtech.net"
|
||||
edition = "2021"
|
||||
license = "Apache-2.0"
|
||||
rust-version = "1.80"
|
||||
|
||||
[workspace.dependencies]
|
||||
addr = "0.15.6"
|
||||
|
||||
@@ -19,6 +19,7 @@ futures = { workspace = true }
|
||||
humantime-serde = { workspace = true }
|
||||
log = { workspace = true }
|
||||
rand = { workspace = true }
|
||||
rand_chacha = { workspace = true }
|
||||
serde = { workspace = true, features = ["derive"] }
|
||||
serde_json = { workspace = true }
|
||||
sha2 = { workspace = true }
|
||||
|
||||
@@ -458,7 +458,7 @@ impl PacketStatisticsControl {
|
||||
|
||||
fn report_rates(&self) {
|
||||
if let Some((_, rates)) = self.rates.back() {
|
||||
log::info!("{}", rates.summary());
|
||||
log::debug!("{}", rates.summary());
|
||||
log::debug!("{}", rates.detailed_summary());
|
||||
}
|
||||
}
|
||||
@@ -486,7 +486,7 @@ impl PacketStatisticsControl {
|
||||
// Check what the number of retransmissions was during the recording window
|
||||
if let Some((_, start_stats)) = self.history.front() {
|
||||
let delta = self.stats.clone() - start_stats.clone();
|
||||
log::info!(
|
||||
log::debug!(
|
||||
"mix packet retransmissions/real mix packets: {}/{}",
|
||||
delta.retransmissions_queued,
|
||||
delta.real_packets_queued,
|
||||
|
||||
@@ -453,6 +453,7 @@ where
|
||||
|
||||
let mut pending_acks = Vec::with_capacity(fragments.len());
|
||||
let mut real_messages = Vec::with_capacity(fragments.len());
|
||||
debug!("Splitting message into {} fragments", fragments.len());
|
||||
for fragment in fragments {
|
||||
// we need to clone it because we need to keep it in memory in case we had to retransmit
|
||||
// it. And then we'd need to recreate entire ACK again.
|
||||
|
||||
@@ -90,4 +90,6 @@ default = ["http-client"]
|
||||
http-client = ["cosmrs/rpc"]
|
||||
generate-ts = []
|
||||
contract-testing = ["nym-mixnet-contract-common/contract-testing"]
|
||||
|
||||
# Features below are added to make clippy happy, it seems like they're unused we should remove them
|
||||
tendermint-rpc-http-client = ["tendermint-rpc/http-client"]
|
||||
tendermint-rpc-websocket-client = ["tendermint-rpc/websocket-client"]
|
||||
|
||||
@@ -49,5 +49,7 @@ pub const COMPUTE_REWARD_ESTIMATION: &str = "compute-reward-estimation";
|
||||
pub const AVG_UPTIME: &str = "avg_uptime";
|
||||
pub const STAKE_SATURATION: &str = "stake-saturation";
|
||||
pub const INCLUSION_CHANCE: &str = "inclusion-probability";
|
||||
pub const SUBMIT_GATEWAY: &str = "submit-gateway-monitoring-results";
|
||||
pub const SUBMIT_NODE: &str = "submit-node-monitoring-results";
|
||||
|
||||
pub const SERVICE_PROVIDERS: &str = "services";
|
||||
|
||||
@@ -300,8 +300,8 @@ where
|
||||
}
|
||||
|
||||
#[cfg(any(
|
||||
feature = "tendermint-rpc/http-client",
|
||||
feature = "tendermint-rpc/websocket-client"
|
||||
feature = "tendermint-rpc-http-client",
|
||||
feature = "tendermint-rpc-websocket-client"
|
||||
))]
|
||||
async fn wait_until_healthy<T>(&self, timeout: T) -> Result<(), Error>
|
||||
where
|
||||
|
||||
@@ -820,8 +820,8 @@ where
|
||||
}
|
||||
|
||||
#[cfg(any(
|
||||
feature = "tendermint-rpc/http-client",
|
||||
feature = "tendermint-rpc/websocket-client"
|
||||
feature = "tendermint-rpc-http-client",
|
||||
feature = "tendermint-rpc-websocket-client"
|
||||
))]
|
||||
async fn wait_until_healthy<T>(&self, timeout: T) -> Result<(), Error>
|
||||
where
|
||||
|
||||
@@ -300,8 +300,8 @@ pub trait TendermintRpcClient {
|
||||
}
|
||||
|
||||
#[cfg(any(
|
||||
feature = "tendermint-rpc/http-client",
|
||||
feature = "tendermint-rpc/websocket-client"
|
||||
feature = "tendermint-rpc-http-client",
|
||||
feature = "tendermint-rpc-websocket-client"
|
||||
))]
|
||||
/// Poll the `/health` endpoint until it returns a successful result or
|
||||
/// the given `timeout` has elapsed.
|
||||
@@ -518,8 +518,8 @@ mod non_wasm {
|
||||
}
|
||||
|
||||
#[cfg(any(
|
||||
feature = "tendermint-rpc/http-client",
|
||||
feature = "tendermint-rpc/websocket-client"
|
||||
feature = "tendermint-rpc-http-client",
|
||||
feature = "tendermint-rpc-websocket-client"
|
||||
))]
|
||||
async fn wait_until_healthy<T>(&self, timeout: T) -> Result<(), Error>
|
||||
where
|
||||
|
||||
@@ -22,7 +22,7 @@ use tracing::{debug, error};
|
||||
pub mod bandwidth;
|
||||
pub mod error;
|
||||
mod inboxes;
|
||||
pub(crate) mod models;
|
||||
pub mod models;
|
||||
mod shared_keys;
|
||||
mod tickets;
|
||||
#[cfg(feature = "wireguard")]
|
||||
|
||||
@@ -9,11 +9,12 @@ license.workspace = true
|
||||
[dependencies]
|
||||
futures = { workspace = true }
|
||||
rand = { workspace = true }
|
||||
rand_chacha = { workspace = true }
|
||||
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
tokio = { workspace = true, features = ["macros"]}
|
||||
tokio = { workspace = true, features = ["macros"] }
|
||||
|
||||
nym-crypto = { path = "../crypto", features = ["asymmetric"] }
|
||||
nym-task = { path = "../task" }
|
||||
|
||||
@@ -294,4 +294,8 @@ impl<R: CryptoRng + Rng> FragmentPreparer for NodeTester<R> {
|
||||
fn average_ack_delay(&self) -> Duration {
|
||||
self.average_ack_delay
|
||||
}
|
||||
|
||||
fn nonce(&self) -> i32 {
|
||||
1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ repository = { workspace = true }
|
||||
log = { workspace = true }
|
||||
rand = { workspace = true }
|
||||
rand_distr = { workspace = true }
|
||||
rand_chacha = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
|
||||
nym-sphinx-acknowledgements = { path = "acknowledgements" }
|
||||
@@ -27,10 +28,13 @@ nym-sphinx-types = { path = "types" }
|
||||
# to separate crate?
|
||||
nym-crypto = { path = "../crypto", version = "0.4.0" }
|
||||
nym-topology = { path = "../topology" }
|
||||
nym-metrics = { path = "../nym-metrics" }
|
||||
|
||||
[dev-dependencies]
|
||||
nym-mixnet-contract-common = { path = "../cosmwasm-smart-contracts/mixnet-contract" }
|
||||
nym-crypto = { path = "../crypto", version = "0.4.0", features = ["asymmetric"] }
|
||||
nym-crypto = { path = "../crypto", version = "0.4.0", features = [
|
||||
"asymmetric",
|
||||
] }
|
||||
|
||||
# do not include this when compiling into wasm as it somehow when combined together with reqwest, it will require
|
||||
# net2 via tokio-util -> tokio -> mio -> net2
|
||||
@@ -43,5 +47,13 @@ features = ["sync"]
|
||||
|
||||
[features]
|
||||
default = ["sphinx"]
|
||||
sphinx = ["nym-crypto/sphinx", "nym-sphinx-params/sphinx", "nym-sphinx-types/sphinx"]
|
||||
outfox = ["nym-crypto/outfox", "nym-sphinx-params/outfox", "nym-sphinx-types/outfox"]
|
||||
sphinx = [
|
||||
"nym-crypto/sphinx",
|
||||
"nym-sphinx-params/sphinx",
|
||||
"nym-sphinx-types/sphinx",
|
||||
]
|
||||
outfox = [
|
||||
"nym-crypto/outfox",
|
||||
"nym-sphinx-params/outfox",
|
||||
"nym-sphinx-types/outfox",
|
||||
]
|
||||
|
||||
@@ -13,7 +13,14 @@ repository = { workspace = true }
|
||||
log = { workspace = true }
|
||||
rand = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
dashmap = { workspace = true, features = ["serde"] }
|
||||
serde = { workspace = true, features = ["derive"] }
|
||||
utoipa = { workspace = true }
|
||||
|
||||
nym-sphinx-addressing = { path = "../addressing" }
|
||||
nym-sphinx-params = { path = "../params" }
|
||||
nym-sphinx-types = { path = "../types" }
|
||||
nym-metrics = { path = "../../nym-metrics" }
|
||||
nym-crypto = { path = "../../crypto", version = "0.4.0", features = [
|
||||
"asymmetric",
|
||||
] }
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
use crate::ChunkingError;
|
||||
use nym_sphinx_params::{SerializedFragmentIdentifier, FRAG_ID_LEN};
|
||||
use serde::Serialize;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
use std::fmt::{self, Debug, Formatter};
|
||||
|
||||
@@ -58,7 +60,7 @@ pub const COVER_FRAG_ID: FragmentIdentifier = FragmentIdentifier {
|
||||
/// and u8 position of the `Fragment` in the set.
|
||||
// TODO: this should really be redesigned, especially how cover and reply messages are really
|
||||
// "abusing" this. They should work with it natively instead.
|
||||
#[derive(Debug, Clone, Copy, Hash, Eq, PartialEq, Ord, PartialOrd)]
|
||||
#[derive(Debug, Clone, Copy, Hash, Eq, PartialEq, Ord, PartialOrd, Serialize)]
|
||||
pub struct FragmentIdentifier {
|
||||
set_id: i32,
|
||||
fragment_position: u8,
|
||||
@@ -75,6 +77,10 @@ impl fmt::Display for FragmentIdentifier {
|
||||
}
|
||||
|
||||
impl FragmentIdentifier {
|
||||
pub fn set_id(&self) -> i32 {
|
||||
self.set_id
|
||||
}
|
||||
|
||||
pub fn to_bytes(self) -> SerializedFragmentIdentifier {
|
||||
debug_assert_eq!(FRAG_ID_LEN, 5);
|
||||
|
||||
@@ -125,6 +131,10 @@ impl Debug for Fragment {
|
||||
}
|
||||
|
||||
impl Fragment {
|
||||
pub fn header(&self) -> FragmentHeader {
|
||||
self.header.clone()
|
||||
}
|
||||
|
||||
/// Tries to encapsulate provided payload slice and metadata into a `Fragment`.
|
||||
/// It can fail if payload would not fully fit in a single `Fragment` or some of the metadata
|
||||
/// is malformed or self-contradictory, for example if current_fragment > total_fragments.
|
||||
@@ -216,6 +226,10 @@ impl Fragment {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn seed(&self) -> i32 {
|
||||
self.header().seed()
|
||||
}
|
||||
|
||||
/// Gets the size of payload contained in this `Fragment`.
|
||||
pub fn payload_size(&self) -> usize {
|
||||
self.payload.len()
|
||||
@@ -297,8 +311,8 @@ impl Fragment {
|
||||
/// there is 7 bytes of overhead inside each sphinx packet sent
|
||||
/// and for the longest messages, without upper bound, there is usually also only 7 bytes
|
||||
/// of overhead apart from first and last fragments in each set that instead have 10 bytes of overhead.
|
||||
#[derive(PartialEq, Clone, Debug)]
|
||||
pub(crate) struct FragmentHeader {
|
||||
#[derive(PartialEq, Clone, Debug, Serialize, ToSchema)]
|
||||
pub 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.
|
||||
@@ -324,6 +338,20 @@ pub(crate) struct FragmentHeader {
|
||||
}
|
||||
|
||||
impl FragmentHeader {
|
||||
pub fn seed(&self) -> i32 {
|
||||
let mut seed = self.id;
|
||||
seed = seed.wrapping_mul(self.total_fragments as i32);
|
||||
seed = seed.wrapping_mul(self.current_fragment as i32);
|
||||
seed
|
||||
}
|
||||
|
||||
pub fn total_fragments(&self) -> u8 {
|
||||
self.total_fragments
|
||||
}
|
||||
|
||||
pub fn current_fragment(&self) -> u8 {
|
||||
self.current_fragment
|
||||
}
|
||||
/// Tries to create a new `FragmentHeader` using provided metadata. Bunch of logical
|
||||
/// checks are performed to see if the data is not self-contradictory,
|
||||
/// for example if current_fragment > total_fragments.
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use crate::fragment::{linked_fragment_payload_max_len, unlinked_fragment_payload_max_len};
|
||||
use dashmap::DashMap;
|
||||
use fragment::{Fragment, FragmentHeader};
|
||||
use nym_crypto::asymmetric::ed25519::PublicKey;
|
||||
use serde::Serialize;
|
||||
pub use set::split_into_sets;
|
||||
use thiserror::Error;
|
||||
use utoipa::ToSchema;
|
||||
|
||||
pub const MIN_PADDING_OVERHEAD: usize = 1;
|
||||
|
||||
@@ -22,6 +29,118 @@ pub mod fragment;
|
||||
pub mod reconstruction;
|
||||
pub mod set;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct FragmentMixParams {
|
||||
destination: PublicKey,
|
||||
hops: u8,
|
||||
}
|
||||
|
||||
impl FragmentMixParams {
|
||||
pub fn destination(&self) -> &PublicKey {
|
||||
&self.destination
|
||||
}
|
||||
|
||||
pub fn hops(&self) -> u8 {
|
||||
self.hops
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, ToSchema)]
|
||||
pub struct SentFragment {
|
||||
header: FragmentHeader,
|
||||
at: u64,
|
||||
client_nonce: i32,
|
||||
#[serde(skip)]
|
||||
mixnet_params: FragmentMixParams,
|
||||
}
|
||||
|
||||
impl SentFragment {
|
||||
fn new(
|
||||
header: FragmentHeader,
|
||||
at: u64,
|
||||
client_nonce: i32,
|
||||
destination: PublicKey,
|
||||
hops: u8,
|
||||
) -> Self {
|
||||
let mixnet_params = FragmentMixParams { destination, hops };
|
||||
SentFragment {
|
||||
header,
|
||||
at,
|
||||
client_nonce,
|
||||
mixnet_params,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn header(&self) -> FragmentHeader {
|
||||
self.header.clone()
|
||||
}
|
||||
|
||||
pub fn at(&self) -> u64 {
|
||||
self.at
|
||||
}
|
||||
|
||||
pub fn client_nonce(&self) -> i32 {
|
||||
self.client_nonce
|
||||
}
|
||||
|
||||
pub fn seed(&self) -> i32 {
|
||||
self.header().seed().wrapping_mul(self.client_nonce())
|
||||
}
|
||||
|
||||
pub fn mixnet_params(&self) -> FragmentMixParams {
|
||||
self.mixnet_params.clone()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, ToSchema)]
|
||||
pub struct ReceivedFragment {
|
||||
header: FragmentHeader,
|
||||
at: u64,
|
||||
}
|
||||
|
||||
impl ReceivedFragment {
|
||||
fn new(header: FragmentHeader, at: u64) -> Self {
|
||||
ReceivedFragment { header, at }
|
||||
}
|
||||
|
||||
pub fn header(&self) -> FragmentHeader {
|
||||
self.header.clone()
|
||||
}
|
||||
|
||||
pub fn at(&self) -> u64 {
|
||||
self.at
|
||||
}
|
||||
}
|
||||
|
||||
pub static FRAGMENTS_RECEIVED: LazyLock<DashMap<i32, Vec<ReceivedFragment>>> =
|
||||
LazyLock::new(DashMap::new);
|
||||
|
||||
pub static FRAGMENTS_SENT: LazyLock<DashMap<i32, Vec<SentFragment>>> = LazyLock::new(DashMap::new);
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! now {
|
||||
() => {
|
||||
match std::time::SystemTime::now().duration_since(std::time::SystemTime::UNIX_EPOCH) {
|
||||
Ok(n) => n.as_secs(),
|
||||
Err(_) => 0,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
pub fn fragment_received(fragment: &Fragment) {
|
||||
let id = fragment.fragment_identifier().set_id();
|
||||
let mut entry = FRAGMENTS_RECEIVED.entry(id).or_default();
|
||||
let r = ReceivedFragment::new(fragment.header(), now!());
|
||||
entry.push(r);
|
||||
}
|
||||
|
||||
pub fn fragment_sent(fragment: &Fragment, client_nonce: i32, destination: PublicKey, hops: u8) {
|
||||
let id = fragment.fragment_identifier().set_id();
|
||||
let mut entry = FRAGMENTS_SENT.entry(id).or_default();
|
||||
let s = SentFragment::new(fragment.header(), now!(), client_nonce, destination, hops);
|
||||
entry.push(s);
|
||||
}
|
||||
|
||||
/// The idea behind the process of chunking is to incur as little data overhead as possible due
|
||||
/// to very computationally costly sphinx encapsulation procedure.
|
||||
///
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
use crate::fragment::Fragment;
|
||||
use crate::ChunkingError;
|
||||
use crate::{fragment_received, ChunkingError};
|
||||
use log::*;
|
||||
use std::collections::HashMap;
|
||||
|
||||
@@ -66,6 +66,12 @@ impl ReconstructionBuffer {
|
||||
// if the set is complete.
|
||||
debug_assert!(self.is_complete);
|
||||
|
||||
debug!(
|
||||
"Got {} fragments for set id {}",
|
||||
self.fragments.len(),
|
||||
self.fragments[0].as_ref().unwrap().id()
|
||||
);
|
||||
|
||||
self.fragments
|
||||
.into_iter()
|
||||
.map(|fragment| fragment.unwrap().extract_payload())
|
||||
@@ -104,6 +110,8 @@ impl ReconstructionBuffer {
|
||||
}
|
||||
});
|
||||
|
||||
fragment_received(&fragment);
|
||||
|
||||
let fragment_index = fragment.current_fragment() as usize - 1;
|
||||
if self.fragments[fragment_index].is_some() {
|
||||
// TODO: what to do in that case? give up on the message? overwrite it? panic?
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
use crate::message::{NymMessage, ACK_OVERHEAD, OUTFOX_ACK_OVERHEAD};
|
||||
use crate::NymPayloadBuilder;
|
||||
use log::debug;
|
||||
use nym_crypto::asymmetric::encryption;
|
||||
use nym_crypto::Digest;
|
||||
use nym_sphinx_acknowledgements::surb_ack::SurbAck;
|
||||
@@ -11,12 +12,14 @@ use nym_sphinx_addressing::clients::Recipient;
|
||||
use nym_sphinx_addressing::nodes::NymNodeRoutingAddress;
|
||||
use nym_sphinx_anonymous_replies::reply_surb::ReplySurb;
|
||||
use nym_sphinx_chunking::fragment::{Fragment, FragmentIdentifier};
|
||||
use nym_sphinx_chunking::fragment_sent;
|
||||
use nym_sphinx_forwarding::packet::MixPacket;
|
||||
use nym_sphinx_params::packet_sizes::PacketSize;
|
||||
use nym_sphinx_params::{PacketType, ReplySurbKeyDigestAlgorithm, DEFAULT_NUM_MIX_HOPS};
|
||||
use nym_sphinx_types::{Delay, NymPacket};
|
||||
use nym_topology::{NymTopology, NymTopologyError};
|
||||
use rand::{CryptoRng, Rng};
|
||||
use rand::{CryptoRng, Rng, SeedableRng};
|
||||
use rand_chacha::ChaCha20Rng;
|
||||
|
||||
use std::time::Duration;
|
||||
|
||||
@@ -49,6 +52,7 @@ pub trait FragmentPreparer {
|
||||
type Rng: CryptoRng + Rng;
|
||||
|
||||
fn rng(&mut self) -> &mut Self::Rng;
|
||||
fn nonce(&self) -> i32;
|
||||
fn num_mix_hops(&self) -> u8;
|
||||
fn average_packet_delay(&self) -> Duration;
|
||||
fn average_ack_delay(&self) -> Duration;
|
||||
@@ -192,9 +196,18 @@ pub trait FragmentPreparer {
|
||||
packet_type: PacketType,
|
||||
mix_hops: Option<u8>,
|
||||
) -> Result<PreparedFragment, NymTopologyError> {
|
||||
debug!("Preparing chunk for sending");
|
||||
// each plain or repliable packet (i.e. not a reply) attaches an ephemeral public key so that the recipient
|
||||
// could perform diffie-hellman with its own keys followed by a kdf to re-derive
|
||||
// the packet encryption key
|
||||
|
||||
let seed = fragment.seed().wrapping_mul(self.nonce());
|
||||
let mut rng = ChaCha20Rng::seed_from_u64(seed as u64);
|
||||
|
||||
let destination = packet_recipient.gateway();
|
||||
let hops = mix_hops.unwrap_or(self.num_mix_hops());
|
||||
fragment_sent(&fragment, self.nonce(), *destination, hops);
|
||||
|
||||
let non_reply_overhead = encryption::PUBLIC_KEY_SIZE;
|
||||
let expected_plaintext = match packet_type {
|
||||
PacketType::Outfox => {
|
||||
@@ -228,10 +241,8 @@ pub trait FragmentPreparer {
|
||||
};
|
||||
|
||||
// generate pseudorandom route for the packet
|
||||
let hops = mix_hops.unwrap_or(self.num_mix_hops());
|
||||
log::trace!("Preparing chunk for sending with {} mix hops", hops);
|
||||
let route =
|
||||
topology.random_route_to_gateway(self.rng(), hops, packet_recipient.gateway())?;
|
||||
let route = topology.random_route_to_gateway(&mut rng, hops, destination)?;
|
||||
let destination = packet_recipient.as_sphinx_destination();
|
||||
|
||||
// including set of delays
|
||||
@@ -313,6 +324,8 @@ pub struct MessagePreparer<R> {
|
||||
/// Number of mix hops each packet ('real' message, ack, reply) is expected to take.
|
||||
/// Note that it does not include gateway hops.
|
||||
num_mix_hops: u8,
|
||||
|
||||
nonce: i32,
|
||||
}
|
||||
|
||||
impl<R> MessagePreparer<R>
|
||||
@@ -325,12 +338,15 @@ where
|
||||
average_packet_delay: Duration,
|
||||
average_ack_delay: Duration,
|
||||
) -> Self {
|
||||
let mut rng = rng;
|
||||
let nonce = rng.gen();
|
||||
MessagePreparer {
|
||||
rng,
|
||||
sender_address,
|
||||
average_packet_delay,
|
||||
average_ack_delay,
|
||||
num_mix_hops: DEFAULT_NUM_MIX_HOPS,
|
||||
nonce,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -454,6 +470,10 @@ impl<R: CryptoRng + Rng> FragmentPreparer for MessagePreparer<R> {
|
||||
fn average_ack_delay(&self) -> Duration {
|
||||
self.average_ack_delay
|
||||
}
|
||||
|
||||
fn nonce(&self) -> i32 {
|
||||
self.nonce
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -60,7 +60,7 @@ pub(super) async fn run_outbound(
|
||||
|
||||
loop {
|
||||
select! {
|
||||
connection_message = &mut mix_receiver.next() => {
|
||||
connection_message = mix_receiver.next() => {
|
||||
if let Some(connection_message) = connection_message {
|
||||
if deal_with_message(connection_message, &mut writer, &local_destination_address, &remote_source_address, connection_id).await {
|
||||
break;
|
||||
|
||||
@@ -5,7 +5,6 @@ edition = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
readme = { workspace = true }
|
||||
homepage = { workspace = true }
|
||||
documentation = { workspace = true }
|
||||
|
||||
@@ -15,9 +14,10 @@ documentation = { workspace = true }
|
||||
bs58 = { workspace = true }
|
||||
log = { workspace = true }
|
||||
rand = { workspace = true }
|
||||
reqwest = { workspace = true, features = ["json"] }
|
||||
thiserror = { workspace = true }
|
||||
async-trait = { workspace = true, optional = true }
|
||||
semver = "0.11"
|
||||
semver = { version = "0.11" }
|
||||
|
||||
# 'serializable' feature
|
||||
serde = { workspace = true, features = ["derive"], optional = true }
|
||||
@@ -28,20 +28,22 @@ tsify = { workspace = true, features = ["js"], optional = true }
|
||||
wasm-bindgen = { workspace = true, optional = true }
|
||||
|
||||
## internal
|
||||
nym-bin-common = { path = "../bin-common" }
|
||||
nym-config = { path = "../config" }
|
||||
nym-crypto = { path = "../crypto", features = ["sphinx", "outfox"] }
|
||||
nym-mixnet-contract-common = { path = "../cosmwasm-smart-contracts/mixnet-contract" }
|
||||
nym-sphinx-addressing = { path = "../nymsphinx/addressing" }
|
||||
nym-sphinx-types = { path = "../nymsphinx/types", features = ["sphinx", "outfox"] }
|
||||
nym-sphinx-types = { path = "../nymsphinx/types", features = [
|
||||
"sphinx",
|
||||
"outfox",
|
||||
] }
|
||||
nym-sphinx-routing = { path = "../nymsphinx/routing" }
|
||||
nym-bin-common = { path = "../bin-common" }
|
||||
|
||||
|
||||
# I'm not sure how to feel about pulling in this dependency here...
|
||||
nym-api-requests = { path = "../../nym-api/nym-api-requests" }
|
||||
|
||||
|
||||
# 'serializable' feature
|
||||
nym-config = { path = "../config", optional = true }
|
||||
|
||||
# 'wasm-serde-types' feature
|
||||
wasm-utils = { path = "../wasm/utils", default-features = false, optional = true }
|
||||
|
||||
@@ -49,4 +51,5 @@ wasm-utils = { path = "../wasm/utils", default-features = false, optional = true
|
||||
default = ["provider-trait"]
|
||||
provider-trait = ["async-trait"]
|
||||
wasm-serde-types = ["tsify", "wasm-bindgen", "wasm-utils"]
|
||||
serializable = ["serde", "nym-config", "serde_json"]
|
||||
serializable = ["serde", "serde_json"]
|
||||
outfox = []
|
||||
|
||||
@@ -51,4 +51,16 @@ pub enum NymTopologyError {
|
||||
|
||||
#[error("{0}")]
|
||||
PacketError(#[from] NymPacketError),
|
||||
|
||||
#[error("{0}")]
|
||||
ReqwestError(#[from] reqwest::Error),
|
||||
|
||||
#[error("{0}")]
|
||||
MixnodeConversionError(#[from] crate::mix::MixnodeConversionError),
|
||||
|
||||
#[error("{0}")]
|
||||
GatewayConversionError(#[from] crate::gateway::GatewayConversionError),
|
||||
|
||||
#[error("{0}")]
|
||||
VarError(#[from] std::env::VarError),
|
||||
}
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
|
||||
use crate::filter::VersionFilterable;
|
||||
pub use error::NymTopologyError;
|
||||
use log::{debug, warn};
|
||||
use log::{debug, info, warn};
|
||||
use mix::Node;
|
||||
use nym_config::defaults::var_names::NYM_API;
|
||||
use nym_mixnet_contract_common::mixnode::MixNodeDetails;
|
||||
use nym_mixnet_contract_common::{GatewayBond, IdentityKeyRef, MixId};
|
||||
use nym_sphinx_addressing::nodes::NodeIdentity;
|
||||
@@ -116,13 +118,40 @@ impl Display for NetworkAddress {
|
||||
|
||||
pub type MixLayer = u8;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct NymTopology {
|
||||
mixes: BTreeMap<MixLayer, Vec<mix::Node>>,
|
||||
gateways: Vec<gateway::Node>,
|
||||
}
|
||||
|
||||
impl NymTopology {
|
||||
pub async fn new_from_env() -> Result<Self, NymTopologyError> {
|
||||
let api_url = std::env::var(NYM_API)?;
|
||||
|
||||
info!("Generating topology from {}", api_url);
|
||||
|
||||
let mixnodes = reqwest::get(&format!("{}/v1/mixnodes", api_url))
|
||||
.await?
|
||||
.json::<Vec<MixNodeDetails>>()
|
||||
.await?
|
||||
.into_iter()
|
||||
.map(|details| details.bond_information)
|
||||
.map(mix::Node::try_from)
|
||||
.filter(Result::is_ok)
|
||||
.collect::<Result<Vec<_>, _>>()?;
|
||||
|
||||
let gateways = reqwest::get(&format!("{}/v1/gateways", api_url))
|
||||
.await?
|
||||
.json::<Vec<GatewayBond>>()
|
||||
.await?
|
||||
.into_iter()
|
||||
.map(gateway::Node::try_from)
|
||||
.filter(Result::is_ok)
|
||||
.collect::<Result<Vec<_>, _>>()?;
|
||||
let topology = NymTopology::new_unordered(mixnodes, gateways);
|
||||
Ok(topology)
|
||||
}
|
||||
|
||||
pub fn new(mixes: BTreeMap<MixLayer, Vec<mix::Node>>, gateways: Vec<gateway::Node>) -> Self {
|
||||
NymTopology { mixes, gateways }
|
||||
}
|
||||
@@ -270,7 +299,7 @@ impl NymTopology {
|
||||
&self,
|
||||
rng: &mut R,
|
||||
num_mix_hops: u8,
|
||||
) -> Result<Vec<SphinxNode>, NymTopologyError>
|
||||
) -> Result<Vec<Node>, NymTopologyError>
|
||||
where
|
||||
R: Rng + CryptoRng + ?Sized,
|
||||
{
|
||||
@@ -295,12 +324,32 @@ impl NymTopology {
|
||||
let random_mix = layer_mixes
|
||||
.choose(rng)
|
||||
.ok_or(NymTopologyError::EmptyMixLayer { layer })?;
|
||||
route.push(random_mix.into());
|
||||
route.push(random_mix.clone());
|
||||
}
|
||||
|
||||
Ok(route)
|
||||
}
|
||||
|
||||
pub fn random_path_to_gateway<R>(
|
||||
&self,
|
||||
rng: &mut R,
|
||||
num_mix_hops: u8,
|
||||
gateway_identity: &NodeIdentity,
|
||||
) -> Result<(Vec<mix::Node>, gateway::Node), NymTopologyError>
|
||||
where
|
||||
R: Rng + CryptoRng + ?Sized,
|
||||
{
|
||||
let gateway = self.get_gateway(gateway_identity).ok_or(
|
||||
NymTopologyError::NonExistentGatewayError {
|
||||
identity_key: gateway_identity.to_base58_string(),
|
||||
},
|
||||
)?;
|
||||
|
||||
let path = self.random_mix_route(rng, num_mix_hops)?;
|
||||
|
||||
Ok((path, gateway.clone()))
|
||||
}
|
||||
|
||||
/// Tries to create a route to the specified gateway, such that it goes through mixnode on layer 1,
|
||||
/// mixnode on layer2, .... mixnode on layer n and finally the target gateway
|
||||
pub fn random_route_to_gateway<R>(
|
||||
@@ -321,6 +370,7 @@ impl NymTopology {
|
||||
Ok(self
|
||||
.random_mix_route(rng, num_mix_hops)?
|
||||
.into_iter()
|
||||
.map(|node| SphinxNode::from(&node))
|
||||
.chain(std::iter::once(gateway.into()))
|
||||
.collect())
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ version = "1.0.0"
|
||||
description = "Nym common types"
|
||||
authors.workspace = true
|
||||
edition = "2021"
|
||||
rust-version = "1.58"
|
||||
rust-version.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -11,6 +11,7 @@ pub mod gas;
|
||||
pub mod gateway;
|
||||
pub mod helpers;
|
||||
pub mod mixnode;
|
||||
pub mod monitoring;
|
||||
pub mod pending_events;
|
||||
pub mod transaction;
|
||||
pub mod vesting;
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
use std::{collections::HashSet, sync::LazyLock, time::SystemTime};
|
||||
|
||||
use nym_crypto::asymmetric::identity::{PrivateKey, PublicKey, Signature};
|
||||
use nym_mixnet_contract_common::MixId;
|
||||
use schemars::JsonSchema;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
static NETWORK_MONITORS: LazyLock<HashSet<String>> = LazyLock::new(|| {
|
||||
let mut nm = HashSet::new();
|
||||
nm.insert("5VsPyLbsBCq9PAMWmjKkToteVAKNabNqex6QwDf5fWzt".to_string());
|
||||
nm
|
||||
});
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, JsonSchema, Clone)]
|
||||
pub struct NodeResult {
|
||||
pub node_id: MixId,
|
||||
pub identity: String,
|
||||
pub reliability: u8,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, JsonSchema, Clone)]
|
||||
pub struct MixnodeResult {
|
||||
pub mix_id: MixId,
|
||||
pub identity: String,
|
||||
pub owner: String,
|
||||
pub reliability: u8,
|
||||
}
|
||||
|
||||
impl MixnodeResult {
|
||||
pub fn new(mix_id: MixId, identity: String, owner: String, reliability: u8) -> Self {
|
||||
MixnodeResult {
|
||||
mix_id,
|
||||
identity,
|
||||
owner,
|
||||
reliability,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, JsonSchema, Clone)]
|
||||
pub struct GatewayResult {
|
||||
pub identity: String,
|
||||
pub owner: String,
|
||||
pub reliability: u8,
|
||||
pub mix_id: MixId,
|
||||
}
|
||||
|
||||
impl GatewayResult {
|
||||
pub fn new(identity: String, owner: String, reliability: u8) -> Self {
|
||||
GatewayResult {
|
||||
identity,
|
||||
owner,
|
||||
reliability,
|
||||
mix_id: 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, JsonSchema)]
|
||||
#[serde(untagged)]
|
||||
pub enum MonitorResults {
|
||||
Mixnode(Vec<MixnodeResult>),
|
||||
Gateway(Vec<GatewayResult>),
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, JsonSchema)]
|
||||
pub struct MonitorMessage {
|
||||
results: Vec<NodeResult>,
|
||||
signature: String,
|
||||
signer: String,
|
||||
timestamp: i64,
|
||||
}
|
||||
|
||||
impl MonitorMessage {
|
||||
fn message_to_sign(results: &[NodeResult], timestamp: i64) -> Vec<u8> {
|
||||
let mut msg = match serde_json::to_vec(results) {
|
||||
Ok(msg) => msg,
|
||||
Err(_) => Vec::new(),
|
||||
};
|
||||
msg.extend_from_slice(×tamp.to_le_bytes());
|
||||
msg
|
||||
}
|
||||
|
||||
pub fn timely(&self) -> bool {
|
||||
let now = SystemTime::now()
|
||||
.duration_since(SystemTime::UNIX_EPOCH)
|
||||
.expect("Time went backwards")
|
||||
.as_secs() as i64;
|
||||
|
||||
now - self.timestamp < 5
|
||||
}
|
||||
|
||||
pub fn new(results: Vec<NodeResult>, private_key: &PrivateKey) -> Self {
|
||||
let timestamp = SystemTime::now()
|
||||
.duration_since(SystemTime::UNIX_EPOCH)
|
||||
.expect("Time went backwards")
|
||||
.as_secs() as i64;
|
||||
|
||||
let msg = Self::message_to_sign(&results, timestamp);
|
||||
let signature = private_key.sign(&msg);
|
||||
let public_key = private_key.public_key();
|
||||
|
||||
MonitorMessage {
|
||||
results,
|
||||
signature: signature.to_base58_string(),
|
||||
signer: public_key.to_base58_string(),
|
||||
timestamp,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_allowed(&self) -> bool {
|
||||
NETWORK_MONITORS.contains(&self.signer)
|
||||
}
|
||||
|
||||
pub fn results(&self) -> &[NodeResult] {
|
||||
&self.results
|
||||
}
|
||||
|
||||
pub fn verify(&self) -> bool {
|
||||
let msg = Self::message_to_sign(&self.results, self.timestamp);
|
||||
|
||||
let signature = match Signature::from_base58_string(&self.signature) {
|
||||
Ok(sig) => sig,
|
||||
Err(_) => return false,
|
||||
};
|
||||
|
||||
PublicKey::from_base58_string(&self.signer)
|
||||
.map(|pk| pk.verify(msg, &signature).is_ok())
|
||||
.unwrap_or(false)
|
||||
}
|
||||
}
|
||||
@@ -30,13 +30,9 @@ workspace = true
|
||||
optional = true
|
||||
|
||||
[features]
|
||||
default = ["sleep", "console_error_panic_hook"]
|
||||
default = ["sleep"]
|
||||
sleep = ["web-sys", "web-sys/Window"]
|
||||
websocket = [
|
||||
"getrandom",
|
||||
"tungstenite",
|
||||
"gloo-net"
|
||||
]
|
||||
websocket = ["getrandom", "tungstenite", "gloo-net"]
|
||||
crypto = [
|
||||
"web-sys",
|
||||
"web-sys/Crypto",
|
||||
|
||||
@@ -84,6 +84,7 @@ pub struct WireguardData {
|
||||
#[cfg(target_os = "linux")]
|
||||
pub async fn start_wireguard<St: nym_gateway_storage::Storage + 'static>(
|
||||
storage: St,
|
||||
all_peers: Vec<nym_gateway_storage::models::WireguardPeer>,
|
||||
task_client: nym_task::TaskClient,
|
||||
wireguard_data: WireguardData,
|
||||
control_tx: UnboundedSender<peer_controller::PeerControlResponse>,
|
||||
@@ -95,7 +96,7 @@ pub async fn start_wireguard<St: nym_gateway_storage::Storage + 'static>(
|
||||
|
||||
let mut peers = vec![];
|
||||
let mut suspended_peers = vec![];
|
||||
for storage_peer in storage.get_all_wireguard_peers().await? {
|
||||
for storage_peer in all_peers {
|
||||
let suspended = storage_peer.suspended;
|
||||
let peer = Peer::try_from(storage_peer)?;
|
||||
if suspended {
|
||||
|
||||
+18
-22
@@ -1,30 +1,27 @@
|
||||
# Documentation
|
||||
# Nym Docs v2
|
||||
|
||||
This is v2 of the nym docs, condensed from various mdbooks projects that we had previously.
|
||||
|
||||
These docs are hosted at [nymtech.net/docs](www.nymtech.net/docs).
|
||||
|
||||
## Doc projects
|
||||
Each directory contains a readme with more information about running and contributing to the projects. Each is built with [`mdbook`](https://rust-lang.github.io/mdBook/index.html) - use `mdbook serve` to build and serve them (defaults to `localhost:3000`).
|
||||
* `docs` contains technical documentation hosted at [https://nymtech.net/docs](https://nymtech.net/docs)
|
||||
* `dev-portal` contains developer documentation hosted at [https://nymtech.net/developers](https://nymtech.net/developers)
|
||||
* `operators` contains node setup and maintenance guides hosted at [https://nymtech.net/operators](https://nymtech.net/operators)
|
||||
`docs/pages/` contains several subdirs, each hosting a subsection of the docs:
|
||||
* `network` contains key concepts, cryptosystems, architecture.
|
||||
* `developers` contains key concepts for developers, required architecture, and Rust/Typescript SDK docs.
|
||||
* `operators` contains node setup and maintenance guides.
|
||||
|
||||
> If you are looking for the Typescript SDK documentation located at [sdk.nymtech.net](https://sdk.nymtech.net) this can be found in `../sdk/typescript/docs/`
|
||||
## Contribution
|
||||
* If you wish to add to the documentation please create a PR against this repo, with a `patch` against `develop`.
|
||||
|
||||
## Contribution
|
||||
* If you wish to add to the documentation please create a PR against this repo.
|
||||
* If you are **adding a plugin dependency** make sure to also **add that to the list of plugins in `install_mdbook_deps.sh` line 12**.
|
||||
## Scripts
|
||||
* There are several autogenerated command files for clients and binaries. These are generated with `generate:commands`, which runs the `autodoc` rust binary, moves the files to their required places, and then if there is an update, commits them to git. This is for remote deployments.
|
||||
* TODO
|
||||
|
||||
## Scripts
|
||||
* `bump_versions.sh` allows you to update the ~~`platform_release_version` and~~ `wallet_release_version` variable~~s~~ in the `book.toml` of each mdbook project at once. You can also optionally update the `minimum_rust_version` as well. Helpful for lazy-updating when cutting a new version of the docs.
|
||||
### Autodoc
|
||||
`autodoc` is a script that generates markdown files containing commands and their output (both command and `--help` output). For the moment the binaries and their commands are manually configured in the script.
|
||||
|
||||
* The following scripts are used by the `ci-dev.yml` and `cd-dev.yml` scripts (located in `../.github/workflows/`):
|
||||
* `build_all_to_dist.sh` is used for building all mdbook projects and moving the rendered html to `../dist/` to be rsynced with various servers.
|
||||
* `install_mdbook_deps.sh` checks for an existing install of mdbook (and plugins), uninstalls them, and then installs them on a clean slate. This is to avoid weird dependency clashes if relying on an existing mdbook version.
|
||||
* `post_process.sh` is used to post process CSS/image/href links for serving several mdbooks from a subdirectory.
|
||||
* `removed_existing_config.sh` is used to check for existing nym client/node config files on the CI/CD server and remove it if it exists. This is to mitigate issues with `mdbook-cmdrun` where e.g. a node is already initialised, and the command fails.
|
||||
|
||||
## CI/CD
|
||||
Deployment of the docs is partially automated and partially manual.
|
||||
* `ci-docs.yml` will run on pushes to all branches **apart from `master`**
|
||||
* `cd-docs.yml` must be run manually. This pushes to a staging branch which then must be manually promoted to production.
|
||||
## CI/CD
|
||||
TODO
|
||||
|
||||
## Licensing and copyright information
|
||||
This is a monorepo and components that make up Nym as a system are licensed individually, so for accurate information, please check individual files.
|
||||
@@ -36,4 +33,3 @@ As a general approach, licensing is as follows this pattern:
|
||||
* Nym applications and binaries are [GPL-3.0-only](https://www.gnu.org/licenses/)
|
||||
|
||||
* Used libraries and different components are [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0.html) or [MIT](https://mit-license.org/)
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
/autodoc-generated-markdown/*
|
||||
@@ -0,0 +1,13 @@
|
||||
[package]
|
||||
name = "autodoc"
|
||||
version = "0.1.0"
|
||||
authors.workspace = true
|
||||
repository.workspace = true
|
||||
homepage.workspace = true
|
||||
documentation.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
[dependencies]
|
||||
env_logger = "0.11.3"
|
||||
log.workspace = true
|
||||
@@ -0,0 +1,4 @@
|
||||
# `autodoc`
|
||||
|
||||
Command output documentation generator WIP
|
||||
|
||||
@@ -0,0 +1,259 @@
|
||||
use log::{debug, info};
|
||||
use std::fs::File;
|
||||
use std::io::{self, Write};
|
||||
use std::process::{Command, Output};
|
||||
use std::{fs, vec};
|
||||
|
||||
const WRITE_PATH: &str = "./autodoc-generated-markdown/";
|
||||
|
||||
fn main() -> io::Result<()> {
|
||||
env_logger::init();
|
||||
|
||||
// TODO if this balloons write automated way of grabbing commands from crates.
|
||||
let commands_with_subcommands = vec![
|
||||
(
|
||||
"../../target/release/nym-api",
|
||||
vec!["init", "run", "build-info"],
|
||||
),
|
||||
(
|
||||
"../../target/release/nym-client",
|
||||
vec![
|
||||
"init",
|
||||
"run",
|
||||
"import-credential",
|
||||
"list-gateways",
|
||||
"switch-gateway",
|
||||
"build-info",
|
||||
"completions",
|
||||
"generate-fig-spec",
|
||||
],
|
||||
),
|
||||
(
|
||||
"../../target/release/nym-socks5-client",
|
||||
vec![
|
||||
"init",
|
||||
"run",
|
||||
"import-credential",
|
||||
"list-gateways",
|
||||
"add-gateway",
|
||||
"build-info",
|
||||
"completions",
|
||||
"generate-fig-spec",
|
||||
],
|
||||
),
|
||||
(
|
||||
"../../target/release/nym-node",
|
||||
vec![
|
||||
"build-info",
|
||||
"bonding-information",
|
||||
"node-details",
|
||||
"migrate",
|
||||
"run",
|
||||
"sign",
|
||||
],
|
||||
),
|
||||
(
|
||||
"../../target/release/nymvisor",
|
||||
vec![
|
||||
"init",
|
||||
"run",
|
||||
"build-info",
|
||||
"daemon-build-info",
|
||||
"add-upgrade",
|
||||
"config",
|
||||
],
|
||||
),
|
||||
];
|
||||
|
||||
let commands_with_subsubcommands = vec![(
|
||||
"../../target/release/nym-cli",
|
||||
vec![
|
||||
(
|
||||
"account",
|
||||
vec!["create", "balance", "pub-key", "send", "send-multiple"],
|
||||
),
|
||||
("signature", vec!["sign", "verify"]),
|
||||
(
|
||||
"ecash",
|
||||
vec![
|
||||
"issue-ticket-book",
|
||||
"recover-ticket-book",
|
||||
"import-ticket-book",
|
||||
],
|
||||
),
|
||||
(
|
||||
"coconut",
|
||||
vec![
|
||||
"generate-freepass",
|
||||
"issue-credentials",
|
||||
"recover-credentials",
|
||||
"import-credential",
|
||||
],
|
||||
),
|
||||
("block", vec!["get", "time", "current-height"]),
|
||||
(
|
||||
"cosmwasm",
|
||||
vec![
|
||||
"upload",
|
||||
"init",
|
||||
"generate-init-message",
|
||||
"migrate",
|
||||
"execute",
|
||||
],
|
||||
),
|
||||
("tx", vec!["get", "query"]),
|
||||
(
|
||||
"vesting-schedule",
|
||||
vec!["create", "query", "vested-balance", "withdraw-vested"],
|
||||
),
|
||||
("mixnet", vec!["query", "delegators", "operators"]),
|
||||
("generate-fig", vec![""]),
|
||||
],
|
||||
)];
|
||||
|
||||
for (main_command, subcommands) in commands_with_subcommands {
|
||||
let last_word = get_last_word_from_filepath(main_command);
|
||||
debug!("now running {last_word:#?}");
|
||||
|
||||
if !fs::metadata(WRITE_PATH)
|
||||
.map(|metadata| metadata.is_dir())
|
||||
.unwrap_or(false)
|
||||
{
|
||||
fs::create_dir_all(WRITE_PATH)?;
|
||||
}
|
||||
|
||||
let mut file = File::create(format!("{}/{}-commands.md", WRITE_PATH, last_word.unwrap()))?;
|
||||
writeln!(
|
||||
file,
|
||||
"# {} Binary Commands (Autogenerated)",
|
||||
format!("`{}`", last_word.unwrap())
|
||||
)?;
|
||||
writeln!(
|
||||
file,
|
||||
"\nThese docs are autogenerated by the [`autodocs`](https://github.com/nymtech/nym/tree/max/new-docs-framework/documentation/autodoc) script."
|
||||
)?;
|
||||
let output = Command::new(main_command).arg("--help").output()?;
|
||||
write_output_to_file(&mut file, output)?;
|
||||
|
||||
for subcommand in subcommands {
|
||||
execute_command(&mut file, main_command, subcommand, None)?;
|
||||
}
|
||||
}
|
||||
|
||||
// nym-cli has subsubcommands so needs its own loop
|
||||
for (main_command, subcommands) in &commands_with_subsubcommands {
|
||||
let last_word = get_last_word_from_filepath(main_command);
|
||||
debug!("now running {last_word:#?}");
|
||||
let mut file = File::create(format!("{}/{}-commands.md", WRITE_PATH, last_word.unwrap()))?;
|
||||
writeln!(
|
||||
file,
|
||||
"# {} Binary Commands (Autogenerated)",
|
||||
format!("`{}`", last_word.unwrap())
|
||||
)?;
|
||||
writeln!(
|
||||
file,
|
||||
"\nThese docs are autogenerated by the [`autodocs`](https://github.com/nymtech/nym/tree/max/new-docs-framework/documentation/autodoc) script."
|
||||
)?;
|
||||
let output = Command::new(main_command).arg("--help").output()?;
|
||||
|
||||
write_output_to_file(&mut file, output)?;
|
||||
|
||||
for (subcommand, subsubcommands) in subcommands {
|
||||
writeln!(file, "\n## `{}` ", subcommand)?;
|
||||
let output = Command::new(main_command)
|
||||
.arg(subcommand)
|
||||
.arg("--help")
|
||||
.output()?;
|
||||
if !output.stdout.is_empty() {
|
||||
write_output_to_file(&mut file, output)?;
|
||||
} else {
|
||||
debug!("empty stdout - nothing to write");
|
||||
}
|
||||
for subsubcommand in subsubcommands {
|
||||
execute_command(&mut file, main_command, subcommand, Some(subsubcommand))?;
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn get_last_word_from_filepath(filepath: &str) -> Option<&str> {
|
||||
let parts: Vec<&str> = filepath.split('/').collect();
|
||||
parts.last().copied()
|
||||
}
|
||||
|
||||
fn execute_command(
|
||||
file: &mut File,
|
||||
main_command: &str,
|
||||
subcommand: &str,
|
||||
subsubcommand: Option<&str>,
|
||||
) -> io::Result<()> {
|
||||
// checking for the nym-cli subsubcommands
|
||||
if subsubcommand.is_some() {
|
||||
writeln!(file, "\n### `{} {}`", subcommand, subsubcommand.unwrap())?;
|
||||
|
||||
info!("executing {} {} --help ", main_command, subcommand);
|
||||
let output = Command::new(main_command)
|
||||
.arg(subcommand)
|
||||
.arg(subsubcommand.unwrap())
|
||||
.arg("--help")
|
||||
.output()?;
|
||||
if !output.stdout.is_empty() {
|
||||
write_output_to_file(file, output)?;
|
||||
} else {
|
||||
debug!("empty stdout - nothing to write");
|
||||
}
|
||||
// just subcommands
|
||||
} else {
|
||||
writeln!(file, "\n### `{}`", subcommand)?;
|
||||
|
||||
// execute help
|
||||
let output = Command::new(main_command)
|
||||
.arg(subcommand)
|
||||
.arg("--help")
|
||||
.output()?;
|
||||
if !output.stdout.is_empty() {
|
||||
write_output_to_file(file, output)?;
|
||||
} else {
|
||||
debug!("empty stdout - nothing to write");
|
||||
}
|
||||
|
||||
// then execute w/out help: the majority of functions will fail since you're not passing
|
||||
// required params but thats fine as we can just not render stderr into the final file.
|
||||
//
|
||||
// this check is basically checking for the rare commands (rn just one) that start a process with no params
|
||||
// perhaps if this list grows we could just add a timeout and shunt the running and writing
|
||||
// into a thread with a timeout or something but for right now its fine / thats overkill
|
||||
if get_last_word_from_filepath(main_command).unwrap() == "nym-node"
|
||||
|| get_last_word_from_filepath(main_command).unwrap() == "nym-api"
|
||||
|| get_last_word_from_filepath(main_command).unwrap() == "nymvisor"
|
||||
&& subcommand == "run"
|
||||
{
|
||||
info!("SKIPPING {} {}", main_command, subcommand);
|
||||
} else {
|
||||
info!("executing {} {}", main_command, subcommand);
|
||||
let output = Command::new(main_command).arg(subcommand).output()?;
|
||||
if !output.stdout.is_empty() {
|
||||
writeln!(file, "Example output:")?;
|
||||
write_output_to_file(file, output)?;
|
||||
} else {
|
||||
debug!("empty stdout - nothing to write");
|
||||
if !&output.stderr.is_empty() {
|
||||
debug!("stderr: {:#?}", String::from_utf8_lossy(&output.stderr));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn write_output_to_file(file: &mut File, output: Output) -> io::Result<()> {
|
||||
writeln!(file, "```sh")?;
|
||||
file.write_all(&output.stdout)?;
|
||||
writeln!(file, "```")?;
|
||||
|
||||
if !&output.stderr.is_empty() {
|
||||
debug!("stderr: {:#?}", String::from_utf8_lossy(&output.stderr));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
# this is a script called by the github CI and CD workflows to build all 3 docs projects
|
||||
# and move them to /dist/ in the root of the monorepo. They are rsynced to various servers
|
||||
# from there by subsequent workflow tasks.
|
||||
|
||||
# array of project dirs
|
||||
declare -a projects=("docs" "dev-portal" "operators")
|
||||
|
||||
# check you're calling from the right place
|
||||
if [ $(pwd | awk -F/ '{print $NF}') != "documentation" ]
|
||||
then
|
||||
echo "failure: please run script from documentation/"
|
||||
else
|
||||
for i in "${projects[@]}"
|
||||
do
|
||||
# cd to project dir
|
||||
cd "./$i" &&
|
||||
# little sanity checks
|
||||
echo $(pwd) && echo $(mdbook --version) &&
|
||||
# clean old book
|
||||
echo "cleaning old book"
|
||||
rm -rf ./book/
|
||||
# build book
|
||||
# mdbook test || true
|
||||
mdbook build
|
||||
# check for destination, if ! then mkdir & check again else echo thumbs up
|
||||
if [ ! -d ../../dist/docs/$i ]; then
|
||||
echo "dest doesn't exist: creating dir"
|
||||
mkdir -p ../../dist/docs/$i
|
||||
fi
|
||||
if [ -d ../../dist/docs/$i ]; then
|
||||
echo "cp destination exists, all good"
|
||||
fi
|
||||
# clean old dist/$i
|
||||
rm -rf ../../dist/docs/$i
|
||||
# move newly rendered book/ to dist
|
||||
rsync -r ./book/html/ ../../dist/docs/$i
|
||||
# sanity check
|
||||
ls -laF ../../dist/docs/
|
||||
# cd back to ../documentation/
|
||||
cd ../
|
||||
done
|
||||
# rename for server paths
|
||||
rm -rf ../dist/docs/developers
|
||||
mv ../dist/docs/dev-portal ../dist/docs/developers
|
||||
fi
|
||||
@@ -1,45 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
# takes one manadatory arg and one optional arg: wallet release and minimum rust versions
|
||||
# it then uses sed to bump them in the three book.toml files.
|
||||
#
|
||||
# e.g if the upcoming wallet release version was 1.2.9 you'd run this as:
|
||||
# `./bump_versions.sh "1.2.9"`
|
||||
#
|
||||
# you can also set the minumum rust version by passing an optional additional argument:
|
||||
# `./bump_versions.sh "1.2.9" "1.67"`
|
||||
|
||||
# array of project dirs
|
||||
declare -a projects=("docs" "dev-portal" "operators")
|
||||
|
||||
# check number of args passed
|
||||
if [ "$#" -lt 1 ] || [ "$#" -gt 2 ];
|
||||
then
|
||||
echo "failure: please pass at least 1 and at most 2 args: "
|
||||
echo "./bump_version.sh <new wallet_release_version> [OPTIONAL]<new minimum_rust_version>"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# check you're calling from the right place
|
||||
if [ $(pwd | awk -F/ '{print $NF}') != "documentation" ]
|
||||
then
|
||||
echo "failure: please run script from documentation/"
|
||||
exit 0
|
||||
else
|
||||
## now loop through the above array sed-ing the variable values in the book.toml files
|
||||
for i in "${projects[@]}"
|
||||
do
|
||||
# sed the vars in the book.toml file for each project
|
||||
echo "setting wallet version in $i/"
|
||||
sed -i 's/wallet_release_version =.*/wallet_release_version = "'$2'"/' "$i"/book.toml
|
||||
if [ "$3" ]
|
||||
then
|
||||
echo "setting minimum rust version in $i/"
|
||||
sed -i 's/minimum_rust_version = .*/minimum_rust_version = "'$3'"/' "$i"/book.toml
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@@ -1,14 +1,6 @@
|
||||
# mdbook files
|
||||
book/
|
||||
|
||||
# Compiled assets
|
||||
.sass-cache
|
||||
_site
|
||||
|
||||
# Developing
|
||||
todo.md
|
||||
.idea
|
||||
|
||||
# OSX
|
||||
.DS_Store
|
||||
.next
|
||||
node_modules
|
||||
out
|
||||
|
||||
# the lock file will break Vercel because it may get committed from a machine with a different build architecture
|
||||
package-lock.json
|
||||
|
||||
@@ -1,42 +1,40 @@
|
||||
# Nym Documentation
|
||||
Documentation for the Nym privacy platform built using the [mdBook](https://rust-lang.github.io/mdBook/) docs framework.
|
||||
# Nym Docs v2
|
||||
|
||||
Documentation can be viewed at https://nymtech.net/docs
|
||||
New consolidated version of the nym docs.
|
||||
|
||||
## Contributing
|
||||
Contributions to our documentation are very welcome. Please work on your contribution in either a `feature/<feature-name>` or `chore/<chore-name>` branch from `master` and target your pull request at `master`.
|
||||
## Local development
|
||||
|
||||
Since these docs autogenerate command output and import docs from binaries in `target/release` on `build` make sure you're branching off of `master` when making your branch.
|
||||
```
|
||||
npm i
|
||||
npm run dev
|
||||
```
|
||||
|
||||
Changes merged to `master` will be autodeployed to the production site.
|
||||
Open `http://localhost:3000` to browse the output that will hot-reload when you make changes.
|
||||
|
||||
### Contributing a new translation
|
||||
To contribute tranlsations in a new language, please get in touch via [Matrix](https://matrix.to/#/#general:nymtech.chat) or [Discord](https://nymtech.net/go/discord).
|
||||
If you are cutting a new version with binaries that have updated commands (and you have updated the command list in `autodocs`) run:
|
||||
|
||||
### Variables
|
||||
There are some variables that are shared across the entire docs site, such as the current latest software version.
|
||||
```
|
||||
npm generate:commands
|
||||
```
|
||||
|
||||
Variables are denoted in the `.md` files wrapped in `{{}}` (e.g `{{wallet_release_version}}`), and are located in the `book.toml` file under the `[preprocessor.variables.variables]` heading. If you are changing something like the software release version, minimum code versions in prerequisites, etc, **check in here first!**
|
||||
This will regenerate the md command files for the binaries, move them into position, and then commit them to the branch head.
|
||||
|
||||
### Diagrams
|
||||
Most diagrams are simply ascii. Copies are kept in `/diagrams/` for ease of reproducability. Created using [textik](https://textik.com/#).
|
||||
## Build
|
||||
|
||||
### Importing files and auto-generated command output
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
|
||||
Example files are inserted as per normal with mdbook.
|
||||
The static output will be in `./out`;
|
||||
|
||||
Some binary command outputs are generated using the [`cmdrun`](https://docs.rs/mdbook-cmdrun/latest/mdbook_cmdrun/) mdbook plugin.
|
||||
If you are cutting a new version with binaries that have updated commands (and you have updated the command list in `autodocs`) **run this first**:
|
||||
|
||||
## Building
|
||||
When working locally, it is recommended that you use `mdbook serve` to have a local version of the docs served on `localhost:3000`, with hot reloading on any changes made to files in the `src/` directory.
|
||||
```
|
||||
npm generate:commands
|
||||
```
|
||||
|
||||
You can find other commands in the [mdBook CLI tool docs](https://rust-lang.github.io/mdBook/cli/index.html).
|
||||
This will regenerate the md command files for the binaries, move them into position, and then commit them to the branch head.
|
||||
|
||||
### I tried to edit files in `theme/` and they aren't taking effect / `mdbook serve` causes a looping reload on file changes after changing fields in `[preprocessor.theme]` config
|
||||
## Template details
|
||||
|
||||
Looping reload is a known issue with the `mdbook-theme` preprocessor used for the table of contents and layout of these docs. As outlined in the `mdbook-theme` [readme](https://github.com/zjp-CN/mdbook-theme#avoid-repeating-call-on-this-tool-when-mdbook-watch) one way to mitigate this is to set `turn-off = true` under `[preprocessor.theme]`. This means that `mdbook serve` or `mdbook watch` ignores changes to the `theme/` directory, which is the source of the looping reload. If you have changed or commented out this line, reintroduce it to remove the looping reload. If you are trying to edit the theme of the docs and want to apply the change, see [here](https://github.com/zjp-CN/mdbook-theme#avoid-repeating-call-on-this-tool-when-mdbook-watch) for more info on how to remove the block, change the theme, and reintroduce the block.
|
||||
|
||||
### Checking the mdBook version
|
||||
To check the version of mdBook installed on your system, you can use the `mdbook --version` command. This will print the version number of mdBook installed on your system in the terminal.
|
||||
|
||||
The latest release of the binary of the pre-compiled binaries can be found on [GitHub](https://github.com/rust-lang/mdBook/releases).
|
||||
This documentation was made with [Nextra](https://nextra.site) using the template from here https://github.com/shuding/nextra-docs-template.
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import { Tabs } from 'nextra/components';
|
||||
|
||||
export const MyTab = ({ name, children }) => (
|
||||
<Tabs.Tab>{name} {children}</Tabs.Tab>
|
||||
);
|
||||
@@ -0,0 +1,158 @@
|
||||
import React from "react";
|
||||
import { Box, Grid, Typography } from "@mui/material";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
|
||||
import networkDocs from "../public/images/landing/network-docs.png";
|
||||
import developerDocs from "../public/images/landing/developer-docs.png";
|
||||
import sdkDocs from "../public/images/landing/sdk-docs.png";
|
||||
import operatorGuide from "../public/images/landing/operator-guide.png";
|
||||
|
||||
export const LandingPage = () => {
|
||||
const squares = [
|
||||
{
|
||||
text: "Network Docs",
|
||||
description: "Architecture, crypto systems, and how the Mixnet works",
|
||||
href: "/network",
|
||||
icon: developerDocs,
|
||||
},
|
||||
{
|
||||
text: "Operator Guides",
|
||||
description:
|
||||
"Guides and maintenance: if you want to run a node, start here",
|
||||
|
||||
href: "/operators/introduction",
|
||||
icon: operatorGuide,
|
||||
},
|
||||
{
|
||||
text: "Developer Portal",
|
||||
description:
|
||||
"Conceptual overview, clients, and tools for developers and integrations",
|
||||
|
||||
href: "/developers",
|
||||
icon: networkDocs,
|
||||
},
|
||||
{
|
||||
text: "SDKs",
|
||||
description: "Rust and Typescript SDK docs",
|
||||
|
||||
href: "/developers/rust",
|
||||
icon: sdkDocs,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<Box maxWidth={1200} margin={"0 auto"}>
|
||||
<Typography variant="h2" mb={6}>
|
||||
Nym Docs
|
||||
</Typography>
|
||||
|
||||
<Typography mb={10}>
|
||||
Nym is a privacy platform. It provides strong network-level privacy
|
||||
against sophisticated end-to-end attackers, and anonymous access control
|
||||
using blinded, re-randomizable, decentralized credentials. Our goal is
|
||||
to allow developers to build new applications, or upgrade existing apps,
|
||||
with privacy features unavailable in other systems.
|
||||
</Typography>
|
||||
<Grid container border={"1px solid #262626"}>
|
||||
{squares.map((square, index) => (
|
||||
<Grid
|
||||
item
|
||||
key={index}
|
||||
xs={12}
|
||||
md={6}
|
||||
padding={4}
|
||||
width={"100%"}
|
||||
sx={{
|
||||
borderBottom: {
|
||||
xs: index < 3 ? "1px solid #262626" : "none",
|
||||
md: index === 0 || index === 1 ? "1px solid #262626" : "none",
|
||||
},
|
||||
borderRight: {
|
||||
md: index === 0 || index === 2 ? "1px solid #262626" : "none",
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Link href={square.href} target="_blank" rel="noopener noreferrer">
|
||||
<Box display={"flex"} gap={4} height={"100%"}>
|
||||
<Image
|
||||
src={square.icon}
|
||||
alt={square.text}
|
||||
width={180}
|
||||
height={134}
|
||||
/>
|
||||
<Box
|
||||
display={"flex"}
|
||||
flexDirection={"column"}
|
||||
justifyContent={"space-between"}
|
||||
flexGrow={1}
|
||||
height={"100%"}
|
||||
>
|
||||
<Typography variant="h5" sx={{ fontWeight: 600 }}>
|
||||
{square.text}
|
||||
</Typography>
|
||||
<Typography variant="body1" sx={{ color: "#909195" }}>
|
||||
{square.description}
|
||||
</Typography>
|
||||
<Typography sx={{ color: "#ff6600", fontWeight: 600 }}>
|
||||
Open
|
||||
</Typography>
|
||||
</Box>
|
||||
</Box>
|
||||
</Link>
|
||||
</Grid>
|
||||
))}
|
||||
</Grid>
|
||||
|
||||
<style jsx>{`
|
||||
.landing-page-container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 2rem 1rem;
|
||||
}
|
||||
.landing-page-intro {
|
||||
font-size: 1.125rem;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
.landing-page-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 2rem;
|
||||
max-width: 36rem;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.landing-page-square {
|
||||
background-color: #000000;
|
||||
color: white;
|
||||
padding: 1rem;
|
||||
border-radius: 0.5rem;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
transition: box-shadow 0.3s ease;
|
||||
aspect-ratio: 1 / 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 3px solid #ff6600;
|
||||
box-shadow: 0 0 10px #ff6600;
|
||||
}
|
||||
.landing-page-square:hover {
|
||||
box-shadow: 0 0 20px #ff6600;
|
||||
}
|
||||
.landing-page-icon {
|
||||
width: 12.5rem;
|
||||
height: 12.5rem;
|
||||
margin-bottom: 0.75rem;
|
||||
color: #ff6600;
|
||||
}
|
||||
.landing-page-text {
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
color: #ff6600;
|
||||
}
|
||||
`}</style>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Box } from "@mui/material";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import matrixLogo from "../public/images/matrix-logo.png";
|
||||
export const Matrix = () => {
|
||||
return (
|
||||
<Link
|
||||
href={"https://matrix.to/#/#dev:nymtech.chat"}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<Image src={matrixLogo} alt={"Matrix Logo"} width={20} height={24} />
|
||||
</Link>
|
||||
);
|
||||
};
|
||||
+21
-17
@@ -1,26 +1,25 @@
|
||||
import React, { useState } from 'react';
|
||||
import CircularProgress from '@mui/material/CircularProgress';
|
||||
import Button from '@mui/material/Button';
|
||||
import TextField from '@mui/material/TextField';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import Box from '@mui/material/Box';
|
||||
import { mixFetch } from '@nymproject/mix-fetch-full-fat';
|
||||
import Stack from '@mui/material/Stack';
|
||||
import Paper from '@mui/material/Paper';
|
||||
import type { SetupMixFetchOps } from '@nymproject/mix-fetch-full-fat';
|
||||
import React, { useState } from "react";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import Button from "@mui/material/Button";
|
||||
import TextField from "@mui/material/TextField";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Box from "@mui/material/Box";
|
||||
import { mixFetch } from "@nymproject/mix-fetch-full-fat";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import Paper from "@mui/material/Paper";
|
||||
import type { SetupMixFetchOps } from "@nymproject/mix-fetch-full-fat";
|
||||
|
||||
const defaultUrl = 'https://nymtech.net/favicon.svg';
|
||||
const args = { mode: 'unsafe-ignore-cors' };
|
||||
const defaultUrl = "https://nymtech.net/favicon.svg";
|
||||
const args = { mode: "unsafe-ignore-cors" };
|
||||
|
||||
const mixFetchOptions: SetupMixFetchOps = {
|
||||
preferredGateway: '6Gb7ftQdKveMjPyrxDXeAtfYAX7Zg5mVZHtnRC5MmZ1B', // with WSS
|
||||
preferredGateway: "6Gb7ftQdKveMjPyrxDXeAtfYAX7Zg5mVZHtnRC5MmZ1B", // with WSS
|
||||
preferredNetworkRequester:
|
||||
'8rRGWy54oC8drFL9DepMegBt2DLrsqQwCoHMXt9nsnTo.2XjCPVbb4FpQ9hNRcXwb9mTzEAVVk1zf1tcch3wdtNEA@6Gb7ftQdKveMjPyrxDXeAtfYAX7Zg5mVZHtnRC5MmZ1B',
|
||||
"8rRGWy54oC8drFL9DepMegBt2DLrsqQwCoHMXt9nsnTo.2XjCPVbb4FpQ9hNRcXwb9mTzEAVVk1zf1tcch3wdtNEA@6Gb7ftQdKveMjPyrxDXeAtfYAX7Zg5mVZHtnRC5MmZ1B",
|
||||
mixFetchOverride: {
|
||||
requestTimeoutMs: 60_000,
|
||||
},
|
||||
forceTls: true, // force WSS
|
||||
extra: {},
|
||||
};
|
||||
|
||||
export const MixFetch = () => {
|
||||
@@ -44,7 +43,7 @@ export const MixFetch = () => {
|
||||
};
|
||||
|
||||
return (
|
||||
<div style={{ marginTop: '1rem' }}>
|
||||
<div style={{ marginTop: "1rem" }}>
|
||||
<Stack direction="row">
|
||||
<TextField
|
||||
disabled={busy}
|
||||
@@ -55,7 +54,12 @@ export const MixFetch = () => {
|
||||
defaultValue={defaultUrl}
|
||||
onChange={(e) => setUrl(e.target.value)}
|
||||
/>
|
||||
<Button variant="outlined" disabled={busy} sx={{ marginLeft: '1rem' }} onClick={handleFetch}>
|
||||
<Button
|
||||
variant="outlined"
|
||||
disabled={busy}
|
||||
sx={{ marginLeft: "1rem" }}
|
||||
onClick={handleFetch}
|
||||
>
|
||||
Fetch
|
||||
</Button>
|
||||
</Stack>
|
||||
@@ -0,0 +1,20 @@
|
||||
import {Accordion, AccordionItem} from "@nextui-org/react";
|
||||
|
||||
export const App = () => {
|
||||
const defaultContent =
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.";
|
||||
|
||||
return (
|
||||
<Accordion variant="shadow">
|
||||
<AccordionItem key="1" aria-label="Accordion 1" title="Accordion 1">
|
||||
{defaultContent}
|
||||
</AccordionItem>
|
||||
<AccordionItem key="2" aria-label="Accordion 2" title="Accordion 2">
|
||||
{defaultContent}
|
||||
</AccordionItem>
|
||||
<AccordionItem key="3" aria-label="Accordion 3" title="Accordion 3">
|
||||
{defaultContent}
|
||||
</AccordionItem>
|
||||
</Accordion>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Tabs } from 'nextra/components';
|
||||
import Mixnodes from 'components/operators/snippets/mixnode-migrate-tab-snippet.mdx';
|
||||
import Gateways from 'components/operators/snippets/gateway-migrate-tab-snippet.mdx'
|
||||
|
||||
export const MigrateTabs = () => {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Tabs items={[
|
||||
<code>nym-mixnode</code>,
|
||||
<code>nym-gateway</code>
|
||||
]} defaultIndex="1">
|
||||
<Tabs.Tab><Mixnodes/></Tabs.Tab>
|
||||
<Tabs.Tab><Gateways/></Tabs.Tab>
|
||||
</Tabs>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Tabs } from 'nextra/components';
|
||||
import Mixnodes from 'components/operators/snippets/mixnode-run-tab-snippet.mdx';
|
||||
import EntryGateway from 'components/operators/snippets/entry-gateway-run-tab-snippet.mdx';
|
||||
import ExitGateway from 'components/operators/snippets/exit-gateway-run-tab-snippet.mdx';
|
||||
|
||||
export const RunTabs = () => {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Tabs items={[
|
||||
<code>mixnode</code>,
|
||||
<code>exit-gateway</code>,
|
||||
<code>entry-gateway</code>
|
||||
]} defaultIndex="1">
|
||||
<Tabs.Tab><Mixnodes/></Tabs.Tab>
|
||||
<Tabs.Tab><ExitGateway/></Tabs.Tab>
|
||||
<Tabs.Tab><EntryGateway/></Tabs.Tab>
|
||||
</Tabs>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<>
|
||||
If you run a `nym-node` for the first time, you will need to specify a few parameters, please read the section [Essential Parameters & Variables](#essential-paramteters--varibles) before you start and make sure that your `nym-node` is up to date with the [latest version](https://github.com/nymtech/nym/releases/).
|
||||
|
||||
**Initialise and run:**
|
||||
|
||||
To initialise and test run with yur node with all needed options, use this command:
|
||||
```sh
|
||||
./nym-node run --id <ID> --mode entry-gateway --public-ips "$(curl -4 https://ifconfig.me)" --hostname "<HOSTNAME>" --http-bind-address 0.0.0.0:8080 --mixnet-bind-address 0.0.0.0:1789 --location <LOCATION> --accept-operator-terms-and-conditions --wireguard-enabled true
|
||||
```
|
||||
If you prefer to have a generic local identifier set to `default-nym-node`, skip `--id` option.
|
||||
|
||||
We highly recommend to setup [reverse proxy and WSS](proxy-configuration.md) for `nym-node`. If you haven't configured any of that, skip `--hostname` flag.
|
||||
|
||||
In any case `--public-ips` is a necessity for your node to bond to API and communicate with the internet.
|
||||
|
||||
**Initialise only** without running the node with `--init-only` command :
|
||||
|
||||
Adding `--init-only` option results in `nym-node` initialising a configuration file `config.toml` without running - a good option for an initial node setup. Remember that if you using this flag on a node which already has a config file, this will not over-write the values, unless used with a specified flag `--write-changes` (`-w`) - a good option for introducing changes to your `config.toml` file.
|
||||
|
||||
```sh
|
||||
./nym-node run --id <ID> --init-only --mode entry-gateway --public-ips "$(curl -4 https://ifconfig.me)" --hostname "<HOSTNAME>" --http-bind-address 0.0.0.0:8080 --mixnet-bind-address 0.0.0.0:1789 --location <LOCATION> --wireguard-enabled true
|
||||
```
|
||||
|
||||
In the example above we dropped `--accept-operator-terms-and-conditions` as the flag must be added to a running command explicitly and it is not stored in the config, `--init-only` will not run the node.
|
||||
|
||||
**Deny init**
|
||||
|
||||
`--deny-init` was introduced as an additional safety for migration from legacy binaries to `nym-node` to prevent operators initialise over existing nodes. For most of the operators, this flag is not needed.
|
||||
|
||||
In this example we run the node with custom `--id` without initialising, using `--deny-init` command:
|
||||
```sh
|
||||
./nym-node run --id <ID> --deny-init --mode entry-gateway --accept-operator-terms-and-conditions
|
||||
```
|
||||
</>
|
||||
@@ -0,0 +1,35 @@
|
||||
<>
|
||||
If you run a `nym-node` for the first time, you will need to specify a few parameters, please read the section [Essential Parameters & Variables](#essential-paramteters--varibles) before you start and make sure that your `nym-node` is up to date with the [latest version](https://github.com/nymtech/nym/releases/).
|
||||
|
||||
**Initialise and Run**
|
||||
|
||||
To initialise and test run your node, use this command:
|
||||
```sh
|
||||
./nym-node run --id <ID> --mode exit-gateway --public-ips "$(curl -4 https://ifconfig.me)" --hostname "<HOSTNAME>" --http-bind-address 0.0.0.0:8080 --mixnet-bind-address 0.0.0.0:1789 --location <LOCATION> --accept-operator-terms-and-conditions --wireguard-enabled true
|
||||
```
|
||||
If you prefer to have a generic local identifier set to `default-nym-node`, skip `--id` option.
|
||||
|
||||
We highly recommend to setup [reverse proxy and WSS](proxy-configuration.md) for `nym-node`. If you haven't configured any of that, skip `--hostname` flag.
|
||||
|
||||
In any case `--public-ips` is a necessity for your node to bond to API and communicate with the internet.
|
||||
|
||||
|
||||
**Initialise only** without running the node with `--init-only` command:
|
||||
|
||||
Adding `--init-only` option results in `nym-node` initialising a configuration file `config.toml` without running - a good option for an initial node setup. Remember that if you using this flag on a node which already has a config file, this will not over-write the values, unless used with a specified flag `--write-changes` (`-w`) - a good option for introducing changes to your `config.toml` file.
|
||||
|
||||
```sh
|
||||
./nym-node run --id <ID> --init-only --mode exit-gateway --public-ips "$(curl -4 https://ifconfig.me)" --hostname "<HOSTNAME>" --http-bind-address 0.0.0.0:8080 --mixnet-bind-address 0.0.0.0:1789 --location <LOCATION> --wireguard-enabled true
|
||||
```
|
||||
|
||||
In the example above we dropped `--accept-operator-terms-and-conditions` as the flag must be added to a running command explicitly and it is not stored in the config, `--init-only` will not run the node.
|
||||
|
||||
**Deny init**
|
||||
|
||||
`--deny-init` was introduced as an additional safety for migration from legacy binaries to `nym-node` to prevent operators initialise over existing nodes. For most of the operators, this flag is not needed.
|
||||
|
||||
In this example we run the node with custom `--id` without initialising, using `--deny-init` command:
|
||||
```sh
|
||||
./nym-node run --id <ID> --deny-init --mode exit-gateway --accept-operator-terms-and-conditions
|
||||
```
|
||||
</>
|
||||
@@ -0,0 +1,23 @@
|
||||
import { Steps } from 'nextra/components';
|
||||
|
||||
<>
|
||||
Migrate your `nym-gateway` to `nym-node --mode entry-gateway` or `--mode exit-gateway` using these commands:
|
||||
<Steps>
|
||||
###### 1. Move relevant info from `config.toml`
|
||||
```sh
|
||||
./nym-node migrate --config-file ~/.nym/gateways/<GATEWAY_ID>/config/config.toml gateway
|
||||
```
|
||||
|
||||
###### 2. Initialise with new `nym-node` config chosing one of the options below:
|
||||
|
||||
- as `entry-gateway`:
|
||||
```sh
|
||||
./nym-node run --id <ID> --mode entry-gateway --public-ips "$(curl -4 https://ifconfig.me)" --hostname <HOSTNAME> --http-bind-address 0.0.0.0:8080 --mixnet-bind-address 0.0.0.0:1789 --location <LOCATION> --accept-operator-terms-and-conditions --wireguard-enabled true
|
||||
```
|
||||
|
||||
- or as `exit-gateway`:
|
||||
```sh
|
||||
./nym-node run --id <ID> --mode exit-gateway --public-ips "$(curl -4 https://ifconfig.me)" --hostname <HOSTNAME> --http-bind-address 0.0.0.0:8080 --mixnet-bind-address 0.0.0.0:1789 --location <LOCATION> --accept-operator-terms-and-conditions --wireguard-enabled true
|
||||
```
|
||||
</Steps>
|
||||
</>
|
||||
@@ -0,0 +1,16 @@
|
||||
import { Steps } from 'nextra/components';
|
||||
|
||||
<>
|
||||
Migrate your `nym-mixnode` to `nym-node --mode mixnode` using these commands:
|
||||
<Steps>
|
||||
###### 1. Move relevant info from `config.toml`
|
||||
```sh
|
||||
./nym-node migrate --config-file ~/.nym/mixnodes/<ID>/config/config.toml mixnode
|
||||
```
|
||||
|
||||
###### 2. Initialise with new `nym-node` config
|
||||
```sh
|
||||
./nym-node run --mode mixnode --id <ID> --location <LOCATION> --mixnet-bind-address 0.0.0.0:1789 --http-bind-address 0.0.0.0:8080 --accept-operator-terms-and-conditions
|
||||
```
|
||||
</Steps>
|
||||
</>
|
||||
@@ -0,0 +1,31 @@
|
||||
<>
|
||||
If you run a `nym-node` for the first time, you will need to specify a few parameters, please read the section [Essential Parameters & Variables](#essential-paramteters--varibles) before you start and make sure that your `nym-node` is up to date with the [latest version](https://github.com/nymtech/nym/releases/).
|
||||
|
||||
**Initialise and Run:**
|
||||
|
||||
To initialise and run your node, use this command:
|
||||
|
||||
```sh
|
||||
./nym-node run --mode mixnode --mixnet-bind-address 0.0.0.0:1789 --verloc-bind-address 0.0.0.0:1790 --http-bind-address 0.0.0.0:8080 --public-ips "$(curl -4 https://ifconfig.me)" --accept-operator-terms-and-conditions
|
||||
```
|
||||
|
||||
**Init only**
|
||||
|
||||
Adding `--init-only` option results in `nym-node` initialising a configuration file `config.toml` without running - a good option for an initial node setup. Remember that if you using this flag on a node which already has a config file, this will not over-write the values, unless used with a specified flag `--write-changes` (`-w`) - a good option for introducing changes to your `config.toml` file.
|
||||
|
||||
Initialise only with a custom `--id` and `--init-only` command:
|
||||
```sh
|
||||
./nym-node run --mode mixnode --id <ID> --init-only --mixnet-bind-address 0.0.0.0:1789 --verloc-bind-address 0.0.0.0:1790 --http-bind-address 0.0.0.0:8080 --public-ips "$(curl -4 https://ifconfig.me)" --accept-operator-terms-and-conditions
|
||||
```
|
||||
|
||||
If you prefer to have a generic local identifier set to `default-nym-node`, skip `--id` option.
|
||||
|
||||
**Deny init**
|
||||
|
||||
`--deny-init` was introduced as an additional safety for migration from legacy binaries to `nym-node` to prevent operators initialise over existing nodes. For most of the operators, this flag is not needed.
|
||||
|
||||
In this example we run the node with custom `--id` without initialising, using `--deny-init` command:
|
||||
```sh
|
||||
./nym-node run --mode mixnode --id <ID> --deny-init --accept-operator-terms-and-conditions
|
||||
```
|
||||
</>
|
||||
@@ -0,0 +1,13 @@
|
||||
Open the needed ports for `nym-node` by running these commands:
|
||||
|
||||
```sh
|
||||
ufw allow 22/tcp # SSH - you're in control of these ports
|
||||
ufw allow 80/tcp # HTTP
|
||||
ufw allow 443/tcp # HTTPS
|
||||
ufw allow 1789/tcp # Nym specific
|
||||
ufw allow 1790/tcp # Nym specific
|
||||
ufw allow 8080/tcp # Nym specific - nym-node-api
|
||||
ufw allow 9000/tcp # Nym Specific - clients port
|
||||
ufw allow 9001/tcp # Nym specific - wss port
|
||||
ufw allow 51822/udp # WireGuard
|
||||
```
|
||||
@@ -0,0 +1,10 @@
|
||||
Open the needed ports for `validator` by running these commands:
|
||||
|
||||
```sh
|
||||
ufw allow 1317 # REST API server endpoint
|
||||
ufw allow 26656 # Listen for incoming peer connections
|
||||
ufw allow 26660 # Listen for Prometheus connections
|
||||
ufw allow 22 # SSH port
|
||||
ufw allow 80 # http port
|
||||
ufw allow 443/tcp # https port
|
||||
```
|
||||
@@ -0,0 +1,7 @@
|
||||
import { Callout } from 'nextra/components';
|
||||
|
||||
If you want to bond or upgrade your `nym-node` via the CLI, then check out the [relevant section in the Nym CLI](https://nymtech.net/docs/tools/nym-cli.html#upgrade-a-mix-node) docs.
|
||||
|
||||
<Callout>
|
||||
If you run in mode `--entry-gateway` or `--exit-gateway`, visit [Nym Harbour Master](https://harbourmaster.nymtech.net/) to get all the probe info about your node directly from API.
|
||||
</Callout>
|
||||
@@ -0,0 +1,9 @@
|
||||
- Open your Desktop wallet
|
||||
|
||||
- Navigate to the `Bonding` page and click the `Node Settings` link in the top right corner
|
||||
|
||||

|
||||
|
||||
- Update the fields in the `Node Settings` page (usually the field `Version` is the only one to change) and click `Submit changes to the blockchain`.
|
||||
|
||||

|
||||
@@ -0,0 +1,6 @@
|
||||
import { Callout } from 'nextra/components'
|
||||
|
||||
<Callout type="info" emoji="ℹ️">
|
||||
Our documentation often refer to syntax annotated in `<>` brackets. We use this expression for variables that are unique to each user (like path, local moniker, versions etcetra).
|
||||
Any syntax in `<>` brackets needs to be substituted with your correct name or version, without the `<>` brackets. If you are unsure, please check our table of essential [parameters and variables](https://nymtech.net/docs/operators/variables.html).
|
||||
</Callout>
|
||||
@@ -0,0 +1,10 @@
|
||||
import VariableInfo from './snippets-general/varible-info-snippet.mdx';
|
||||
|
||||
export const VarInfo = () => {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<VariableInfo/ >
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
**Flag (Option)** ,**Variable** ,**Description** ,**Syntax example**
|
||||
`--mode` ,`<MODE>` ,"A functionality of your `nym-node` in the mixnet - mandatory! Chose from `entry-gateway`, `mixnode` or `exit-gateway` ",`--mode exit-gateway`
|
||||
`--id` ,`<ID>` ,"A local only `nym-node` identifier, specified by flag `--id`. Not mandatory as it defaults to `default-nym-node` if not specified. ",`--id alice_super_node`
|
||||
`-w` or `--write-changes` ,*none* ,Specify whether to write new changes - the values of other flags in the given command - to the config file ,`--write-changes`
|
||||
`--accept-operator-terms-and-conditions` ,*none* ,"A flag added explicitly to `nym-node run` command every time, showing that the operator agreed with [T&Cs](#terms--conditions) ",`--accept-operator-terms-and-conditions`
|
||||
`--public-ips` ,`<PUBLIC_IPS>` ,IPv4 of the `nym-node` server - mandatory! Use this address as a `host` value for bonding.Use this address as a `host` value for bonding. ,"`--public-ips ""$(curl -4 https://ifconfig.me)""` "
|
||||
`--mixnet-bind-address` ,`<MIXNET_BIND_ADDRESS>` ,Address to bind to for listening for mixnet packets - mandatory! Must be on port `1789`! ,`--mixnet-bind-address 0.0.0.0:1789`
|
||||
`--http-bind-address` ,`<HTTP_BIND_ADDRESS>` ,Socket address this node will use for binding its http API - mandatory! Must be on port `8080`! ,`--http-bind-address 0.0.0.0:8080`
|
||||
`--hostname` ,`<HOSTNAME>` ,"Your registered DNS domain, asigned to the VPS with `nym-node`. Use without prefix like `http://` or `https://` ",`exit-gateway1.squad.nsl`
|
||||
`--location` ,`<LOCATION>` ,"Location of your node. Formats 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. ",`--location JAM`
|
||||
`--wireguard-private-ip` ,`<WIREGUARD_PRIVATE_IP>` ,"Private IP address of the wireguard gateway. This mandatory field is set to a correct default: `10.1.0.1`, operators upgrading from older versions must overwrite it. ",`--wireguard-private-ip 10.1.0.1`
|
||||
`--wireguard-enabled` ,`<WIREGUARD_ENABLED>` ,"Specifies whether the wireguard service is enabled, possible values: `true` or `false` - `true` is recommended ",`--wireguard-enabled true`
|
||||
`--expose-system-info` ,`<EXPOSE_SYSTEM_INFO>` ,"Specify whether basic system information should be exposed. default: `true`, possible values: `true` or `false` ",`--expose-system-info false`
|
||||
`--expose-system-hardware` ,`<EXPOSE_SYSTEM_HARDWARE>` ,"Specify whether basic system hardware information should be exposed. default: `true`, possible values: `true` or `false` ",`--expose-system-hardware false`
|
||||
*not a flag* ,`<PATH_TO>` ,"Specify a full path to the given file, directory or binary behind this variable ",`/root/src/nym/target/release/`
|
||||
`--announce-wss-port`,`<ANNOUNCE_WSS_PORT>`,"Port listening to Web Secure Socket, default and recommended `9001`",`9001`
|
||||
`--landing-page-assets-path`,`<LANDING_PAGE_ASSETS_PATH>`,A sub-directory located at `/var/www/<HOSTNAME>` containing html configuration files,`/var/www/exit-gateway1.squad.nsl`
|
||||
,`<BINARY> `,A name of a binary,`nym-node`
|
||||
,`<ARGUMENTS>`,Replace with all flags used to run the binary with a given command,`--id alice_super_node –accept-operator-terms-and-conditions`
|
||||
,`<WELCOME_TEXT>`,Any text you want to show on the landing page ,"Welcome to Nym Node, operator contact is example@email.me"
|
||||
,`<NYXD_VERSION>`,Version of validator binaries,`v0.43.0`
|
||||
,`<ID_KEY>`,"Node public identity key, exposed on the network",`GQvHcg61viyN9brWn1hficjD66Q9TorsLN2CMGJewVfo`
|
||||
|
@@ -0,0 +1,16 @@
|
||||
| Flag (Option) | Variable | Description | Syntax example |
|
||||
| :-- | :--- | :--- | :--- |
|
||||
| `--mode` | `<MODE>` | A functionality of your `nym-node` in the mixnet - mandatory! Chose from `entry-gateway`, `mixnode` or `exit-gateway` | `--mode exit-gateway` |
|
||||
| `--id` | `<ID>` | A local only `nym-node` identifier, specified by flag `--id`. Not mandatory as it defaults to `default-nym-node` if not specified. | `--id alice_super_node` |
|
||||
| `-w` or `--write-changes` | *none* | Specify whether to write new changes - the values of other flags in the given command - to the config file | `--write-changes` |
|
||||
| `--accept-operator-terms-and-conditions` | *none* | A flag added explicitly to `nym-node run` command every time, showing that the operator agreed with [T&Cs](#terms--conditions) | `--accept-operator-terms-and-conditions` |
|
||||
| `--public-ips` | `<PUBLIC_IPS>` | IPv4 of the `nym-node` server - mandatory! Use this address as a `host` value for bonding.Use this address as a `host` value for bonding. | `--public-ips "$(curl -4 https://ifconfig.me)"` |
|
||||
| `--mixnet-bind-address` | `<MIXNET_BIND_ADDRESS>` | Address to bind to for listening for mixnet packets - mandatory! Must be on port `1789`! | `--mixnet-bind-address 0.0.0.0:1789` |
|
||||
| `--http-bind-address` | `<HTTP_BIND_ADDRESS>` | Socket address this node will use for binding its http API - mandatory! Must be on port `8080`! | `--http-bind-address 0.0.0.0:8080` |
|
||||
| `--hostname` | `<HOSTNAME>` | Your registered DNS domain, asigned to the VPS with `nym-node`. Use without prefix like `http://` or `https://` | `exit-gateway1.squad.nsl` |
|
||||
| `--location` | `<LOCATION>` | Loacation of your node. Formats 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. | `--location JAM` |
|
||||
| `--wireguard-private-ip` | `<WIREGUARD_PRIVATE_IP>` | Private IP address of the wireguard gateway. This mandatory field is set to a correct default: `10.1.0.1`, operators upgrading from older versions must overwrite it. | `--wireguard-private-ip 10.1.0.1` |
|
||||
| `--wireguard-enabled` | `<WIREGUARD_ENABLED>` | Specifies whether the wireguard service is enabled, possible values: `true` or `false` - `true` is recommended | `--wireguard-enabled true` |
|
||||
| `--expose-system-info` | `<EXPOSE_SYSTEM_INFO>` | Specify whether basic system information should be exposed. default: `true`, possible values: `true` or `false` | `--expose-system-info false` |
|
||||
| `--expose-system-hardware` | `<EXPOSE_SYSTEM_HARDWARE>` | Specify whether basic system hardware information should be exposed. default: `true`, possible values: `true` or `false` | `--expose-system-hardware false` |
|
||||
| *not a flag* | `<PATH_TO>` | Specify a full path to the given file, directory or binary behind this variable | `/root/src/nym/target/release/` |
|
||||
@@ -2,4 +2,4 @@
|
||||
/// <reference types="next/image-types/global" />
|
||||
|
||||
// NOTE: This file should not be edited
|
||||
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
||||
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
|
||||
@@ -0,0 +1,475 @@
|
||||
// const path = require('path');
|
||||
// const CopyPlugin = require('copy-webpack-plugin');
|
||||
|
||||
const withNextra = require("nextra")({
|
||||
theme: "nextra-theme-docs",
|
||||
themeConfig: "./theme.config.tsx",
|
||||
});
|
||||
|
||||
const nextra = withNextra();
|
||||
nextra.webpack = (config, options) => {
|
||||
// generate Nextra's webpack config
|
||||
const newConfig = withNextra().webpack(config, options);
|
||||
|
||||
newConfig.module.rules.push({
|
||||
test: /\.txt$/i,
|
||||
use: "raw-loader",
|
||||
});
|
||||
|
||||
// TODO: figure out how to properly bundle WASM and workers with Nextra
|
||||
// newConfig.plugins.push(
|
||||
// new CopyPlugin({
|
||||
// patterns: [
|
||||
// {
|
||||
// from: path.resolve(path.dirname(require.resolve('@nymproject/mix-fetch/package.json')), '*.wasm'),
|
||||
// to: '[name][ext]',
|
||||
// context: path.resolve(__dirname, 'out'),
|
||||
// },
|
||||
// {
|
||||
// from: path.resolve(path.dirname(require.resolve('@nymproject/mix-fetch/package.json')), '*worker*.js'),
|
||||
// to: '[name][ext]',
|
||||
// context: path.resolve(__dirname, 'out'),
|
||||
// },
|
||||
// ],
|
||||
// }),
|
||||
// );
|
||||
|
||||
return newConfig;
|
||||
};
|
||||
|
||||
const config = {
|
||||
...nextra,
|
||||
// output: 'export', // static HTML files, has problems with Vercel
|
||||
// rewrites: undefined,
|
||||
async redirects() {
|
||||
return [
|
||||
// network docs
|
||||
{
|
||||
source: "/docs",
|
||||
destination: "/",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/docs/architecture/nym-vs-others.html",
|
||||
destination: "/network/architecture/nym-vs-others",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/docs/architecture/traffic-flow.html",
|
||||
destination: "/network/traffic",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/docs/architecture/addressing-system.html",
|
||||
destination: "/network/traffic/addressing-system",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/docs/binaries/pre-built-binaries.html",
|
||||
destination: "/developers/binaries#building-from-source",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/docs/binaries/init-and-config.html",
|
||||
destination: "/developers/binaries#building-from-source",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/docs/binaries/building-nym.html",
|
||||
destination: "/developers/binaries#building-from-source",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/docs/nodes/overview.html ",
|
||||
destination: "/network/architecture/mixnet/nodes",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/docs/wallet/desktop-wallet.html",
|
||||
destination:
|
||||
"https://github.com/nymtech/nym/tree/master/nym-wallet#installation-prerequisites---linux--mac",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/docs/wallet/cli-wallet.html",
|
||||
destination: "/developers/chain/cli-wallet",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/docs/explorers/mixnet-explorer.html",
|
||||
destination:
|
||||
"https://github.com/nymtech/nym/tree/master/explorer#nym-network-explorer",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/docs/nyx/interacting-with-chain.html",
|
||||
destination: "/developers/chain",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/docs/nyx/smart-contracts.html",
|
||||
destination: "/network/architecture/nyx/smart-contracts",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/docs/nyx/mixnet-contract.html",
|
||||
destination:
|
||||
"/network/architecture/nyx/smart-contracts/mixnet-contract",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/docs/nyx/vesting-contract.html",
|
||||
destination:
|
||||
"/network/architecture/nyx/smart-contracts/vesting-contract",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/docs/nyx/rpc-node.html",
|
||||
destination: "/developers/chain/rpc-node",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/docs/nyx/ledger-live.html",
|
||||
destination: "/developers/chain/ledger-live",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/docs/coconut.html",
|
||||
destination: "/network/cryptography/zk-nym",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/docs/nyx/bandwidth-credentials.html",
|
||||
destination: "/network/cryptography/zk-nym",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/docs/tools/nym-cli.html",
|
||||
destination: "/developers/tools/nym-cli",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/docs/coc.html",
|
||||
destination: "/network/coc",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/docs/licensing.html",
|
||||
destination: "/network/licensing",
|
||||
permanent: true,
|
||||
},
|
||||
// dev docs
|
||||
{
|
||||
source: "/developers/clients-overview.html",
|
||||
destination: "/developers/clients",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/sdk/rust/rust.html",
|
||||
destination: "/developers/rust",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/sdk/rust/message-types.html",
|
||||
destination: "/developers/rust/mixnet/message-types",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/sdk/rust/message-helpers.html",
|
||||
destination: "/developers/rust/mixnet/message-helpers",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/sdk/rust/troubleshooting.html",
|
||||
destination: "/developers/rust/mixnet/troubleshooting",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/sdk/rust/examples.html",
|
||||
destination: "/developers/rust/mixnet/examples",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/sdk/rust/examples/simple.html",
|
||||
destination: "/developers/rust/mixnet/examples/simple",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/sdk/rust/examples/keys.html",
|
||||
destination: "/developers/sdk/rust/examples/keys.html",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/sdk/rust/examples/storage.html",
|
||||
destination:
|
||||
"/developers/rust/mixnet/examples/builders/builder-with-storage",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/sdk/rust/examples/surbs.html",
|
||||
destination: "/developers/rust/mixnet/examples/surbs",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/sdk/rust/examples/custom-network.html",
|
||||
destination: "/developers/rust/mixnet/examples/custom-topology",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/sdk/rust/examples/socks.html",
|
||||
destination: "/developers/rust/mixnet/examples/socks",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/sdk/rust/examples/split-send.html",
|
||||
destination: "/developers/rust/mixnet/examples/split-send",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/sdk/rust/examples/credential.html",
|
||||
destination: "/developers/rust/mixnet",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/sdk/rust/examples/cargo.html",
|
||||
destination: "/developers/rust/importing",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/sdk/typescript.html",
|
||||
destination: "/developers/typescript",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/binaries/pre-built-binaries.html",
|
||||
destination: "/developers/binaries#pre-built-binaries",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/binaries/building-nym.html",
|
||||
destination: "/developers/binaries",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/clients/websocket-client.html",
|
||||
destination: "/developers/clients/websocket",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/clients/websocket/setup.html",
|
||||
destination: "/developers/clients/websocket/setup",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/clients/websocket/config.html",
|
||||
destination: "/developers/clients/websocket/config",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/clients/websocket/usage.html",
|
||||
destination: "/developers/clients/websocket/usage",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/clients/websocket/examples.html",
|
||||
destination: "/developers/clients/websocket/examples",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/clients/socks5-client.html",
|
||||
destination: "/developers/clients/socks5",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/clients/socks5/setup.html",
|
||||
destination: "/developers/clients/socks5#client-setup",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/clients/socks5/usage.html",
|
||||
destination: "/developers/clients/socks5#using-your-socks5-client",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/clients/webassembly-client.html",
|
||||
destination: "/developers/clients/webassembly-client",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/tutorials/coming-soon.html",
|
||||
destination: "/developers/rust#",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/integrations/integration-options.html",
|
||||
destination: "/developers/integrations",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/faq/integrations-faq.html",
|
||||
destination: "/developers/integrations",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/coc.html",
|
||||
destination: "/developers/coc",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/licensing.html",
|
||||
destination: "/developers/licensing",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/nymvpn/intro.html",
|
||||
destination: "/developers/archive/nymvpn",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/nymvpn/cli.html",
|
||||
destination: "/developers/nymvpn/cli",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/developers/archive/nym-connect.html",
|
||||
destination: "/developers/archive/nym-connect",
|
||||
permanent: true,
|
||||
},
|
||||
// operators:
|
||||
// specific urls that have changed
|
||||
{
|
||||
source: "/operators/nodes/wallet-preparation.html",
|
||||
destination: "/operators/nodes/preliminary-steps/wallet-preparation",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/operators/nodes/vps-setup.html",
|
||||
destination: "/operators/nodes/preliminary-steps/vps-setup",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/operators/nodes/proxy-configuration.html",
|
||||
destination:
|
||||
"/operators/nodes/nym-node/configuration/proxy-configuration",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/operators/nodes/bonding.html",
|
||||
destination: "/operators/nodes/nym-node/bonding",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/operators/nodes/nym-api.html",
|
||||
destination: "/operators/nodes/validator-setup/nym-api",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/operators/nodes/nyx-configuration.html",
|
||||
destination: "/operators/nodes/validator-setup/nyx-configuration",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/operators/nodes/manual-upgrade.html",
|
||||
destination: "/operators/nodes/maintenance/manual-upgrade",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/operators/nodes/nymvisor-upgrade.html",
|
||||
destination: "/operators/nodes/maintenance/nymvisor-upgrade",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/operators/testing/performance.html",
|
||||
destination: "/operators/nodes/performance-and-testing",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/operators/testing/gateway-probe.html",
|
||||
destination: "/operators/nodes/performance-and-testing/gateway-probe",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/operators/testing/node-api-check.html",
|
||||
destination: "/operators/nodes/performance-and-testing/node-api-check",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/operators/testing/prometheus-grafana.html",
|
||||
destination:
|
||||
"/operators/nodes/performance-and-testing/prometheus-grafana",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/operators/testing/explorenym-scripts.html",
|
||||
destination:
|
||||
"/operators/nodes/performance-and-testing/prometheus-grafana/explorenym-scripts",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/operators/legal/community-counsel.html",
|
||||
destination: "/operators/community-counsel",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/operators/legal/exit-gateway.html",
|
||||
destination: "/operators/community-counsel/exit-gateway",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/operators/legal/isp-list.html",
|
||||
destination: "/operators/community-counsel/isp-list",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/operators/legal/jurisdictions.html",
|
||||
destination: "/operators/community-counsel/jurisdictions",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/operators/legal/swiss.html",
|
||||
destination: "/operators/community-counsel/jurisdictions/swiss",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/operators/legal/united-states.html",
|
||||
destination: "/operators/community-counsel/jurisdictions/united-states",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/operators/legal/landing-pages.html",
|
||||
destination: "/operators/community-counsel/landing-pages",
|
||||
permanent: true,
|
||||
},
|
||||
{
|
||||
source: "/operators/legal/add-content.html",
|
||||
destination: "/operators/community-counsel/add-content",
|
||||
permanent: true,
|
||||
},
|
||||
// {
|
||||
// source: "",
|
||||
// destination: "",
|
||||
// permanent: true,
|
||||
// },
|
||||
// since the filepaths are mostly the same, we otherwise just match on old URLs that end with .html
|
||||
{
|
||||
source: "/:path*.html",
|
||||
destination: "/:path*",
|
||||
permanent: false,
|
||||
},
|
||||
/*
|
||||
TODO
|
||||
/developers/examples/custom-services.html
|
||||
/developers/examples/using-nrs.html
|
||||
/developers/examples/browser-only.html
|
||||
/developers/examples/monorepo-examples.html
|
||||
/developers/integrations/payment-integration.html
|
||||
*/
|
||||
];
|
||||
},
|
||||
images: {
|
||||
unoptimized: true,
|
||||
},
|
||||
transpilePackages: ["@nymproject/contract-clients"],
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
@@ -1,17 +1,20 @@
|
||||
{
|
||||
"name": "@nymproject/ts-sdk-docs",
|
||||
"version": "1.3.0-rc.0",
|
||||
"description": "Nym Typescript SDK Docs",
|
||||
"name": "Nym Docs",
|
||||
"version": "1.5-rc.0",
|
||||
"description": "Nym Docs",
|
||||
"license": "Apache-2.0",
|
||||
"author": "Nym Technologies SA",
|
||||
"scripts": {
|
||||
"generate:commands": "../scripts/next-scripts/autodoc.sh",
|
||||
"build": "next build",
|
||||
"dev": "next dev",
|
||||
"dev": " next dev",
|
||||
"lint": "next lint",
|
||||
"lint:fix": "next lint --fix",
|
||||
"start": "next start"
|
||||
},
|
||||
"dependencies": {
|
||||
"@coreui/coreui": "^5.1.2",
|
||||
"@coreui/react": "^5.4.0",
|
||||
"@cosmjs/amino": "^0.32.2",
|
||||
"@cosmjs/cosmwasm-launchpad": "^0.25.6",
|
||||
"@cosmjs/cosmwasm-stargate": "^0.32.2",
|
||||
@@ -29,14 +32,17 @@
|
||||
"@mui/icons-material": "^5.14.9",
|
||||
"@mui/lab": "^5.0.0-alpha.145",
|
||||
"@mui/material": "^5.14.8",
|
||||
"@nextui-org/accordion": "^2.0.40",
|
||||
"@nextui-org/react": "^2.4.8",
|
||||
"@nymproject/contract-clients": ">=1.2.4-rc.2 || ^1",
|
||||
"@nymproject/mix-fetch-full-fat": ">=1.2.4-rc.2 || ^1",
|
||||
"@nymproject/sdk-full-fat": ">=1.2.4-rc.2 || ^1",
|
||||
"chain-registry": "^1.19.0",
|
||||
"cosmjs-types": "^0.9.0",
|
||||
"lucide-react": "^0.438.0",
|
||||
"next": "^13.4.19",
|
||||
"nextra": "latest",
|
||||
"nextra-theme-docs": "latest",
|
||||
"nextra": "2",
|
||||
"nextra-theme-docs": "2",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"save": "^2.9.0",
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"index": {
|
||||
"display": "hidden"
|
||||
},
|
||||
"network": {
|
||||
"title": "Network",
|
||||
"type": "page"
|
||||
},
|
||||
"developers": {
|
||||
"title": "Developers",
|
||||
"type": "menu",
|
||||
"items": {
|
||||
"developers": {
|
||||
"title": "Developer Overview",
|
||||
"href": "/developers/"
|
||||
},
|
||||
"rust": {
|
||||
"title": "Rust SDK",
|
||||
"href": "/developers/rust"
|
||||
},
|
||||
"typescript": {
|
||||
"title": "Typescript SDK",
|
||||
"href": "/developers/typescript"
|
||||
}
|
||||
}
|
||||
},
|
||||
"operators": {
|
||||
"title": "Operators",
|
||||
"type": "page"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"index": "Introduction",
|
||||
"concepts": "Core Concepts",
|
||||
"binaries": "Binaries",
|
||||
"integrations": "Integration Options",
|
||||
"clients": "Clients",
|
||||
"tools": "Tools",
|
||||
"chain": "Interacting with Nyx",
|
||||
"--": {
|
||||
"type": "separator"
|
||||
},
|
||||
"rust": "Rust SDK",
|
||||
"typescript": "Typescript SDK",
|
||||
"---": {
|
||||
"type": "separator"
|
||||
},
|
||||
"archive": "Archive",
|
||||
"licensing": "Licensing",
|
||||
"coc": "Coc"
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
# Archive page: NymConnect Setup
|
||||
|
||||
```admonish warning
|
||||
Since the beginning of 2024 NymConnect is no longer maintained. Nym is developing a new client called [NymVPN](https://nymvpn.com), an application routing all users traffic thorugh the mixnet.
|
||||
If users want to route their traffic through socks5 we advice to use maintained [Nym Socks5 Client](../clients/socks5/setup.md).
|
||||
```
|
||||
|
||||
In case you want to run deprecated NymConnect, follow these steps:
|
||||
|
||||
1. Navigate to our [Github repository](https://github.com/nymtech/nym/releases?q=nym-connect&expanded=true) and download NymConnect binary
|
||||
2. On Linux and Mac, make executable by opening terminal in the same directory and run:
|
||||
|
||||
```sh
|
||||
chmod +x ./nym-connect_<VERSION>.AppImage
|
||||
```
|
||||
|
||||
1. Start the application
|
||||
2. Click on `Connect` button to initialise the connection with the Mixnet
|
||||
3. Anytime you'll need to setup Host and Port in your applications, click on `IP` and `Port` to copy the values to clipboard
|
||||
4. In case you have problems such as `Gateway Issues`, try to reconnect or restart the application
|
||||
|
||||
## Connect Privacy Enhanced Applications (PEApps)
|
||||
|
||||
Here are some examples of applications which will work behind Socks5 proxy (`nym-socks5-client` or deprecated NymConnect), to enhance users privacy.
|
||||
|
||||
### Electrum Bitcoin wallet via NymConnect
|
||||
|
||||
To download Electrum visit the [official webpage](https://electrum.org/#download). To connect to the Mixnet follow these steps:
|
||||
|
||||
1. Start and connect NymConnect (or [`nym-socks5-client`](../clients/socks5/setup.md))
|
||||
2. Start your Electrum Bitcoin wallet
|
||||
3. Go to: *Tools* -> *Network* -> *Proxy*
|
||||
4. Set *Use proxy* to ✅, choose `SOCKS5` from the drop-down and add (copy-paste) the values from your NymConnect application
|
||||
5. Now your Electrum Bitcoin wallet runs through the Mixnet and it will be connected only if your NymConnect or `nym-socks5-client` are connected.
|
||||
|
||||

|
||||
|
||||
### Monero wallet via NymConnect
|
||||
|
||||
To download Monero wallet visit [getmonero.org](https://www.getmonero.org/downloads/). To connect to the Mixnet follow these steps:
|
||||
|
||||
1. Start and connect NymConnect (or [`nym-socks5-client`](../clients/socks5/setup.md))
|
||||
2. Start your Monero wallet
|
||||
3. Go to: *Settings* -> *Interface* -> *Socks5 proxy* -> Add values: IP address `127.0.0.1`, Port `1080` (the values copied from NymConnect)
|
||||
5. Now your Monero wallet runs through the Mixnet and it will be connected only if your NymConnect or `nym-socks5-client` are connected.
|
||||
|
||||
|
||||
### Matrix (Element) via NymConnect
|
||||
|
||||
To download Element (chat client for Matrix) visit [element.io](https://element.io/download). To connect to the Mixnet follow these steps:
|
||||
|
||||
1. Start and connect NymConnect (or [`nym-socks5-client`](../clients/socks5/setup.md))
|
||||
2. Start `element-desktop` with `--proxy-server` argument:
|
||||
|
||||
**Linux**
|
||||
|
||||
```sh
|
||||
element-desktop --proxy-server=socks5://127.0.0.1:1080
|
||||
```
|
||||
|
||||
**Mac**
|
||||
|
||||
```sh
|
||||
open -a Element --args --proxy-server=socks5://127.0.0.1:1080
|
||||
```
|
||||
|
||||
To make the start of Element over NymConnect simplier, you can add this command to your key-binding shortcuts in your system settings.
|
||||
|
||||
### Telegram via NymConnect
|
||||
|
||||
1. Start and connect NymConnect (or [`nym-socks5-client`](../clients/socks5/setup.md))
|
||||
2. Start your Telegram chat application
|
||||
3. Open the Telegram proxy settings.
|
||||
- Linux: *Settings* -> *Advanced* -> *Connection type* -> *Use custom proxy*
|
||||
- MacOS: *Settings* -> *Advanced* -> *Data & Storage* -> *Connection Type* -> *Use custom Proxy*
|
||||
- Windows: *Settings* -> *Data and Storage* -> *Use proxy*
|
||||
4. Add a proxy with the *Add proxy button*.
|
||||
5. Select *SOCKS5* and make sure the port details are the same as those generated by NymConnect. Alternatively, follow this link: [https://t.me/socks?server=127.0.0.1&port=1080](https://t.me/socks?server=127.0.0.1&port=1080)
|
||||
6. *Save the proxy settings* in Telegram.
|
||||
7. Telegram is now running through the Nym Mixnet and is privacy-enhanced! This allows you to connect from regions which blocked Telegram.
|
||||
8. Note if you remain idle on Telegram for a while you might lose connectivity and your messages might not get through via SOCKS5 proxy. If that happens reconnect your NymConnect and reset the proxy again.
|
||||
|
||||
|
||||
Follow this [video](https://youtu.be/quj8H2qeOwY?t=97) to see the steps on Telegram setup.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user