Skip to content

Commit

Permalink
Add version attribute setter to NodeInfo (#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
cthulhu-rider authored Aug 15, 2023
2 parents 4c702aa + 9d3628d commit 51b2b9a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions netmap/node_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 51b2b9a

Please sign in to comment.