Each NeoFS storage node should be present in at least one subnet.
Make `netmap.IterateSubnets` function to return an error if the node by the
end of the loop does not belong to any subnet.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
NeoFS storage node can participate in a subnet group (at least one).
According to NeoFS API V2 protocol, subnets are entered and exited through
the attributes of the node. We should provide functionality for conveniently
setting and reading attributes based on the needs of the network.
Define `NodeSubnetInfo` type which groups information about the subnet
reflected in `NodeInfo`. Implement `WriteSubnetInfo` function which writes
`SubnetInfo` data to `NodeInfo`. It will be used to prepare a request for
registration on the NeoFS network. Implement `IterateSubnets` function which
allows to iterate over all subnets of the node. Moreover, it allows you to
remove a subnet from the `NodeInfo` right during iterative traversal.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Implement `encoding.TextMarshaler` / `encoding.TextUnmarshaler` interfaces
on `SubnetID` according to NeoFS API V2 protocol.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Define `subnet.Info` structure of corresponding message from NeoFS API
protocol. Provide field getters and setters. Implement
`StableMarshal` / `StableSize` methods of binary encoding. Implement
`ToGRPCMessage` / `FromGRPCMessage` method for testing and
potential transport.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Implement `Fixed32Marshal` / `Fixed32Size` functions which allow to work
with protobuf fixed32 fields.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Define `SysAttributeZoneDefault` constant for default zone in V2 code. Add
`SetNativeName` function which sets name with default zone.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Implement `GetNativeNameWithZone` / `SetNativeNameWithZone` function which
gets / sets `__NEOFS_NAME` and `__NEOFS_ZONE` container attributes.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Recompile NeoFS API protobuf files. Implement `NetworkParameter` and
`NetworkConfig` types. Expand `NetworkInfo` type with MillisecondsPerBlock
and `NetworkConfig`.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
There is a need to analyze some response information in API client.
Define `ResponseMetaInfo` structure of response information. Add
`WithResponseInfoHandler` client option which allows to set the response
info callback. The callback is called right after any response is received.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Return `AnnounceIntermediateResultResponse` instead of
`AnnounceIntermediateResultRequest` from `rpc.AnnounceIntermediateResult`.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Copy `Curve` field of `ecdsa.PublicKey` arg to `keys.PublicKey` instance in
`NEO3WalletFromPublicKey` function.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
According to specification, well-known object related filter keys for
extended ACL do not include `$Object:split.parent`.
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
In the well-known BasicACL constants we need to set the always toggled
bits for the system group. Otherwise it may be confusing for those who
read the specification and try to match it with the reference
implementation or the resulting BasicACL set in the container.
Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>