Git Product home page Git Product logo

sn_api's Introduction

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.

sn_api's People

Contributors

bochaco avatar joshuef avatar ravinderjangra avatar s-coyle avatar jacderida avatar dan-da avatar iancoleman avatar lionel-faber avatar scorch-dev avatar b-zee avatar thierry61 avatar dirvine avatar hunterlester avatar yanghuidong avatar frabrunelle avatar maidsafe-qa avatar safeshane avatar yoga07 avatar chrisjsimpson avatar oetyng avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.