Developers
Examples

Examples

Runnable examples in sdk/rust/nym-sdk/examples/ (opens in a new tab). Each file is self-contained with step-by-step comments.

cargo run --example <NAME>
ExampleSourceWhat it demonstrates
Simplesimple.rs (opens in a new tab)Send a message to yourself and print it
SURB Replysurb_reply.rs (opens in a new tab)Anonymous replies using AnonymousSenderTag and send_reply()
Builderbuilder.rs (opens in a new tab)Using MixnetClientBuilder with ephemeral keys
Builder with Storagebuilder_with_storage.rs (opens in a new tab)Persisting keys to disk with StoragePaths
Parallel Send/Receiveparallel_sending_and_receiving.rs (opens in a new tab)Using split_sender() for concurrent tasks
Sandbox Testnetsandbox.rs (opens in a new tab)Connecting to the Sandbox testnet instead of mainnet
Bandwidth Credentialbandwidth.rs (opens in a new tab)Acquiring a bandwidth credential for paid mixnet access
Custom Topologycustom_topology_provider.rs (opens in a new tab)Implementing the TopologyProvider trait to filter or customize node selection
Overwrite Topologymanually_overwrite_topology.rs (opens in a new tab)Manually constructing a topology with hardcoded nodes
Control Requestscontrol_requests.rs (opens in a new tab)Sending service provider control requests (health, version, binary info)
Custom Storagemanually_handle_storage.rs (opens in a new tab)Implementing custom storage backends for keys, gateways, and credentials