Commit graph

499 commits

Author SHA1 Message Date
Evgenii Stratonikov
cf5f8a8f78 [#684] neofs-adm: transfer gas to the proxy contract
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-07-26 16:04:05 +03:00
Evgenii Stratonikov
c78350846a [#687] neofs-adm: set aliases for contract hashes in NNS
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-07-26 16:04:05 +03:00
Evgenii Stratonikov
df1b26c708 [#687] neofs-adm: register candidates
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-07-26 16:04:05 +03:00
Evgenii Stratonikov
0efc7b7fee [#687] neofs-adm: deploy NeoFS contracts
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-07-26 16:04:05 +03:00
Evgenii Stratonikov
8ea67ec565 [#687] neofs-adm: check for initialization stage completion
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-07-26 16:04:05 +03:00
Evgenii Stratonikov
c3f7ccaee6 [#687] neofs-adm: set alphabet and notary nodes
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-07-26 16:04:05 +03:00
Evgenii Stratonikov
425c1db5c0 [#687] neofs-adm: transfer funds to consensus wallets
This is the first stage requiring running blockchain.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-07-26 16:04:05 +03:00
Pavel Karpy
6638136d11 [#711] node/config/test: Adapt test to new config examples
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-07-23 11:09:02 +03:00
Pavel Karpy
9aa6ab4fc9 [#710] cli: Make --address flag optional
If `--address` was not presented use default wallet
address and do not require it.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-07-22 15:28:26 +03:00
Pavel Karpy
863633e6a5 [#705] cmd/neofs-node/object: Add fetcher without Notary
Depending on having notary contract in sidechain get
IR list either from NeoFSAlphabet role either from
netmap contract.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-07-22 15:12:06 +03:00
Evgenii Stratonikov
a2cb9cbc49 [#684] neofs-adm: add labels to multisig accounts
Also check that correct multisig is generated.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-07-21 15:23:16 +03:00
Evgenii Stratonikov
be6b8ca179 [#684] neofs-adm: add size validation to generate-alphabet
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-07-21 15:23:16 +03:00
Evgenii Stratonikov
459fe40758 [#684] neofs-adm: add tests for generate-alphabet
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-07-21 15:23:16 +03:00
Evgenii Stratonikov
5ca5d9ccf9 [#684] neofs-adm: create wallet right after password input
It is pretty annoying to get an error about non-existent directory
after entering 7 passwords.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-07-21 15:23:16 +03:00
Evgenii Stratonikov
4ebc6f796f [#684] neofs-adm: generate consensus wallets
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-07-21 15:23:16 +03:00
Alex Vanin
fd24a99533 [#694] cmd/neofs-node: Reuse single instance of client cache in all components
This will reduce amount of open connections up to 3 times.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-07-13 15:17:48 +03:00
Pavel Karpy
53391f057e [#693] node/reputation: Log keys in hex format
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-07-13 15:12:21 +03:00
Alex Vanin
e2f7b3f1cc [#690] cmd/neofs-node: Fallback to wallet section if node key is not set
Some users want to specify only wallet section in the SN. It is not
possible if `Key` throws panic on empty value. Instead it should
fallback to wallet section. Panic is suitable if node's key is provided
but invalid.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-07-13 14:49:31 +03:00
Alex Vanin
6bf01a0a22 [#683] cmd/neofs-adm: Add CLI flags for morph commands
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-07-13 11:29:39 +03:00
Pavel Karpy
cf8f640726 [#675] cli/container: Support binary eACL format
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-07-09 09:36:02 +03:00
Alex Vanin
d189d60925 [#666] cmd/neofs-adm: Initial app structure with config init command
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-07-08 14:37:38 +03:00
Pavel Karpy
3a7d7bdecd [#665] cli: Set non-zero exit codes in err cases
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-07-06 18:10:38 +03:00
Pavel Karpy
8965e70463 [#665] cli/util: Add exit code utils
Add `errf`, `exitOnErr` and `exitOnErrCode` functions
that works with errors and exits with non-zero exit
codes on non-nil errors.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-07-06 18:10:38 +03:00
Pavel Karpy
75632a7d83 [#667] node: Add --version flag support
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-07-06 18:07:35 +03:00
Pavel Karpy
eadc3a4de9 [#667] ir: Make --version output same as in CLI
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-07-06 18:07:35 +03:00
Leonard Lyubich
d610346a7b [#660] cli/container: Use version.IsValid in parseEACL
Extended ACL input can have version later than CLI one, and it should not be
downgraded. But the version should be still adequate.

Set `pkg.SDKVersion` on false return of `version.IsValid`.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-07-05 11:05:44 +03:00
Leonard Lyubich
dab33e0f9b [#652] Update Neo Go to v0.95.3
Add `keys.NEP2ScryptParams()` to `keys.NEP2Decrypt` call arguments.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-29 13:44:59 +03:00
Leonard Lyubich
56d4410913 [#638] Update to Go 1.16
Changes:

  * replace `iotuil` elements with the ones from `os` package;
  * replace `os.Filemode` with `fs.FileMode`;
  * use `signal.NotifyContext` instead of `NewGracefulContext` (removed).

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-29 13:44:59 +03:00
Leonard Lyubich
61f48a2736 [#651] cmd/cli: Replace netmap snapshot from netmap section to control
There is a need to have all `Control` service-related commands in `control`
section.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-29 13:44:59 +03:00
Leonard Lyubich
81ddaeca16 [#607] config/example: Add all formats of node's network addresses
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-28 15:52:50 +03:00
Leonard Lyubich
43eff09944 [#607] *: Do not use deprecated elements of code
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-28 15:52:50 +03:00
Leonard Lyubich
119031c8c7 [#607] network: Make AddressGroup.WriteToNodeInfo method a function
Method implementation doesn't use any private logic.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-28 15:52:50 +03:00
Leonard Lyubich
1e52e86bbc [#607] node/control: Make group address in NodeInfo message
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-28 15:52:50 +03:00
Leonard Lyubich
163c24a2d2 [#607] cmd/node: Configure group of bootstrap addresses
There is a need to support multiple network addresses of the storage nodes.

Make `BootstrapAddress` to return `network.AddressGroup` (and rename).

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-28 15:52:50 +03:00
Leonard Lyubich
8060735732 [#607] cmd/node: Serve gRPC on multiple interfaces
Generalize single gRPC interface of the storage node to a group of
interfaces. Each interface calls the same RPC handler.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-28 15:52:50 +03:00
Leonard Lyubich
d1eb9c3b0f [#607] cmd/node: Empty Control server address as disable
In previous implementation if Control listen endpoint was omitted in config
the gRPC listening endpoint was used instead.

Consider empty address as an option to disable the service.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-28 15:52:50 +03:00
Leonard Lyubich
c444118f47 [#607] cmd/node: Make reputationClientConstructor to accept AddressGroup
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-28 15:52:50 +03:00
Leonard Lyubich
cede2b4ed7 [#607] reputation,container: Support address groups in ServerInfo
There is a need to support multiple server endpoints for reputation and
container transmission.

Replace `ServerInfo.Address` getter with `ServerInfo.IterateAddresses`
iterator.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-28 15:52:50 +03:00
Leonard Lyubich
8ac3c62518 [#607] object/head: Make client constructor to work with group address
Make Object Head service to work with `AddressGroup` instead of `Address`
in order to support multiple addresses of the storage node.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-28 15:52:50 +03:00
Leonard Lyubich
d0e48c949b [#607] object/search: Make client constructor to work with group address
Make Object Search service to work with `AddressGroup` instead of `Address`
in order to support multiple addresses of the storage node.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-28 15:52:50 +03:00
Leonard Lyubich
ad14df07f6 [#607] object/get: Make client constructor to work with group address
Make Object Get service to work with `AddressGroup` instead of `Address` in
order to support multiple addresses of the storage node.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-28 15:52:50 +03:00
Leonard Lyubich
8972f84672 [#607] object/put: Make client constructor to work with group address
Make Object Put service to work with `AddressGroup` instead of `Address` in
order to support multiple addresses of the storage node.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-28 15:52:50 +03:00
Leonard Lyubich
6e5d7f84af [#607] network: Generalize LocalAddressSource to address group
Make `LocalAddressSource.LocalAddress` method to return `AddressGroup`. Make
`IsLocalAddress` function to accept parameter of type `AddressGroup`. Adopt
the application code with temporary `GroupFromAddress` helper.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-28 15:52:50 +03:00
Leonard Lyubich
e11f50ec8e [#607] network: Make ClientCache to accept AddressGroup
Change type of the `ClientCache.Get` method's parameter to `AddressGroup`.
Use `GroupFromAddress` to call the method from the wrappers in order to no
change their interface.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-28 15:52:50 +03:00
Leonard Lyubich
c82615667d [#607] network: Return group-address client from ClientCache
Add group-address `Client` implementation. Return instances of this
implementation from `ClientCache.Get` method.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-28 15:52:50 +03:00
Leonard Lyubich
3805b0f638 [#607] client: Overload Client interface
There is a need to generalize single-address client to group-address client.
To do this, we can re-implement `Client` interface from NeoFS API Go library
and still use it in the application code. There is a problem with method
`Raw` which must return single-address raw client. So as not to make changes
to API library we need to overload Client interface in order to support
`Raw` method in group-address client implementation.

Define `Client` interface in new `pkg/core/client` package. Completely
inherit API `Client` interface. Add `RawForAddress` method to build raw
client for the single node address. Adopt the application code that used Raw
method to work with new `Client`.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-28 15:52:50 +03:00
tivizi
1f461baf0b [#626] The default config file location
Signed-off-by: Tivizi Jing <tivizi@163.com>
2021-06-25 11:16:17 +03:00
tivizi
2da5a309f7 [#626] Support default config file
Signed-off-by: Tivizi Jing <tivizi@163.com>
2021-06-25 11:16:17 +03:00
Pavel Karpy
48827f42d3 [#643] pkg: Sync method names and commentaries to them
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-06-24 16:10:44 +03:00
Pavel Karpy
14afc6a1e5 [#635] cli: Do not enter password twice
Obtain key once in every cobra command to
pass it to `getOwnerID` and `initSession`
and do not ask to enter password more than
one time in `put` and `putSG` operations.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-06-23 10:22:28 +03:00