Compare commits
152 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 093e6482fc | |||
| c0c3c437d5 | |||
| 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 |
Generated
+31
@@ -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"
|
||||
@@ -2185,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"
|
||||
@@ -2208,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"
|
||||
|
||||
@@ -93,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",
|
||||
|
||||
+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>
|
||||
);
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.9 KiB |
@@ -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 "./images/network-docs.png";
|
||||
import developerDocs from "./images/developer-docs.png";
|
||||
import sdkDocs from "./images/sdk-docs.png";
|
||||
import operatorGuide from "./images/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",
|
||||
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 "../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/` |
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
@@ -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,360 @@
|
||||
// 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,
|
||||
},
|
||||
// {
|
||||
// source: "",
|
||||
// destination: "",
|
||||
// permanent: true,
|
||||
// },
|
||||
/*
|
||||
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
|
||||
OPERATORS
|
||||
*/
|
||||
];
|
||||
},
|
||||
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.
|
||||
@@ -0,0 +1,64 @@
|
||||
# Nym Binaries
|
||||
|
||||
## Building from Source
|
||||
|
||||
> Nym runs on Mac OS X, Linux, and Windows. All nodes **except the Desktop Wallet and NymConnect** on Windows should be considered experimental - it works fine if you're an app developer but isn't recommended for running nodes.
|
||||
|
||||
## Building Nym
|
||||
Nym has two main codebases:
|
||||
|
||||
- the [Nym platform](https://github.com/nymtech/nym), written in Rust. This contains all of our code _except_ for the validators.
|
||||
- the [Nym validators](https://github.com/nymtech/nyxd), written in Go.
|
||||
|
||||
> This page details how to build the main Nym platform code. **If you want to build and run a validator, [go here]() TODO LINK AFTER MERGE instead.**
|
||||
|
||||
## Prerequisites
|
||||
- Debian/Ubuntu: `pkg-config`, `build-essential`, `libssl-dev`, `curl`, `jq`, `git`
|
||||
|
||||
```
|
||||
apt install pkg-config build-essential libssl-dev curl jq git
|
||||
```
|
||||
|
||||
- Arch/Manjaro: `base-devel`
|
||||
|
||||
```
|
||||
pacman -S base-devel
|
||||
```
|
||||
|
||||
- Mac OS X: `pkg-config` , `brew`, `openss1`, `protobuf`, `curl`, `git`
|
||||
Running the following the script installs Homebrew and the above dependencies:
|
||||
|
||||
```
|
||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
```
|
||||
|
||||
- `Rust & cargo >= {{minimum_rust_version}}`
|
||||
|
||||
We recommend using the [Rust shell script installer](https://www.rust-lang.org/tools/install). Installing cargo from your package manager (e.g. `apt`) is not recommended as the packaged versions are usually too old.
|
||||
|
||||
If you really don't want to use the shell script installer, the [Rust installation docs](https://forge.rust-lang.org/infra/other-installation-methods.html) contain instructions for many platforms.
|
||||
|
||||
## Download and build Nym binaries
|
||||
The following commands will compile binaries into the `nym/target/release` directory:
|
||||
|
||||
```sh
|
||||
rustup update
|
||||
git clone https://github.com/nymtech/nym.git
|
||||
cd nym
|
||||
|
||||
git reset --hard # in case you made any changes on your branch
|
||||
git pull # in case you've checked it out before
|
||||
|
||||
git checkout master # master branch has the latest release version: `develop` will most likely be incompatible with deployed public networks
|
||||
|
||||
cargo build --release # build your binaries with **mainnet** configuration
|
||||
```
|
||||
|
||||
> You cannot build from GitHub's .zip or .tar.gz archive files on the releases page - the Nym build scripts automatically include the current git commit hash in the built binary during compilation, so the build will fail if you use the archive code (which isn't a Git repository). Check the code out from github using `git clone` instead.
|
||||
|
||||
|
||||
## Pre-built Binaries
|
||||
|
||||
The [Github releases page](https://github.com/nymtech/nym/releases) has pre-built binaries which should work on Ubuntu 20.04 and other Debian-based systems, but at this stage cannot be guaranteed to work everywhere.
|
||||
|
||||
If the pre-built binaries don't work or are unavailable for your system, you will need to build the platform yourself.
|
||||
@@ -0,0 +1,15 @@
|
||||
# Interacting with Nyx Chain and Smart Contracts
|
||||
|
||||
There are two options for interacting with the blockchain to send tokens or interact with deployed smart contracts:
|
||||
* [`Nym-CLI`](../tools/nym-cli.md) tool
|
||||
* `nyxd` binary
|
||||
|
||||
## Nym-CLI tool (recommended in most cases)
|
||||
The `nym-cli` tool is a binary offering a simple interface for interacting with deployed smart contract (for instance, bonding and unbonding a mix node from the CLI), as well as creating and managing accounts and keypairs, sending tokens, and querying the blockchain.
|
||||
|
||||
Instructions on how to do so can be found on the [`nym-cli` docs page](./tools/nym-cli)
|
||||
|
||||
## Nyxd binary
|
||||
The `nyxd` binary, although more complex to compile and use, offers the full range of commands availiable to users of CosmosSDK chains. Use this if you are (e.g.) wanting to perform more granular queries about transactions from the CLI.
|
||||
|
||||
You can use the instructions on how to do this on from the [`gaiad` docs page](https://hub.cosmos.network/main/delegators/delegator-guide-cli.html#querying-the-state).
|
||||
@@ -0,0 +1,6 @@
|
||||
# CLI Wallet
|
||||
|
||||
If you have already read our [validator setup and maintenance documentation]() TODO LINK AFTER MERGE you will have seen that we compile and use the `nyxd` binary primarily for our validators. This binary can however be used for many other tasks, such as creating and using keypairs for wallets, or automated setups that require the signing and broadcasting of transactions.
|
||||
|
||||
### Using `nyxd` binary as a CLI wallet
|
||||
You can use the `nyxd` as a minimal CLI wallet if you want to set up an account (or multiple accounts). Just compile the binary as per the documentation, **stopping after** the [building your validator]() TODO LINK AFTER MERGE step is complete. You can then run `nyxd keys --help` to see how you can set up and store different keypairs with which to interact with the Nyx blockchain.
|
||||
@@ -0,0 +1,2 @@
|
||||
# Cosmos Registry
|
||||
You can find all relevant information (chain info, RPC endpoints, etc) on the [Cosmos Chain Registry](https://github.com/cosmos/chain-registry/tree/master/nyx).
|
||||
@@ -0,0 +1,78 @@
|
||||
# Ledger Live Support
|
||||
|
||||
Use the following instructions to interact with the Nyx blockchain - either with deployed smart contracts, or just to send tokens - using your Ledger device to sign transactions.
|
||||
|
||||
## Prerequisites
|
||||
* Download and install [Ledger Live](https://www.ledger.com/ledger-live).
|
||||
* Compile the `nyxd` binary as per the instructions [here]() TODO LINK AFTER MERGE. Stop after you can successfully run `nyxd` and get the helptext in your console output.
|
||||
|
||||
## Prepare your Ledger App
|
||||
* Plug in your Ledger device
|
||||
* Install the `Cosmos (ATOM)` app by following the instructions [here](https://hub.cosmos.network/main/resources/ledger.html). This app allows you to interact with **any** Cosmos SDK chain - you can manage your ATOM, OSMOSIS, NYM tokens, etc.
|
||||
* On the device, navigate to the Cosmos app and open it
|
||||
|
||||
## Create a keypair
|
||||
Add a reference to the ledger device on your local machine by running the following command in the same directory as your `nyxd` binary:
|
||||
|
||||
```
|
||||
nyxd keys add ledger_account --ledger
|
||||
```
|
||||
|
||||
## Command help with `nyxd`
|
||||
More information about each command is available by consulting the help section (`--help`) at each layer of `nyxd`'s commands:
|
||||
|
||||
```
|
||||
# logging top level command help
|
||||
nyxd --help
|
||||
|
||||
# logging top level command help for transaction commands
|
||||
nyxd tx --help
|
||||
|
||||
# logging top level command help for transaction commands utilising the 'bank' module
|
||||
nyxd tx bank --help
|
||||
```
|
||||
|
||||
## Sending tokens between addresses
|
||||
Perform a transaction from the CLI with `nyxd`, appending the `--ledger` option to the command.
|
||||
|
||||
As an example, the below command will send 1 `NYM` from the ledger account to the `$DESTINATION_ACCOUNT`:
|
||||
|
||||
```
|
||||
nyxd tx bank send ledger_account $DESTINATION_ACCOOUNT 1000000unym --ledger --node https://rpc.dev.nymte.ch:443
|
||||
```
|
||||
|
||||
> When a command is run, the transaction will appear on the Ledger device and will require physical confirmation from the device before being signed.
|
||||
|
||||
## Nym-specific transactions
|
||||
Nym-specific commands and queries, like bonding a mix node or delegating unvested tokens, are available in the `wasm` module, and follow the following pattern:
|
||||
|
||||
```
|
||||
# Executing commands
|
||||
nyxd tx wasm execute $CONTRACT_ADDRESS $JSON_MSG
|
||||
|
||||
# Querying the state of a smart contract
|
||||
nyxd query wasm contract-state smart $CONTRACT_ADDRESS $JSON_MSG
|
||||
```
|
||||
|
||||
You can find the value of `$CONTRACT_ADDRESS` in the [`network defaults`](https://github.com/nymtech/nym/blob/master/common/network-defaults/src/mainnet.rs) file.
|
||||
|
||||
The value of `$JSON_MSG` will be a blog of `json` formatted as defined for each command and query. You can find these definitions for the mixnet smart contract [here](https://github.com/nymtech/nym/blob/master/common/cosmwasm-smart-contracts/mixnet-contract/src/msg.rs) and for the vesting contract [here](https://github.com/nymtech/nym/blob/master/common/cosmwasm-smart-contracts/vesting-contract/src/messages.rs) under `ExecuteMsg` and `QueryMsg`.
|
||||
|
||||
### Example command execution:
|
||||
#### Delegate to a mix node
|
||||
You can delegate to a mix node from the CLI using `nyxd` and signing the transaction with your ledger by filling in the values of this example:
|
||||
```
|
||||
CONTRACT_ADDRESS=mixnet_contract_address
|
||||
|
||||
./nyxd tx wasm execute $CONTRACT_ADDRESS '{"delegate_to_mixnode":{"mix_identity":"MIX_NODE_IDENTITY","amount":{"amount":"100000000000","denom":"unym"}}}' --ledger --from admin --node https://rpc.dev.nymte.ch:443 --gas-prices 0.025unymt --gas auto -b block
|
||||
```
|
||||
|
||||
> By replacing the value of `CONTRACT_ADDRESS` with the address of the vesting contract, you could use the above command to use tokens held in the vesting contract.
|
||||
|
||||
#### Query a vesting schedule
|
||||
You can query for (e.g.) seeing the current vesting period of an address by filling in the values of the following:
|
||||
```
|
||||
CONTRACT_ADDRESS=vesting_contract_address
|
||||
|
||||
nyxd query wasm contract-state smart $CONTRACT_ADDRESS '{"get_current_vesting_period"}:{"address": "address_to_query_for"}' --ledger --from admin --node https://rpc.dev.nymte.ch:443 --chain-id qa-net --gas-prices 0.025unymt --gas auto -b block
|
||||
```
|
||||
@@ -0,0 +1,9 @@
|
||||
# RPC Nodes
|
||||
|
||||
RPC Nodes (which might otherwise be referred to as 'Lite Nodes' or just 'Full Nodes') differ from Validators in that they hold a copy of the Nyx blockchain, but do **not** participate in consensus / block-production.
|
||||
|
||||
You may want to set up an RPC Node for querying the blockchain, or in order to have an endpoint that your app can use to send transactions.
|
||||
|
||||
In order to set up an RPC Node, simply follow the instructions to set up a [Validator]() TODO LINK AFTER MERGE, but **exclude the `nyxd tx staking create-validator` command**.
|
||||
|
||||
If you want to fast-sync your node, check out the Polkachu snapshot and their other [resources](https://polkachu.com/seeds/nym).
|
||||
@@ -0,0 +1,21 @@
|
||||
# Types of Nym clients
|
||||
At present, there are three Nym clients. These are built as standalone binaries when building our codebase, but are most easily accessed through one of our SDKs:
|
||||
|
||||
- the websocket (native) client - most easily accessed via the [Rust SDK](./rust) and [Go/C++ FFI](./rust/ffi).
|
||||
- the SOCKS5 client - most easily accessed via the [Rust SDK](./rust).
|
||||
- the wasm (webassembly) client - most easily via the [Typescript SDK](./typescript).
|
||||
|
||||
> For information about the role that clients play within the Nym system and their role when communicating with the Mixnet, see the [Client network docs](../network/architecture/mixnet/clients).
|
||||
|
||||
### The websocket client
|
||||
This is a compiled program that can run on Linux, Mac OS X, and Windows machines. It can be run as a persistent process on a desktop or server machine. You can connect to it with **any language that supports websockets**.
|
||||
|
||||
### The webassembly client
|
||||
If you're working in JavaScript or Typescript in the browser, or building an [edge computing](https://en.wikipedia.org/wiki/Edge_computing) app, you'll likely want to choose the webassembly client.
|
||||
|
||||
It's packaged and [available on the npm registry](https://www.npmjs.com/package/@nymproject/nym-client-wasm), so you can `npm install` it into your JavaScript or TypeScript application.
|
||||
|
||||
### The SOCKS5 client
|
||||
The `nym-socks5-client` is useful for allowing existing applications to use the Nym mixnet without any code changes. All that's necessary is that they can use one of the SOCKS5, SOCKS4a, or SOCKS4 proxy protocols (which many applications can - crypto wallets, browsers, chat applications etc).
|
||||
|
||||
When used as a standalone client, it's less flexible as a way of writing custom applications than the other clients, but able to be used to proxy application traffic through the mixnet without having to make any code changes.
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"socks5": "Socks5 (standalone)",
|
||||
"webassembly-client": "Webassembly Client",
|
||||
"websocket": "Websocket (standalone)"
|
||||
}
|
||||
@@ -0,0 +1,193 @@
|
||||
# Socks5 Client (Standalone)
|
||||
|
||||
> This client can also be utilised via the [Rust SDK](../rust).
|
||||
|
||||
## What is this client for?
|
||||
Many existing applications are able to use either the SOCKS4, SOCKS4A, or SOCKS5 proxy protocols. If you want to send such an application's traffic through the mixnet, you can use the `nym-socks5-client` to bounce network traffic through the Nym network, like this:
|
||||
|
||||
```mermaid
|
||||
---
|
||||
config:
|
||||
theme: neo-dark
|
||||
layout: elk
|
||||
---
|
||||
flowchart TB
|
||||
subgraph Local Machine[Local Machine]
|
||||
A[Application Logic]
|
||||
B[Nym Socks5 Client]
|
||||
end
|
||||
A <-->|Bytes| B
|
||||
B <-->|Sphinx Packets| EG
|
||||
|
||||
subgraph Mixnet Nodes[Mixnet Nodes]
|
||||
EG[/Entry Gateway/]
|
||||
M{Mix Nodes 1..3}
|
||||
ExG[\Exit Gateway\]
|
||||
end
|
||||
EG <-->|Sphinx Packets| M
|
||||
M <-->|Sphinx Packets| ExG
|
||||
|
||||
subgraph External Systems
|
||||
C[Blockchain RPC]
|
||||
D[Mail Server]
|
||||
E[Message Server]
|
||||
F[etc]
|
||||
end
|
||||
C <-->|Bytes| ExG
|
||||
D <-->|Bytes| ExG
|
||||
E <-->|Bytes| ExG
|
||||
F <-->|Bytes| ExG
|
||||
```
|
||||
|
||||
There are 2 pieces of software that work together to send SOCKS traffic through the mixnet: the `nym-socks5-client`, and a `nym-node` running as an Exit Gateway.
|
||||
|
||||
> The functionality performed by the Exit Gateway was previously performed by the `nym-network-requester`: this functionality has been migrated into the Exit Gateway mode of the `nym-node`.
|
||||
|
||||
The `nym-socks5-client` allows you to do the following from your local machine:
|
||||
* Take a TCP data stream from a application that can send traffic via SOCKS5.
|
||||
* Chop up the TCP stream into multiple Sphinx packets, assigning sequence numbers to them, while leaving the TCP connection open for more data
|
||||
* Send the Sphinx packets through the Nym Network. Packets are shuffled and mixed as they transit the mixnet.
|
||||
|
||||
The `nym-node` then reassembles the original TCP stream using the packets' sequence numbers, and make the intended request. It will then chop up the response into Sphinx packets and send them back through the mixnet to your `nym-socks5-client`. The application will then receive its data, without even noticing that it wasn't talking to a "normal" SOCKS5 proxy!
|
||||
|
||||
|
||||
## Download or compile socks5 client
|
||||
|
||||
If you are using OSX or a Debian-based operating system, you can download the `nym-socks5-client` binary from our [Github releases page](https://github.com/nymtech/nym/releases).
|
||||
|
||||
If you are using a different operating system, or want to build from source, simply use `cargo build --release` from the root of the Nym monorepo.
|
||||
|
||||
## Client setup
|
||||
### Viewing command help
|
||||
|
||||
You can check that your binaries are properly compiled with:
|
||||
|
||||
```
|
||||
./nym-socks5-client --help
|
||||
```
|
||||
|
||||
You can check the necessary parameters for the available commands by running:
|
||||
|
||||
```
|
||||
./nym-client <COMMAND> --help
|
||||
```
|
||||
|
||||
### Initialising a new client instance
|
||||
Before you can use the client, you need to initalise a new instance of it, which can be done with the following command:
|
||||
|
||||
```
|
||||
./nym-socks5-client init --id docs-example --use-reply-surbs true --provider Entztfv6Uaz2hpYHQJ6JKoaCTpDL5dja18SuQWVJAmmx.Cvhn9rBJw5Ay9wgHcbgCnVg89MPSV5s2muPV2YF1BXYu@Fo4f4SQLdoyoGkFae5TpVhRVoXCF8UiypLVGtGjujVPf
|
||||
```
|
||||
|
||||
The `--id` in the example above is a local identifier so that you can name your clients and keep track of them on your local system; it is **never** transmitted over the network.
|
||||
|
||||
The `--use-reply-surbs` field denotes whether you wish to send [SURBs](../../network/concepts/anonymous-replies) along with your request. It defaults to `false`, we are explicitly setting it as `true`. It defaults to `false` for compatibility with versions of the pre-smoosh `nym-network-requester` binary which will soon be deprecated.
|
||||
|
||||
The `--provider` field needs to be filled with the Nym address of an Exit Gateway that can make network requests on your behalf. You can select one from the [mixnet explorer](https://explorer.nymtech.net/network-components/gateways) by copying its `Client ID` and using this as the value of the `--provider` flag. Alternatively, you could use [Harbourmaster](https://harbourmaster.nymtech.net/).
|
||||
|
||||
#### Choosing a Gateway
|
||||
By default - as in the example above - your client will choose a random gateway to connect to.
|
||||
|
||||
However, there are several options for choosing a gateway, if you do not want one that is randomly assigned to your client:
|
||||
* If you wish to connect to a specific gateway, you can specify this with the `--gateway` flag when running `init`.
|
||||
* You can also choose a gateway based on its location relative to your client. This can be done by appending the `--latency-based-selection` flag to your `init` command. This command means that to select a gateway, your client will:
|
||||
* fetch a list of all availiable gateways
|
||||
* send few ping messages to all of them, and measure response times.
|
||||
* create a weighted distribution to randomly choose one, favouring ones with lower latency.
|
||||
|
||||
You can select one from the [mixnet explorer](https://explorer.nymtech.net/network-components/gateways) by copying its `Client ID` and using this as the value of the `--provider` flag. Alternatively, you could use [Harbourmaster](https://harbourmaster.nymtech.net/).
|
||||
|
||||
> Note this doesn't mean that your client will pick the closest gateway to you, but it will be far more likely to connect to gateway with a 20ms ping rather than 200ms
|
||||
|
||||
### Configuring your client
|
||||
When you initalise a client instance, a configuration directory will be generated and stored in `$HOME_DIR/.nym/socks5-clients/<client-name>/`.
|
||||
|
||||
```
|
||||
tree $HOME/<user>/.nym/socks5-clients/docs-example
|
||||
├── config
|
||||
│ └── config.toml
|
||||
└── data
|
||||
├── ack_key.pem
|
||||
├── credentials_database.db
|
||||
├── gateway_shared.pem
|
||||
├── persistent_reply_store.sqlite
|
||||
├── private_encryption.pem
|
||||
├── private_identity.pem
|
||||
├── public_encryption.pem
|
||||
└── public_identity.pem
|
||||
|
||||
```
|
||||
|
||||
The `config.toml` file contains client configuration options, while the two `pem` files contain client key information.
|
||||
|
||||
The generated files contain the client name, public/private keypairs, and gateway address. The name `<client_id>` in the example above is just a local identifier so that you can name your clients.
|
||||
|
||||
#### Configuring your client for Docker
|
||||
By default, the native client listens to host `127.0.0.1`. However this can be an issue if you wish to run a client in a Dockerized environment, where it can be convenenient to listen on a different host such as `0.0.0.0`.
|
||||
|
||||
You can set this via the `--host` flag during either the `init` or `run` commands.
|
||||
|
||||
Alternatively, a custom host can be set in the `config.toml` file under the `socket` section. If you do this, remember to restart your client process.
|
||||
|
||||
### Running the socks5 client
|
||||
|
||||
You can run the initialised client by doing this:
|
||||
|
||||
```
|
||||
./nym-socks5-client run --id docs-example
|
||||
```
|
||||
|
||||
## Automating your socks5 client with systemd
|
||||
|
||||
Create a service file for the socks5 client at `/etc/systemd/system/nym-socks5-client.service`:
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
Description=Nym Socks5 Client
|
||||
StartLimitInterval=350
|
||||
StartLimitBurst=10
|
||||
|
||||
[Service]
|
||||
User=nym # replace this with whatever user you wish
|
||||
LimitNOFILE=65536
|
||||
ExecStart=/home/nym/nym-socks5-client run --id <your_id>
|
||||
KillSignal=SIGINT
|
||||
Restart=on-failure
|
||||
RestartSec=30
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
Now enable and start your socks5 client:
|
||||
|
||||
```
|
||||
systemctl enable nym-socks5-client.service
|
||||
systemctl start nym-socks5-client.service
|
||||
# you can always check your socks5 client has succesfully started with:
|
||||
systemctl status nym-socks5-client.service
|
||||
```
|
||||
|
||||
## Using your Socks5 Client
|
||||
|
||||
After completing the steps above, your local Socks5 Client will be listening on `localhost:1080` ready to proxy traffic to the Network Requester set as the `--provider` when initialising.
|
||||
|
||||
When trying to connect your app, generally the proxy settings are found in `settings->advanced` or `settings->connection`.
|
||||
|
||||
Here is an example of setting the proxy connecting in Blockstream Green:
|
||||
|
||||

|
||||
|
||||
Most wallets and other applications will work basically the same way: find the network proxy settings, enter the proxy url (host: **localhost**, port: **1080**).
|
||||
|
||||
In some other applications, this might be written as **localhost:1080** if there's only one proxy entry field.
|
||||
|
||||
## Useful Commands
|
||||
|
||||
**no-banner**
|
||||
|
||||
Adding `--no-banner` startup flag will prevent Nym banner being printed even if run in tty environment.
|
||||
|
||||
**build-info**
|
||||
|
||||
A `build-info` command prints the build information like commit hash, rust version, binary version just like what command `--version` does. However, you can also specify an `--output=json` flag that will format the whole output as a json, making it an order of magnitude easier to parse.
|
||||
@@ -0,0 +1,823 @@
|
||||
# `nym-socks5-client` Binary Commands (Autogenerated)
|
||||
|
||||
These docs are autogenerated by the [`autodocs`](https://github.com/nymtech/nym/tree/max/new-docs-framework/documentation/autodoc) script.
|
||||
```sh
|
||||
A SOCKS5 localhost proxy that converts incoming messages to Sphinx and sends them to a Nym address
|
||||
|
||||
Usage: nym-socks5-client [OPTIONS] <COMMAND>
|
||||
|
||||
Commands:
|
||||
init Initialise a Nym client. Do this first!
|
||||
run Run the Nym client with provided configuration client optionally overriding set parameters
|
||||
import-credential Import a pre-generated credential
|
||||
list-gateways List all registered with gateways
|
||||
add-gateway Add new gateway to this client
|
||||
switch-gateway Change the currently active gateway. Note that you must have already registered with the new gateway!
|
||||
show-ticketbooks Display information associated with the imported ticketbooks,
|
||||
build-info Show build information of this binary
|
||||
completions Generate shell completions
|
||||
generate-fig-spec Generate Fig specification
|
||||
help Print this message or the help of the given subcommand(s)
|
||||
|
||||
Options:
|
||||
-c, --config-env-file <CONFIG_ENV_FILE> Path pointing to an env file that configures the client
|
||||
--no-banner Flag used for disabling the printed banner in tty
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
```
|
||||
|
||||
### `init`
|
||||
```sh
|
||||
Initialise a Nym client. Do this first!
|
||||
|
||||
Usage: nym-socks5-client init [OPTIONS] --id <ID> --provider <PROVIDER>
|
||||
|
||||
Options:
|
||||
--id <ID>
|
||||
Id of client we want to create config for
|
||||
|
||||
--gateway <GATEWAY>
|
||||
Id of the gateway we are going to connect to
|
||||
|
||||
--force-tls-gateway
|
||||
Specifies whether the client will attempt to enforce tls connection to the desired gateway
|
||||
|
||||
--latency-based-selection
|
||||
Specifies whether the new gateway should be determined based by latency as opposed to being chosen uniformly
|
||||
|
||||
--nym-apis <NYM_APIS>
|
||||
Comma separated list of rest endpoints of the API validators
|
||||
|
||||
--provider <PROVIDER>
|
||||
Address of the socks5 provider to send messages to
|
||||
|
||||
--use-reply-surbs <USE_REPLY_SURBS>
|
||||
Specifies whether this client is going to use an anonymous sender tag for communication with the service provider. While this is going to hide its actual address information, it will make the actual communication slower and consume nearly double the bandwidth as it will require sending reply SURBs.
|
||||
|
||||
Note that some service providers might not support this.
|
||||
|
||||
[possible values: true, false]
|
||||
|
||||
-p, --port <PORT>
|
||||
Port for the socket to listen on in all subsequent runs
|
||||
|
||||
--host <HOST>
|
||||
The custom host on which the socks5 client will be listening for requests
|
||||
|
||||
-o, --output <OUTPUT>
|
||||
[default: text]
|
||||
[possible values: text, json]
|
||||
|
||||
-h, --help
|
||||
Print help (see a summary with '-h')
|
||||
```
|
||||
|
||||
### `run`
|
||||
```sh
|
||||
Run the Nym client with provided configuration client optionally overriding set parameters
|
||||
|
||||
Usage: nym-socks5-client run [OPTIONS] --id <ID>
|
||||
|
||||
Options:
|
||||
--id <ID>
|
||||
Id of client we want to create config for
|
||||
|
||||
--gateway <GATEWAY>
|
||||
Id of the gateway we want to connect to. If overridden, it is user's responsibility to ensure prior registration happened
|
||||
|
||||
--nym-apis <NYM_APIS>
|
||||
Comma separated list of rest endpoints of the API validators
|
||||
|
||||
--use-anonymous-replies <USE_ANONYMOUS_REPLIES>
|
||||
Specifies whether this client is going to use an anonymous sender tag for communication with the service provider. While this is going to hide its actual address information, it will make the actual communication slower and consume nearly double the bandwidth as it will require sending reply SURBs.
|
||||
|
||||
Note that some service providers might not support this.
|
||||
|
||||
[possible values: true, false]
|
||||
|
||||
--provider <PROVIDER>
|
||||
Address of the socks5 provider to send messages to
|
||||
|
||||
-p, --port <PORT>
|
||||
Port for the socket to listen on
|
||||
|
||||
--host <HOST>
|
||||
The custom host on which the socks5 client will be listening for requests
|
||||
|
||||
-h, --help
|
||||
Print help (see a summary with '-h')
|
||||
```
|
||||
|
||||
### `import-credential`
|
||||
```sh
|
||||
Import a pre-generated credential
|
||||
|
||||
Usage: nym-socks5-client import-credential --id <ID> <--credential-data <CREDENTIAL_DATA>|--credential-path <CREDENTIAL_PATH>>
|
||||
|
||||
Options:
|
||||
--id <ID>
|
||||
Id of client that is going to import the credential
|
||||
--credential-data <CREDENTIAL_DATA>
|
||||
Explicitly provide the encoded credential data (as base58)
|
||||
--credential-path <CREDENTIAL_PATH>
|
||||
Specifies the path to file containing binary credential data
|
||||
-h, --help
|
||||
Print help
|
||||
```
|
||||
|
||||
### `list-gateways`
|
||||
```sh
|
||||
List all registered with gateways
|
||||
|
||||
Usage: nym-socks5-client list-gateways [OPTIONS] --id <ID>
|
||||
|
||||
Options:
|
||||
--id <ID> Id of client we want to list gateways for
|
||||
-o, --output <OUTPUT> [default: text] [possible values: text, json]
|
||||
-h, --help Print help
|
||||
```
|
||||
|
||||
### `add-gateway`
|
||||
```sh
|
||||
Add new gateway to this client
|
||||
|
||||
Usage: nym-socks5-client add-gateway [OPTIONS] --id <ID>
|
||||
|
||||
Options:
|
||||
--id <ID> Id of client we want to add gateway for
|
||||
--gateway-id <GATEWAY_ID> Explicitly specify id of the gateway to register with. If unspecified, a random gateway will be chosen instead
|
||||
--force-tls-gateway Specifies whether the client will attempt to enforce tls connection to the desired gateway
|
||||
--latency-based-selection Specifies whether the new gateway should be determined based by latency as opposed to being chosen uniformly
|
||||
--set-active Specify whether this new gateway should be set as the active one
|
||||
--nym-apis <NYM_APIS> Comma separated list of rest endpoints of the API validators
|
||||
-o, --output <OUTPUT> [default: text] [possible values: text, json]
|
||||
-h, --help Print help
|
||||
```
|
||||
|
||||
### `build-info`
|
||||
```sh
|
||||
Show build information of this binary
|
||||
|
||||
Usage: nym-socks5-client build-info [OPTIONS]
|
||||
|
||||
Options:
|
||||
-o, --output <OUTPUT> [default: text] [possible values: text, json]
|
||||
-h, --help Print help
|
||||
```
|
||||
Example output:
|
||||
```sh
|
||||
|
||||
Binary Name: nym-socks5-client
|
||||
Build Timestamp: 2024-10-09T13:56:14.428750844Z
|
||||
Build Version: 1.1.39
|
||||
Commit SHA: fac373c1db4fa5389ba61de7943c77023467bccb
|
||||
Commit Date: 2024-10-09T14:59:40.000000000+02:00
|
||||
Commit Branch: max/new-docs-framework
|
||||
rustc Version: 1.80.0
|
||||
rustc Channel: stable
|
||||
cargo Profile: release
|
||||
|
||||
```
|
||||
|
||||
### `completions`
|
||||
```sh
|
||||
Generate shell completions
|
||||
|
||||
Usage: nym-socks5-client completions <SHELL>
|
||||
|
||||
Arguments:
|
||||
<SHELL> [possible values: bash, elvish, fish, power-shell, zsh]
|
||||
|
||||
Options:
|
||||
-h, --help Print help
|
||||
```
|
||||
|
||||
### `generate-fig-spec`
|
||||
```sh
|
||||
Generate Fig specification
|
||||
|
||||
Usage: nym-socks5-client generate-fig-spec
|
||||
|
||||
Options:
|
||||
-h, --help Print help
|
||||
```
|
||||
Example output:
|
||||
```sh
|
||||
const completion: Fig.Spec = {
|
||||
name: "nym-socks5-client",
|
||||
description: "A SOCKS5 localhost proxy that converts incoming messages to Sphinx and sends them to a Nym address",
|
||||
subcommands: [
|
||||
{
|
||||
name: "init",
|
||||
description: "Initialise a Nym client. Do this first!",
|
||||
options: [
|
||||
{
|
||||
name: "--id",
|
||||
description: "Id of client we want to create config for",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "id",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--gateway",
|
||||
description: "Id of the gateway we are going to connect to",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "gateway",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--nyxd-urls",
|
||||
description: "Comma separated list of rest endpoints of the nyxd validators",
|
||||
hidden: true,
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "nyxd_urls",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--nym-apis",
|
||||
description: "Comma separated list of rest endpoints of the API validators",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "nym_apis",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--custom-mixnet",
|
||||
description: "Path to .json file containing custom network specification",
|
||||
hidden: true,
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "custom_mixnet",
|
||||
isOptional: true,
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--enabled-credentials-mode",
|
||||
description: "Set this client to work in a enabled credentials mode that would attempt to use gateway with bandwidth credential requirement",
|
||||
hidden: true,
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "enabled_credentials_mode",
|
||||
isOptional: true,
|
||||
suggestions: [
|
||||
"true",
|
||||
"false",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--provider",
|
||||
description: "Address of the socks5 provider to send messages to",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "provider",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--use-reply-surbs",
|
||||
description: "Specifies whether this client is going to use an anonymous sender tag for communication with the service provider. While this is going to hide its actual address information, it will make the actual communication slower and consume nearly double the bandwidth as it will require sending reply SURBs",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "use_reply_surbs",
|
||||
isOptional: true,
|
||||
suggestions: [
|
||||
"true",
|
||||
"false",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-p", "--port"],
|
||||
description: "Port for the socket to listen on in all subsequent runs",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "port",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--host",
|
||||
description: "The custom host on which the socks5 client will be listening for requests",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "host",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-o", "--output"],
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "output",
|
||||
isOptional: true,
|
||||
suggestions: [
|
||||
"text",
|
||||
"json",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--force-tls-gateway",
|
||||
description: "Specifies whether the client will attempt to enforce tls connection to the desired gateway",
|
||||
},
|
||||
{
|
||||
name: "--latency-based-selection",
|
||||
description: "Specifies whether the new gateway should be determined based by latency as opposed to being chosen uniformly",
|
||||
exclusiveOn: [
|
||||
"--gateway",
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "--fastmode",
|
||||
description: "Mostly debug-related option to increase default traffic rate so that you would not need to modify config post init",
|
||||
},
|
||||
{
|
||||
name: "--no-cover",
|
||||
description: "Disable loop cover traffic and the Poisson rate limiter (for debugging only)",
|
||||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help (see more with '--help')",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "run",
|
||||
description: "Run the Nym client with provided configuration client optionally overriding set parameters",
|
||||
options: [
|
||||
{
|
||||
name: "--id",
|
||||
description: "Id of client we want to create config for",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "id",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--gateway",
|
||||
description: "Id of the gateway we want to connect to. If overridden, it is user's responsibility to ensure prior registration happened",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "gateway",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--nyxd-urls",
|
||||
description: "Comma separated list of rest endpoints of the nyxd validators",
|
||||
hidden: true,
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "nyxd_urls",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--nym-apis",
|
||||
description: "Comma separated list of rest endpoints of the API validators",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "nym_apis",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--custom-mixnet",
|
||||
description: "Path to .json file containing custom network specification",
|
||||
hidden: true,
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "custom_mixnet",
|
||||
isOptional: true,
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--enabled-credentials-mode",
|
||||
description: "Set this client to work in a enabled credentials mode that would attempt to use gateway with bandwidth credential requirement",
|
||||
hidden: true,
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "enabled_credentials_mode",
|
||||
isOptional: true,
|
||||
suggestions: [
|
||||
"true",
|
||||
"false",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--use-anonymous-replies",
|
||||
description: "Specifies whether this client is going to use an anonymous sender tag for communication with the service provider. While this is going to hide its actual address information, it will make the actual communication slower and consume nearly double the bandwidth as it will require sending reply SURBs",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "use_anonymous_replies",
|
||||
isOptional: true,
|
||||
suggestions: [
|
||||
"true",
|
||||
"false",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--provider",
|
||||
description: "Address of the socks5 provider to send messages to",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "provider",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-p", "--port"],
|
||||
description: "Port for the socket to listen on",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "port",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--host",
|
||||
description: "The custom host on which the socks5 client will be listening for requests",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "host",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--geo-routing",
|
||||
description: "Set geo-aware mixnode selection when sending mixnet traffic, for experiments only",
|
||||
hidden: true,
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "geo_routing",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--fastmode",
|
||||
description: "Mostly debug-related option to increase default traffic rate so that you would not need to modify config post init",
|
||||
},
|
||||
{
|
||||
name: "--no-cover",
|
||||
description: "Disable loop cover traffic and the Poisson rate limiter (for debugging only)",
|
||||
},
|
||||
{
|
||||
name: "--medium-toggle",
|
||||
description: "Enable medium mixnet traffic, for experiments only. This includes things like disabling cover traffic, no per hop delays, etc",
|
||||
},
|
||||
{
|
||||
name: "--outfox",
|
||||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help (see more with '--help')",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "import-credential",
|
||||
description: "Import a pre-generated credential",
|
||||
options: [
|
||||
{
|
||||
name: "--id",
|
||||
description: "Id of client that is going to import the credential",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "id",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--credential-data",
|
||||
description: "Explicitly provide the encoded credential data (as base58)",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "credential_data",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--credential-path",
|
||||
description: "Specifies the path to file containing binary credential data",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "credential_path",
|
||||
isOptional: true,
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--version",
|
||||
hidden: true,
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "version",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "list-gateways",
|
||||
description: "List all registered with gateways",
|
||||
options: [
|
||||
{
|
||||
name: "--id",
|
||||
description: "Id of client we want to list gateways for",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "id",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-o", "--output"],
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "output",
|
||||
isOptional: true,
|
||||
suggestions: [
|
||||
"text",
|
||||
"json",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "add-gateway",
|
||||
description: "Add new gateway to this client",
|
||||
options: [
|
||||
{
|
||||
name: "--id",
|
||||
description: "Id of client we want to add gateway for",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "id",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--gateway-id",
|
||||
description: "Explicitly specify id of the gateway to register with. If unspecified, a random gateway will be chosen instead",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "gateway_id",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--nym-apis",
|
||||
description: "Comma separated list of rest endpoints of the API validators",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "nym_apis",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--custom-mixnet",
|
||||
description: "Path to .json file containing custom network specification",
|
||||
hidden: true,
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "custom_mixnet",
|
||||
isOptional: true,
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-o", "--output"],
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "output",
|
||||
isOptional: true,
|
||||
suggestions: [
|
||||
"text",
|
||||
"json",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--force-tls-gateway",
|
||||
description: "Specifies whether the client will attempt to enforce tls connection to the desired gateway",
|
||||
},
|
||||
{
|
||||
name: "--latency-based-selection",
|
||||
description: "Specifies whether the new gateway should be determined based by latency as opposed to being chosen uniformly",
|
||||
exclusiveOn: [
|
||||
"--gateway-id",
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "--set-active",
|
||||
description: "Specify whether this new gateway should be set as the active one",
|
||||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "switch-gateway",
|
||||
description: "Change the currently active gateway. Note that you must have already registered with the new gateway!",
|
||||
options: [
|
||||
{
|
||||
name: "--id",
|
||||
description: "Id of client we want to list gateways for",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "id",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--gateway-id",
|
||||
description: "Id of the gateway we want to switch to",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "gateway_id",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "show-ticketbooks",
|
||||
description: "Display information associated with the imported ticketbooks,",
|
||||
options: [
|
||||
{
|
||||
name: "--id",
|
||||
description: "Id of client that is going to display the ticketbook information",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "id",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-o", "--output"],
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "output",
|
||||
isOptional: true,
|
||||
suggestions: [
|
||||
"text",
|
||||
"json",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "build-info",
|
||||
description: "Show build information of this binary",
|
||||
options: [
|
||||
{
|
||||
name: ["-o", "--output"],
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "output",
|
||||
isOptional: true,
|
||||
suggestions: [
|
||||
"text",
|
||||
"json",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "completions",
|
||||
description: "Generate shell completions",
|
||||
options: [
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
args: {
|
||||
name: "shell",
|
||||
suggestions: [
|
||||
"bash",
|
||||
"elvish",
|
||||
"fish",
|
||||
"power-shell",
|
||||
"zsh",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "generate-fig-spec",
|
||||
description: "Generate Fig specification",
|
||||
options: [
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "help",
|
||||
description: "Print this message or the help of the given subcommand(s)",
|
||||
subcommands: [
|
||||
{
|
||||
name: "init",
|
||||
description: "Initialise a Nym client. Do this first!",
|
||||
},
|
||||
{
|
||||
name: "run",
|
||||
description: "Run the Nym client with provided configuration client optionally overriding set parameters",
|
||||
},
|
||||
{
|
||||
name: "import-credential",
|
||||
description: "Import a pre-generated credential",
|
||||
},
|
||||
{
|
||||
name: "list-gateways",
|
||||
description: "List all registered with gateways",
|
||||
},
|
||||
{
|
||||
name: "add-gateway",
|
||||
description: "Add new gateway to this client",
|
||||
},
|
||||
{
|
||||
name: "switch-gateway",
|
||||
description: "Change the currently active gateway. Note that you must have already registered with the new gateway!",
|
||||
},
|
||||
{
|
||||
name: "show-ticketbooks",
|
||||
description: "Display information associated with the imported ticketbooks,",
|
||||
},
|
||||
{
|
||||
name: "build-info",
|
||||
description: "Show build information of this binary",
|
||||
},
|
||||
{
|
||||
name: "completions",
|
||||
description: "Generate shell completions",
|
||||
},
|
||||
{
|
||||
name: "generate-fig-spec",
|
||||
description: "Generate Fig specification",
|
||||
},
|
||||
{
|
||||
name: "help",
|
||||
description: "Print this message or the help of the given subcommand(s)",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: ["-c", "--config-env-file"],
|
||||
description: "Path pointing to an env file that configures the client",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "config_env_file",
|
||||
isOptional: true,
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--no-banner",
|
||||
description: "Flag used for disabling the printed banner in tty",
|
||||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Print version",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completion;
|
||||
```
|
||||
@@ -0,0 +1,22 @@
|
||||
# Webassembly Client
|
||||
|
||||
The Nym webassembly client allows any webassembly-capable runtime to build and send Sphinx packets to the Nym network, for uses in edge computing and browser-based applications.
|
||||
|
||||
This is currently packaged and distributed for ease of use via the [Nym Typescript SDK library](../typescript). **We imagine most developers will use this client via the SDK for ease.**
|
||||
|
||||
The webassembly client allows for the easy creation of Sphinx packets from within mobile apps and browser-based client-side apps (including Electron or similar).
|
||||
|
||||
## Building apps with Webassembly Client
|
||||
|
||||
Check out the [Typescript SDK docs](../typescript) for examples of usage.
|
||||
|
||||
## Think about what you're sending!
|
||||
import { Callout } from 'nextra/components'
|
||||
|
||||
<Callout type="warning" emoji="⚠️">
|
||||
Think about what information your app sends. That goes for whatever you put into your Sphinx packet messages as well as what your app's environment may leak.
|
||||
</Callout>
|
||||
|
||||
Whenever you write client apps using HTML/JavaScript, we recommend that you **do not load external resources from CDNs**. Webapp developers do this all the time, to save load time for common resources, or just for convenience. But when you're writing privacy apps it's better not to make these kinds of requests. Pack everything locally.
|
||||
|
||||
If you use only local resources within your Electron app or your browser extensions, explicitly encoding request data in a Sphinx packet does protect you from the normal leakage that gets sent in a browser HTTP request. [There's a lot of stuff that leaks when you make an HTTP request from a browser window](https://panopticlick.eff.org/). Luckily, all that metadata and request leakage doesn't happen in Nym, because you're choosing very explicitly what to encode into Sphinx packets, instead of sending a whole browser environment by default.
|
||||
@@ -0,0 +1,13 @@
|
||||
# Websocket Client (Standalone)
|
||||
|
||||
> This client can also be utilised via the [Rust SDK](../rust) and [Go/C++ FFI](../rust/ffi).
|
||||
|
||||
You can run this client as a standalone process and pipe traffic into it to be sent through the mixnet. This is useful if you're building an application in a language other than Typescript or Rust and cannot utilise one of the SDKs.
|
||||
|
||||
You can find the code for this client [here](https://github.com/nymtech/nym/tree/master/clients/native).
|
||||
|
||||
## Download or compile client
|
||||
|
||||
If you are using OSX or a Debian-based operating system, you can download the `nym-socks5-client` binary from our [Github releases page](https://github.com/nymtech/nym/releases).
|
||||
|
||||
If you are using a different operating system, or want to build from source, simply use `cargo build --release` from the root of the Nym monorepo.
|
||||
@@ -0,0 +1,754 @@
|
||||
# `nym-client` Binary Commands (Autogenerated)
|
||||
|
||||
These docs are autogenerated by the [`autodocs`](https://github.com/nymtech/nym/tree/max/new-docs-framework/documentation/autodoc) script.
|
||||
```sh
|
||||
Implementation of the Nym Client
|
||||
|
||||
Usage: nym-client [OPTIONS] <COMMAND>
|
||||
|
||||
Commands:
|
||||
init Initialise a Nym client. Do this first!
|
||||
run Run the Nym client with provided configuration client optionally overriding set parameters
|
||||
import-credential Import a pre-generated credential
|
||||
list-gateways List all registered with gateways
|
||||
add-gateway Add new gateway to this client
|
||||
switch-gateway Change the currently active gateway. Note that you must have already registered with the new gateway!
|
||||
show-ticketbooks Display information associated with the imported ticketbooks,
|
||||
build-info Show build information of this binary
|
||||
completions Generate shell completions
|
||||
generate-fig-spec Generate Fig specification
|
||||
help Print this message or the help of the given subcommand(s)
|
||||
|
||||
Options:
|
||||
-c, --config-env-file <CONFIG_ENV_FILE> Path pointing to an env file that configures the client
|
||||
--no-banner Flag used for disabling the printed banner in tty
|
||||
-h, --help Print help
|
||||
-V, --version Print version
|
||||
```
|
||||
|
||||
### `init`
|
||||
```sh
|
||||
Initialise a Nym client. Do this first!
|
||||
|
||||
Usage: nym-client init [OPTIONS] --id <ID>
|
||||
|
||||
Options:
|
||||
--id <ID>
|
||||
Id of client we want to create config for
|
||||
--gateway <GATEWAY>
|
||||
Id of the gateway we are going to connect to
|
||||
--force-tls-gateway
|
||||
Specifies whether the client will attempt to enforce tls connection to the desired gateway
|
||||
--latency-based-selection
|
||||
Specifies whether the new gateway should be determined based by latency as opposed to being chosen uniformly
|
||||
--nym-apis <NYM_APIS>
|
||||
Comma separated list of rest endpoints of the API validators
|
||||
--disable-socket <DISABLE_SOCKET>
|
||||
Whether to not start the websocket [possible values: true, false]
|
||||
-p, --port <PORT>
|
||||
Port for the socket (if applicable) to listen on in all subsequent runs
|
||||
--host <HOST>
|
||||
Ip for the socket (if applicable) to listen for requests
|
||||
-o, --output <OUTPUT>
|
||||
[default: text] [possible values: text, json]
|
||||
-h, --help
|
||||
Print help
|
||||
```
|
||||
|
||||
### `run`
|
||||
```sh
|
||||
Run the Nym client with provided configuration client optionally overriding set parameters
|
||||
|
||||
Usage: nym-client run [OPTIONS] --id <ID>
|
||||
|
||||
Options:
|
||||
--id <ID>
|
||||
Id of client we want to create config for
|
||||
--gateway <GATEWAY>
|
||||
Id of the gateway we want to connect to. If overridden, it is user's responsibility to ensure prior registration happened
|
||||
--nym-apis <NYM_APIS>
|
||||
Comma separated list of rest endpoints of the API validators
|
||||
--disable-socket <DISABLE_SOCKET>
|
||||
Whether to not start the websocket [possible values: true, false]
|
||||
-p, --port <PORT>
|
||||
Port for the socket to listen on
|
||||
--host <HOST>
|
||||
Ip for the socket (if applicable) to listen for requests
|
||||
-h, --help
|
||||
Print help
|
||||
```
|
||||
|
||||
### `import-credential`
|
||||
```sh
|
||||
Import a pre-generated credential
|
||||
|
||||
Usage: nym-client import-credential --id <ID> <--credential-data <CREDENTIAL_DATA>|--credential-path <CREDENTIAL_PATH>>
|
||||
|
||||
Options:
|
||||
--id <ID>
|
||||
Id of client that is going to import the credential
|
||||
--credential-data <CREDENTIAL_DATA>
|
||||
Explicitly provide the encoded credential data (as base58)
|
||||
--credential-path <CREDENTIAL_PATH>
|
||||
Specifies the path to file containing binary credential data
|
||||
-h, --help
|
||||
Print help
|
||||
```
|
||||
|
||||
### `list-gateways`
|
||||
```sh
|
||||
List all registered with gateways
|
||||
|
||||
Usage: nym-client list-gateways [OPTIONS] --id <ID>
|
||||
|
||||
Options:
|
||||
--id <ID> Id of client we want to list gateways for
|
||||
-o, --output <OUTPUT> [default: text] [possible values: text, json]
|
||||
-h, --help Print help
|
||||
```
|
||||
|
||||
### `switch-gateway`
|
||||
```sh
|
||||
Change the currently active gateway. Note that you must have already registered with the new gateway!
|
||||
|
||||
Usage: nym-client switch-gateway --id <ID> --gateway-id <GATEWAY_ID>
|
||||
|
||||
Options:
|
||||
--id <ID> Id of client we want to list gateways for
|
||||
--gateway-id <GATEWAY_ID> Id of the gateway we want to switch to
|
||||
-h, --help Print help
|
||||
```
|
||||
|
||||
### `build-info`
|
||||
```sh
|
||||
Show build information of this binary
|
||||
|
||||
Usage: nym-client build-info [OPTIONS]
|
||||
|
||||
Options:
|
||||
-o, --output <OUTPUT> [default: text] [possible values: text, json]
|
||||
-h, --help Print help
|
||||
```
|
||||
Example output:
|
||||
```sh
|
||||
|
||||
Binary Name: nym-client
|
||||
Build Timestamp: 2024-10-09T13:56:14.428750844Z
|
||||
Build Version: 1.1.39
|
||||
Commit SHA: fac373c1db4fa5389ba61de7943c77023467bccb
|
||||
Commit Date: 2024-10-09T14:59:40.000000000+02:00
|
||||
Commit Branch: max/new-docs-framework
|
||||
rustc Version: 1.80.0
|
||||
rustc Channel: stable
|
||||
cargo Profile: release
|
||||
|
||||
```
|
||||
|
||||
### `completions`
|
||||
```sh
|
||||
Generate shell completions
|
||||
|
||||
Usage: nym-client completions <SHELL>
|
||||
|
||||
Arguments:
|
||||
<SHELL> [possible values: bash, elvish, fish, power-shell, zsh]
|
||||
|
||||
Options:
|
||||
-h, --help Print help
|
||||
```
|
||||
|
||||
### `generate-fig-spec`
|
||||
```sh
|
||||
Generate Fig specification
|
||||
|
||||
Usage: nym-client generate-fig-spec
|
||||
|
||||
Options:
|
||||
-h, --help Print help
|
||||
```
|
||||
Example output:
|
||||
```sh
|
||||
const completion: Fig.Spec = {
|
||||
name: "nym-native-client",
|
||||
description: "Implementation of the Nym Client",
|
||||
subcommands: [
|
||||
{
|
||||
name: "init",
|
||||
description: "Initialise a Nym client. Do this first!",
|
||||
options: [
|
||||
{
|
||||
name: "--id",
|
||||
description: "Id of client we want to create config for",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "id",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--gateway",
|
||||
description: "Id of the gateway we are going to connect to",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "gateway",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--nyxd-urls",
|
||||
description: "Comma separated list of rest endpoints of the nyxd validators",
|
||||
hidden: true,
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "nyxd_urls",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--nym-apis",
|
||||
description: "Comma separated list of rest endpoints of the API validators",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "nym_apis",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--custom-mixnet",
|
||||
description: "Path to .json file containing custom network specification",
|
||||
hidden: true,
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "custom_mixnet",
|
||||
isOptional: true,
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--enabled-credentials-mode",
|
||||
description: "Set this client to work in a enabled credentials mode that would attempt to use gateway with bandwidth credential requirement",
|
||||
hidden: true,
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "enabled_credentials_mode",
|
||||
isOptional: true,
|
||||
suggestions: [
|
||||
"true",
|
||||
"false",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--disable-socket",
|
||||
description: "Whether to not start the websocket",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "disable_socket",
|
||||
isOptional: true,
|
||||
suggestions: [
|
||||
"true",
|
||||
"false",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-p", "--port"],
|
||||
description: "Port for the socket (if applicable) to listen on in all subsequent runs",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "port",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--host",
|
||||
description: "Ip for the socket (if applicable) to listen for requests",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "host",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-o", "--output"],
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "output",
|
||||
isOptional: true,
|
||||
suggestions: [
|
||||
"text",
|
||||
"json",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--force-tls-gateway",
|
||||
description: "Specifies whether the client will attempt to enforce tls connection to the desired gateway",
|
||||
},
|
||||
{
|
||||
name: "--latency-based-selection",
|
||||
description: "Specifies whether the new gateway should be determined based by latency as opposed to being chosen uniformly",
|
||||
exclusiveOn: [
|
||||
"--gateway",
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "--fastmode",
|
||||
description: "Mostly debug-related option to increase default traffic rate so that you would not need to modify config post init",
|
||||
},
|
||||
{
|
||||
name: "--no-cover",
|
||||
description: "Disable loop cover traffic and the Poisson rate limiter (for debugging only)",
|
||||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "run",
|
||||
description: "Run the Nym client with provided configuration client optionally overriding set parameters",
|
||||
options: [
|
||||
{
|
||||
name: "--id",
|
||||
description: "Id of client we want to create config for",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "id",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--gateway",
|
||||
description: "Id of the gateway we want to connect to. If overridden, it is user's responsibility to ensure prior registration happened",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "gateway",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--nyxd-urls",
|
||||
description: "Comma separated list of rest endpoints of the nyxd validators",
|
||||
hidden: true,
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "nyxd_urls",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--nym-apis",
|
||||
description: "Comma separated list of rest endpoints of the API validators",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "nym_apis",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--custom-mixnet",
|
||||
description: "Path to .json file containing custom network specification",
|
||||
hidden: true,
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "custom_mixnet",
|
||||
isOptional: true,
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--enabled-credentials-mode",
|
||||
description: "Set this client to work in a enabled credentials mode that would attempt to use gateway with bandwidth credential requirement",
|
||||
hidden: true,
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "enabled_credentials_mode",
|
||||
isOptional: true,
|
||||
suggestions: [
|
||||
"true",
|
||||
"false",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--disable-socket",
|
||||
description: "Whether to not start the websocket",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "disable_socket",
|
||||
isOptional: true,
|
||||
suggestions: [
|
||||
"true",
|
||||
"false",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-p", "--port"],
|
||||
description: "Port for the socket to listen on",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "port",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--host",
|
||||
description: "Ip for the socket (if applicable) to listen for requests",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "host",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--fastmode",
|
||||
description: "Mostly debug-related option to increase default traffic rate so that you would not need to modify config post init",
|
||||
},
|
||||
{
|
||||
name: "--no-cover",
|
||||
description: "Disable loop cover traffic and the Poisson rate limiter (for debugging only)",
|
||||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "import-credential",
|
||||
description: "Import a pre-generated credential",
|
||||
options: [
|
||||
{
|
||||
name: "--id",
|
||||
description: "Id of client that is going to import the credential",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "id",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--credential-data",
|
||||
description: "Explicitly provide the encoded credential data (as base58)",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "credential_data",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--credential-path",
|
||||
description: "Specifies the path to file containing binary credential data",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "credential_path",
|
||||
isOptional: true,
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--version",
|
||||
hidden: true,
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "version",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "list-gateways",
|
||||
description: "List all registered with gateways",
|
||||
options: [
|
||||
{
|
||||
name: "--id",
|
||||
description: "Id of client we want to list gateways for",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "id",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-o", "--output"],
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "output",
|
||||
isOptional: true,
|
||||
suggestions: [
|
||||
"text",
|
||||
"json",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "add-gateway",
|
||||
description: "Add new gateway to this client",
|
||||
options: [
|
||||
{
|
||||
name: "--id",
|
||||
description: "Id of client we want to add gateway for",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "id",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--gateway-id",
|
||||
description: "Explicitly specify id of the gateway to register with. If unspecified, a random gateway will be chosen instead",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "gateway_id",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--nym-apis",
|
||||
description: "Comma separated list of rest endpoints of the API validators",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "nym_apis",
|
||||
isOptional: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--custom-mixnet",
|
||||
description: "Path to .json file containing custom network specification",
|
||||
hidden: true,
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "custom_mixnet",
|
||||
isOptional: true,
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-o", "--output"],
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "output",
|
||||
isOptional: true,
|
||||
suggestions: [
|
||||
"text",
|
||||
"json",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--force-tls-gateway",
|
||||
description: "Specifies whether the client will attempt to enforce tls connection to the desired gateway",
|
||||
},
|
||||
{
|
||||
name: "--latency-based-selection",
|
||||
description: "Specifies whether the new gateway should be determined based by latency as opposed to being chosen uniformly",
|
||||
exclusiveOn: [
|
||||
"--gateway-id",
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "--set-active",
|
||||
description: "Specify whether this new gateway should be set as the active one",
|
||||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "switch-gateway",
|
||||
description: "Change the currently active gateway. Note that you must have already registered with the new gateway!",
|
||||
options: [
|
||||
{
|
||||
name: "--id",
|
||||
description: "Id of client we want to list gateways for",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "id",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--gateway-id",
|
||||
description: "Id of the gateway we want to switch to",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "gateway_id",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "show-ticketbooks",
|
||||
description: "Display information associated with the imported ticketbooks,",
|
||||
options: [
|
||||
{
|
||||
name: "--id",
|
||||
description: "Id of client that is going to display the ticketbook information",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "id",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-o", "--output"],
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "output",
|
||||
isOptional: true,
|
||||
suggestions: [
|
||||
"text",
|
||||
"json",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "build-info",
|
||||
description: "Show build information of this binary",
|
||||
options: [
|
||||
{
|
||||
name: ["-o", "--output"],
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "output",
|
||||
isOptional: true,
|
||||
suggestions: [
|
||||
"text",
|
||||
"json",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "completions",
|
||||
description: "Generate shell completions",
|
||||
options: [
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
args: {
|
||||
name: "shell",
|
||||
suggestions: [
|
||||
"bash",
|
||||
"elvish",
|
||||
"fish",
|
||||
"power-shell",
|
||||
"zsh",
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "generate-fig-spec",
|
||||
description: "Generate Fig specification",
|
||||
options: [
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "help",
|
||||
description: "Print this message or the help of the given subcommand(s)",
|
||||
subcommands: [
|
||||
{
|
||||
name: "init",
|
||||
description: "Initialise a Nym client. Do this first!",
|
||||
},
|
||||
{
|
||||
name: "run",
|
||||
description: "Run the Nym client with provided configuration client optionally overriding set parameters",
|
||||
},
|
||||
{
|
||||
name: "import-credential",
|
||||
description: "Import a pre-generated credential",
|
||||
},
|
||||
{
|
||||
name: "list-gateways",
|
||||
description: "List all registered with gateways",
|
||||
},
|
||||
{
|
||||
name: "add-gateway",
|
||||
description: "Add new gateway to this client",
|
||||
},
|
||||
{
|
||||
name: "switch-gateway",
|
||||
description: "Change the currently active gateway. Note that you must have already registered with the new gateway!",
|
||||
},
|
||||
{
|
||||
name: "show-ticketbooks",
|
||||
description: "Display information associated with the imported ticketbooks,",
|
||||
},
|
||||
{
|
||||
name: "build-info",
|
||||
description: "Show build information of this binary",
|
||||
},
|
||||
{
|
||||
name: "completions",
|
||||
description: "Generate shell completions",
|
||||
},
|
||||
{
|
||||
name: "generate-fig-spec",
|
||||
description: "Generate Fig specification",
|
||||
},
|
||||
{
|
||||
name: "help",
|
||||
description: "Print this message or the help of the given subcommand(s)",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
name: ["-c", "--config-env-file"],
|
||||
description: "Path pointing to an env file that configures the client",
|
||||
isRepeatable: true,
|
||||
args: {
|
||||
name: "config_env_file",
|
||||
isOptional: true,
|
||||
template: "filepaths",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "--no-banner",
|
||||
description: "Flag used for disabling the printed banner in tty",
|
||||
},
|
||||
{
|
||||
name: ["-h", "--help"],
|
||||
description: "Print help",
|
||||
},
|
||||
{
|
||||
name: ["-V", "--version"],
|
||||
description: "Print version",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default completion;
|
||||
```
|
||||
@@ -0,0 +1,47 @@
|
||||
# Setup & Run
|
||||
|
||||
## Viewing command help
|
||||
|
||||
You can check that your binaries are properly compiled with:
|
||||
|
||||
```
|
||||
./nym-client --help
|
||||
```
|
||||
|
||||
The two most important commands you will issue to the client are:
|
||||
|
||||
* `init` - initalise a new client instance.
|
||||
* `run` - run a mixnet client process.
|
||||
|
||||
You can check the necessary parameters for the available commands by running:
|
||||
|
||||
```
|
||||
./nym-client <command> --help
|
||||
```
|
||||
|
||||
## Initialising your client
|
||||
|
||||
Before you can use the client, you need to initalise a new instance of it. Each instance of the client has its own public/private keypair, and connects to its own gateway node. Taken together, these 3 things (public/private keypair + gateway node identity key) make up an app's identity.
|
||||
|
||||
Initialising a new client instance can be done with the following command:
|
||||
|
||||
```
|
||||
./nym-client init --id example-client
|
||||
```
|
||||
|
||||
The `--id` in the example above is a local identifier so that you can name your clients; it is **never** transmitted over the network.
|
||||
|
||||
There is an optional `--gateway` flag that you can use if you want to use a specific gateway. The supplied argument is the `Identity Key` of the gateway you wish to use, which can be found on the [mixnet explorer](https://explorer.nymtech.net/network-components/gateways). Alternatively, you could use [Harbourmaster](https://harbourmaster.nymtech.net/)
|
||||
|
||||
Not passing this argument will randomly select a gateway for your client.
|
||||
|
||||
## Running your client
|
||||
You can run the initalised client by doing this:
|
||||
|
||||
```
|
||||
./nym-client run --id example-client
|
||||
```
|
||||
|
||||
When you run the client, it immediately starts generating (fake) cover traffic and sending it to the mixnet.
|
||||
|
||||
When the client is first started, it will reach out to the Nym network's validators, and get a list of available Nym nodes (gateways, mixnodes, and validators). We call this list of nodes the network _topology_. The client does this so that it knows how to connect, register itself with the network, and know which mixnodes it can route Sphinx packets through.
|
||||
@@ -0,0 +1,119 @@
|
||||
# Using Your Client
|
||||
The Nym native client exposes a websocket interface that your code connects to. The **default** websocket port is `1977`, you can override that in the client config if you want.
|
||||
|
||||
Once you have a websocket connection, interacting with the client involves piping messages down the socket and listening for incoming messages.
|
||||
|
||||
## Message Requests
|
||||
There are a number of message types that you can send up the websocket as defined [here](https://github.com/nymtech/nym/blob/master/clients/native/websocket-requests/src/responses.rs#L48).
|
||||
|
||||
### Getting your own address
|
||||
When you start your app, it is best practice to ask the native client to tell you what your own address is (from the generated configuration files <!--add link -->. If you are running a service, you need to do this in order to know what address to give others. In a client-side piece of code you can also use this as a test to make sure your websocket connection is running smoothly. To do this, send:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "selfAddress"
|
||||
}
|
||||
```
|
||||
|
||||
You'll receive a response of the format:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "selfAddress",
|
||||
"address": "your address" // e.g. "71od3ZAupdCdxeFNg8sdonqfZTnZZy1E86WYKEjxD4kj@FWYoUrnKuXryysptnCZgUYRTauHq4FnEFu2QGn5LZWbm"
|
||||
}
|
||||
```
|
||||
|
||||
See [here](https://github.com/nymtech/nym/blob/93cc281abc2cc951023b51746fa6f2ead1f56c46/clients/native/examples/python-examples/websocket/textsend.py#L16C9-L16C9) for an example of this being used.
|
||||
|
||||
> Note that all the pieces of native client example code begin with printing the selfAddress. Examples exist for Rust, Go, Javascript, and Python.
|
||||
|
||||
### Sending text
|
||||
If you want to send text information through the mixnet, format a message like this one and poke it into the websocket:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "send",
|
||||
"message": "the message",
|
||||
"recipient": "71od3ZAupdCdxeFNg8sdonqfZTnZZy1E86WYKEjxD4kj@FWYoUrnKuXryysptnCZgUYRTauHq4FnEFu2QGn5LZWbm"
|
||||
}
|
||||
```
|
||||
|
||||
In some applications, e.g. where people are chatting with friends who they know, you might want to include unencrypted reply information in the message field. This provides an easy way for the receiving chat to then turn around and send a reply message:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "send",
|
||||
"message": {
|
||||
"sender": "198427b63ZAupdCdxeFNg8sdonqfZTnZZy1E86WYKEjxD4kj@FWYoUrnKuXryysptnCZgUYRTauHq4FnEFu2QGn5LZWbm",
|
||||
"chatMessage": "hi julia!"
|
||||
},
|
||||
"recipient": "71od3ZAupdCdxeFNg8sdonqfZTnZZy1E86WYKEjxD4kj@FWYoUrnKuXryysptnCZgUYRTauHq4FnEFu2QGn5LZWbm"
|
||||
}
|
||||
```
|
||||
|
||||
**If that fits your security model, good. However, will probably be the case that you want to send anonymous replies using Single Use Reply Blocks (SURBs)**.
|
||||
|
||||
You can read more about SURBs [here](../../network/concepts/anonymous-replies) but in short they are ways for the receiver of this message to anonymously reply to you - the sender - **without them having to know your client address**.
|
||||
|
||||
Your client will send along a number of `replySurbs` to the recipient of the message. These are pre-addressed Sphinx packets that the recipient can write to the payload of (i.e. write response data to), but not view the final destination of. If the recipient is unable to fit the response data into the bucket of SURBs sent to it, it will use a SURB to request more SURBs be sent to it from your client.
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "sendAnonymous",
|
||||
"message": "something you want to keep secret",
|
||||
"recipient": "71od3ZAupdCdxeFNg8sdonqfZTnZZy1E86WYKEjxD4kj@FWYoUrnKuXryysptnCZgUYRTauHq4FnEFu2QGn5LZWbm",
|
||||
"replySurbs": 20 // however many reply SURBs to send along with your message
|
||||
}
|
||||
```
|
||||
|
||||
See ['Replying to SURB Messages'](#replying-to-surb-messages) below for an example of how to deal with incoming messages that have SURBs attached.
|
||||
|
||||
Deciding on the amount of SURBs to generate and send along with outgoing messages depends on the expected size of the reply. You might want to send a lot of SURBs in order to make sure you get your response as quickly as possible (but accept the minor additional latency when sending, as your client has to generate and encrypt the packets), or you might just send a few (e.g. 20) and then if your response requires more SURBs, send them along, accepting the additional latency in getting your response.
|
||||
|
||||
### Sending binary data
|
||||
You can also send bytes instead of JSON. For that you have to send a binary websocket frame containing a binary encoded
|
||||
Nym [`ClientRequest`](https://github.com/nymtech/nym/blob/develop/clients/native/websocket-requests/src/requests.rs#L25) containing the same information.
|
||||
|
||||
> As a response the `native-client` will send a `ServerResponse` to be decoded. See [Message Responses](#message-responses) below for more.
|
||||
|
||||
You can find examples of sending and receiving binary data in the [code examples](https://github.com/nymtech/nym/tree/master/clients/native/examples), and an example project from the Nym community [BTC-BC](https://github.com/sgeisler/btcbc-rs/): Bitcoin transaction transmission via Nym, a client and service provider written in Rust.
|
||||
|
||||
### Replying to SURB messages
|
||||
Each bucket of `replySURBs`, when received as part of an incoming message, has a unique session identifier, which **only identifies the bucket of pre-addressed packets**. This is necessary to make sure that your app is replying to the correct people with the information meant for them in a situation where multiple clients are sending requests to a single service.
|
||||
|
||||
Constructing a reply with SURBs looks something like this (where `senderTag` was parsed from the incoming message)
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "reply",
|
||||
"message": "reply you also want to keep secret",
|
||||
"senderTag": "the sender tag you parsed from the incoming message"
|
||||
}
|
||||
```
|
||||
|
||||
### Error messages
|
||||
Errors from the app's client, or from the gateway, will be sent down the websocket to your code in the following format:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "error",
|
||||
"message": "string message"
|
||||
}
|
||||
```
|
||||
|
||||
### LaneQueueLength
|
||||
This is currently only used in the [Socks Client](../socks5) to keep track of the number of Sphinx packets waiting to be sent to the mixnet via being slotted amongst cover traffic. As this value becomes larger, the client signals to the application it should slow down the speed with which it writes to the proxy. This is to stop situations arising whereby an app connected to the client appears as if it has sent (e.g.) a bunch of messages and is awaiting a reply, when they in fact have not been sent through the mixnet yet.
|
||||
|
||||
## Message Responses
|
||||
Responses to your messages are defined [here](https://github.com/nymtech/nym/blob/master/clients/native/websocket-requests/src/responses.rs#L47):
|
||||
|
||||
```rust
|
||||
#[derive(Debug)]
|
||||
pub enum ServerResponse {
|
||||
Received(ReconstructedMessage),
|
||||
SelfAddress(Box<Recipient>),
|
||||
LaneQueueLength { lane: u64, queue_length: usize },
|
||||
Error(error::Error),
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,5 @@
|
||||
# Core Concepts
|
||||
|
||||
We are working on making the Mixnet as easy as possible to use; that said, it is at the moment still quite an unusual system in terms of how it works and the required parts.
|
||||
|
||||
We are working on abstractions to emulate more traditional networking such as reading from / writing to TCP sockets, and have plans to modify the internals of the clients to remove some of the required architecture and slim down the parts required to use the Mixnet.
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"required-architecture": "Required Architecture",
|
||||
"messages": "Message Based Paradigm",
|
||||
"message-queue": "Message Queue",
|
||||
"credentials": "Credentials"
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Callout } from 'nextra/components'
|
||||
|
||||
# Credentials
|
||||
|
||||
<Callout type="info" emoji="ℹ️">
|
||||
|
||||
Right now we are still working on the specifics of how credentials will work for developers; this page serves as a stub with what information we do currently have.
|
||||
|
||||
</Callout>
|
||||
|
||||
Once the [zk-nym](../../network/cryptography/zk-nym) credential system is turned on, all Nym clients will have to present a valid credential to their Gateway on connection.
|
||||
|
||||
We plan to supply developers with a credential faucet for their applications, and a pay-per-play backend for large existing applications that wish to integrate and supply their users' with credentials under the hood.
|
||||
|
||||
> Remember, due to the [rerandomisation](../../network/cryptography/zk-nym/rerandomise) properties of the zk-nym scheme, that an application supplies a user with a credential in no way affects any privacy properties: the user will always present unlinkable rerandomised credential data to whatever Gateway their app instance connects to!
|
||||
@@ -0,0 +1,75 @@
|
||||
# Message Queue
|
||||
|
||||
Clients, once connected to the Mixnet, **are always sending traffic into the Mixnet**; as well as the packets that you as a developer are sending from your application logic, they send [cover traffic](../../network/concepts/cover-traffic) at a constant rate defined by a Poisson process. This is part of the network's mitigation of timing attacks.
|
||||
|
||||
There are two constant streams of sphinx packets leaving the client at the rate defined by the Poisson process.
|
||||
- one that is solely cover traffic
|
||||
- one that sends a mixture of cover and 'real' traffic
|
||||
|
||||
|
||||
```mermaid
|
||||
---
|
||||
config:
|
||||
theme: neo-dark
|
||||
layout: elk
|
||||
|
||||
title: Cover Traffic Stream
|
||||
---
|
||||
sequenceDiagram
|
||||
box Local Machine
|
||||
participant App Logic
|
||||
participant Nym Client
|
||||
end
|
||||
participant Entry Gateway
|
||||
|
||||
loop Cover Traffic Stream
|
||||
Nym Client->>Nym Client: Delay
|
||||
Nym Client->>Entry Gateway: Cover traffic
|
||||
end
|
||||
|
||||
|
||||
```
|
||||
|
||||
```mermaid
|
||||
---
|
||||
config:
|
||||
theme: neo-dark
|
||||
layout: elk
|
||||
|
||||
title: Mixed Stream
|
||||
---
|
||||
sequenceDiagram
|
||||
box Local Machine
|
||||
participant App Logic
|
||||
participant Nym Client
|
||||
end
|
||||
participant Entry Gateway
|
||||
|
||||
loop Cover + Real Traffic Stream
|
||||
Nym Client->>Nym Client: Check internal queue + delay
|
||||
Nym Client->>Entry Gateway: Cover traffic
|
||||
alt Packets with App Payload
|
||||
App Logic-->>Nym Client: Send(bytes): add to internal queue
|
||||
Nym Client->>Nym Client: Check internal queue: bytes to send
|
||||
Nym Client->>Nym Client: Encrypt & packetise bytes
|
||||
Nym Client->>Entry Gateway: Real Packets
|
||||
Nym Client->>Nym Client: Check internal queue: bytes to send
|
||||
Nym Client->>Nym Client: Encrypt & packetise bytes
|
||||
Nym Client->>Entry Gateway: Real Packets
|
||||
Nym Client->>Nym Client: Check internal queue: queue empty
|
||||
end
|
||||
Nym Client->>Nym Client: Delay
|
||||
Nym Client->>Entry Gateway: Cover traffic
|
||||
end
|
||||
```
|
||||
|
||||
> Since Sphinx packets are indistinguishable to an external observer, the only difference between 'real' and cover traffic is whether the payload is empty or not. This can be only known to the eventual receiver of the packet.
|
||||
|
||||
## What does `send()` do then?
|
||||
|
||||
When passing a message to a client (however you do it, either piping messages from an app to a standalone client or via one of the `send` functions exposed by the SDKs), you are **putting that message into the queue** to be source encrypted and sent in the future, in order to ensure that traffic leaving the client does so in a manner that to an external observer is uniform / does not create any 'burst' or change in traffic timings that could aid traffic analysis.
|
||||
|
||||
## Note on Client Shutdown
|
||||
Accidentally dropping a client before your message has been sent is something that is possible and should be avoided (see the [troubleshooting guide](../rust/mixnet/troubleshooting) for more on this) but is easy to avoid simply by remembering to:
|
||||
- keep your client process alive, even if you are not expecting a reply to your message
|
||||
- (in the case of the SDKs) properly disconnecting your client in order to make sure that the message queue is flushed of Sphinx packets with actual payloads.
|
||||
@@ -0,0 +1,30 @@
|
||||
# Message-based Paradigm
|
||||
|
||||
For the moment, Mixnet clients work assuming they will be piped atomic messages looking something like this:
|
||||
|
||||
```
|
||||
MixnetMessage {
|
||||
Message: Message_Bytes,
|
||||
To: Nym_Address,
|
||||
Attached_SURBS: Number_Of_Surbs
|
||||
}
|
||||
```
|
||||
|
||||
That the client will then encrypt as Sphinx packets and send through the Mixnet.
|
||||
|
||||
Likewise, they assume that once they have received and decrypted a Sphinx packet, they will kick back a reconstructed message to the rest of your app logic that look something like:
|
||||
|
||||
```
|
||||
ReconstructedMessage {
|
||||
Message: Message_Bytes,
|
||||
From: SURB_Sender_Tag
|
||||
}
|
||||
```
|
||||
|
||||
This is obviously quite different to e.g. simply being able to read/write from a stream returned from a function call to create a TCP connection, but there are several approaches that developers can take to dealing with this right now.
|
||||
|
||||
## Message Abstractions
|
||||
- Rust/Go (and soon C++) developers can use the `TcpProxy` [stream abstraction](../rust/tcpproxy).
|
||||
- Developers who are using Typescript/Javascript can also avoid having to deal directly with messages via using [MixFetch](../typescript/examples/mix-fetch).
|
||||
- As can developers who are bundling and running the standalone [socks5 client](../clients/socks5) using some form of init script.
|
||||
- There will be a seperate pair of binaries coming soon which other developers can use to run as a persistent secondary proxy process based on the [zcash gRPC demo](https://github.com/nymtech/nym-zcash-grpc-demo) codebase, built using the `TcpProxy` abstraction. These will simply expose a `localhost` socket port to pipe traffic to and from in the same way as you would a TCP connection.
|
||||
@@ -0,0 +1,48 @@
|
||||
# Required Application Architecture
|
||||
|
||||
Due to the fact that there are a lot of components that make up the Nym network (the Mixnet, Blockchain, etc) there is often confusion / misunderstandings about what is required to run application traffic through the Mixnet and take advantage of its various privacy properties.
|
||||
|
||||
## What do I need?
|
||||
Nym clients on 'both sides' of the Mixnet.
|
||||
- traditional client / server application setups involve having a Nym client on the local 'client' machine, as well as on the 'server' backend your local app/process wants to remotely communicate with. We need to put the Mixnet betwen them to gain the privacy properties as we need our local app to pipe its traffic to its local Nym client and have this traffic encrypted and slotted into the message queue for sending, and our server code to have a Nym client listening out for incoming messages to decrypt, reconstruct, and pass upstream to the server process. The server-side Nym client can then [anonymously reply via SURBs](../../network/traffic/anonymous-replies) to the client-app.
|
||||
- P2P app setups may differ only insofar as that they probably shouldn't rely on [ephemeral clients](../rust/mixnet/examples/simple) as they will likely need a persistent Nym address - otherwise the logic is the same as client/server apps.
|
||||
|
||||
> We haven't yet tried to integrate a fully P2P application using anonymous replies: reach out if you are trying / have ideas!
|
||||
|
||||
That's it - so long as you have a Nym client, you can communicate with other Nym clients through the Mixnet. The content of your message payloads is up to you, and you can approach funneling traffic through the Mixnet as a black box if you want!
|
||||
|
||||
```mermaid
|
||||
---
|
||||
config:
|
||||
theme: neo-dark
|
||||
layout: elk
|
||||
---
|
||||
flowchart TB
|
||||
subgraph Local Machine[Local Machine]
|
||||
A[Application Logic]
|
||||
B[Nym Client]
|
||||
end
|
||||
|
||||
A <-->|Bytes| B
|
||||
B <-->|Sphinx Packets| Mixnet
|
||||
|
||||
Mixnet{Mixnet Nodes}
|
||||
|
||||
subgraph Remote Machine
|
||||
C[Application Logic]
|
||||
D[Nym Client]
|
||||
end
|
||||
|
||||
C <-->|Bytes| D
|
||||
D <-->|Sphinx Packets| Mixnet
|
||||
```
|
||||
|
||||
## What don't I need (but is maybe nice to have)?
|
||||
You **do not need to run any infrastructure to integrate Mixnet functionality**.
|
||||
|
||||
That said, if you are expecting a lot of traffic and perhaps don't want to rely on other people's Gateway infrastructure, you could run your own. However, this is something that is more in the 'nice to have'/'quality of service' category, and is not necessarily expected when starting to build on Nym. Furthermore, if our tokenomic incentives are working as they should, Gateway uptimes should be so good as to not require this regardless!
|
||||
|
||||
## What do I definitely not need?
|
||||
- To run a Mix Node. Defining which Mix Nodes you want to run traffic through is, although [technically possible](../rust/mixnet/examples/custom-topology), **only to be used in testing or research scenarios**; limiting the potential paths of your packets to a subset of the overall Mixnet topology is effectively reducing your anonymity set, and potentially leaking this subset through e.g. having the calculation logic open sourced is even worse. The best performing Mix Nodes are selected to route traffic per epoch, and will be used by your Nym clients when routing packets.
|
||||
- To run a Validator / NymAPI instance.
|
||||
- `NYM` tokens: for the moment the Mixnet is free to use. Developers will have access to a Credential faucet once the [zk-nym](../../network/cryptography/zk-nym) scheme is enabled in mainnet.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user