Fix comments in nym-sdk builder_with_storage example (#3283)

This commit is contained in:
Jon Häggblad
2023-04-05 14:30:58 +02:00
committed by GitHub
parent 790e7a0e1e
commit 5019b4b266
2 changed files with 85 additions and 2 deletions
Generated
+82
View File
@@ -3009,6 +3009,8 @@ name = "mixnode-common"
version = "0.1.0"
dependencies = [
"bytes",
"cfg-if",
"cpu-cycles",
"futures",
"humantime-serde",
"log",
@@ -3027,6 +3029,7 @@ dependencies = [
"thiserror",
"tokio",
"tokio-util",
"tracing",
"url",
"validator-client",
]
@@ -3264,6 +3267,9 @@ dependencies = [
"semver 0.11.0",
"serde",
"serde_json",
"tracing-appender",
"tracing-subscriber",
"tracing-tree",
"vergen",
]
@@ -3610,6 +3616,7 @@ version = "1.1.14"
dependencies = [
"anyhow",
"bs58",
"cfg-if",
"clap 4.1.11",
"colored",
"cpu-cycles",
@@ -3633,6 +3640,7 @@ dependencies = [
"nym-task",
"nym-topology",
"nym-types",
"opentelemetry",
"pretty_env_logger",
"rand 0.7.3",
"rocket",
@@ -3642,6 +3650,7 @@ dependencies = [
"tokio",
"tokio-util",
"toml",
"tracing",
"url",
"validator-client",
]
@@ -4258,6 +4267,49 @@ dependencies = [
"vcpkg",
]
[[package]]
name = "opentelemetry"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f4b8347cc26099d3aeee044065ecc3ae11469796b4d65d065a23a584ed92a6f"
dependencies = [
"opentelemetry_api",
"opentelemetry_sdk",
]
[[package]]
name = "opentelemetry_api"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed41783a5bf567688eb38372f2b7a8530f5a607a4b49d38dd7573236c23ca7e2"
dependencies = [
"futures-channel",
"futures-util",
"indexmap",
"once_cell",
"pin-project-lite",
"thiserror",
"urlencoding",
]
[[package]]
name = "opentelemetry_sdk"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b3a2a91fdbfdd4d212c0dcc2ab540de2c2bcbbd90be17de7a7daf8822d010c1"
dependencies = [
"async-trait",
"crossbeam-channel",
"futures-channel",
"futures-executor",
"futures-util",
"once_cell",
"opentelemetry_api",
"percent-encoding",
"rand 0.8.5",
"thiserror",
]
[[package]]
name = "os_str_bytes"
version = "6.5.0"
@@ -6610,6 +6662,17 @@ dependencies = [
"tracing-core",
]
[[package]]
name = "tracing-appender"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09d48f71a791638519505cefafe162606f706c25592e4bde4d97600c0195312e"
dependencies = [
"crossbeam-channel",
"time 0.3.20",
"tracing-subscriber",
]
[[package]]
name = "tracing-attributes"
version = "0.1.23"
@@ -6670,6 +6733,19 @@ dependencies = [
"tracing-log",
]
[[package]]
name = "tracing-tree"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "758e983ab7c54fee18403994507e7f212b9005e957ce7984996fac8d11facedb"
dependencies = [
"atty",
"nu-ansi-term",
"tracing-core",
"tracing-log",
"tracing-subscriber",
]
[[package]]
name = "try-lock"
version = "0.2.4"
@@ -6888,6 +6964,12 @@ dependencies = [
"serde",
]
[[package]]
name = "urlencoding"
version = "2.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8db7427f936968176eaa7cdf81b7f98b980b18495ec28f1b5791ac3bfe3eea9"
[[package]]
name = "utf-8"
version = "0.7.6"
@@ -11,14 +11,15 @@ async fn main() {
let storage_paths =
mixnet::StoragePaths::new_from_dir(mixnet::KeyMode::Keep, &config_dir).unwrap();
// Create the client with a storage backend, and enable it by giving it some paths
// Create the client with a storage backend, and enable it by giving it some paths. If keys
// exists at these paths, they will be loaded, otherwise they will be generated.
let client = mixnet::MixnetClientBuilder::new()
.enable_storage(storage_paths)
.build::<mixnet::ReplyStorage>()
.await
.unwrap();
// Now we connect to the mixnet, using ephemeral keys already created
// Now we connect to the mixnet, using keys now stored in the paths provided.
let mut client = client.connect_to_mixnet().await.unwrap();
// Be able to get our client address