Commit graph

119 commits

Author SHA1 Message Date
Evgenii Stratonikov
a91b59fff9 [#1115] neofs-adm: use request timeout in N3 client
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-02-11 12:58:59 +03:00
Evgenii Stratonikov
b3b3b8b20f [#1090] neofs-adm: Add history of commands to a storage configurator
It also persists between sessions.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-02-08 14:53:20 +03:00
Evgenii Stratonikov
8263582dde [#1090] neofs-adm: add interactive configurator for storage node
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-02-08 14:53:20 +03:00
Evgenii Stratonikov
1deea4e8c6 [#749] neofs-adm: Set signer for committee transactions
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-02-04 11:49:55 +03:00
Evgenii Stratonikov
8fa2b364a1 [#749] neofs-adm: add group scope to force-new-epoch command
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-02-04 11:49:55 +03:00
Evgenii Stratonikov
e4bc9c7fad [#749] neofs-adm: save group public key in NNS
Query `group.neofs` instead of retrieving individual manifest.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-02-04 11:49:55 +03:00
Evgenii Stratonikov
def1bbc84c [#749] neofs-adm: create wallet for signing contract group
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-02-04 11:49:55 +03:00
Evgenii Stratonikov
b416285eb0 [#749] neofs-adm: include neofs contracts in a group
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-02-04 11:49:55 +03:00
Evgenii Stratonikov
674f520da7 [#1132] *: Use path/filepath package when working with files
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-02-03 10:12:07 +03:00
Evgenii Stratonikov
476528361e [#1023] *: fix linter errors
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-01-31 13:01:58 +03:00
Pavel Karpy
6f338c660c [#1038] adm: Do not cut data args in NNS
This reverts commit 185a2827cc.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2022-01-27 12:08:36 +03:00
Pavel Karpy
fee2f5a330 [#1100] *: Adopt new SDK's owner.ID API
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2022-01-21 17:58:30 +03:00
Evgenii Stratonikov
5828f43e52 [#851] util/rand: use single random source
It is much more convenient to skip source creation.
Also fix some bugs:
1. `cryptoSource.Int63()` now returns number in [0, 1<<63) as required
   by `rand.Source` interface.
2. Replace `cryptoSource.Uint63()` with `cryptoSource.Uint64` to allow
   generate uint64 numbers directly (see rand.Source64 docs).

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-01-12 19:29:27 +03:00
Evgenii Stratonikov
efabffbfd0 [#1041] cmd/*: factor out autocomplet command generation
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-01-12 18:33:48 +03:00
Evgenii Stratonikov
56b8793520 [#1056] neofs-adm: deploy proxy contract without arguments
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-12-30 13:54:07 +03:00
Evgenii Stratonikov
185a2827cc Revert "[#1038] adm: Do not cut data args in NNS"
This reverts commit acb4a9e5b4.
2021-12-30 10:20:54 +03:00
Evgenii Stratonikov
549546dea1 [#1035] neofs-adm: reuse NEF and manifest during alphabet contract update
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-12-30 10:20:54 +03:00
Evgenii Stratonikov
4673c81451 [#1035] neofs-adm: update contracts in a single transaction
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-12-30 10:20:54 +03:00
Pavel Karpy
acb4a9e5b4 [#1038] adm: Do not cut data args in NNS
The updated version of the `NNS` contract now supports the third `data`
argument that may provide additional information.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-12-20 14:43:29 +03:00
Pavel Karpy
11466ea3cc [#1031] adm: Use 10 as maxConnPerHost in neo-go client
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-12-16 18:55:53 +03:00
Alex Vanin
2a031c5542 [#1013] Support autocomplete in neofs-adm
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-12-14 17:34:10 +03:00
Pavel Karpy
cb246dfab7 [#1015] docs: Add subnetwork managing HOWTO
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-12-09 09:47:50 +03:00
Pavel Karpy
14f49df658 [#1015] docs: Add subnetwork creation HOWTO
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-12-09 09:47:50 +03:00
Alex Vanin
d89ffbfbdf [#1020] neofs-adm: Make key flag non global in subnet
Key flag should not be global because `subnet get` command
does not require any credentials.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-12-08 18:49:41 +03:00
Alex Vanin
3bb67075f4 [#1020] neofs-adm: Do not ask key in morph subnet get command
There is no need to provide credential to fetch public data from
side chain.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-12-08 18:49:41 +03:00
Pavel Karpy
15ff98c229 [#1024] adm: Change private key to wallet in subnet flags
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-12-08 15:57:22 +03:00
Pavel Karpy
b4c36a109d [#1019] adm: Fetch subnet SH from NNS
Also, delete `-a` (`--contract`) flag.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-12-08 13:33:36 +03:00
Alex Vanin
c383fc6929 [#1014] neofs-adm: Print NNS contract version
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-12-07 18:55:44 +03:00
Evgenii Stratonikov
a5e952cc72 [#1006] neofs-adm: skip missing entries in dump-hashes
We have `subnet` contract in list, but it isn't currently deployed.
This commit skips missing NNS entries to handle such situation. In
future we may optimize this to be done in 1 round-trip.

As a nice side-effect, dump-hashes for notary-enabled environment works
even if notary is disabled -- it just prints zero hash for proxy
contract.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-12-03 13:24:17 +03:00
Evgenii Stratonikov
ca894fee23 [#749] neofs-adm: make alphabet size check more robust
We can now store wallet for signing manifest groups in the same dir.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-12-02 17:24:16 +03:00
Evgenii Stratonikov
40b51b3586 [#995] neofs-adm: implement deposit-notary command
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-12-02 17:24:16 +03:00
Evgenii Stratonikov
fba8890224 [#995] neofs-adm: split out tx context
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-12-02 17:24:16 +03:00
Leonard Lyubich
1b698867a7 [#979] adm/subnet: Fix typos
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-12-01 17:31:04 +03:00
Leonard Lyubich
dd2998d724 [#979] adm/subnet: Rename id flag to node in node cmd
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-12-01 17:31:04 +03:00
Leonard Lyubich
5f915dfb43 [#979] adm/subnet: Rename id flag to admin in admin cmd
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-12-01 17:31:04 +03:00
Leonard Lyubich
cc8a0037e0 [#979] adm/subnet: Fix print out of subnet info in get cmd
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-12-01 17:31:04 +03:00
Leonard Lyubich
3fcd7bc948 [#979] adm/subnet: Always set group ID parameter in client cmds
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-12-01 17:31:04 +03:00
Leonard Lyubich
4d79195ede [#979] adm/subnet: Fix notary issues
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>
2021-12-01 17:31:04 +03:00
Leonard Lyubich
98e0792b08 [#979] adm/subnet: Add commands to add/remove nodes
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>
2021-12-01 17:31:04 +03:00
Leonard Lyubich
579c3717a5 [#979] adm/subnet: Inherit pre-run functions in child commands
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>
2021-12-01 17:31:04 +03:00
Leonard Lyubich
6facc26cb9 [#979] adm/subnet: Fix handling of non-notary flag in initClient
`initSubnetClient` must call `EnableNotarySupport` only if non-notary
flag is not set.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-12-01 17:31:04 +03:00
Leonard Lyubich
4b8ca75274 [#979] adm: Fix problems after testing
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>
2021-12-01 17:31:04 +03:00
Leonard Lyubich
9622c9c858 [#979] adm: Register NNS domain of the deployed contracts
Make `deployContracts` method to call `nnsRegisterDomain` in order to
register NNS domain for deployed contracts.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-12-01 17:31:04 +03:00
Leonard Lyubich
2f2ca2e0bd [#979] adm: Deploy missing contracts during updating
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>
2021-12-01 17:31:04 +03:00
Leonard Lyubich
e8f8e58e90 [#979] adm: Add subnet-related commands
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>
2021-12-01 17:31:04 +03:00
Leonard Lyubich
70f17dc778 [#979] adm: Deploy and update Subnet contract
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-12-01 17:31:04 +03:00
Evgenii Stratonikov
98f288c946 [#984] neofs-adm: fix contract hash check in NNS
Don't update if the hash is already there.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-11-29 11:19:36 +03:00
Evgenii Stratonikov
7765ab3f02 [#984] neofs-adm: replace addRoot with register for NNS
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-11-29 11:19:36 +03:00
Evgenii Stratonikov
63a8b530f6 [#984] neofs-adm: compare NEF.Checksum to check if contract was updated
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-11-29 11:19:36 +03:00
Evgenii Stratonikov
95893927aa *: replace neofs-api-go with neofs-sdk-go
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-11-12 17:29:09 +03:00