Skip to content

Commit

Permalink
Merge branch 'master' into fix-writecache
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhangTao1596 authored Dec 15, 2021
2 parents c4198f7 + 2a031c5 commit 6907775
Show file tree
Hide file tree
Showing 24 changed files with 571 additions and 116 deletions.
17 changes: 13 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Changelog for NeoFS Node

## [Unreleased]

### [0.27.0-rc.1] - 2021-12-02 - Sinjido (신지도, 薪智島) rc.1
## [0.27.0] - 2021-12-09 - Sinjido (신지도, 薪智島)

NeoFS API v2.11.0 support with response status codes and storage subnetworks.

Expand All @@ -12,12 +12,16 @@ NeoFS API v2.11.0 support with response status codes and storage subnetworks.
- Tombstone owner now is always set (#842)
- Node in relay mode does not require shard config anymore (#969)
- Alphabet nodes now ignore notary notifications with non-HALT main tx (#976)
- neofs-adm now prints version of NNS contract (#1014)
- Possible NPE in blobovnicza (#1007)
- More precise calculation of blobovnicza size (#915)

### Added
- Maintenance mode for Storage node (#922)
- Float values in Storage node config (#903)
- Status codes for NeoFS API Response messages (#961)
- Subnetwork support (#977, #973, #983, #974, #982, #979, #998, #995, #1001)
- Subnetwork support (#977, #973, #983, #974, #982, #979, #998, #995, #1001, #1004)
- Customized fee for named container registration (#1008)

### Changed
- Alphabet contract number is not mandatory (#880)
Expand All @@ -30,6 +34,8 @@ NeoFS API v2.11.0 support with response status codes and storage subnetworks.
- Object replication is now async and continuous (#965)
- NeoFS ADM updated for the neofs-contract v0.13.0 deploy (#984)
- Minimal TLS version is set to v1.2 (#878)
- Alphabet nodes now invoke `netmap.Register` to add node to the network map
candidates in notary enabled environment (#1008)

### Upgrading from v0.26.1
`NEOFS_IR_CONTRACTS_ALPHABET_AMOUNT` is not mandatory env anymore. If it
Expand All @@ -50,6 +56,9 @@ Shard configuration records were renamed:
Specify storage subnetworks in `NEOFS_NODE_SUBNET_ENTRIES` as the list of
integer numbers. To exit default subnet, use `NEOFS_NODE_SUBNET_EXIT_ZERO=true`

Specify fee for named container registration in notary disabled environment
with `NEOFS_IR_FEE_NAMED_CONTAINER_REGISTER`.

## [0.26.1] - 2021-11-02

### Fixed
Expand Down Expand Up @@ -801,8 +810,8 @@ NeoFS-API v2.0 support and updated brand-new storage node application.

First public review release.

[Unreleased]: https://github.com/nspcc-dev/neofs-node/compare/v0.27.0-rc.1...master
[0.27.0-rc.1]: https://github.com/nspcc-dev/neofs-node/compare/v0.26.1...v0.27.0-rc.1
[Unreleased]: https://github.com/nspcc-dev/neofs-node/compare/v0.27.0...master
[0.27.0]: https://github.com/nspcc-dev/neofs-node/compare/v0.26.1...v0.27.0
[0.26.1]: https://github.com/nspcc-dev/neofs-node/compare/v0.26.0...v0.26.1
[0.26.0]: https://github.com/nspcc-dev/neofs-node/compare/v0.25.1...v0.26.0
[0.25.1]: https://github.com/nspcc-dev/neofs-node/compare/v0.25.0...v0.25.1
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</p>

---
[![Report](https://goreportcard.com/badge/github.com/nspcc-dev/neo-go)](https://goreportcard.com/report/github.com/nspcc-dev/neofs-node)
[![Report](https://goreportcard.com/badge/github.com/nspcc-dev/neofs-node)](https://goreportcard.com/report/github.com/nspcc-dev/neofs-node)
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/nspcc-dev/neofs-node?sort=semver)
![License](https://img.shields.io/github/license/nspcc-dev/neofs-node.svg?style=popout)

Expand All @@ -26,24 +26,24 @@ of disks, capacity, etc. Thus, NeoFS gives full control over data to users.
Deep [Neo Blockchain](https://neo.org) integration allows NeoFS to be used by
dApp directly from
[NeoVM](https://docs.neo.org/docs/en-us/basic/technology/neovm.html) on the
[Smart Contract](https://docs.neo.org/docs/en-us/basic/technology/neocontract.html)
[Smart Contract](https://docs.neo.org/docs/en-us/intro/glossary.html)
code level. This way dApps are not limited to on-chain storage and can
manipulate large amounts of data without paying a prohibitive price.

NeoFS has native [gRPC](https://grpc.io) API and popular protocol gates such as
[AWS S3](https://docs.aws.amazon.com/AmazonS3/latest/API/Welcome.html),
[HTTP](https://wikipedia.org/wiki/Hypertext_Transfer_Protocol),
NeoFS has native [gRPC API](https://github.com/nspcc-dev/neofs-api) and popular
protocol gates such as [AWS S3](https://github.com/nspcc-dev/neofs-s3-gw),
[HTTP](https://github.com/nspcc-dev/neofs-http-gw),
[FUSE](https://wikipedia.org/wiki/Filesystem_in_Userspace) and
[sFTP](https://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol) allowing
developers to easily integrate applications without rewriting their code.
developers to integrate applications without rewriting their code.

# Supported platforms

For now we only support GNU/Linux on amd64 CPUs with AVX/AVX2 instructions. More
platforms will be officially supported after '1.0' release.

Latest version of neofs-node works with neofs-contract
[v0.9.0](https://github.com/nspcc-dev/neofs-contract/releases/tag/v0.9.0).
[v0.13.0](https://github.com/nspcc-dev/neofs-contract/releases/tag/v0.13.0).

# Contributing

Expand Down
41 changes: 41 additions & 0 deletions cmd/neofs-adm/docs/subnetwork-creation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# NeoFS subnetwork creation

This is a short guide on how to create NeoFS subnetworks. This guide
considers that side chain and inner ring (alphabet nodes) have already
been deployed and side chain contains deployed `subnet` contract.

## Prerequisites

To follow this guide you need:
- neo-go side chain RPC endpoint;
- latest released version of [neofs-adm](https://github.com/nspcc-dev/neofs-node/releases);
- wallet with NeoFS account.

## Creation

```shell
$ neofs-adm morph subnet create \
-r <side_chain_RPC_endpoint> \
-w </path/to/owner/wallet> \
--notary
Create subnet request sent successfully. ID: 4223489767.
```

**NOTE:** use `--notary` only in notary-enabled environmental. You need to
have sufficient notary deposit (not expired with enough GAS balance). This
is the only one command that requires alphabet signature and, therefore,
the only one command that needs `--notary` flag. Your subnet ID will differ
from the example.

Default account in the wallet that was passed with `-w` flag is the owner
of the just created subnetwork.

You can check if your subnetwork was created successfully:

```shell
$ neofs-adm morph subnet get \
-r <side_chain_RPC_endpoint> \
--subnet <subnet_ID>
Owner: NUc734PMJXiqa2J9jRtvskU3kCdyyuSN8Q
```
Your owner will differ from the example.
137 changes: 137 additions & 0 deletions cmd/neofs-adm/docs/subnetwork-usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# Managing Subnetworks

This is a short guide on how to manage NeoFS subnetworks. This guide
considers that side chain and inner ring (alphabet nodes) have already
been deployed and side chain contains deployed `subnet` contract.

## Prerequisites

- neo-go side chain RPC endpoint;
- latest released version of [neofs-adm](https://github.com/nspcc-dev/neofs-node/releases);
- [created](subnetwork-creation.md) subnetwork;
- wallet with account that owns the subnetwork;
- public key of the Storage Node;
- public keys of the node and client administrators;
- owner IDs of the NeoFS users.

## Add node administrator

Node administrators are the accounts that can manage (add and delete nodes)
whitelist of the nodes that could be included to the subnetwork. Only subnet
owner is allowed to add and remove node administrators from subnetwork.

```shell
$ neofs-adm morph subnet admin add \
-r <side_chain_RPC_endpoint> \
-w </path/to/owner/wallet> \
--admin <HEX_admin_public_key> \
--subnet <subnet_ID>
Add admin request sent successfully.
```

## Add node

Adding a node to a subnetwork means that the node becomes able to service
containers that have been created in that subnetwork. Addition only changes
list of the allowed nodes. Node is not required to be bootstrapped at the
moment of its inclusion.

```shell
$ neofs-adm morph subnet node add \
-r <side_chain_RPC_endpoint> \
-w </path/to/node_admin/wallet> \
--node <HEX_node_public_key> \
--subnet <subnet_ID>
Add node request sent successfully.
```

**NOTE:** owner of the subnetwork is also allowed to add nodes.

## Add client administrator

Client administrators are the accounts that can manage (add and delete
nodes) whitelist of the clients that can creates containers in the
subnetwork. Only subnet owner is allowed to add and remove client
administrators from subnetwork.

```shell
$ neofs-adm morph subnet admin add \
-r <side_chain_RPC_endpoint> \
-w </path/to/owner/wallet> \
--admin <HEX_admin_public_key> \
--subnet <subnet_ID> \
--client \
--group <group_ID>
Add admin request sent successfully.
```

**NOTE:** you do not need to create group explicitly, it would be created
right after the first client admin has been added. Group ID is 4-byte
positive integer number.

## Add client

```shell
$ neofs-adm morph subnet client add \
-r <side_chain_RPC_endpoint> \
-w </path/to/client_admin/wallet> \
--client <client_ownerID> \
--subnet <subnet_ID> \
--group <group_ID>
Add client request sent successfully.
```

**NOTE:** owner of the subnetwork is also allowed to add clients. This is
the only one command that accepts `ownerID`, not the public key.
Administrator can manage only his group (a group where that administrator
has been added by subnet owner).

# Bootstrapping Storage Node

After subnetwork [creation](subnetwork-creation.md) and inclusion node to it, the
node could be bootstrapped and service subnetwork containers.

For bootstrapping you need to specify ID of the subnetwork in the node's
configuration:

```yaml
...
node:
...
subnet:
entries: # list of IDs of subnets to enter in a text format of NeoFS API protocol (overrides corresponding attributes)
- <subnetwork_ID>
...
...
```

**NOTE:** specifying subnetwork that is denied for the node is not an error:
that configuration value would be ignored. You do not need to specify zero
(with 0 ID) subnetwork: its inclusion is implicit. On the contrary, to exclude
node from the default zero subnetwork you need to specify it explicitly:

```yaml
...
node:
...
subnet:
exit_zero: true # toggle entrance to zero subnet (overrides corresponding attribute and occurrence in `entries`)
...
...
```

# Creating container in non-zero subnetwork

Creating containers without using `--subnet` flag is equivalent to the
creating container in the zero subnetwork.

To create container in a private network your wallet must have been added to
the client whitelist by client admins or subnet owners:

```shell
$ neofs-cli container create \
--policy 'REP 1' \
-w </path/to/wallet> \
-r s01.neofs.devenv:8080 \
--subnet <subnet_ID>
```
58 changes: 58 additions & 0 deletions cmd/neofs-adm/internal/modules/autocomplete.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package modules

import (
"os"

"github.com/spf13/cobra"
)

var completionCmd = &cobra.Command{
Use: "completion [bash|zsh|fish|powershell]",
Short: "Generate completion script",
Long: `To load completions:
Bash:
$ source <(neofs-adm completion bash)
# To load completions for each session, execute once:
Linux:
$ neofs-adm completion bash > /etc/bash_completion.d/neofs-adm
MacOS:
$ neofs-adm completion bash > /usr/local/etc/bash_completion.d/neofs-adm
Zsh:
# If shell completion is not already enabled in your environment you will need
# to enable it. You can execute the following once:
$ echo "autoload -U compinit; compinit" >> ~/.zshrc
# To load completions for each session, execute once:
$ neofs-adm completion zsh > "${fpath[1]}/_neofs-adm"
# You will need to start a new shell for this setup to take effect.
Fish:
$ neofs-adm completion fish | source
# To load completions for each session, execute once:
$ neofs-adm completion fish > ~/.config/fish/completions/neofs-adm.fish
`,
DisableFlagsInUseLine: true,
ValidArgs: []string{"bash", "zsh", "fish", "powershell"},
Args: cobra.ExactValidArgs(1),
Run: func(cmd *cobra.Command, args []string) {
switch args[0] {
case "bash":
_ = cmd.Root().GenBashCompletion(os.Stdout)
case "zsh":
_ = cmd.Root().GenZshCompletion(os.Stdout)
case "fish":
_ = cmd.Root().GenFishCompletion(os.Stdout, true)
case "powershell":
_ = cmd.Root().GenPowerShellCompletion(os.Stdout)
}
},
}
Loading

0 comments on commit 6907775

Please sign in to comment.