Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADM: Add subnet-related commands #992

Merged
merged 19 commits into from
Dec 1, 2021

Conversation

cthulhu-rider
Copy link
Contributor

@cthulhu-rider cthulhu-rider self-assigned this Nov 28, 2021
@cthulhu-rider cthulhu-rider added enhancement Improving existing functionality neofs-adm NeoFS Adm application issues labels Nov 28, 2021
@codecov
Copy link

codecov bot commented Nov 28, 2021

Codecov Report

Merging #992 (d38cb65) into master (1cee1b8) will decrease coverage by 0.72%.
The diff coverage is 14.12%.

❗ Current head d38cb65 differs from pull request most recent head c0b970e. Consider uploading reports for the commit c0b970e to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #992      +/-   ##
==========================================
- Coverage   38.34%   37.62%   -0.73%     
==========================================
  Files         264      265       +1     
  Lines       13725    14150     +425     
==========================================
+ Hits         5263     5324      +61     
- Misses       8024     8387     +363     
- Partials      438      439       +1     
Impacted Files Coverage Δ
cmd/neofs-adm/internal/modules/morph/initialize.go 0.00% <0.00%> (ø)
...fs-adm/internal/modules/morph/initialize_deploy.go 0.00% <0.00%> (ø)
...neofs-adm/internal/modules/morph/initialize_nns.go 0.00% <0.00%> (ø)
pkg/morph/client/notary.go 0.00% <0.00%> (ø)
pkg/services/control/ir/service.pb.go 22.42% <ø> (ø)
pkg/services/control/ir/types.pb.go 35.00% <ø> (ø)
pkg/services/control/service.pb.go 12.47% <ø> (ø)
pkg/services/control/types.pb.go 35.48% <ø> (ø)
cmd/neofs-adm/internal/modules/morph/subnet.go 14.74% <14.74%> (ø)
cmd/neofs-adm/internal/modules/morph/root.go 47.31% <100.00%> (+0.57%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1cee1b8...c0b970e. Read the comment docs.

@cthulhu-rider cthulhu-rider force-pushed the feature/979-adm-subnet branch 14 times, most recently from b4704a5 to 59b48b1 Compare December 1, 2021 11:09
Leonard Lyubich added 10 commits December 1, 2021 16:51
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Add `subnet` command which contains all subnet-related commands. Add
sub-commands:
  * `create` for creation;
  * `remove` for removal;
  * `get` for reading;
  * `admin` for admin management;
  * `client` for client management.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Make `nnsResolveHash` function to return declared error on `token not
found` fault exception. Catch this error in `deployContracts` method,
and switch to deployment if updating contract is missing.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Make `deployContracts` method to call `nnsRegisterDomain` in order to
register NNS domain for deployed contracts.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Make `Client.EnableNotarySupport` method to call `NNSContractAddress`
for proxy contract if it is not specified in corresponding option.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Use persistent flags on parent command in order to inherit flags in
sub-commands. Turn on notary mode of morph client in `subnet` command of
admin utility for notary environments.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
…ndVUB

Make `CalculateNonceAndVUB` to return zero values if notary isn't
enabled.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Notary event name equals to the name of the method which throws the
event.

Define name const of notary subnet creation.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
…ient

`initSubnetClient` must call `EnableNotarySupport` only if non-notary
flag is not set.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Cobra commands don't call `PreRun` functions on parent by default. We
need to do it in `subnet` command of admin utility in order to inherit
viper bindings.

Add `inheritPreRun` function which makes sub-commands to call `PreRun`
functions before its own `PreRun`.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Leonard Lyubich added 4 commits December 1, 2021 16:52
Implement `ManageNodes` operation on morph subnet client.
 Add `node add` and `node remove` commands to `subnet` section.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Only `subnet create` command can generate notary requests.

Remove global `non-notary` flag. Add `notary` flag to `create` cmd.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Leonard Lyubich added 2 commits December 1, 2021 17:22
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
cmd/neofs-adm/internal/modules/morph/subnet.go Outdated Show resolved Hide resolved
cmd/neofs-adm/internal/modules/morph/subnet.go Outdated Show resolved Hide resolved
cmd/neofs-adm/internal/modules/morph/subnet.go Outdated Show resolved Hide resolved
cmd/neofs-adm/internal/modules/morph/subnet.go Outdated Show resolved Hide resolved
Leonard Lyubich added 2 commits December 1, 2021 17:27
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
@cthulhu-rider cthulhu-rider merged commit 1b69886 into nspcc-dev:master Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving existing functionality neofs-adm NeoFS Adm application issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add administation module for subnetworks
3 participants