From 5636e61a8d73ce9513869400ec5ec04e103304cd Mon Sep 17 00:00:00 2001 From: mfahampshire Date: Wed, 18 Dec 2024 18:15:36 +0100 Subject: [PATCH] tweak format --- .../docs/pages/developers/clients/socks5.mdx | 7 ----- .../developers/clients/socks5/config.mdx | 6 +++-- .../pages/developers/clients/socks5/setup.mdx | 6 +++++ .../pages/developers/clients/socks5/usage.mdx | 6 ++--- .../developers/clients/webassembly-client.mdx | 2 +- .../developers/concepts/message-queue.md | 1 + .../pages/developers/concepts/messages.mdx | 1 + .../docs/pages/developers/integrations.mdx | 5 ++-- .../docs/pages/developers/tools/nym-cli.md | 26 ------------------- .../pages/developers/tools/nym-cli/_meta.json | 4 +++ .../pages/developers/tools/nym-cli/usage.mdx | 26 +++++++++++++++++++ 11 files changed, 47 insertions(+), 43 deletions(-) create mode 100644 documentation/docs/pages/developers/tools/nym-cli/_meta.json create mode 100644 documentation/docs/pages/developers/tools/nym-cli/usage.mdx diff --git a/documentation/docs/pages/developers/clients/socks5.mdx b/documentation/docs/pages/developers/clients/socks5.mdx index 08e40b6306c..bcc1a6458d6 100644 --- a/documentation/docs/pages/developers/clients/socks5.mdx +++ b/documentation/docs/pages/developers/clients/socks5.mdx @@ -2,7 +2,6 @@ > 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 @@ -49,9 +48,3 @@ The `nym-socks5-client` allows you to do the following from your local machine: * 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. diff --git a/documentation/docs/pages/developers/clients/socks5/config.mdx b/documentation/docs/pages/developers/clients/socks5/config.mdx index 3c53d14da10..a70404c9c64 100644 --- a/documentation/docs/pages/developers/clients/socks5/config.mdx +++ b/documentation/docs/pages/developers/clients/socks5/config.mdx @@ -1,4 +1,6 @@ -# Configuring your client +# Config + +## Default Config Directories When you initalise a client instance, a configuration directory will be generated and stored in `$HOME_DIR/.nym/socks5-clients//`. ``` @@ -21,7 +23,7 @@ The `config.toml` file contains client configuration options, while the two `pem The generated files contain the client name, public/private keypairs, and gateway address. The name `` in the example above is just a local identifier so that you can name your clients. -#### Configuring your client for Docker +## 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. diff --git a/documentation/docs/pages/developers/clients/socks5/setup.mdx b/documentation/docs/pages/developers/clients/socks5/setup.mdx index 1a02158aa03..027fadf35e9 100644 --- a/documentation/docs/pages/developers/clients/socks5/setup.mdx +++ b/documentation/docs/pages/developers/clients/socks5/setup.mdx @@ -1,4 +1,10 @@ # Client setup + +## 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. ## Viewing command help You can check that your binaries are properly compiled with: diff --git a/documentation/docs/pages/developers/clients/socks5/usage.mdx b/documentation/docs/pages/developers/clients/socks5/usage.mdx index be79556af83..1f19f9d1665 100644 --- a/documentation/docs/pages/developers/clients/socks5/usage.mdx +++ b/documentation/docs/pages/developers/clients/socks5/usage.mdx @@ -1,5 +1,6 @@ -# Running the socks5 client +# Usage +## Run You can run the initialised client by doing this: ``` @@ -7,7 +8,6 @@ You can run the initialised client by doing this: ``` ## Automating your socks5 client with systemd - Create a service file for the socks5 client at `/etc/systemd/system/nym-socks5-client.service`: ```ini @@ -38,7 +38,6 @@ 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`. @@ -52,7 +51,6 @@ Most wallets and other applications will work basically the same way: find the n 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. diff --git a/documentation/docs/pages/developers/clients/webassembly-client.mdx b/documentation/docs/pages/developers/clients/webassembly-client.mdx index 71276ef8c1d..9c7241c1acf 100644 --- a/documentation/docs/pages/developers/clients/webassembly-client.mdx +++ b/documentation/docs/pages/developers/clients/webassembly-client.mdx @@ -1,5 +1,6 @@ # Webassembly Client +## Overview 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.** @@ -7,7 +8,6 @@ This is currently packaged and distributed for ease of use via the [Nym Typescri 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! diff --git a/documentation/docs/pages/developers/concepts/message-queue.md b/documentation/docs/pages/developers/concepts/message-queue.md index 4209631f296..3fba96b77f1 100644 --- a/documentation/docs/pages/developers/concepts/message-queue.md +++ b/documentation/docs/pages/developers/concepts/message-queue.md @@ -1,5 +1,6 @@ # Message Queue +## Sphinx Packet Streams 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. diff --git a/documentation/docs/pages/developers/concepts/messages.mdx b/documentation/docs/pages/developers/concepts/messages.mdx index 68e4b6f92c4..5a019593c91 100644 --- a/documentation/docs/pages/developers/concepts/messages.mdx +++ b/documentation/docs/pages/developers/concepts/messages.mdx @@ -1,5 +1,6 @@ # Message-based Paradigm +## Message Format For the moment, Mixnet clients work assuming they will be piped atomic messages looking something like this: ``` diff --git a/documentation/docs/pages/developers/integrations.mdx b/documentation/docs/pages/developers/integrations.mdx index 1cc836a2969..6937290ae55 100644 --- a/documentation/docs/pages/developers/integrations.mdx +++ b/documentation/docs/pages/developers/integrations.mdx @@ -6,7 +6,7 @@ import { GitHubRepoSearch } from '../../code-snippets/mixfetchurl'; # Integration Options Developers might want to either integrate a Mixnet client or just to interact with the blockchain. See the relevant section below. -### Integrating Mixnet Functionality +## Integrating Mixnet Functionality There are several options available to developers wanting to embed a Nym client in their application code. @@ -34,8 +34,7 @@ There are several options available to developers wanting to embed a Nym client If your app is not written in any of the supported languages, you might still be able to send traffic through a standalone [socks5 client](./clients/socks5) but will have to think about packaging and bundling the client binary with e.g. a `systemd` file for autostart to run the client as a daemon. If you want to discuss FFI options reach out to us via our public dev channel. -### Interacting with Nyx - +## Interacting with Nyx If instead of relying on the Mixnet you wish to interact with the Nyx chain, either as a payment processor or to get on-chain events, see [interacting with the chain](./chain). > Note that depending on your setup, you might already be able to combine interacting with the chain with using the Mixnet: check the options above for more. diff --git a/documentation/docs/pages/developers/tools/nym-cli.md b/documentation/docs/pages/developers/tools/nym-cli.md index bf938f2173b..e2be8ea3ef2 100644 --- a/documentation/docs/pages/developers/tools/nym-cli.md +++ b/documentation/docs/pages/developers/tools/nym-cli.md @@ -1,34 +1,8 @@ # Nym-CLI -## What is this tool for? This is a CLI tool for interacting with: * the Nyx blockchain (account management, querying the chain state, etc) * the smart contracts deployed on Nyx (bonding and un-bonding mixnodes, collecting rewards, etc) It provides a convenient wrapper around the `nymd` client, and has similar functionality to the `nyxd` binary for querying the chain or executing smart contract methods. - -## Building -The `nym-cli` binary can be built by running `cargo build --release` in the `nym/tools/nym-cli` directory. - -## Usage -See the [commands](./nym-cli/commands.mdx) page for an overview of all command options. - -### Staking on someone's behalf (for custodians) - -There is a limitation the staking address can only perform the following actions (and are visible via the Nym Wallet: - -- Bond on the gateway's or mix node's behalf. -- Delegate or Un-delegate (to a mix node in order to begin receiving rewards) -- Claiming the rewards on the account - -```admonish note title="" -The staking address has no ability to withdraw any coins from the parent's account. -``` - -The staking address must maintain the same level of security as the parent mnemonic; while the parent mnemonic's delegations and bonding events will be visible to the parent owner, the staking address will be the only account capable of undoing the bonding and delegating from the mix nodes or gateway. - -Query for staking on behalf of someone else -``` -./nym-cli --mnemonic mixnet delegators delegate --mix-id --identity-key --amount -``` diff --git a/documentation/docs/pages/developers/tools/nym-cli/_meta.json b/documentation/docs/pages/developers/tools/nym-cli/_meta.json new file mode 100644 index 00000000000..723024d1fd5 --- /dev/null +++ b/documentation/docs/pages/developers/tools/nym-cli/_meta.json @@ -0,0 +1,4 @@ +{ + "usage": "Usage", + "commands": "Commands" +} diff --git a/documentation/docs/pages/developers/tools/nym-cli/usage.mdx b/documentation/docs/pages/developers/tools/nym-cli/usage.mdx new file mode 100644 index 00000000000..f9fa301cc9f --- /dev/null +++ b/documentation/docs/pages/developers/tools/nym-cli/usage.mdx @@ -0,0 +1,26 @@ +# Usage + +## Building +The `nym-cli` binary can be built by running `cargo build --release` in the `nym/tools/nym-cli` directory. + +## Usage +See the [commands](./nym-cli/commands.mdx) page for an overview of all command options. + +## Staking on someone's behalf (for custodians) + +There is a limitation the staking address can only perform the following actions (and are visible via the Nym Wallet: + +- Bond on the gateway's or mix node's behalf. +- Delegate or Un-delegate (to a mix node in order to begin receiving rewards) +- Claiming the rewards on the account + +```admonish note title="" +The staking address has no ability to withdraw any coins from the parent's account. +``` + +The staking address must maintain the same level of security as the parent mnemonic; while the parent mnemonic's delegations and bonding events will be visible to the parent owner, the staking address will be the only account capable of undoing the bonding and delegating from the mix nodes or gateway. + +Query for staking on behalf of someone else +``` +./nym-cli --mnemonic mixnet delegators delegate --mix-id --identity-key --amount +```