Importing and using a custom network topology
There will be a breaking SDK upgrade in the coming months. This upgrade will make the SDK a lot easier to build with.
This upgrade will affect the interface of the SDK dramatically, and will be coupled with a protocol change - stay tuned for information on early access to the new protocol testnet.
It will also be coupled with the documentation of the SDK on crates.io (opens in a new tab).
These examples are not the same as using a configurable network: these functions define a subset of nodes to use on a given network, whereas the testnet example is an example of switching to use a different network entirely. The two can be combined, but if you are looking for how to connect your client to a testnet, see the testnet
file.
If you want to send traffic through a sub-set of nodes (for instance, ones you control, or a small test setup) when developing, debugging, or performing research, you will need to import these nodes as a custom network topology, instead of grabbing it from the Mainnet Nym-API
(opens in a new tab).
There are two ways to do this:
Custom Topology Provider
If you are also running a Validator and Nym API for your network, you can specify that endpoint. Clients will then use this endpoint to grab a network topology on startup. You can also use this to specify using a testnet.
Import a specific topology manually
If you aren't running a Validator and Nym API, and just want to import a specific sub-set of mix nodes, you can also overwrite the grabbed topology manually.