Skip to content

Commit

Permalink
Merge pull request #3828 from nymtech/documentation/patch-variables
Browse files Browse the repository at this point in the history
Documentation/patch-variables
  • Loading branch information
mfahampshire committed Sep 4, 2023
2 parents 80f7175 + d988fe0 commit a59295f
Show file tree
Hide file tree
Showing 33 changed files with 84 additions and 77 deletions.
4 changes: 2 additions & 2 deletions documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Each directory contains a readme with more information about running and contrib
* `operators` contains node setup and maintenance guides hosted at [https://nymtech.net/operators](https://nymtech.net/operators)

## Scripts
* `bump_versions.sh` allows you to update the `platform_release_version` and `wallet_release_version` variables 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.
* `build_all_to_dist.sh` is used by the `ci-dev.yml` and `cd-dev.yml` scripts for building all mdbook projects and moving the rendered html to `../dist/` to be rsynced with various servers.
* `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.
* `build_all_to_dist.sh` is used by the `ci-dev.yml` and `cd-dev.yml` scripts for building all mdbook projects and moving the rendered html to `../dist/` to be rsynced with various servers.


19 changes: 9 additions & 10 deletions documentation/bump_versions.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#!/usr/bin/env bash
# this takes two args: platform release version and wallet release version.
# 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 platform release was v1.1.29 and the release version 1.2.9 you'd run this as:
# `./bump_versions.sh "1.1.29" "1.2.9"`
# 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 3rd argument:
# `./bump_versions.sh "1.1.29" "1.2.9" "1.67"`
# 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 2 ] || [ "$#" -gt 3 ];
if [ "$#" -lt 1 ] || [ "$#" -gt 2 ];
then
echo "failure: please pass at least 2 and at most 3 args: "
echo "./bump_version.sh <new platform_release_version> <new wallet_release_version> [OPTIONAL]<new minimum_rust_version>"
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

Expand All @@ -29,8 +29,7 @@ else
for i in "${projects[@]}"
do
# sed the vars in the book.toml file for each project
echo "setting platform and wallet versions in $i/"
sed -i 's/platform_release_version =.*/platform_release_version = "'$1'"/' "$i"/book.toml
echo "setting wallet version in $i/"
sed -i 's/wallet_release_version =.*/wallet_release_version = "'$2'"/' "$i"/book.toml
if [ "$3" ]
then
Expand Down
2 changes: 1 addition & 1 deletion documentation/dev-portal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If you have built a project with Nym or are compiling and writing resources abou
## Variables
There are some variables that are shared across this book, such as the current latest software version.

Variables are denoted in the `.md` files wrapped in `{{}}` (e.g `{{platform_release_version}}` is the most recent release), 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!**
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!**

## 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.
Expand Down
1 change: 0 additions & 1 deletion documentation/dev-portal/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ assets_version = "2.0.0" # do not edit: managed by `mdbook-admonish install`
# https://gitlab.com/tglman/mdbook-variables/
[preprocessor.variables.variables]
minimum_rust_version = "1.66"
platform_release_version = "1.1.29"
wallet_release_version = "1.2.8"

[preprocessor.last-changed]
Expand Down
Binary file added documentation/dev-portal/src/images/matrix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/dev-portal/src/images/matrix.webp
Binary file not shown.
Binary file added documentation/dev-portal/src/images/telegram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
4 changes: 2 additions & 2 deletions documentation/dev-portal/src/integrations/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Yes, it is supported.
Yes. Follow the instructions in the [Ledger support for Nyx documentation](https://nymtech.net/docs/nyx/ledger-live.html).

### Where can I find network details such as deployed smart contract addresses?
In the [`network defaults`](https://github.com/nymtech/nym/blob/release/{{platform_release_version}}/common/network-defaults/src/mainnet.rs) file.
In the [`network defaults`](https://github.com/nymtech/nym/blob/master/common/network-defaults/src/mainnet.rs) file.

## `NYM` Token
The token used to reward mixnet infrastructure operators - `NYM` - is one of the native tokens of the Nyx blockchain. The other token is `NYX`.
Expand Down Expand Up @@ -198,4 +198,4 @@ For the moment then yes, the mixnet is free to use. There are no limits on the a
No, although we do recommend that apps that wish to integrate look into running some of their own infrastructure such as gateways in order to assure uptime.

### How can I find out if an application is already supported by network requester services?
You can check the [default allowed list](https://nymtech.net/.wellknown/network-requester/standard-allowed-list.txt) file to see which application traffic is whitelisted by default. If the domain is present on that list, it means that existing [network requesters](https://nymtech.net/docs/nodes/network-requester-setup.html) can be used to privacy-protect your application traffic. Simply use [NymConnect](../quickstart/nymconnect-gui.md) to connect to this service through the mixnet.
You can check the [default allowed list](https://nymtech.net/.wellknown/network-requester/standard-allowed-list.txt) file to see which application traffic is whitelisted by default. If the domain is present on that list, it means that existing [network requesters](https://nymtech.net/docs/nodes/network-requester-setup.html) can be used to privacy-protect your application traffic. Simply use [NymConnect](../quickstart/nymconnect-gui.md) to connect to this service through the mixnet.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ It’s packaged and available on the npm registry, so you can npm install it int

The webassembly client is most easily used via the [typescript sdk](https://nymtech.net/docs/sdk/typescript.html).

You can find example code in the [examples section](https://github.com/nymtech/nym/tree/release/{{platform_release_version}}/sdk/typescript/examples) of the codebase, and in the [typescript sdk docs](https://nymtech.net/docs/sdk/typescript.html).
You can find example code in the [examples section](https://github.com/nymtech/nym/tree/master/sdk/typescript/examples) of the codebase, and in the [typescript sdk docs](https://nymtech.net/docs/sdk/typescript.html).

#### SOCKS client
This 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).
Expand Down
2 changes: 1 addition & 1 deletion documentation/dev-portal/src/quickstart/nymconnect-gui.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Install NymConnect and select an application that you want to privacy-enhance fr
**Please note that NymConnect is currently released in beta. Please report bugs via Github**.

## Usage instuctions
* [Download](https://github.com/nymtech/nym/releases/tag/nym-connect-{{platform_release_version}}) and install NymConnect.
* [Download](https://github.com/nymtech/nym/releases/) and install NymConnect.
* Select your service provider from the dropdown menu.
* Click `connect` - NymConnect will connect to a service provider and its SOCKS Proxy (IP) and Port will be displayed.
* Click on IP or Port to copy their values to the clipboard.
Expand Down
1 change: 1 addition & 0 deletions documentation/dev-portal/src/tutorials/matrix.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Matrix NymConnect Integration

![](../images//matrix.png)

Chat applications became an essential part of human communication. Matrix chat has end to end encryption on protocol level and Element app users can sort their communication into spaces and rooms. Now the Matrix communities can rely on network privacy as NymConnect supports Matrix chat protocol.

Expand Down
32 changes: 17 additions & 15 deletions documentation/dev-portal/src/tutorials/monero.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,35 @@ A team made up of Monero community members have successfully set up a service pr

## How can I use Monero over the Nym mixnet?

The mainnet service provider to Monero over the Nym mixnet is now ready for use via [NymConnect](https://nymtech.net/download-nymconnect/).
> Any syntax in `<>` brackets is a user's unique variable. Exchange with a corresponding name without the `<>` brackets.
* Download and open the latest version of [NymConnect](https://nymtech.net/download-nymconnect/).
* Click on the top left options and go to Settings
* Go to “Select service provider” and turn it on
* For Mainnet, search for this provider or insert it manually:
The mainnet service provider to Monero over the Nym mixnet is now ready for use via [NymConnect](https://nymtech.net/download-nymconnect/).

* **Download** the latest version of [**NymConnect**](https://nymtech.net/download-nymconnect/).
* Make sure your NymConnect is executable.
```sh
i1TiuoNp4jp9weffCW7tPnkb4hRTPydRjX8iXFVaYDG.88Z1hruuvbzWpdCE2xYnTbPNrr49j4s7mmUQC5wvRRLZ@3EPuxwGn2WP2HdxybzoDa5QsohYSP76aQQRUJuPMvk23
# in Linux open terminal in the same folder and run:
chmod +x ./nym-connect_<YOUR_VERSION>.AppImage
```
* **Open NymConnect app**
* **Turn it on** - Monero wallet is listed in the apps supported by default, no need for any setup
* **Copy** the **Socks5 address** and **Port**

* Go to the main NymConnect interface and connect to the mixnet

Then go to your Monero wallet (gui or otherwise) and change the settings to run over socks5 proxy:
Then go to your Monero wallet (desktop or CLI) and change the settings to run over socks5 proxy:

**Monero desktop:**
**Monero desktop wallet:**

* Settings -> Interface -> Socks5 proxy -> Add values: IP address `localhost`, Port `1080`
* Settings -> Interface -> Socks5 proxy -> Add values: IP address `127.0.0.1`, Port `1080` (the values copied from NymConnect)

<!---commenting the video as it has a redundant part about manual NR setup
<iframe width="700" height="400" src="https://www.youtube.com/embed/oSHnk1BG_f0" title="Demo: Connect Your Monero Wallet to the Nym Mixnet via NymConnect" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

**CLI**
--->
**CLI wallet**

* **Monerod:** add `--proxy 127.0.0.1:1080 --bootstrap-daemon-proxy 127.0.0.1:1080` to args

* **Monero-wallet-{rpc, cli}:** add `--proxy 127.0.0.1:1080 --daemon-ssl-allow-any-cert` to args

Follow the instructions and the Monero mainnet will be connected through to the Nym mixnet.

For those who want to try it out in testnet, a stagenet service provider is also available: [https://nymtech.net/.wellknown/connect/service-providers.json](https://nymtech.net/.wellknown/connect/service-providers.json)

Now your Monero traffic is protected by the network privacy of Nym Mixnet.
4 changes: 3 additions & 1 deletion documentation/dev-portal/src/tutorials/telegram.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

*This is a shortened version of a [Nym Community post](https://blog.nymtech.net/how-to-use-telegram-in-iraq-with-nymconnect-106a3b8dd050) written by Saliveja.*

![](../images/telegram.png)

The purpose of the following manual is not to promote Telegram but so people can use it with the Nym mixnet if they wish to, should a situation ask for that. This privacy-enhances Telegram at the network level and allows users to access the application from locations like where the application was banned.

See also: [Element (Matrix) over the Nym mixnet](./matrix.md): private, decentralised and secure messaging.
Expand All @@ -10,7 +12,7 @@ See also: [Element (Matrix) over the Nym mixnet](./matrix.md): private, decentra

Here’s how to configure Telegram with NymConnect:

1. Download and install NymConnect ().**
1. **Download and install NymConnect(https://nymtech.net/download-nymconnect/).**
For more releases, check out [Github](https://github.com/nymtech/nym/tags). NymConnect is available for Linux, Windows, and MacOS.
On Linux make sure NymConnect is executable. Opening a terminal in the same directory and run:
```sh
Expand Down
8 changes: 1 addition & 7 deletions documentation/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To contribute tranlsations in a new language, please get in touch via [Matrix](h
### Variables
There are some variables that are shared across the entire docs site, such as the current latest software version.

Variables are denoted in the `.md` files wrapped in `{{}}` (e.g `{{platform_release_version}}` is the most recent release), 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!**
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!**

### Diagrams
Most diagrams are simply ascii. Copies are kept in `/diagrams/` for ease of reproducability. Created using [textik](https://textik.com/#).
Expand All @@ -27,12 +27,6 @@ Example files are inserted as per normal with mdbook.

Some binary command outputs are generated using the [`cmdrun`](https://docs.rs/mdbook-cmdrun/latest/mdbook_cmdrun/) mdbook plugin.

### Updating platform version

When updating the version, make sure to change **both** the version in the `title` on line 2 of `book.toml`, as well as the `platform_release_version` variable in the same file.

> In the future this will be dealt with something like a preprocessor widget (todo).
## 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.

Expand Down
1 change: 0 additions & 1 deletion documentation/docs/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ assets_version = "2.0.0" # do not edit: managed by `mdbook-admonish install`
# https://gitlab.com/tglman/mdbook-variables/
[preprocessor.variables.variables]
minimum_rust_version = "1.66"
platform_release_version = "1.1.29"
wallet_release_version = "1.2.8"

[preprocessor.last-changed]
Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

# Binaries
- [Pre-built Binaries](binaries/pre-built-binaries.md)
- [Binary Initialisation and Configuration](binaries/init-and-config.md)
- [Building from Source](binaries/building-nym.md)
- [Binary Initialisation and Configuration](binaries/init-and-config.md)
<!-- - [Version Compatibility Table](binaries/version-compatiblity.md) -->

# Nodes
Expand Down
5 changes: 2 additions & 3 deletions documentation/docs/src/binaries/building-nym.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,17 @@ If you really don't want to use the shell script installer, the [Rust installati
## 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 release/{{platform_release_version}} # checkout to the latest release branch: `develop` will most likely be incompatible with deployed public networks
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
NETWORK=sandbox cargo build --release # build your binaries with **sandbox** configuration
```

Quite a bit of stuff gets built. The key working parts are:
Expand Down
9 changes: 8 additions & 1 deletion documentation/docs/src/binaries/init-and-config.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Binary Initialisation and Configuration

All Nym binaries must first be initialised with `init` before being `run`.
All Nym binaries must first be made executable and initialised with `init` before being `run`.

To make a binary executable, open terminal in the same directory and run:

```sh
chmod +x <BINARY_NAME>
# for example: chmod +x nym-mixnode
```

The `init` command is usually where you pass flags specifying configuration arguments such as the gateway you wish to communicate with, the ports you wish your binary to listen on, etc.

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/src/clients/socks5-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Create a service file for the socks5 client at `/etc/systemd/system/nym-socks5-c

```ini
[Unit]
Description=Nym Socks5 Client ({{platform_release_version}})
Description=Nym Socks5 Client
StartLimitInterval=350
StartLimitBurst=10

Expand Down
4 changes: 2 additions & 2 deletions documentation/docs/src/clients/websocket-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Alternatively, a custom host can be set in the `config.toml` file under the `soc
### Connecting to the local websocket
The Nym native client exposes a websocket interface that your code connects to. To program your app, choose a websocket library for whatever language you're using. The **default** websocket port is `1977`, you can override that in the client config if you want.

The Nym monorepo includes websocket client example code for Rust, Go, Javacript, and Python, all of which can be found [here](https://github.com/nymtech/nym/tree/release/{{platform_release_version}}/clients/native/examples).
The Nym monorepo includes websocket client example code for Rust, Go, Javacript, and Python, all of which can be found [here](https://github.com/nymtech/nym/tree/master/clients/native/examples).

> Rust users can run the examples with `cargo run --example <rust_file>.rs`, as the examples are not organised in the same way as the other examples, due to already being inside a Cargo project.
Expand Down Expand Up @@ -183,7 +183,7 @@ Nym [`ClientRequest`](https://github.com/nymtech/nym/blob/develop/clients/native

As a response the `native-client` will send a `ServerResponse` to be decoded.

You can find examples of sending and receiving binary data in the Rust, Python and Go [code examples](https://github.com/nymtech/nym/tree/release/{{platform_release_version}}/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.
You can find examples of sending and receiving binary data in the Rust, Python and Go [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.

#### Getting your own address
Sometimes, when you start your app, it can be convenient to ask the native client to tell you what your own address is (from the saved configuration files). To do this, send:
Expand Down
Loading

0 comments on commit a59295f

Please sign in to comment.