Skip to content

Commit

Permalink
tweak format
Browse files Browse the repository at this point in the history
  • Loading branch information
mfahampshire committed Dec 18, 2024
1 parent 3521f36 commit 5636e61
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 43 deletions.
7 changes: 0 additions & 7 deletions documentation/docs/pages/developers/clients/socks5.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
6 changes: 4 additions & 2 deletions documentation/docs/pages/developers/clients/socks5/config.mdx
Original file line number Diff line number Diff line change
@@ -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/<client-name>/`.

```
Expand All @@ -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 `<client_id>` 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.
Expand Down
6 changes: 6 additions & 0 deletions documentation/docs/pages/developers/clients/socks5/setup.mdx
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
6 changes: 2 additions & 4 deletions documentation/docs/pages/developers/clients/socks5/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Running the socks5 client
# Usage

## Run
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
Expand Down Expand Up @@ -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`.
Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# 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.**

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!
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
1 change: 1 addition & 0 deletions documentation/docs/pages/developers/concepts/messages.mdx
Original file line number Diff line number Diff line change
@@ -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:

```
Expand Down
5 changes: 2 additions & 3 deletions documentation/docs/pages/developers/integrations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<Tabs items={['Rust/Go/C++', 'Typescript/Javascript','Other']}>
Expand Down Expand Up @@ -34,8 +34,7 @@ There are several options available to developers wanting to embed a Nym client
<Tabs.Tab> 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. </Tabs.Tab>
</Tabs>

### 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.
26 changes: 0 additions & 26 deletions documentation/docs/pages/developers/tools/nym-cli.md
Original file line number Diff line number Diff line change
@@ -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 <staking address mnemonic> mixnet delegators delegate --mix-id <input> --identity-key <input> --amount <input>
```
4 changes: 4 additions & 0 deletions documentation/docs/pages/developers/tools/nym-cli/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"usage": "Usage",
"commands": "Commands"
}
26 changes: 26 additions & 0 deletions documentation/docs/pages/developers/tools/nym-cli/usage.mdx
Original file line number Diff line number Diff line change
@@ -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 <staking address mnemonic> mixnet delegators delegate --mix-id <input> --identity-key <input> --amount <input>
```

0 comments on commit 5636e61

Please sign in to comment.