Skip to main content

Getting Started With Rust

The wallet.rs library is published on crates.io. You can also download the source code from the official GitHub repository.

Requirements

info

We recommend you update Rust to the latest stable version rustup update stable.

The library uses cmake and openssl. You may need install additional build tools on your system to run the build process successfully using Cargo.

You can install all needed prerequisites on Windows with Chocolatey. If you have any of the tools already installed just remove them from the command

Install Chocolatey with

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

and install the needed packages with

choco install visualstudio2022buildtools visualstudio2022-workload-vctools rust-ms msys2 llvm

Include the Library

The only thing you need to do to start using the library is to add it as dependency in your Cargo.toml file:

[dependencies]
iota-wallet = { git = "https://github.com/iotaledger/wallet.rs", branch = "develop" }
tokio = "1.21.2"

Use the Library

In order to use the library, you need to create an AccountManager:

Safe Password Storage

In a production setup, do not store passwords in the host's environment variables or in the source code. See our backup and security recommendations for production setups.

wallet/examples/01_create_wallet.rs
loading...

What's Next?

Now that you are up and running, you can get acquainted with the library using its how-to guides and the repository's code examples.