Construct used space Controller on node's app-side. Call Controller.Start on
StartEstimation event from sidechain. Call Controller.Stop on
StopEstimation event from sidechain.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Implement processing of AnnounceUsedSpace RPC from NeoFS API v2 method on
the app-side according to the following algorithm (except common steps for
each RPC):
* check if the request sender is presented in container;
* check route of the request (compose from signatures);
* pass the value to Writer returned by WriterProvider.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Define component on app-side that implements RemoteWriterProvider with next
logic:
* if ServerInfo is nil, call internal dead end provider;
* if address in ServerInfo equals to local node's address, do nothing;
* otherwise create API client instance via client cache and return the
wrapper over it.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Implement wrapper over StorageEngine on app-side that iterates over the
values returned by ListContainers+ContainerSize method pair. Component will
be used as the source of local metrics.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Implement wrapper over netmap and container storages on app-side that builds
placement vectors by next steps:
* read container from storage;
* read network map from storage by epoch number;
* build container nodes according to placement policy;
* build placement vectors with epoch-dependent pivot.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Implement wrapper over API client on app-side that passes used space values
to it. Values are buffered on Put call and sent on Close call.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Implement wrapper over Container contract's client on app-side that passes
used space values to it. Uses a fixed public key, whose value will be the
key of the local storage node.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
To run storage node at dev-env environment it should have
configurable parameters. To keep `cfg` structures we can
read configuration from env and yml config file with viper
and parse values such as script hashes, fees, keys into
`cfg` structures.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>