From 9d3628d66b16b1feaadd35ebb07e13f5c5229533 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Tue, 15 Aug 2023 15:29:40 +0300 Subject: [PATCH] netmap: Add version attribute setter A new well-known attribute is available after https://github.com/nspcc-dev/neofs-api/pull/267. Signed-off-by: Pavel Karpy --- netmap/node_info.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/netmap/node_info.go b/netmap/node_info.go index 8e287f43..bc4bd64b 100644 --- a/netmap/node_info.go +++ b/netmap/node_info.go @@ -262,6 +262,12 @@ func (x *NodeInfo) SetCapacity(capacity uint64) { x.setNumericAttribute(attrCapacity, capacity) } +// SetVersion sets node's version. By default, version +// is not announced. +func (x *NodeInfo) SetVersion(version string) { + x.SetAttribute(attrVersion, version) +} + // capacity returns capacity set using SetCapacity. // // Zero NodeInfo has zero capacity. @@ -359,6 +365,10 @@ const ( // price in GAS tokens for storing one GB of data during one Epoch. attrPrice = "Price" + // attrVersion is a key to the node attribute that indicates node's + // version. + attrVersion = "Version" + // attrCapacity is a key to the node attribute that indicates the // total available disk space in Gigabytes. attrCapacity = "Capacity"