Skip to content

Commit

Permalink
Merge pull request #29 from configwizard/neofs-v1.0.0-docs
Browse files Browse the repository at this point in the history
Neofs v1.0.0 documentation
  • Loading branch information
apisit authored Apr 6, 2022
2 parents 7a7bdb5 + 0025dbf commit 3991c8f
Show file tree
Hide file tree
Showing 19 changed files with 1,423 additions and 8 deletions.
5 changes: 5 additions & 0 deletions docs/n3/neofs/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"label": "NeoFS",
"position": 9
}

17 changes: 17 additions & 0 deletions docs/n3/neofs/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: 'Neo FS Go SDK Documentation'
description: "This section covers the elements of NeoFS and the NeoFS SDK written in Go"
author: ngdenterprise
tags: [ "NEOFS"]
skill: intermediate
sidebar: true
---
## Neo Community Documentation

Please join us on the Neo discord server if you would like any support and please contribute back if you have something to add!

With time there will be an easy to use 'get things done' API for Go, and a starter app for Javascript developers to build on top of.

:::note
Best place to get started is probably in the [overview](/neo-docs/introduction/overview) area, or if you want to get cracking, head over the [creating a wallet!](/neo-docs/tutorials/wallets)
:::
44 changes: 44 additions & 0 deletions docs/n3/neofs/introduction/Concepts.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: "Concepts"
date: 2022-01-18T21:13:48Z
---

NeoFS is very carefully designed to offer the power of a filesytem with all the expected capabilities, on top of a decentralised network.

This means that files/folders etc can have permissions to who can read/write to them who can delete etc etc.

As NeoFS is built on top of the Neo blockchain, these permissions are based on wallet addresses of users.

### Objects

[Objects](/docs/n3/neofs/topics/objects) represent all files/data that is stored on NeoFS. Objects are accessed via SessionTokens or Bearer Tokens

### Containers

A [container](/docs/n3/neofs/topics/containers) controls the basic permissions that are applied to all content within it. Think of a container like a drive on a computer or network (and not a folder per se).

All objects must live within a container, their permissions will default to the permissions of the container

### OwnerID

OwnerID is derived from the public or private key of a wallet and is unique to that wallet.

### Policies

Container policies define the way objects will be placed among storage nodes. That is, you as the container owner can decide what type of node should store a file for you.

### EACL

Containers and sessions/bearer tokens can have differeing permissions. By default permissions will be the same as the container's however if permissions are attached as a table to the container, or a bearer token is sent as part of a request, then they can override the permissions of the container

Read more about [ACL here](https://github.com/nspcc-dev/neofs-spec/blob/master/01-arch/07-acl.md)

### Access

Access is made using session tokens (derived from the private key), or bearer tokens, which are distributed by the container owner to others they want to be able to offer restricted capabilities (and time limits) to other users

### Wallets

A wallet is specifically an item that takes the NEP-6 format and contains any number of accounts. Accounts contain a public address, a private key and other information (read more here)

Wallets contain accounts. The first account in a wallet is the default and its wallet Address is the default address
48 changes: 48 additions & 0 deletions docs/n3/neofs/introduction/Libraries.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: "Libraries"
date: 2022-01-18T21:13:48Z
---

The Go SDK is the basis of all the functionality that is available to you as a developer with regards to NeoFS.

the Neo-Go package offers all the functionalities that you will require to interact with the Neo blockchain and wallets

## SDK

The SDK is responsible for providing functionality to interact with NeoFS itself via gRPC requests. You will need the SDK for such things as:

* creating, retrieving, deleting containers
* creating, updating, retrieving, deleting objects
* creating basic and extended ACL rules for containers

##### [find it here](https://github.com/nspcc-dev/neofs-sdk-go)

## Neo-Go library

General interaction with NeoFS doesn't require Neo-Go however invariably you will need to manage wallets or use cryptographic functions that are required while setting permissions throughout the NeoFS system.

##### [find it here](https://github.com/nspcc-dev/neo-go)

### Helpers

Sometimes there will be throughout the tutorials the need to reuse functions from elsewhere. These are stored in the Helpers tutorial and will be useful functions to have available within your projects

:::note
See Helpers, whenever you see `helper.` in a code sample
:::

### Neo FS local environment

You can clone the repository so that you can start NeoFS locally, this may be beneficial for education reasons or perhaps to run integration tests against a local NeoFS

https://github.com/nspcc-dev/neofs-dev-env/

### Resources

- Javascript interaction with NeoFS - https://github.com/CityOfZion/neofs-demo/blob/461466ab5450f4defa75c12e81a095b2b1411e0d/src/neofs.js#L167
- Smart contract interaction in Go - https://github.com/nspcc-dev/neo-go/blob/f9e8dcbed8c9325983403f25a1a37e764523ff62/cli/smartcontract/smart_contract.go#L574
- Transaction documentation in Go - https://pkg.go.dev/github.com/nspcc-dev/[email protected]/pkg/core/transaction
- neo-go low level docs - https://github.com/nspcc-dev/neo-go/tree/master/docs
- gRPC neofs docs - https://github.com/nspcc-dev/neofs-api/tree/master/proto-docs
- storage/placement policy low level docs - https://github.com/nspcc-dev/neofs-spec/blob/master/01-arch/02-policy.md
- ACL low level docs - https://github.com/nspcc-dev/neofs-spec/blob/master/01-arch/07-acl.md
44 changes: 44 additions & 0 deletions docs/n3/neofs/introduction/Overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: "Overview"
date: 2022-01-18T21:13:48Z
---

This chapter outlines the [concepts](/docs/n3/neofs/introduction/concepts) and top level points required to understand and enjoy building on neo & NeoFS

### Starting out

The topics here are primarily in Go, however where we have code snippets for other languages we will endeavour to add them.

You will need:

1. Go language installed and running
2. [NeoFS SDK - Go](https://github.com/nspcc-dev/neofs-sdk-go)
3. [Neo Go library](https://github.com/nspcc-dev/neo-go)
4. Read the [wallets](/docs/n3/neofs/topics/wallets/) page as it will outline the basis of working with Neo and NeoFS - a wallet.
5. Neo/Gas in your wallet. You can get these from the [testnet faucet here](https://neowish.ngd.network/#/)
6. These libraries will assume you are using the testnet throughout. All urls referenced can be retrieved from NeoFS or from Dora the explorer.

These tutorials are primarily in Go, however where we have code snippets for other languages we will endeavour to add them.

:::note
This documentation is not a tutorial, it is a reference to using the SDK, however in general when writing an application you will require:
:::

1. a private key
2. with this, you can instantiate a wallet and an account held by the wallet.
3. the wallet allows you to instantiate a NeoFS client.
4. Once you have a client, you can interact with NeoFS
5. To do so however, you will need a session token (or a bearer token but start with a session token). The session token contains a signature that validates your wallet against NeoFS.
6. You might create a container, put an object in a container, or delete an object.

### Libraries

[Libraries](/docs/n3/neofs/introduction/libraries) covers the packages and libraries that are required to interact with Neo and NeoFS in Go

### References

* [neofs-spec](https://nspcc.ru/upload/neofs-spec-latest.pdf#13)

### With Thanks To

* [NSPCC team](https://github.com/nspcc-dev/) - team behind NeoFS, the [neo-go-sdk](https://github.com/nspcc-dev/neofs-sdk-go) and the [neo-go](github.com/nspcc-dev/neo-go) packages
4 changes: 4 additions & 0 deletions docs/n3/neofs/introduction/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "NeoFS Overview",
"position": 1
}
4 changes: 4 additions & 0 deletions docs/n3/neofs/topics/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "NeoFS Capabilities",
"position": 2
}
Loading

0 comments on commit 3991c8f

Please sign in to comment.