Commit graph

723 commits

Author SHA1 Message Date
Alex Vanin
eaecc438f8 [#932] neofs-cli: Support ContainerAliasFee global config parameter
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-10-19 19:15:56 +03:00
Evgenii Stratonikov
751147793f [#927] neofs-adm: provide better error message if endpoint is missing
Note that we cannot mark `--rpc-endpoint` flag as required because
it can be taken from config.

Before:
```
Error: can't create N3 client: failed to get network magic: Post "": unsupported protocol scheme ""
```

Now:
```
Error: can't create N3 client: missing endpoint
```

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-19 17:47:29 +03:00
Evgenii Stratonikov
f1202a5738 [#927] neofs-adm: fix dump-config command
```
Error: can't to initialize context: can't read alphabet wallets dir: open : no such file or directory
```
It needs neither contracts nor wallets, just N3 client.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-19 17:47:29 +03:00
Evgenii Stratonikov
c93c5e726c [#927] neofs-adm: add fee flags to morph init
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-19 17:47:29 +03:00
Evgenii Stratonikov
26e11a732d [#927] neofs-adm: provide container alias fee on deploy
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-19 17:47:29 +03:00
Pavel Karpy
0866c1fb90 [#920] cli: Rename RPC flag for control service
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-10-18 12:19:02 +03:00
Pavel Karpy
f0252e00c1 [#920] cli: Do not add rpc flags to util
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-10-18 12:19:02 +03:00
Evgenii Stratonikov
1a1435be3d [#791] neofs-lens: inspect objects by address
```
> neofs-lens list --path ./blob/blobovnicza/1/1/0
6ay4GfhR9RgN28d5ufg63toPetkYHGcpcW7G3b7QWSek/9ibXu6v4uTwLEcME5vyHev6Zi8LpxqiWTe1dahKpAbb6
H3VBttoLQoknzMDgnVNyLZ8EpkDnQjnaxDr9fnAWeEHA/Hw1titdGh7BrTe2yLotiYbVh9FQaRRNhoNzXTyetpFgt

> neofs-lens inspect --path ./blob/blobovnicza/1/1/0 \
    --address 6ay4GfhR9RgN28d5ufg63toPetkYHGcpcW7G3b7QWSek/9ibXu6v4uTwLEcME5vyHev6Zi8LpxqiWTe1dahKpAbb6 \
    --header --out payload
Version: v2.1
Type: REGULAR
CID: 6ay4GfhR9RgN28d5ufg63toPetkYHGcpcW7G3b7QWSek
ID: 9ibXu6v4uTwLEcME5vyHev6Zi8LpxqiWTe1dahKpAbb6
Owner: 2dokPzmmcLnnR21jQB3qPppTQRgwMNMKEWD
CreatedAt: 0
PayloadSize: 32
Attributes:
  foo: bar

> hexdump -C payload
00000000  ff 6c d4 71 c4 83 f1 5f  b9 0b ad b3 7c 58 21 b6  |.l.q..._....|X!.|
00000010  d9 55 26 a4 1a 95 04 68  0b 4e 7c 8b 76 3a 1b 1d  |.U&....h.N|.v:..|
00000020
```

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-18 11:55:02 +03:00
Leonard Lyubich
e5e5395830 [#833] cli/netmap: Beautify output of MillisecondsPerBlock parameter
Convert milliseconds to `time.Duration` value and use its stringer in
`netinfo` command.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-10-15 13:56:19 +03:00
Leonard Lyubich
8f9b1fe090 [#833] cli: Write MillisecondsPerBlock and NeoFS network config
Print MillisecondsPerBlock and NeoFS network parameters in `netinfo` command
of `netmap` section.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-10-15 13:56:19 +03:00
Leonard Lyubich
283ccc04b4 [#833] services/netmap: Support new fields of netmap.NetworkInfo
Make the implementation of network info source (Netmap V2 service
dependency) to read MillisecondsPerBlock sidechain parameter and NeoFS
network parameters depending on the client version.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-10-15 13:56:19 +03:00
Pavel Karpy
fae2c21165 [#873] innerring/config: Delete useless defaults
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-10-15 12:22:25 +03:00
Pavel Karpy
2f2258733b [#873] node: Delete useless notary deposit Amount, Duration envs
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-10-15 12:22:25 +03:00
Pavel Karpy
8374c3d2f5 [#873] node: Delete useless notary timer
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-10-15 12:22:25 +03:00
Pavel Karpy
2a3a6cc0ba [#873] node: Use dynamic notary deposit duration
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-10-15 12:22:25 +03:00
Pavel Karpy
5e816dc01a [#873] node: Make deposits depend on epoch and balances
SN tries to keep 1:3 proportion of GAS and
notary balances respectively. If that proportion
has been messed(means that notary balance is
lower than required) it sends half of its
GAS balance to the notary service.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-10-15 12:22:25 +03:00
Leonard Lyubich
40a4a7faa2 [#674] object/put: Use pseudo worker pool for local operations
After storage engine started to limit number of PUT operations there is no
need to limited worker pool in Object Put service.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-10-14 10:20:39 +03:00
Leonard Lyubich
2126235f0e [#674] node: Configure size of per-shard worker pools
Add `shard_pool_size` config to `storage` section. Set app default to 20.
Pass the value to `WithShardPoolSize` option.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-10-14 10:20:39 +03:00
Evgenii Stratonikov
f836e7c1dc [#888] neofs-adm: use constant for update methods
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-12 15:50:22 +03:00
Evgenii Stratonikov
31b3c71457 [#888] neofs-adm: allow to work with multiple NNS versions
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-12 15:50:22 +03:00
Evgenii Stratonikov
6571f9214f [#888] neofs-adm: update container contract deploy parameters
It supports NNS domain and zone now.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-12 15:50:22 +03:00
Evgenii Stratonikov
8ddd0aab55 [#888] neofs-adm: set contract hashes on read
Non-alphabet contract are always deployed from committee
so it makes sense to calculate hashes in one place.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-12 15:50:22 +03:00
Evgenii Stratonikov
6bcd4811e2 [#888] neofs-adm: update NNS wrappers
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-12 15:50:22 +03:00
Evgenii Stratonikov
bca41f87af [#888] neofs-adm: deploy NNS contract first
Container contract uses actual NNS interface. This also aleviates some
pain related to update as neofs-adm code itself uses current NNS
version.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-12 15:50:22 +03:00
Evgenii Stratonikov
1177f0ca78 [#888] neofs-adm: deploy contracts with Global scope
Container contract now calls NNS contract to register TLD for nice
names. This must be witnessed by a committee.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-12 15:50:22 +03:00
Evgenii Stratonikov
ec27a96b8c [#888] neofs-adm: dump NNS contract hash
This can be useful for debugging.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-12 15:50:22 +03:00
Alex Vanin
e500bd13a9 [#906] neofs-adm/docs: Fix notes from Fyrchik
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-10-11 18:33:45 +03:00
Elizaveta Chichindaeva
6c155f62c4 [#906] neofs-adm/docs: Fix language
Signed-off-by: Elizaveta Chichindaeva <elizaveta@nspcc.ru>
2021-10-11 18:33:45 +03:00
Alex Vanin
d50e8f2e72 [#906] neofs-adm/docs: Add step-by-step deploy guide
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-10-11 18:33:45 +03:00
Alex Vanin
3c47cff717 [#906] neofs-adm: Add README file
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-10-11 18:33:45 +03:00
Alex Vanin
0126f18531 [#886] cli: Fix RPC flags for control service
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-10-08 17:18:18 +03:00
Evgenii Stratonikov
cc377b34d2 [#868] blobstor: initialize (de-)compressors in Init
Do not log in options constructors. Also failure to
initialize compression module (possibly due to invalid options) is
certainly an error deserving proper treatment.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-08 16:01:45 +03:00
Evgenii Stratonikov
00f14d4dcd [#857] config: use size suffixes where possible
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-08 11:26:24 +03:00
Evgenii Stratonikov
a0abf10c8e [#857] config: allow to parse sizes with suffix
The code is taken from viper as `cast` package that we use
doesn't have needed converter.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-10-08 11:26:24 +03:00
Pavel Karpy
4615ff1392 [#886] cli: Fix API flags
Bind API cobra flags(`ttl' and xhdr')
to the Viper.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-10-07 18:54:34 +03:00
Alex Vanin
e41e74b5fc [#872] services/container: Ignore passed routes in load router
Higher level solution for original issue with lost announcements
from single node container.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-10-05 19:29:27 +03:00
Alex Vanin
f08636c518 [#872] cmd/neofs-node: Don't lose local container size estimations
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-10-05 19:29:27 +03:00
Leonard Lyubich
4d7915a366 [#791] neofs-lens: Implement object listing
Implement `list` command for object listing. Support listing of the objects
from write-cache and blobovnicza.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-10-05 10:51:10 +03:00
Leonard Lyubich
522cbab47c [#791] cmd: Implement application observing storage engine
Implement skeleton of `neofs-lens` app which is going to be used for working
with storage engine's data.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-10-05 10:51:10 +03:00
Pavel Karpy
8c59ade4ed [#854] cli: Do not use global flags
Also delete `ttl` and `xhdr` flags from
`accounting balance` command and refactor
command initialization.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-10-04 12:12:21 +03:00
Evgenii Stratonikov
4ccb3d05d8 [#835] neofs-adm: rename contract update method
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-09-30 20:57:24 +03:00
Alex Vanin
f2a61451b7 [#867] governance: Add option to disable governance sync
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-30 20:57:13 +03:00
Leonard Lyubich
312e356a75 [#645] object: Compare public keys in reputation client constructor
In previous implementation of reputation client constructor compared network
addresses to check the membership of the network map.

Replace network addresses comparison with public key comparison.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-09-30 20:57:00 +03:00
Leonard Lyubich
e473f3ac91 [#645] *: Use helper functions to build client.NodeInfo structures
Helper functions from core/client package allow to set public keys of
storage nodes.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-09-30 20:57:00 +03:00
Leonard Lyubich
7b228b7603 [#645] *: Construct clients from client.NodeInfo in API client cache
There is a need to have the ability to expand the data needed for client
construction.

Replace `network.AddressGroup` parameter of client cache interfaces with
`client.NodeInfo`.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-09-30 20:57:00 +03:00
Leonard Lyubich
287683c590 [#863] node: Do not open main chain client connection
In current implementation storage node doesn't use main chain client.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-09-29 12:55:48 +03:00
Leonard Lyubich
50c4c5116d [#863] node: Prevent panic about missing Neo RPC endpoints
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-09-29 12:55:48 +03:00
Alex Vanin
409b72cb5b [#786] neofs-node: Ignore proxy contract in notary disabled environment
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-27 16:20:31 +03:00
Leonard Lyubich
0e3e8db5c0 [#845] node: Configure Object PUT remote and local pools separately
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-09-27 16:20:19 +03:00
Leonard Lyubich
ee20200c2e [#845] object/put: Separate pools for local and remote operations
In previous implementation Object PUT used single pool of workers for local
and remote ops, but these ops are heterogeneous.

Use remote/local pool for remote/local operations in PUT service. At first
the pools are configured with the same size.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-09-27 16:20:19 +03:00
Alex Vanin
3e5c7e0ade [#836] neofs-adm: Fix proxy contract deploy arguments
Proxy contract does not include notary flag because
contract is useless without notary subsystem.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-23 09:55:46 +03:00
Alex Vanin
4c30757439 [#836] neofs-adm: Do not define contract owner
Contract owners are removed in neofs-contract v0.11.0.
Now side chain committee has rights to update contracts.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-23 09:55:46 +03:00
Alex Vanin
ce8a906bb5 [#834] neofs-adm: Update NNS contract during contract update
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-22 18:23:59 +03:00
Alex Vanin
d996004d80 [#834] neofs-adm: Use committee signature when updating alphabet contract
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-22 18:23:59 +03:00
Alex Vanin
6b3a9e6fcc [#834] neofs-adm: Update contract update if it exists
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-22 18:23:59 +03:00
Alex Vanin
60636d4c1d [#834] neofs-adm: Throw error if deploy produce non-HALT state
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-22 18:23:59 +03:00
Leonard Lyubich
d938c7267b [#789] node/config: Add Shard's refill_metabase config to examples
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-09-15 18:22:09 +03:00
Leonard Lyubich
b5fff810f4 [#789] cmd/node: Add refill_metabase config to shard section
Implement `RefillMetabase` method to `shardconfig.Config` type which reads
`refill_metabase` config value. Pass the result to `WithRefillMetabase`
option.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-09-15 18:22:09 +03:00
Leonard Lyubich
368e280413 [#776] cmd/node: Configure write-cache size limit
Add `size_limit` config value to write-cache section. Add `SizeLimit` method
of `writecache.Config` type. Pass its value to `WithMaxCacheSize` option on
app construction.

Reflect config update in examples. Cover new value in unit test.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-09-15 18:07:36 +03:00
Alex Vanin
d840627816 [#786] cmd/neofs-node: Use NNS to find contract script hashes missing in config
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-13 14:51:35 +03:00
Alex Vanin
affae68061 [#812] cmd/neofs-node: Support notary notifications in reputation service
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-13 14:51:07 +03:00
Alex Vanin
90823a7d05 [#812] cmd/neofs-node: Fix reputation wrapper import typo
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-13 14:51:07 +03:00
Pavel Karpy
288a8784d0 [#815] node: Make notary deposit before bootstrap
Bootstrap process involves `addPeer` contract
call => it is necessary to make deposit before
booting up.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-09-13 14:50:52 +03:00
Pavel Karpy
b303e49408 [#815] morph/event/netmap: Add updateState notary notification support
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-09-13 14:50:52 +03:00
Alex Vanin
01df4ffa61 [#811] service/container: Hide cache invalidation logic in Writer interface
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-13 14:50:18 +03:00
Alex Vanin
49b6b5b49d [#811] cmd/node: Use cache invalidator in container service
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-13 14:50:18 +03:00
Pavel Karpy
19e97e4d7c [#807] node: Fix notary container invocation
Create non-notary container wrapper and
use it in load announcing since it shouldn't
be invoked as notary request.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-09-09 18:37:45 +03:00
Alex Vanin
1edf40f4d6 [#798] morph/subscriber: Remove RPC Init timeout
More convenient way is to fail straight away and
expect external restart.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-07 17:22:25 +03:00
Alex Vanin
4874b4ae92 [#798] cmd/neofs-node: Save latest processed block number
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-07 17:22:25 +03:00
Alex Vanin
cdb3b71070 [#798] neofs-node/config: Add persistent_state section
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-07 17:22:25 +03:00
Alex Vanin
005f54e61e [#798] pkg/innerring: Save latest processed block number
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-09-07 17:22:25 +03:00
Pavel Karpy
4a81781c0c [#770] logger: Delete spaces in log message keys
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-09-07 12:55:01 +03:00
Pavel Karpy
2f343a15e5 [#770] node/cmd: Add TryNotary to SN container wrapper
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-09-07 12:55:01 +03:00
Pavel Karpy
722b844aa2 [#770] node: Add notary deposit timer
Storage Node needs to have notary deposit
for successful notary request sending.
Add notary deposit on startup(and wait for
its acceptance). Add notary deposit timer,
its config in `morph` section and env vars
for its tuning.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-09-07 12:55:01 +03:00
Pavel Karpy
e29bcd98e2 [#770] node/config: Add notary deposit config
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-09-07 12:55:01 +03:00
Pavel Karpy
2ef5e86aaf [#770] node/config: Add uint32 casting
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-09-07 12:55:01 +03:00
Pavel Karpy
d77b2d1b76 [#770] node/config: Add proxy contract to config
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-09-07 12:55:01 +03:00
Pavel Karpy
d252aa4a3e [#770] pkg/morph: Rename all parsers and handlers structs/interfaces
Prepare all listening structures for notary events:
rename(add prefix/suffix 'notification') all
notification specific handlers/parsers.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-09-07 12:55:01 +03:00
Leonard Lyubich
358e3ed8c4 [#645] *: Change the locality condition of the node from the placement
Some software components regulate the way of working with placement arrays
when a local node enters it. In the previous implementation, the locality
criterion was the correspondence between the announced network address
(group) and the address with which the node was configured. However, by
design, network addresses are not unique identifiers of storage nodes in the
system.

Change comparisons by network addresses to comparisons by keys in all
packages with the logic described above. Implement `netmap.AnnouncedKeys`
interface on `cfg` type in the storage node application.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-09-07 09:53:18 +03:00
Pavel Karpy
3c848b2cad [#788] cli: Wrap/sync errors
Add context to error messages. Sync error
messages for errors with the same context.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-09-07 09:52:53 +03:00
Leonard Lyubich
85bd2a1cdf [#746] morph: Add error return of MagicNumber method
Since morph `Client` works in multi-client mode, there is an error case when
we can not get network magic when all endpoints are unavailable.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-09-02 11:04:38 +03:00
Leonard Lyubich
ad7ad12a0c [#746] morph: Implement and use multi-client
There is a need to work with a set of Neo RPC nodes in order not to depend
on the failure of some nodes while others are active.

Support "multi-client" mode of morph `Client` entity. If instance is not
"multi-client", it works as before. Constructor `New` creates multi-client,
and each method performs iterating over the fixed set of endpoints until
success. Opened client connections are cached (without eviction for now).

Storage (as earlier) and IR (from now) nodes can be configured with multiple
Neo endpoints. As above, `New` creates multi-client instance, so we don't
need initialization changes on app-side.

`Wait` and `GetDesignateHash` methods of `Client` return an error from now
to detect connection errors. `NotaryEnabled` method is removed as unused.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-09-02 11:04:38 +03:00
Leonard Lyubich
e738699fcc [#676] services/container: Cache the results of read operations
In previous implementation Container service handlers didn't cache the
results of `Get` / `GetEACL` / `List` operations. As a consequence of this,
high load on the service caused neo-go client's connection errors. To avoid
this there is a need to use cache. Object service already uses `Get` and
`GetEACL` caches.

Implement cache of `List` results. Share already implemented cache of Object
service with the Container one. Provide new instance of read-only container
storage (defined as an interface)to morph executor's constructor on which
container service is based. Write operations remained unchanged.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-08-30 18:01:26 +03:00
Pavel Karpy
c54f524df9 [#773] writecache: Delete unused dbSize param
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-08-27 15:05:53 +03:00
Pavel Karpy
9b32b5523d [#760] cli: Support COMMON_PREFIX matchtype
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-08-27 15:03:15 +03:00
Leonard Lyubich
7a5729ea2b [#761] cmd/node: Do not perform bootstrap procedure in relay mode
Storage node should not try to register itself in network in relay mode.

Implement `needBootstrap` method which checks if node need to bootstrap.
Call `bootstrap` method in `bootstrapNode` function only on true return.
Skip re-bootstrap logic in new epoch event handler on false return.
Return an error if `ControlService.SetNetmapStatus` is called on relay
node.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-08-26 18:54:55 +03:00
Leonard Lyubich
05d5b724a9 [#761] cmd/node: Rename reBootstrapEnabled to needBootstrap
`reBootstrapEnabled` state var is not used. It is going to be used to decide
whether to bootstrap node or not.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-08-26 18:54:55 +03:00
Leonard Lyubich
3c78890b97 [#761] cmd/node: Add bootstrap method docs
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-08-26 18:54:55 +03:00
Alex Vanin
cadd94f08f [#766] Fix stylecheck import linter error
Remove redundant imports

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-08-26 17:57:15 +03:00
Alex Vanin
53f031e98c [#766] Fix misspell linter error
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-08-26 17:57:15 +03:00
Leonard Lyubich
4b7cc6e293 [#758] cmd/neofs-adm: Implement command to refill storage node's GAS
Add `refill-gas` sub-command to `morph` command which provides the ability
to refill storage node's GAS.

Command performs some actions from `generate-storage-wallet` runner, so
common code is moved to a separate function `refillGas`.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-08-25 17:07:23 +03:00
Evgenii Stratonikov
f9d9f33461 neofs-adm: use nnsResolveHash instead of custom code
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-08-24 12:35:52 +03:00
Evgenii Stratonikov
72b8d919fe [#755] neofs-adm: allow to filter containers by ID
`--cid <cid1> --cid <cid2>` as well as `--cid <cid1>,<cid2>` is supported.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-08-24 12:35:52 +03:00
Evgenii Stratonikov
00a299c1a4 [#755] neofs-adm: add contract hash flag to dump-containers
`--container-contract` flag must be used for deployments without NNS.
Our current testnet sidechain is like this, for example.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-08-24 12:35:52 +03:00
Evgenii Stratonikov
5072b703bc [#755] neofs-adm: allow to restore containers
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-08-24 12:35:52 +03:00
Evgenii Stratonikov
a013dcbab5 [#755] neofs-adm: allow to dump active containers
`morph dump-containers` will dump all containers from the
contaner contract. JSON format is chosen to allow manual intervention.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-08-24 12:35:52 +03:00
Evgenii Stratonikov
58e8d6e1fd [#755] neofs-adm: print NNS records during initialization
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-08-24 12:35:52 +03:00
Pavel Karpy
53036276e5 #759] node: Log notary status on startup
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-08-23 15:26:10 +03:00
Evgenii Stratonikov
8178c5e69b [#757] neofs-adm: ensure notary contract is enabled
This is the only case we support, it makes sense to fail early.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-08-19 17:46:10 +03:00
Evgenii Stratonikov
33c3f18b4f [#748] neofs-adm: allow to update contracts
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-08-10 12:03:10 +03:00
Pavel Karpy
aa0955f15d [#747] neofs-adm: Support ~ for paths in config
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-08-05 14:44:42 +03:00
Pavel Karpy
b5cadff2c3 [#745] node: Add more debug logs on shutdown
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-08-05 14:44:05 +03:00
Alex Vanin
d8e47e60a7 [#738] neofs-adm: Use constants and reduce code in dump-config
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-08-03 21:03:36 +03:00
Alex Vanin
ddbfb09560 [#738] neofs-adm: Add command to dump NeoFS network config
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-08-03 21:03:36 +03:00
Alex Vanin
37cc702271 [#738] neofs-adm: Set more network configuration values
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-08-03 21:03:36 +03:00
Pavel Karpy
e8665f6cef [#730] node/morph: Use disable_cache config param
Do not init caches for eACL, containers and netmap
if `disable_cache` config options is `true`, use
direct RPC calls instead.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-08-03 09:40:10 +03:00
Pavel Karpy
c423aa432a [#730] node/config/morph: Add disable_cache
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-08-03 09:40:10 +03:00
Pavel Karpy
cb842096d4 [#720] ir: Delete without_notary defaults
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-08-03 09:30:11 +03:00
Evgenii Stratonikov
e2cef00497 [#732] neofs-adm: read contract path only on init
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-08-02 14:28:23 +03:00
Evgenii Stratonikov
a2f6e07b1d [#732] neofs-adm: read alphabet contract once
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-08-02 14:28:23 +03:00
Evgenii Stratonikov
8e71773c4a [#732] neofs-adm: fetch single accounts during the initialization
Simplify code and perform error checking before the actual work.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-08-02 14:28:23 +03:00
Evgenii Stratonikov
018256def8 [#732] neofs-adm: remove debug output
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-08-02 14:28:23 +03:00
Evgenii Stratonikov
c81008764a [#732] neofs-adm: fetch native hashes once
Retrieve list of native contracts during initialization
in a single query.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-08-02 14:28:23 +03:00
Evgenii Stratonikov
6a40adcfca [#732] neofs-adm: get contract path on initialization
Simplifies code a bit.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-08-02 14:28:23 +03:00
Pavel Karpy
67b17cfb02 [#727] config: Use 0660 as default permissions
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-07-30 16:42:22 +03:00
Pavel Karpy
7a10d902be [#727] Use util.MkdirAllX instead of os.MkdirAll
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-07-30 16:42:22 +03:00
Evgenii Stratonikov
c332188341 [#685] neofs-adm: generate storage node wallets
Initial GAS can be provided both in config and as a CLI argument.
Generating wallet with 0 GAS is currently prohibited.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-07-30 14:09:51 +03:00
Evgenii Stratonikov
90259b5cc7 [#685] neofs-adm: reduce amount of logs
If `init` is run on a dirty network (i.e. with some stages already
done), no transactions are really sent so clean up logs a bit.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-07-30 14:09:51 +03:00
Evgenii Stratonikov
b95c16879d [#686] neofs-adm: implement morph force-new-epoch
Allow to force epoch change.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-07-30 14:08:56 +03:00
Evgenii Stratonikov
9c1fb0b55e [#728] neofs-adm: update to neofs-contract@v0.10.1
Add config parameters to netmap and neofs contracts.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-07-30 12:45:21 +03:00
Evgenii Stratonikov
2290109849 [#726] neofs-adm: use NNSIsAvailable from neo-go
There is no need in writing another wrapper.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-07-29 10:50:32 +03:00
Evgenii Stratonikov
9e56012760 [#726] neofs-adm: set alphabet contract addresses in NNS
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-07-29 10:50:32 +03:00
Evgenii Stratonikov
4d65e138f5 [#726] neofs-adm: allow to dump deployed contract hashes
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-07-29 10:50:32 +03:00
Evgenii Stratonikov
9ef2579afa [#726] neofs-adm: remove alphabet contract from contract list
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-07-29 10:50:32 +03:00
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