22 releases (12 breaking)
|new 0.29.1||Jun 17, 2021|
|0.28.1||Jun 15, 2021|
|0.21.0||Mar 16, 2021|
|0.17.0||Dec 23, 2020|
192 downloads per month
|MaidSafe website||Safe Dev Forum||Safe Network Forum|
This crate provides all that's needed by any Rust application which intends to connect and read/write data on The Safe Network.
A Rust Safe application can make use of the
sn_api crate to be able to not only read/write data on the Safe Network but also to send/receive authorisation requests to the Safe Authenticator (see https://hub.safedev.org/discover for additional info of the Authenticator). You can find more information about the Authenticator in MaidSafe reference implementation sn_authd.
The following diagram depicts how each of the client side components fit in the Safe applications ecosystem.
The Safe API provides all the functions needed to communicate with the The Safe Network and the Safe Authenticator. If you are developing a Rust application for Safe, this is all you need as a dependency from your app.
There are currently three different APIs provided by this crate:
- The API for regular Safe applications which read and write data to Safe. This API exposes all the functions needed to manipulate data, with the additional
auth_appto obtain a key-pair from
connectfor connecting to Safe (providing a key-pair if write access is required by the app).
- An API for Authenticator apps, like
sn_authdwhich makes use of this API. This is a small API which exposes functions to create, read and update a private container on Safe where to store the set of key-pairs the user administers for his/her apps, as well as some utilities to parse/generate messages that can be received/sent on an RPC mechanism like what
sn_authddoes with JSON-RPC over QUIC. The container with key-pairs is stored on Safe at a location derived from a passphrase and password provided by the user.
- API to communicate with an Authenticator through JSON-RPC over QUIC. This can be used by apps which can manage an Authenticator app, as an example CLI uses this API to start/stop authd, to send a request to create a Safe, to allow/deny an app authorisation request, to lock/unlock a Safe, etc. The
$ safe authcommands act simply as the user interface for the
sn_authdusing this API to communicate with it.
You can discuss development-related questions on the Safe Dev Forum. If you are just starting to develop an application for the Safe Network, it's very advisable to visit the Safe Network Dev Hub where you will find a lot of relevant information.
This Safe Network library is dual-licensed under the Modified BSD (LICENSE-BSD https://opensource.org/licenses/BSD-3-Clause) or the MIT license (LICENSE-MIT https://opensource.org/licenses/MIT) at your option.
Want to contribute? Great 🎉
There are many ways to give back to the project, whether it be writing new code, fixing bugs, or just reporting errors. All forms of contributions are encouraged!
For instructions on how to contribute, see our Guide to contributing.