From cc74172e7a741d1a1e4d35cf4f2cc2f296181f49 Mon Sep 17 00:00:00 2001 From: mfahampshire Date: Wed, 9 Oct 2024 22:40:31 +0200 Subject: [PATCH] rust sdk links --- .../docs/pages/developers/rust/development-status.md | 6 ++---- .../docs/pages/developers/rust/mixnet/examples/surbs.md | 2 +- .../docs/pages/developers/rust/mixnet/message-types.md | 2 +- .../docs/pages/developers/rust/mixnet/troubleshooting.md | 2 +- documentation/docs/pages/developers/rust/tcpproxy.mdx | 2 +- .../pages/developers/rust/tcpproxy/examples/multiconn.mdx | 2 ++ .../pages/developers/rust/tcpproxy/examples/singleconn.mdx | 2 ++ 7 files changed, 10 insertions(+), 8 deletions(-) diff --git a/documentation/docs/pages/developers/rust/development-status.md b/documentation/docs/pages/developers/rust/development-status.md index ad07537bbb..79b53b9d3f 100644 --- a/documentation/docs/pages/developers/rust/development-status.md +++ b/documentation/docs/pages/developers/rust/development-status.md @@ -7,11 +7,9 @@ In the future the SDK will be made up of several modules, each of which will all |-----------|---------------------------------------------------------------------------------------|----------| | Mixnet | Create / load clients & keypairs, subscribe to Mixnet events, send & receive messages | ✔️ | | TcpProxy | Utilise the TcpProxyClient and TcpProxyServer abstractions for streaming | ✔️ | -| Ecash | Create & verify Ecash credentials | 🛠️ | +| Ecash | Create & verify Ecash credentials | ❌ | | Validator | Sign & broadcast Nyx blockchain transactions, query the blockchain | ❌ | -The `Mixnet` module currently exposes the logic of two clients: the [websocket client]() TODO LINK, and the [socks]() TODO client. +The `Mixnet` module currently exposes the logic of two clients: the [websocket client](../clients/websocket), and the [socks](../clients/socks5) client. The `TcpProxy` module exposes functionality to set up client/server instances that expose a localhost TcpSocket to read/write to. - -The `Ecash` module is in progress. Right now it exposes logic allowing for the creation of zk-nym credentials on the Sandbox testnet. diff --git a/documentation/docs/pages/developers/rust/mixnet/examples/surbs.md b/documentation/docs/pages/developers/rust/mixnet/examples/surbs.md index 74cb4803db..ab8d9abb79 100644 --- a/documentation/docs/pages/developers/rust/mixnet/examples/surbs.md +++ b/documentation/docs/pages/developers/rust/mixnet/examples/surbs.md @@ -1,7 +1,7 @@ # Anonymous Replies with SURBs (Single Use Reply Blocks) Both functions used to send messages through the mixnet (`send_message` and `send_plain_message`) send a pre-determined number of SURBs along with their messages by default. -You can read more about how SURBs function under the hood [here](https://nymtech.net/docs/architecture/traffic-flow.html#private-replies-using-surbs). **TODO change link** +You can read more about how SURBs function under the hood [here](../../../../network/traffic/anonymous-replies). In order to reply to an incoming message using SURBs, you can construct a `recipient` from the `sender_tag` sent along with the message you wish to reply to. diff --git a/documentation/docs/pages/developers/rust/mixnet/message-types.md b/documentation/docs/pages/developers/rust/mixnet/message-types.md index 0e48190f3e..833b1cc3fc 100644 --- a/documentation/docs/pages/developers/rust/mixnet/message-types.md +++ b/documentation/docs/pages/developers/rust/mixnet/message-types.md @@ -11,7 +11,7 @@ Sends bytes to the supplied Nym address. There is the option to specify the numb - `send_plain_message(&self, address: Recipient, message: M) -> Result<()>` Sends data to the supplied Nym address with the default surb behaviour. -> Note we specify *outgoing* messages above: this is because the SDK assumes that replies will be anonymous via [SURBs]() TODO LINK. +> Note we specify *outgoing* messages above: this is because the SDK assumes that replies will be anonymous via [SURBs](../../../network/traffic/anonymous-replies). Replies rely on the creation of an `AnonymousSenderTag` by parsing and storing the `sender_tag` from incoming messages, and using this to reply, instead of the `Receipient` type used by the functions outlined above: diff --git a/documentation/docs/pages/developers/rust/mixnet/troubleshooting.md b/documentation/docs/pages/developers/rust/mixnet/troubleshooting.md index cd409493a1..06bba32f6d 100644 --- a/documentation/docs/pages/developers/rust/mixnet/troubleshooting.md +++ b/documentation/docs/pages/developers/rust/mixnet/troubleshooting.md @@ -7,7 +7,7 @@ If you come across something that isn't explained here, [PRs are welcome](https: ### On client shutdown (expected) If this is happening at the end of your code when disconnecting your client, this is fine; we just have a verbose client! When calling `client.disconnect().await` this is simply informing you that the client is shutting down. -On client shutdown / disconnect this is to be expected - this can be seen in many of the code examples as well. We use the [`nym_bin_common::logging`](https://github.com/nymtech/nym/blob/develop/common/bin-common/src/logging/mod.rs) import to set logging in our example code. This defaults to `INFO` level. +On client shutdown / disconnect this is to be expected - this can be seen in many of the code examples as well. We use the [`nym_bin_common::logging`](https://github.com/nymtech/nym/blob/master/common/bin-common/src/logging/mod.rs) import to set logging in our example code. This defaults to `INFO` level. If you wish to quickly lower the verbosity of your client process logs when developing you can prepend your command with `RUST_LOG=`. diff --git a/documentation/docs/pages/developers/rust/tcpproxy.mdx b/documentation/docs/pages/developers/rust/tcpproxy.mdx index b522fa4ad2..287232a27f 100644 --- a/documentation/docs/pages/developers/rust/tcpproxy.mdx +++ b/documentation/docs/pages/developers/rust/tcpproxy.mdx @@ -1,5 +1,5 @@ # TcpProxy Module -This module exposes the `TcpProxyClient` and the `TcpProxyServer` which can be used to proxy traffic through the Mixnet in a way that is more familiar to developers than the methods exposed by the [`Mixnet` module](./mxinet). +This module exposes the `TcpProxyClient` and the `TcpProxyServer` which can be used to proxy traffic through the Mixnet in a way that is more familiar to developers than the methods exposed by the [`Mixnet` module](./mixnet). Both `Client` and `Server` are intended to be initialised and then run in a background thread, exposing a configurable `localhost` socket which developers can read/write/stream to without having to worry about the [message-based](../concepts/messages) nature of sending and receiving traffic to/from the Mixnet. diff --git a/documentation/docs/pages/developers/rust/tcpproxy/examples/multiconn.mdx b/documentation/docs/pages/developers/rust/tcpproxy/examples/multiconn.mdx index 8591a7c4ce..3a97858119 100644 --- a/documentation/docs/pages/developers/rust/tcpproxy/examples/multiconn.mdx +++ b/documentation/docs/pages/developers/rust/tcpproxy/examples/multiconn.mdx @@ -3,6 +3,8 @@ This example starts off several Tcp connections on a loop to a remote endpoint: in this case the `TcpListener` behind the `NymProxyServer` instance on the echo server found in [`nym/tools/echo-server/`](https://github.com/nymtech/nym/tree/develop/tools/echo-server). It pipes a few messages to it, logs the replies, and keeps track of the number of replies received per connection. +> You can find this code [here](https://github.com/nymtech/nym/blob/develop/sdk/rust/nym-sdk/examples/tcp_proxy_multistream.rs) + ```rust use nym_sdk::mixnet::Recipient; use nym_sdk::tcp_proxy; diff --git a/documentation/docs/pages/developers/rust/tcpproxy/examples/singleconn.mdx b/documentation/docs/pages/developers/rust/tcpproxy/examples/singleconn.mdx index afa9d5328d..1ee1196868 100644 --- a/documentation/docs/pages/developers/rust/tcpproxy/examples/singleconn.mdx +++ b/documentation/docs/pages/developers/rust/tcpproxy/examples/singleconn.mdx @@ -6,6 +6,8 @@ This is a basic example which opens a single TCP connection and writes a bunch o For a more irl example check the [multi connection example](./multiconn). +> You can find this code [here](https://github.com/nymtech/nym/blob/develop/sdk/rust/nym-sdk/examples/tcp_proxy_single_connection.rs) + ```rust use nym_sdk::tcp_proxy; use rand::rngs::SmallRng;