From c47bc174bcdd3876e4e9310f1c296240629bbcec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9A=A1=EF=B8=8F2FakTor=E2=9A=A1=EF=B8=8F?= Date: Mon, 12 Jun 2023 15:47:28 +0200 Subject: [PATCH 01/14] Update socks5-client.md --- documentation/docs/src/clients/socks5-client.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/documentation/docs/src/clients/socks5-client.md b/documentation/docs/src/clients/socks5-client.md index e7163347cb..2eeabd5b3e 100644 --- a/documentation/docs/src/clients/socks5-client.md +++ b/documentation/docs/src/clients/socks5-client.md @@ -8,6 +8,7 @@ ``` ## 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: ``` @@ -65,6 +66,7 @@ The `nym-socks5-client` allows you to do the following from your local machine: The `nym-network-requester` 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! ## Client setup + ### Viewing command help You can check that your binaries are properly compiled with: @@ -86,6 +88,7 @@ You can check the necessary parameters for the available commands by running: ``` ### 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: ``` @@ -105,6 +108,7 @@ The `--provider` field needs to be filled with the Nym address of a Network Requ Since the nodes on this list are the infrastructure for [Nymconnect](https://nymtech.net/developers/quickstart/nymconnect-gui.html) they will support all apps on the [default whitelist](../nodes/network-requester-setup.md#network-requester-whitelist): Keybase, Telegram, Electrum, Blockstream Green, and Helios. #### 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: @@ -140,6 +144,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 + 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. From 92e902c81e5fd7da8086d73833999e989326496c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9A=A1=EF=B8=8F2FakTor=E2=9A=A1=EF=B8=8F?= Date: Mon, 12 Jun 2023 15:54:13 +0200 Subject: [PATCH 02/14] Update socks5-client.md --- .../docs/src/clients/socks5-client.md | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/documentation/docs/src/clients/socks5-client.md b/documentation/docs/src/clients/socks5-client.md index 2eeabd5b3e..939c9f88af 100644 --- a/documentation/docs/src/clients/socks5-client.md +++ b/documentation/docs/src/clients/socks5-client.md @@ -121,6 +121,7 @@ However, there are several options for choosing a gateway, if you do not want on > 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//`. ``` @@ -151,8 +152,6 @@ You can set this via the `--host` flag during either the `init` or `run` command 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 initalised client by doing this: @@ -161,6 +160,38 @@ You can run the initalised client by doing this: ./nym-socks5-client run --id docs-example ``` +## Automating your socks5 client with systemd + +Stop the running process with `CTRL-C`, and create a service file for the socks5 client as we did with our client instance previously at `/etc/systemd/system/nym-socks5-client.service`: + +```ini +[Unit] +Description=Nym Socks5 Client ({{platform_release_version}}) +StartLimitInterval=350 +StartLimitBurst=10 + +[Service] +User=nym # replace this with whatever user you wish +LimitNOFILE=65536 +ExecStart=/home/nym/nym-socks5-client run --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. From 81e133b78998815125a8eae77178c070e31b65e1 Mon Sep 17 00:00:00 2001 From: pierre Date: Wed, 21 Jun 2023 12:52:41 +0200 Subject: [PATCH 03/14] feat(nc-android): sentry integration and topbar navigation --- nym-connect/native/android/app/build.gradle | 3 + .../android/app/src/main/AndroidManifest.xml | 15 ++ .../src/main/java/net/nymtech/nyms5/App.kt | 36 ++++ .../java/net/nymtech/nyms5/MainActivity.kt | 175 ++++++++++++++++-- .../java/net/nymtech/nyms5/MainViewModel.kt | 2 +- .../app/src/main/res/drawable/warning_24.xml | 5 + .../app/src/main/res/values/strings.xml | 4 + 7 files changed, 228 insertions(+), 12 deletions(-) create mode 100644 nym-connect/native/android/app/src/main/res/drawable/warning_24.xml diff --git a/nym-connect/native/android/app/build.gradle b/nym-connect/native/android/app/build.gradle index 1afc11b2be..df685fadbd 100644 --- a/nym-connect/native/android/app/build.gradle +++ b/nym-connect/native/android/app/build.gradle @@ -2,6 +2,7 @@ plugins { id 'com.android.application' id 'org.jetbrains.kotlin.android' id 'org.jetbrains.kotlin.plugin.serialization' version '1.8.21' + id "io.sentry.android.gradle" version "3.11.0" } android { @@ -107,12 +108,14 @@ dependencies { implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0' implementation platform('androidx.compose:compose-bom:2022.10.00') implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1' + implementation 'androidx.navigation:navigation-compose:2.6.0' implementation 'androidx.compose.runtime:runtime-livedata' implementation 'androidx.compose.ui:ui' implementation 'androidx.compose.ui:ui-graphics' implementation 'androidx.compose.ui:ui-tooling-preview' implementation 'androidx.compose.material3:material3' implementation 'androidx.work:work-runtime-ktx:2.8.1' + implementation 'androidx.datastore:datastore-preferences:1.0.0' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' diff --git a/nym-connect/native/android/app/src/main/AndroidManifest.xml b/nym-connect/native/android/app/src/main/AndroidManifest.xml index 6321a2ce8c..d013b90324 100644 --- a/nym-connect/native/android/app/src/main/AndroidManifest.xml +++ b/nym-connect/native/android/app/src/main/AndroidManifest.xml @@ -17,6 +17,7 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.Nyms5" + android:enableOnBackInvokedCallback="true" tools:targetApi="31"> + + + + + + + + diff --git a/nym-connect/native/android/app/src/main/java/net/nymtech/nyms5/App.kt b/nym-connect/native/android/app/src/main/java/net/nymtech/nyms5/App.kt index 08c075a460..8a59ada991 100644 --- a/nym-connect/native/android/app/src/main/java/net/nymtech/nyms5/App.kt +++ b/nym-connect/native/android/app/src/main/java/net/nymtech/nyms5/App.kt @@ -1,9 +1,21 @@ package net.nymtech.nyms5 import android.app.Application +import android.content.Context import android.util.Log +import androidx.datastore.core.DataStore +import androidx.datastore.preferences.core.Preferences +import androidx.datastore.preferences.core.booleanPreferencesKey +import androidx.datastore.preferences.preferencesDataStore import androidx.work.Configuration import androidx.work.DelegatingWorkerFactory +import io.sentry.android.core.SentryAndroid +import kotlinx.coroutines.flow.first +import kotlinx.coroutines.flow.map +import kotlinx.coroutines.runBlocking + +val Context.dataStore: DataStore by preferencesDataStore(name = "settings") +val monitoringKey = booleanPreferencesKey("monitoring") class App : Application(), Configuration.Provider { companion object { @@ -13,6 +25,30 @@ class App : Application(), Configuration.Provider { private val tag = "App" + override fun onCreate() { + super.onCreate() + val app = this + + runBlocking { + val monitoring = applicationContext.dataStore.data.map { preferences -> + preferences[monitoringKey] ?: false + }.first() + + if (monitoring) { + Log.i(tag, "Performance monitoring and error reporting enabled") + SentryAndroid.init(app) { options -> + options.dsn = + "https://6872f5818bc147ef9c0fce114fcaac8a@o967446.ingest.sentry.io/4505306218102784" + options.enableAllAutoBreadcrumbs(true) + + // TODO should be adjusted in production env + options.tracesSampleRate = 1.0 + options.profilesSampleRate = 1.0 + } + } + } + } + override fun getWorkManagerConfiguration(): Configuration { val workerFactory = DelegatingWorkerFactory() // pass in the NymProxy class instance diff --git a/nym-connect/native/android/app/src/main/java/net/nymtech/nyms5/MainActivity.kt b/nym-connect/native/android/app/src/main/java/net/nymtech/nyms5/MainActivity.kt index 260a847e20..6e5a472be5 100644 --- a/nym-connect/native/android/app/src/main/java/net/nymtech/nyms5/MainActivity.kt +++ b/nym-connect/native/android/app/src/main/java/net/nymtech/nyms5/MainActivity.kt @@ -14,11 +14,21 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width +import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.verticalScroll +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.ArrowBack +import androidx.compose.material.icons.filled.Menu +import androidx.compose.material3.CenterAlignedTopAppBar +import androidx.compose.material3.DropdownMenu +import androidx.compose.material3.DropdownMenuItem import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton import androidx.compose.material3.LinearProgressIndicator import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Scaffold import androidx.compose.material3.Surface import androidx.compose.material3.Switch import androidx.compose.material3.Text @@ -34,6 +44,8 @@ import androidx.lifecycle.repeatOnLifecycle import kotlinx.coroutines.launch import net.nymtech.nyms5.ui.theme.NymTheme import androidx.compose.runtime.getValue +import androidx.compose.runtime.remember +import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.ui.Alignment import androidx.compose.ui.graphics.Color @@ -42,8 +54,17 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.text.font.FontStyle +import androidx.datastore.core.DataStore +import androidx.datastore.preferences.core.Preferences +import androidx.datastore.preferences.core.edit +import androidx.navigation.compose.NavHost +import androidx.navigation.compose.composable +import androidx.navigation.compose.currentBackStackEntryAsState +import androidx.navigation.compose.rememberNavController import androidx.work.WorkInfo import androidx.work.WorkManager +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.flow.map class MainActivity : ComponentActivity() { private val tag = "MainActivity" @@ -81,18 +102,16 @@ class MainActivity : ComponentActivity() { lifecycleScope.launch { repeatOnLifecycle(Lifecycle.State.STARTED) { - Log.d(tag, "____uiState collect") - viewModel.uiState.collect { - setContent { - NymTheme { - // A surface container using the 'background' color from the theme - Surface( - modifier = Modifier.fillMaxSize(), - color = MaterialTheme.colorScheme.background - ) { + Log.d(tag, "____UI recompose") + applicationContext.dataStore.data.map { preferences -> + preferences[monitoringKey] ?: false + }.collect { monitoring -> + viewModel.uiState.collect { + setContent { + NymTheme { val loading = it.loading - S5ClientSwitch(it.connected, loading, { + HomeScreen(it, monitoring, applicationContext.dataStore) { if (!loading) { when { it -> { @@ -106,7 +125,7 @@ class MainActivity : ComponentActivity() { } } } - }) + } } } } @@ -121,6 +140,85 @@ class MainActivity : ComponentActivity() { } } +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun HomeScreen( + proxyState: MainViewModel.ProxyState, + monitoring: Boolean, + dataStore: DataStore, + onSwitch: (value: Boolean) -> Unit, +) { + val navController = rememberNavController() + var expanded by remember { mutableStateOf(false) } + val scope = rememberCoroutineScope() + + Scaffold(topBar = { + CenterAlignedTopAppBar( + title = { + Text(stringResource(R.string.app_name)) + }, + navigationIcon = { + val navBackStackEntry by navController.currentBackStackEntryAsState() + val currentRoute = navBackStackEntry?.destination?.route + + if (currentRoute === "proxy") { + IconButton(onClick = { expanded = true }) { + Icon( + imageVector = Icons.Filled.Menu, + contentDescription = "Main menu" + ) + } + DropdownMenu( + expanded = expanded, + onDismissRequest = { expanded = false } + ) { + DropdownMenuItem(onClick = { + navController.navigate("monitoring") { + popUpTo("proxy") + } + expanded = false + }, text = { + Text("Error reporting") + }) + } + } else { + IconButton(onClick = { + navController.navigate("proxy") { + popUpTo("proxy") + } + }) { + Icon( + imageVector = Icons.Filled.ArrowBack, + contentDescription = "Back home" + ) + } + } + }, + ) + }) { contentPadding -> + NavHost( + navController = navController, + startDestination = "proxy", + modifier = Modifier.padding(contentPadding) + ) { + composable("proxy") { + S5ClientSwitch( + connected = proxyState.connected, + loading = proxyState.loading, + onSwitch = onSwitch + ) + } + composable("monitoring") { + Monitoring(initialValue = monitoring) { + scope.launch(Dispatchers.IO) { + dataStore.edit { settings -> settings[monitoringKey] = it } + } + } + } + } + } +} + @OptIn(ExperimentalMaterial3Api::class) @Composable fun S5ClientSwitch( @@ -203,6 +301,46 @@ fun S5ClientSwitch( } } +@Composable +fun Monitoring( + modifier: Modifier = Modifier, + initialValue: Boolean, + onSwitch: (value: Boolean) -> Unit, +) { + var monitoring by remember { mutableStateOf(initialValue) } + + Column( + modifier = modifier + .padding(16.dp) + .verticalScroll(rememberScrollState()) + ) { + Row( + verticalAlignment = Alignment.CenterVertically + ) { + Text("Enable error reporting") + Spacer(modifier = modifier.width(16.dp)) + Switch(checked = monitoring, onCheckedChange = { + monitoring = it + onSwitch(it) + }) + } + Spacer(modifier = modifier.height(18.dp)) + Row(verticalAlignment = Alignment.CenterVertically) { + Icon( + painter = painterResource(R.drawable.warning_24), + contentDescription = "copy to clipboard", + tint = Color.Yellow + ) + Spacer(modifier = modifier.width(16.dp)) + Text(stringResource(R.string.monitoring_desc_3), color = Color.Yellow) + } + Spacer(modifier = modifier.height(18.dp)) + Text(stringResource(R.string.monitoring_desc_1)) + Spacer(modifier = modifier.height(18.dp)) + Text(stringResource(R.string.monitoring_desc_2)) + } +} + @Preview @Composable fun PreviewSocks5Client() { @@ -225,3 +363,18 @@ fun PreviewSocks5Client() { } } } + +@Preview +@Composable +fun PreviewMonitoring() { + NymTheme { + Surface( + modifier = Modifier.fillMaxSize(), + color = MaterialTheme.colorScheme.background + ) { + Monitoring(initialValue = false) { + Log.d("Monitoring", "switch $it") + } + } + } +} diff --git a/nym-connect/native/android/app/src/main/java/net/nymtech/nyms5/MainViewModel.kt b/nym-connect/native/android/app/src/main/java/net/nymtech/nyms5/MainViewModel.kt index 3a129daef4..f100dc7676 100644 --- a/nym-connect/native/android/app/src/main/java/net/nymtech/nyms5/MainViewModel.kt +++ b/nym-connect/native/android/app/src/main/java/net/nymtech/nyms5/MainViewModel.kt @@ -27,7 +27,7 @@ class MainViewModel( private val workManager: WorkManager, private val nymProxy: NymProxy ) : ViewModel() { - private val tag = "viewModel" + private val tag = "MainViewModel" private val workRequest: OneTimeWorkRequest = OneTimeWorkRequestBuilder() diff --git a/nym-connect/native/android/app/src/main/res/drawable/warning_24.xml b/nym-connect/native/android/app/src/main/res/drawable/warning_24.xml new file mode 100644 index 0000000000..b1726a3610 --- /dev/null +++ b/nym-connect/native/android/app/src/main/res/drawable/warning_24.xml @@ -0,0 +1,5 @@ + + + diff --git a/nym-connect/native/android/app/src/main/res/values/strings.xml b/nym-connect/native/android/app/src/main/res/values/strings.xml index 5a93a240ab..ee21a78dc9 100644 --- a/nym-connect/native/android/app/src/main/res/values/strings.xml +++ b/nym-connect/native/android/app/src/main/res/values/strings.xml @@ -11,4 +11,8 @@ https://harbourmaster.nymtech.net/v1/services?size=100 DpB3cHAchJiNBQi5FrZx2csXb1mrHkpYh9Wzf8Rjsuko.ANNWrvHqMYuertHGHUrZdBntQhpzfbWekB39qez9U2Vx@2BuMSfMW3zpeAjKXyKLhmY4QW1DXurrtSPEJ6CjX3SEh Connected to the mixnet + Help Nym developers to fix errors, crashes and improve the application by enabling this option. If errors occur or if the app crashes, it will automatically send a report. Also it tracks various performance metrics. We use sentry.io service to handle this. + Note: A report can include your external IP, this can be useful to catch issues related to IP location. + All recorded data is used by Nym developers and for app development purposes only. + You must restart the application for the change to take effect. \ No newline at end of file From e6930046c405e6e6d45a6969793995e0b88243ac Mon Sep 17 00:00:00 2001 From: pierre Date: Thu, 22 Jun 2023 15:18:36 +0200 Subject: [PATCH 04/14] ci(nc-android): disable release apk (unused) --- .github/workflows/nyms5-android-build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nyms5-android-build.yml b/.github/workflows/nyms5-android-build.yml index e85d9c67ad..340f07e26b 100644 --- a/.github/workflows/nyms5-android-build.yml +++ b/.github/workflows/nyms5-android-build.yml @@ -71,7 +71,10 @@ jobs: # build for arm64 and x86_64 run: | ./gradlew :app:assembleArch64Debug - ./gradlew :app:assembleArch64Release + # TODO the release variant build fails because of sentry + # build.gradle needs additional configuration + # see https://docs.sentry.io/platforms/android/gradle/?original_referrer=https%3A%2F%2Fduckduckgo.com%2F + # ./gradlew :app:assembleArch64Release - name: Prepare APKs run: | From bbce67902b1040d9cc5a3b609215a885291e30b6 Mon Sep 17 00:00:00 2001 From: pierre Date: Thu, 22 Jun 2023 15:36:30 +0200 Subject: [PATCH 05/14] ci(nc-android): disable release apk (unused) --- .github/workflows/nyms5-android-build.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nyms5-android-build.yml b/.github/workflows/nyms5-android-build.yml index 340f07e26b..d69adef988 100644 --- a/.github/workflows/nyms5-android-build.yml +++ b/.github/workflows/nyms5-android-build.yml @@ -81,16 +81,16 @@ jobs: mkdir apk mv nym-connect/native/android/app/build/outputs/apk/arch64/debug/app-arch64-debug.apk \ apk/nyms5-arch64-debug.apk - mv nym-connect/native/android/app/build/outputs/apk/arch64/release/app-arch64-release-unsigned.apk \ - apk/nyms5-arch64-release.apk + # mv nym-connect/native/android/app/build/outputs/apk/arch64/release/app-arch64-release-unsigned.apk \ + # apk/nyms5-arch64-release.apk - name: Upload APKs uses: actions/upload-artifact@v3 with: name: nyms5-apk-arch64 + # apk/nyms5-arch64-release.apk path: | apk/nyms5-arch64-debug.apk - apk/nyms5-arch64-release.apk gh-release: name: Publish APK (GH release) @@ -107,7 +107,6 @@ jobs: - name: Release uses: softprops/action-gh-release@v1 with: + # apk/nyms5-arch64-release.apk files: | apk/nyms5-arch64-debug.apk - apk/nyms5-arch64-release.apk - From bab8eb746e661a42a753629766a5429ee4f5a782 Mon Sep 17 00:00:00 2001 From: mx Date: Mon, 26 Jun 2023 10:32:02 +0200 Subject: [PATCH 06/14] version bump + included new wallet version var --- documentation/docs/book.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/documentation/docs/book.toml b/documentation/docs/book.toml index c27cde717e..867f147040 100644 --- a/documentation/docs/book.toml +++ b/documentation/docs/book.toml @@ -49,8 +49,9 @@ assets_version = "2.0.0" # do not edit: managed by `mdbook-admonish install` [preprocessor.variables.variables] minimum_rust_version = "1.66" -# old variables - this is still needed for links.. TODO change to develop? -platform_release_version = "v1.1.21" +# vars for links: TODO remove for streamlining? +platform_release_version = "v1.1.22" +wallet_release_version = "v1.2.5" [preprocessor.last-changed] command = "mdbook-last-changed" From 76335e9adc36964c200dbe7fb857c5d019b599b5 Mon Sep 17 00:00:00 2001 From: mx Date: Mon, 26 Jun 2023 10:32:28 +0200 Subject: [PATCH 07/14] removed --wallet-address from commands --- documentation/docs/src/nodes/gateway-setup.md | 6 ++---- documentation/docs/src/nodes/mix-node-setup.md | 10 +++++----- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/documentation/docs/src/nodes/gateway-setup.md b/documentation/docs/src/nodes/gateway-setup.md index fe48fc8566..a9304a9f6d 100644 --- a/documentation/docs/src/nodes/gateway-setup.md +++ b/documentation/docs/src/nodes/gateway-setup.md @@ -7,7 +7,6 @@ ``` - ## Preliminary steps There are a couple of steps that need completing before starting to set up your gateway: @@ -24,7 +23,6 @@ If you don't already have one, please create a Nym address using the wallet, and > Remember that you can **only** use native Cosmos `NYM` tokens to bond your gateway. You **cannot** use ERC20 representations of `NYM` to run a node. - #### Sandbox testnet Make sure to download a wallet and create an account as outlined above. Then head to our [token faucet](https://faucet.nymtech.net/) and get some tokens to use to bond it. @@ -75,12 +73,12 @@ To check available configuration options use: The following command returns a gateway on your current IP with the `id` of `supergateway`: ``` -./nym-gateway init --id supergateway --host $(curl ifconfig.me) --wallet-address n1eufxdlgt0puwrwptgjfqne8pj4nhy2u5ft62uq +./nym-gateway init --id supergateway --host $(curl ifconfig.me) ``` ~~~admonish example collapsible=true title="Console output" ``` - + ``` ~~~ diff --git a/documentation/docs/src/nodes/mix-node-setup.md b/documentation/docs/src/nodes/mix-node-setup.md index 408ef20b99..bb27f3d216 100644 --- a/documentation/docs/src/nodes/mix-node-setup.md +++ b/documentation/docs/src/nodes/mix-node-setup.md @@ -84,15 +84,15 @@ To check available configuration options for initializing your node use: ``` ~~~ -Initalise your mixnode with the following command, replacing the value of `--id` with the moniker you wish to give your mixnode, and the `--wallet-address` with the Nym address you created earlier. Your `--host` must be publicly routable on the internet in order to mix packets, and can be either an Ipv4 or IPv6 address. The `$(curl ifconfig.me)` command returns your IP automatically using an external service. If you enter your IP address manually, enter it **without** any port information. +Initalise your mixnode with the following command, replacing the value of `--id` with the moniker you wish to give your mixnode. Your `--host` must be publicly routable on the internet in order to mix packets, and can be either an Ipv4 or IPv6 address. The `$(curl ifconfig.me)` command returns your IP automatically using an external service. If you enter your IP address manually, enter it **without** any port information. ``` -./nym-mixnode init --id winston-smithnode --host $(curl ifconfig.me) --wallet-address n1eufxdlgt0puwrwptgjfqne8pj4nhy2u5ft62uq +./nym-mixnode init --id winston-smithnode --host $(curl ifconfig.me) ``` ~~~admonish example collapsible=true title="Console output" ``` - + ``` ~~~ @@ -106,7 +106,7 @@ During the `init` process you will have the option to change the `http_api`, `ve From `v1.1.3`, if you unbond your mixnode that means you are leaving the mixnet and you will lose all your delegations (permanently). You can join again with the same identity key, however, you will start with **no delegations**. ``` -#### Bond via the Desktop wallet (recommended) +#### Bond via the Desktop wallet You can bond your mix node via the Desktop wallet. @@ -149,7 +149,7 @@ You can bond your mix node via the Desktop wallet. > You are asked to `sign` a transaction on bonding so that the mixnet smart contract is able to map your nym address to your node. This allows us to create a nonce for each account and defend against replay attacks. -#### Bond via the CLI (power users) +#### Bond via the CLI If you want to bond your mix node via the CLI, then check out the [relevant section in the Nym CLI](../tools/nym-cli.md#bond-a-mix-node) docs. ### Running your mix node From 24354275d3ef9fdf839b16a50ca5a3e841a02b64 Mon Sep 17 00:00:00 2001 From: mx Date: Mon, 26 Jun 2023 10:49:36 +0200 Subject: [PATCH 08/14] version bumps --- documentation/dev-portal/book.toml | 4 ++-- documentation/docs/book.toml | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/documentation/dev-portal/book.toml b/documentation/dev-portal/book.toml index 3f79b96a6e..fe2a9d1c9e 100644 --- a/documentation/dev-portal/book.toml +++ b/documentation/dev-portal/book.toml @@ -49,8 +49,8 @@ assets_version = "2.0.0" # do not edit: managed by `mdbook-admonish install` [preprocessor.variables.variables] # code prerequisites versions minimum_rust_version = "1.66" -# TODO remove this in place of develop in next release -platform_release_version = "v1.1.21" +# for links: TODO think on how to streamline.. shell script? +platform_release_version = "v1.1.23" [preprocessor.last-changed] command = "mdbook-last-changed" diff --git a/documentation/docs/book.toml b/documentation/docs/book.toml index 867f147040..bfecb66a7f 100644 --- a/documentation/docs/book.toml +++ b/documentation/docs/book.toml @@ -48,9 +48,8 @@ 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" - -# vars for links: TODO remove for streamlining? -platform_release_version = "v1.1.22" +# vars for links: TODO think on how to streamline updating +platform_release_version = "v1.1.23" wallet_release_version = "v1.2.5" [preprocessor.last-changed] From 62ba6b30aed431a4ef484efd509411e5a9fbfe60 Mon Sep 17 00:00:00 2001 From: mx Date: Mon, 26 Jun 2023 10:50:03 +0200 Subject: [PATCH 09/14] updated link to releases page: now wallet version specific --- .../docs/src/wallet/desktop-wallet.md | 44 +++++++++---------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/documentation/docs/src/wallet/desktop-wallet.md b/documentation/docs/src/wallet/desktop-wallet.md index b44abd2f29..ec6496b927 100644 --- a/documentation/docs/src/wallet/desktop-wallet.md +++ b/documentation/docs/src/wallet/desktop-wallet.md @@ -5,23 +5,23 @@ The Nym Desktop Wallet lets you interact with your Nym node and to delegate stak You can download it for Mac, Windows, or Linux. -[![download nym wallet](../images/download-wallet.png)](https://github.com/nymtech/nym/releases/tag/nym-wallet-{{platform_release_version}}) +[![download nym wallet](../images/download-wallet.png)](https://github.com/nymtech/nym/releases/tag/nym-wallet-{{wallet_release_version}}) ### Bypassing security warnings -On Windows you will see a security warning pop up when you attempt to run the wallet. We are in the process of getting app store keys from Microsoft so that this doesn't happen. See the section below for details on steps to bypass these. +On Windows you will see a security warning pop up when you attempt to run the wallet. We are in the process of getting app store keys from Microsoft so that this doesn't happen. See the section below for details on steps to bypass these. -#### Linux +#### Linux -You will need to `chmod +x` the AppImage in the terminal (or give it execute permission in your file browser) before it will run. +You will need to `chmod +x` the AppImage in the terminal (or give it execute permission in your file browser) before it will run. -#### Windows +#### Windows _You will still encounter warnings when opening the wallet on Windows. This is because - although the wallet is approved by Microsoft - it has less than 10 thousand downloads at the current time. Once the wallet has passed this threshold, this warning will disappear._ -Follow the steps below to bypass the warnings. +Follow the steps below to bypass the warnings. -* Select more-info after clicking the msi installer app: +* Select more-info after clicking the msi installer app: ![Windows Warning](../images/wallet-warnings/windows_warningv1-0-2.png) @@ -29,7 +29,7 @@ Follow the steps below to bypass the warnings. ![Windows Warning](../images/wallet-warnings/windows_warning2.png) -* Follow the installer instructions: +* Follow the installer instructions: ![Windows Warning](../images/wallet-warnings/windows_warning3.png) @@ -39,7 +39,7 @@ Follow the steps below to bypass the warnings. ### For developers -If you would like to the compile the wallet yourself, follow the instructions below. +If you would like to the compile the wallet yourself, follow the instructions below. > Please note that the wallet has currently only been built on the operating systems for which there are binaries as listed above. If you find an issue or any additional prerequisties, please create an issue or PR against `develop` on [Github](https://github.com/nymtech/docs). @@ -85,22 +85,22 @@ sudo apt install pkg-config build-essential libssl-dev curl jq ### Removing signing errors when building in development mode -If you're wanting to build the wallet yourself, you will need to make a few modifications to the file located at `nym-wallet/src-tauri/tauri.conf.json` before doing so. These relate to the wallet being accepted by Mac and Windows app stores, and so aren't relevant to you when building and running the wallet yourself. +If you're wanting to build the wallet yourself, you will need to make a few modifications to the file located at `nym-wallet/src-tauri/tauri.conf.json` before doing so. These relate to the wallet being accepted by Mac and Windows app stores, and so aren't relevant to you when building and running the wallet yourself. -On **all** operating systems: +On **all** operating systems: * set the value of line 49 to `false` -* remove lines 50 to 54 +* remove lines 50 to 54 -As well as these modifications for MacOS and Windows users: -* MacOS users must also remove line 39 -* Windows users must remove lines 42 to 46 +As well as these modifications for MacOS and Windows users: +* MacOS users must also remove line 39 +* Windows users must remove lines 42 to 46 ### Installation Once you have made these modifications to `tauri.conf.json`, inside of the `nym-wallet` folder, run: ``` yarn install -``` +``` ### Running in Development Mode @@ -112,7 +112,7 @@ You can run the wallet without having to install it in development mode by runni yarn dev ``` -This will then start the Wallet GUI and produce a binary in `nym-wallet/target/debug/` named `nym-wallet`. +This will then start the Wallet GUI and produce a binary in `nym-wallet/target/debug/` named `nym-wallet`. ### Running in Production Mode @@ -165,25 +165,21 @@ To import or create a new account, first you need to create a password for your 6. Come back to this page to import or create new accounts ### Importing or creating account(s) when you have signed in with mnemonic but a password already exists on your machine -To import or create a new account, you need to log in with your existing password or create a new password. +To import or create a new account, you need to log in with your existing password or create a new password. > Creating a new password will overwrite any old one stored on your machine. Make sure you have saved any mnemonics associated with the password before creating a new one. 1. Log out -2. Click on “Forgot password” +2. Click on “Forgot password” 3. On the next screen select “Create new password” 4. Follow the instructions and create a new password 5. Sign in using your new password ### CLI tool for wallet encrypted file (password) recovery: -The mnemonics that are stored in the local password protected file can also be decrypted and recovered through a simple CLI tool, `nym-wallet-recovery-cli`. +The mnemonics that are stored in the local password protected file can also be decrypted and recovered through a simple CLI tool, `nym-wallet-recovery-cli`. ``` nym-wallet-recovery –file saved-wallet.json –password foo ``` The saved wallet file can be found in `$XDG_DATA_HOME` or `$HOME/.local/share` on Linux, `$HOME/Library/Application Support` on Mac, and `C:\Users\username\AppData\Local` on Windows. - - - - From 97c775bc684171d771d2c882a81672d3e8b89905 Mon Sep 17 00:00:00 2001 From: pierre Date: Mon, 26 Jun 2023 11:59:59 +0200 Subject: [PATCH 10/14] build(nc-android): fix release build (sentry) --- .github/workflows/nyms5-android-build.yml | 7 +++---- nym-connect/native/android/app/build.gradle | 2 +- nym-connect/native/android/sentry.properties | 3 +++ 3 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 nym-connect/native/android/sentry.properties diff --git a/.github/workflows/nyms5-android-build.yml b/.github/workflows/nyms5-android-build.yml index d69adef988..eba252602d 100644 --- a/.github/workflows/nyms5-android-build.yml +++ b/.github/workflows/nyms5-android-build.yml @@ -68,13 +68,12 @@ jobs: working-directory: nym-connect/native/android env: ANDROID_SDK_ROOT: ${{ env.ANDROID_HOME }} + SENTRY_AUTH_TOKEN: ${{ secrets.NYMS5_ANDROID_SENTRY_AUTH_TOKEN }} # build for arm64 and x86_64 run: | + echo "auth.token=$SENTRY_AUTH_TOKEN" | tee -a sentry.properties ./gradlew :app:assembleArch64Debug - # TODO the release variant build fails because of sentry - # build.gradle needs additional configuration - # see https://docs.sentry.io/platforms/android/gradle/?original_referrer=https%3A%2F%2Fduckduckgo.com%2F - # ./gradlew :app:assembleArch64Release + ./gradlew :app:assembleArch64Release - name: Prepare APKs run: | diff --git a/nym-connect/native/android/app/build.gradle b/nym-connect/native/android/app/build.gradle index df685fadbd..23d75605c4 100644 --- a/nym-connect/native/android/app/build.gradle +++ b/nym-connect/native/android/app/build.gradle @@ -102,7 +102,7 @@ dependencies { implementation 'androidx.core:core-ktx:1.10.1' implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1' - implementation 'androidx.activity:activity-compose:1.5.1' + implementation 'androidx.activity:activity-compose:1.7.2' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4' implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0' diff --git a/nym-connect/native/android/sentry.properties b/nym-connect/native/android/sentry.properties new file mode 100644 index 0000000000..f2c03276a0 --- /dev/null +++ b/nym-connect/native/android/sentry.properties @@ -0,0 +1,3 @@ +defaults.project=nym-connect-android +defaults.org=nymtech +# auth.token=xxx From 013403034195b9f7d11542a0f24d56a45d256e1b Mon Sep 17 00:00:00 2001 From: pierre Date: Mon, 26 Jun 2023 12:08:41 +0200 Subject: [PATCH 11/14] build(nc-android): fix release build (sentry) --- .github/workflows/nyms5-android-build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nyms5-android-build.yml b/.github/workflows/nyms5-android-build.yml index eba252602d..ca8179eb16 100644 --- a/.github/workflows/nyms5-android-build.yml +++ b/.github/workflows/nyms5-android-build.yml @@ -80,16 +80,16 @@ jobs: mkdir apk mv nym-connect/native/android/app/build/outputs/apk/arch64/debug/app-arch64-debug.apk \ apk/nyms5-arch64-debug.apk - # mv nym-connect/native/android/app/build/outputs/apk/arch64/release/app-arch64-release-unsigned.apk \ - # apk/nyms5-arch64-release.apk + mv nym-connect/native/android/app/build/outputs/apk/arch64/release/app-arch64-release-unsigned.apk \ + apk/nyms5-arch64-release.apk - name: Upload APKs uses: actions/upload-artifact@v3 with: name: nyms5-apk-arch64 - # apk/nyms5-arch64-release.apk path: | apk/nyms5-arch64-debug.apk + apk/nyms5-arch64-release.apk gh-release: name: Publish APK (GH release) @@ -106,6 +106,6 @@ jobs: - name: Release uses: softprops/action-gh-release@v1 with: - # apk/nyms5-arch64-release.apk files: | apk/nyms5-arch64-debug.apk + apk/nyms5-arch64-release.apk From 09bad9c6b4ec62d7a187d0d29529009fb52c3ec7 Mon Sep 17 00:00:00 2001 From: mx Date: Mon, 26 Jun 2023 17:36:22 +0200 Subject: [PATCH 12/14] * updated libwasmvm.so linking instructions * added note on upgrading to v0.31.1 --- .../docs/src/nodes/validator-setup.md | 45 ++++++------------- 1 file changed, 13 insertions(+), 32 deletions(-) diff --git a/documentation/docs/src/nodes/validator-setup.md b/documentation/docs/src/nodes/validator-setup.md index 9551fdc162..a125bcb440 100644 --- a/documentation/docs/src/nodes/validator-setup.md +++ b/documentation/docs/src/nodes/validator-setup.md @@ -61,6 +61,7 @@ The validator binary can be compiled by running the following commands: ``` git clone https://github.com/nymtech/nyxd.git cd nyxd +git checkout release/ # Mainnet make build @@ -77,43 +78,17 @@ At this point, you will have a copy of the `nyxd` binary in your `build/` direct You should see help text print out. -The `nyxd` binary and the `libwasmvm.so` shared object library binary have been compiled. `libwasmvm.so` is the wasm virtual machine which is needed to execute smart contracts. +### Linking `nyxd` to `libwasmvm.so` -```admonish caution title="" -If you have compiled these files locally and need to upload both of them to the server on which the validator will run, **or** downloaded a pre-compiled binary from Github, you need to locate and link these files in slightly different ways, outlined below. If you have instead compiled them on the server skip to the step outlining setting `LD_LIBRARY PATH` below. -``` +`libwasmvm.so` is the wasm virtual machine which is needed to execute smart contracts in `v0.26.1`. This file is renamed in `libwasmvm.x86_64.so` in `v0.31.1`. -To locate these files on your system **if you downloaded a pre-compiled binary from Github** run: +If you downloaded your `nyxd` binary from Github, you will have seen this file when un-`tar`-ing the `.tar.gz` file from the releases page. -``` -WASMVM_SO=$(ldd path/to/nyxd/binary | grep libwasmvm.so | awk '{ print $3 }') -ls ${WASMVM_SO} -``` +If you are seeing an error concerning this file when trying to run `nyxd`, then you need to move the `libwasmvm.so` file to correct location. -e.g. if you downloaded your `nyxd` binary to `/root` then you would replace `ldd path/to/nyxd/binary` with `ldd nyxd` in the above command. - - -To locate these files on your system **if you uploaded your validator after compiling it on a local machine** run: - -``` -WASMVM_SO=$(ldd build/nyxd | grep libwasmvm.so | awk '{ print $3 }') -ls ${WASMVM_SO} -``` - -The above commands will output something like: - -``` -'/home/username/go/pkg/mod/github.com/!cosm!wasm/wasmvm@v0.13.0/api/libwasmvm.so' -``` - -When you upload your `nyxd` binary, you'll need to tell it where `libwasmvm.so` is when you start your validator, or it will not run. If you have compiled them on your server then this is not necessary, as the compiled `nyxd` already has access to `libwasmvm.so`. - -Upload both `nyxd` and `libwasmvm.so` to your validator machine. If `nyxd` can't find `libwasmvm.so` you will see an error like the following: - -``` -./nyxd: error while loading shared libraries: libwasmvm.so: cannot open shared object file: No such file or directory -``` +Simply `cp` or `mv` that file to `/lib/x86_64-linux-gnu/` and re-run `nyxd`. +### Adding `nyxd` to your `$PATH` You'll need to set `LD_LIBRARY_PATH` in your user's `~/.bashrc` file, and add that to our path. Replace `/home/youruser/path/to/nym/binaries` in the command below to the locations of `nyxd` and `libwasmvm.so` and run it. If you have compiled these on the server, they will be in the `build/` folder: ``` @@ -616,6 +591,12 @@ nyxd tx slashing unjail --fees=7000unyxt ``` +### Upgrading your validator + +Upgrading from `v0.26.0` -> `v0.31.1` doesn't require many modifications, simply grab a binary from the [`nyxd` releases page](https://github.com/nymtech/nyxd/releases) and once the chain has halted at the decided upon haltheight, stop your `nyxd` process, replace your binaries, and restart your process. + +You can also use something like [Cosmovisor](https://github.com/cosmos/cosmos-sdk/tree/main/tools/cosmovisor) - grab the relevant information from the current upgrade proposal [here](https://nym.explorers.guru/proposal/8). + #### Common reasons for your validator being jailed The most common reason for your validator being jailed is that your validator is out of memory because of bloated syslogs. From c505a00fac9ce36e0566eb3dfa9b54caf9688489 Mon Sep 17 00:00:00 2001 From: mx Date: Mon, 26 Jun 2023 17:37:01 +0200 Subject: [PATCH 13/14] pulled in renamed example file --- documentation/docs/src/sdk/rust.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/docs/src/sdk/rust.md b/documentation/docs/src/sdk/rust.md index 1408d85faa..ba1c079725 100644 --- a/documentation/docs/src/sdk/rust.md +++ b/documentation/docs/src/sdk/rust.md @@ -50,7 +50,7 @@ As seen in the example above, the `mixnet::MixnetClientBuilder::new()` function If you're integrating mixnet functionality into an existing app and want to integrate saving client configs and keys into your existing storage logic, you can manually perform the actions taken automatically above (`examples/manually_handle_keys_and_config.rs`) ```rust,noplayground -{{#include ../../../../sdk/rust/nym-sdk/examples/manually_handle_keys_and_config.rs}} +{{#include ../../../../sdk/rust/nym-sdk/examples/manually_handle_storage.rs}} ``` ### Anonymous replies with SURBs From 40465665f0263c6084df50fd1cab90f5129445f1 Mon Sep 17 00:00:00 2001 From: mx <33262279+mfahampshire@users.noreply.github.com> Date: Tue, 27 Jun 2023 09:28:49 +0000 Subject: [PATCH 14/14] Revert "Feature/release 1 1 22 docs" --- documentation/dev-portal/book.toml | 4 +- documentation/docs/book.toml | 6 +-- .../docs/src/clients/socks5-client.md | 40 +---------------- documentation/docs/src/nodes/gateway-setup.md | 6 ++- .../docs/src/nodes/mix-node-setup.md | 10 ++--- .../docs/src/nodes/validator-setup.md | 45 +++++++++++++------ documentation/docs/src/sdk/rust.md | 2 +- .../docs/src/wallet/desktop-wallet.md | 44 +++++++++--------- 8 files changed, 73 insertions(+), 84 deletions(-) diff --git a/documentation/dev-portal/book.toml b/documentation/dev-portal/book.toml index fe2a9d1c9e..3f79b96a6e 100644 --- a/documentation/dev-portal/book.toml +++ b/documentation/dev-portal/book.toml @@ -49,8 +49,8 @@ assets_version = "2.0.0" # do not edit: managed by `mdbook-admonish install` [preprocessor.variables.variables] # code prerequisites versions minimum_rust_version = "1.66" -# for links: TODO think on how to streamline.. shell script? -platform_release_version = "v1.1.23" +# TODO remove this in place of develop in next release +platform_release_version = "v1.1.21" [preprocessor.last-changed] command = "mdbook-last-changed" diff --git a/documentation/docs/book.toml b/documentation/docs/book.toml index bfecb66a7f..c27cde717e 100644 --- a/documentation/docs/book.toml +++ b/documentation/docs/book.toml @@ -48,9 +48,9 @@ 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" -# vars for links: TODO think on how to streamline updating -platform_release_version = "v1.1.23" -wallet_release_version = "v1.2.5" + +# old variables - this is still needed for links.. TODO change to develop? +platform_release_version = "v1.1.21" [preprocessor.last-changed] command = "mdbook-last-changed" diff --git a/documentation/docs/src/clients/socks5-client.md b/documentation/docs/src/clients/socks5-client.md index 939c9f88af..e7163347cb 100644 --- a/documentation/docs/src/clients/socks5-client.md +++ b/documentation/docs/src/clients/socks5-client.md @@ -8,7 +8,6 @@ ``` ## 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: ``` @@ -66,7 +65,6 @@ The `nym-socks5-client` allows you to do the following from your local machine: The `nym-network-requester` 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! ## Client setup - ### Viewing command help You can check that your binaries are properly compiled with: @@ -88,7 +86,6 @@ You can check the necessary parameters for the available commands by running: ``` ### 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: ``` @@ -108,7 +105,6 @@ The `--provider` field needs to be filled with the Nym address of a Network Requ Since the nodes on this list are the infrastructure for [Nymconnect](https://nymtech.net/developers/quickstart/nymconnect-gui.html) they will support all apps on the [default whitelist](../nodes/network-requester-setup.md#network-requester-whitelist): Keybase, Telegram, Electrum, Blockstream Green, and Helios. #### 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: @@ -121,7 +117,6 @@ However, there are several options for choosing a gateway, if you do not want on > 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//`. ``` @@ -145,13 +140,14 @@ 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 - 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 initalised client by doing this: @@ -160,38 +156,6 @@ You can run the initalised client by doing this: ./nym-socks5-client run --id docs-example ``` -## Automating your socks5 client with systemd - -Stop the running process with `CTRL-C`, and create a service file for the socks5 client as we did with our client instance previously at `/etc/systemd/system/nym-socks5-client.service`: - -```ini -[Unit] -Description=Nym Socks5 Client ({{platform_release_version}}) -StartLimitInterval=350 -StartLimitBurst=10 - -[Service] -User=nym # replace this with whatever user you wish -LimitNOFILE=65536 -ExecStart=/home/nym/nym-socks5-client run --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. diff --git a/documentation/docs/src/nodes/gateway-setup.md b/documentation/docs/src/nodes/gateway-setup.md index a9304a9f6d..fe48fc8566 100644 --- a/documentation/docs/src/nodes/gateway-setup.md +++ b/documentation/docs/src/nodes/gateway-setup.md @@ -7,6 +7,7 @@ ``` + ## Preliminary steps There are a couple of steps that need completing before starting to set up your gateway: @@ -23,6 +24,7 @@ If you don't already have one, please create a Nym address using the wallet, and > Remember that you can **only** use native Cosmos `NYM` tokens to bond your gateway. You **cannot** use ERC20 representations of `NYM` to run a node. + #### Sandbox testnet Make sure to download a wallet and create an account as outlined above. Then head to our [token faucet](https://faucet.nymtech.net/) and get some tokens to use to bond it. @@ -73,12 +75,12 @@ To check available configuration options use: The following command returns a gateway on your current IP with the `id` of `supergateway`: ``` -./nym-gateway init --id supergateway --host $(curl ifconfig.me) +./nym-gateway init --id supergateway --host $(curl ifconfig.me) --wallet-address n1eufxdlgt0puwrwptgjfqne8pj4nhy2u5ft62uq ``` ~~~admonish example collapsible=true title="Console output" ``` - + ``` ~~~ diff --git a/documentation/docs/src/nodes/mix-node-setup.md b/documentation/docs/src/nodes/mix-node-setup.md index bb27f3d216..408ef20b99 100644 --- a/documentation/docs/src/nodes/mix-node-setup.md +++ b/documentation/docs/src/nodes/mix-node-setup.md @@ -84,15 +84,15 @@ To check available configuration options for initializing your node use: ``` ~~~ -Initalise your mixnode with the following command, replacing the value of `--id` with the moniker you wish to give your mixnode. Your `--host` must be publicly routable on the internet in order to mix packets, and can be either an Ipv4 or IPv6 address. The `$(curl ifconfig.me)` command returns your IP automatically using an external service. If you enter your IP address manually, enter it **without** any port information. +Initalise your mixnode with the following command, replacing the value of `--id` with the moniker you wish to give your mixnode, and the `--wallet-address` with the Nym address you created earlier. Your `--host` must be publicly routable on the internet in order to mix packets, and can be either an Ipv4 or IPv6 address. The `$(curl ifconfig.me)` command returns your IP automatically using an external service. If you enter your IP address manually, enter it **without** any port information. ``` -./nym-mixnode init --id winston-smithnode --host $(curl ifconfig.me) +./nym-mixnode init --id winston-smithnode --host $(curl ifconfig.me) --wallet-address n1eufxdlgt0puwrwptgjfqne8pj4nhy2u5ft62uq ``` ~~~admonish example collapsible=true title="Console output" ``` - + ``` ~~~ @@ -106,7 +106,7 @@ During the `init` process you will have the option to change the `http_api`, `ve From `v1.1.3`, if you unbond your mixnode that means you are leaving the mixnet and you will lose all your delegations (permanently). You can join again with the same identity key, however, you will start with **no delegations**. ``` -#### Bond via the Desktop wallet +#### Bond via the Desktop wallet (recommended) You can bond your mix node via the Desktop wallet. @@ -149,7 +149,7 @@ You can bond your mix node via the Desktop wallet. > You are asked to `sign` a transaction on bonding so that the mixnet smart contract is able to map your nym address to your node. This allows us to create a nonce for each account and defend against replay attacks. -#### Bond via the CLI +#### Bond via the CLI (power users) If you want to bond your mix node via the CLI, then check out the [relevant section in the Nym CLI](../tools/nym-cli.md#bond-a-mix-node) docs. ### Running your mix node diff --git a/documentation/docs/src/nodes/validator-setup.md b/documentation/docs/src/nodes/validator-setup.md index a125bcb440..9551fdc162 100644 --- a/documentation/docs/src/nodes/validator-setup.md +++ b/documentation/docs/src/nodes/validator-setup.md @@ -61,7 +61,6 @@ The validator binary can be compiled by running the following commands: ``` git clone https://github.com/nymtech/nyxd.git cd nyxd -git checkout release/ # Mainnet make build @@ -78,17 +77,43 @@ At this point, you will have a copy of the `nyxd` binary in your `build/` direct You should see help text print out. -### Linking `nyxd` to `libwasmvm.so` +The `nyxd` binary and the `libwasmvm.so` shared object library binary have been compiled. `libwasmvm.so` is the wasm virtual machine which is needed to execute smart contracts. -`libwasmvm.so` is the wasm virtual machine which is needed to execute smart contracts in `v0.26.1`. This file is renamed in `libwasmvm.x86_64.so` in `v0.31.1`. +```admonish caution title="" +If you have compiled these files locally and need to upload both of them to the server on which the validator will run, **or** downloaded a pre-compiled binary from Github, you need to locate and link these files in slightly different ways, outlined below. If you have instead compiled them on the server skip to the step outlining setting `LD_LIBRARY PATH` below. +``` -If you downloaded your `nyxd` binary from Github, you will have seen this file when un-`tar`-ing the `.tar.gz` file from the releases page. +To locate these files on your system **if you downloaded a pre-compiled binary from Github** run: -If you are seeing an error concerning this file when trying to run `nyxd`, then you need to move the `libwasmvm.so` file to correct location. +``` +WASMVM_SO=$(ldd path/to/nyxd/binary | grep libwasmvm.so | awk '{ print $3 }') +ls ${WASMVM_SO} +``` -Simply `cp` or `mv` that file to `/lib/x86_64-linux-gnu/` and re-run `nyxd`. +e.g. if you downloaded your `nyxd` binary to `/root` then you would replace `ldd path/to/nyxd/binary` with `ldd nyxd` in the above command. + + +To locate these files on your system **if you uploaded your validator after compiling it on a local machine** run: + +``` +WASMVM_SO=$(ldd build/nyxd | grep libwasmvm.so | awk '{ print $3 }') +ls ${WASMVM_SO} +``` + +The above commands will output something like: + +``` +'/home/username/go/pkg/mod/github.com/!cosm!wasm/wasmvm@v0.13.0/api/libwasmvm.so' +``` + +When you upload your `nyxd` binary, you'll need to tell it where `libwasmvm.so` is when you start your validator, or it will not run. If you have compiled them on your server then this is not necessary, as the compiled `nyxd` already has access to `libwasmvm.so`. + +Upload both `nyxd` and `libwasmvm.so` to your validator machine. If `nyxd` can't find `libwasmvm.so` you will see an error like the following: + +``` +./nyxd: error while loading shared libraries: libwasmvm.so: cannot open shared object file: No such file or directory +``` -### Adding `nyxd` to your `$PATH` You'll need to set `LD_LIBRARY_PATH` in your user's `~/.bashrc` file, and add that to our path. Replace `/home/youruser/path/to/nym/binaries` in the command below to the locations of `nyxd` and `libwasmvm.so` and run it. If you have compiled these on the server, they will be in the `build/` folder: ``` @@ -591,12 +616,6 @@ nyxd tx slashing unjail --fees=7000unyxt ``` -### Upgrading your validator - -Upgrading from `v0.26.0` -> `v0.31.1` doesn't require many modifications, simply grab a binary from the [`nyxd` releases page](https://github.com/nymtech/nyxd/releases) and once the chain has halted at the decided upon haltheight, stop your `nyxd` process, replace your binaries, and restart your process. - -You can also use something like [Cosmovisor](https://github.com/cosmos/cosmos-sdk/tree/main/tools/cosmovisor) - grab the relevant information from the current upgrade proposal [here](https://nym.explorers.guru/proposal/8). - #### Common reasons for your validator being jailed The most common reason for your validator being jailed is that your validator is out of memory because of bloated syslogs. diff --git a/documentation/docs/src/sdk/rust.md b/documentation/docs/src/sdk/rust.md index ba1c079725..1408d85faa 100644 --- a/documentation/docs/src/sdk/rust.md +++ b/documentation/docs/src/sdk/rust.md @@ -50,7 +50,7 @@ As seen in the example above, the `mixnet::MixnetClientBuilder::new()` function If you're integrating mixnet functionality into an existing app and want to integrate saving client configs and keys into your existing storage logic, you can manually perform the actions taken automatically above (`examples/manually_handle_keys_and_config.rs`) ```rust,noplayground -{{#include ../../../../sdk/rust/nym-sdk/examples/manually_handle_storage.rs}} +{{#include ../../../../sdk/rust/nym-sdk/examples/manually_handle_keys_and_config.rs}} ``` ### Anonymous replies with SURBs diff --git a/documentation/docs/src/wallet/desktop-wallet.md b/documentation/docs/src/wallet/desktop-wallet.md index ec6496b927..b44abd2f29 100644 --- a/documentation/docs/src/wallet/desktop-wallet.md +++ b/documentation/docs/src/wallet/desktop-wallet.md @@ -5,23 +5,23 @@ The Nym Desktop Wallet lets you interact with your Nym node and to delegate stak You can download it for Mac, Windows, or Linux. -[![download nym wallet](../images/download-wallet.png)](https://github.com/nymtech/nym/releases/tag/nym-wallet-{{wallet_release_version}}) +[![download nym wallet](../images/download-wallet.png)](https://github.com/nymtech/nym/releases/tag/nym-wallet-{{platform_release_version}}) ### Bypassing security warnings -On Windows you will see a security warning pop up when you attempt to run the wallet. We are in the process of getting app store keys from Microsoft so that this doesn't happen. See the section below for details on steps to bypass these. +On Windows you will see a security warning pop up when you attempt to run the wallet. We are in the process of getting app store keys from Microsoft so that this doesn't happen. See the section below for details on steps to bypass these. -#### Linux +#### Linux -You will need to `chmod +x` the AppImage in the terminal (or give it execute permission in your file browser) before it will run. +You will need to `chmod +x` the AppImage in the terminal (or give it execute permission in your file browser) before it will run. -#### Windows +#### Windows _You will still encounter warnings when opening the wallet on Windows. This is because - although the wallet is approved by Microsoft - it has less than 10 thousand downloads at the current time. Once the wallet has passed this threshold, this warning will disappear._ -Follow the steps below to bypass the warnings. +Follow the steps below to bypass the warnings. -* Select more-info after clicking the msi installer app: +* Select more-info after clicking the msi installer app: ![Windows Warning](../images/wallet-warnings/windows_warningv1-0-2.png) @@ -29,7 +29,7 @@ Follow the steps below to bypass the warnings. ![Windows Warning](../images/wallet-warnings/windows_warning2.png) -* Follow the installer instructions: +* Follow the installer instructions: ![Windows Warning](../images/wallet-warnings/windows_warning3.png) @@ -39,7 +39,7 @@ Follow the steps below to bypass the warnings. ### For developers -If you would like to the compile the wallet yourself, follow the instructions below. +If you would like to the compile the wallet yourself, follow the instructions below. > Please note that the wallet has currently only been built on the operating systems for which there are binaries as listed above. If you find an issue or any additional prerequisties, please create an issue or PR against `develop` on [Github](https://github.com/nymtech/docs). @@ -85,22 +85,22 @@ sudo apt install pkg-config build-essential libssl-dev curl jq ### Removing signing errors when building in development mode -If you're wanting to build the wallet yourself, you will need to make a few modifications to the file located at `nym-wallet/src-tauri/tauri.conf.json` before doing so. These relate to the wallet being accepted by Mac and Windows app stores, and so aren't relevant to you when building and running the wallet yourself. +If you're wanting to build the wallet yourself, you will need to make a few modifications to the file located at `nym-wallet/src-tauri/tauri.conf.json` before doing so. These relate to the wallet being accepted by Mac and Windows app stores, and so aren't relevant to you when building and running the wallet yourself. -On **all** operating systems: +On **all** operating systems: * set the value of line 49 to `false` -* remove lines 50 to 54 +* remove lines 50 to 54 -As well as these modifications for MacOS and Windows users: -* MacOS users must also remove line 39 -* Windows users must remove lines 42 to 46 +As well as these modifications for MacOS and Windows users: +* MacOS users must also remove line 39 +* Windows users must remove lines 42 to 46 ### Installation Once you have made these modifications to `tauri.conf.json`, inside of the `nym-wallet` folder, run: ``` yarn install -``` +``` ### Running in Development Mode @@ -112,7 +112,7 @@ You can run the wallet without having to install it in development mode by runni yarn dev ``` -This will then start the Wallet GUI and produce a binary in `nym-wallet/target/debug/` named `nym-wallet`. +This will then start the Wallet GUI and produce a binary in `nym-wallet/target/debug/` named `nym-wallet`. ### Running in Production Mode @@ -165,21 +165,25 @@ To import or create a new account, first you need to create a password for your 6. Come back to this page to import or create new accounts ### Importing or creating account(s) when you have signed in with mnemonic but a password already exists on your machine -To import or create a new account, you need to log in with your existing password or create a new password. +To import or create a new account, you need to log in with your existing password or create a new password. > Creating a new password will overwrite any old one stored on your machine. Make sure you have saved any mnemonics associated with the password before creating a new one. 1. Log out -2. Click on “Forgot password” +2. Click on “Forgot password” 3. On the next screen select “Create new password” 4. Follow the instructions and create a new password 5. Sign in using your new password ### CLI tool for wallet encrypted file (password) recovery: -The mnemonics that are stored in the local password protected file can also be decrypted and recovered through a simple CLI tool, `nym-wallet-recovery-cli`. +The mnemonics that are stored in the local password protected file can also be decrypted and recovered through a simple CLI tool, `nym-wallet-recovery-cli`. ``` nym-wallet-recovery –file saved-wallet.json –password foo ``` The saved wallet file can be found in `$XDG_DATA_HOME` or `$HOME/.local/share` on Linux, `$HOME/Library/Application Support` on Mac, and `C:\Users\username\AppData\Local` on Windows. + + + +