Skip to content
forked from bochaco/sn_api

This crate implements a CLI (Command Line Interface) for the Safe Network

License

BSD-3-Clause, MIT licenses found

Licenses found

BSD-3-Clause
LICENSE-BSD
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

iancoleman/sn_api

 
 

Repository files navigation

The Safe API

MaidSafe website Safe Dev Forum Safe Network Forum

Table of contents

Description

In this repository you'll find all that's needed by any 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).

Safe app authorisation flow

In addition to the sn_api crate to be used by Rust applications, this repository contains a couple of applications (sn_authd and sn_cli) which are required depending on the type of Safe application you are developing, use case, and/or if you are just a user of the Safe Network willing to interact with it using a simple command line interface.

The following diagram depicts how each of the artifacts of this repository fit in the Safe applications ecosystem. You can find more information about each of them further below in the next section of this document.

Safe API ecosystem

The Safe API (sn_api)

The sn_api is a Rust crate which exposes the Safe API with all the functions needed to communicate with 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.

The Safe Network CLI

The sn_cli is a Rust application which implements a CLI (Command Line Interface) for the Safe Network.

Safe CLI

The Safe CLI provides all the tools necessary to interact with the Safe Network, including storing and browsing data of any kind, following links that are contained in the data and using their addresses on the network, using safecoin wallets, and much more. Using the CLI users have access to any type of operation that can be made on the Safe Network and the data stored on it.

If you are just a Safe user, or a system engineer creating automated scripts, this application provides you with all you need to interact with the Safe Network. Please refer to The Safe CLI User Guide to learn how to start using it.

The Authenticator daemon

The sn_authd is a Safe Authenticator implementation which runs in the background a daemon on Linux and Mac, or as a service in Windows platforms.

The Safe Authenticator gives complete control over the type of access and permissions that are granted to the applications used by the Safe users. Any application that is intending to write data on the Network on behalf of the user needs to get credentials which are authorised by the user, and the Safe Authenticator is the component which facilitates such mechanism.

This application is normally shipped as part of the package of an Authenticator GUI, like the Safe Network Application, and therefore Safe users and Safe app developers don't need it or worry about since the Safe API already provides functions to interact with the sn_authd, and the Safe CLI also has commands to do so.

JSON-RPC and QUIC

One last crate found in this repository is the qjsonrpc. This crate provides the implementation of JSON-RPC over QUIC, which is required by the Authenticator daemon communication protocol.

This crate exposes a minimised set of functions which are used by other crates to implement the Authenticator daemon communication protocol. On one hand the sn_api makes use of it to be able to send JSON-RPC messages to the authd over QUIC, and on the other hand the sn_authd makes use of it to accept those requests from clients, generating and sending back a JSON-RPC response over QUIC. Please refer to the sn_authd README to see some examples of these type of requests/responses.

Further Help

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.

License

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.

Contributing

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.

About

This crate implements a CLI (Command Line Interface) for the Safe Network

Resources

License

BSD-3-Clause, MIT licenses found

Licenses found

BSD-3-Clause
LICENSE-BSD
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 98.0%
  • Shell 1.9%
  • Makefile 0.1%