Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronize printing string format of storage node ID #1765

Closed
cthulhu-rider opened this issue Sep 7, 2022 · 3 comments · Fixed by #1880
Closed

Synchronize printing string format of storage node ID #1765

cthulhu-rider opened this issue Sep 7, 2022 · 3 comments · Fixed by #1880
Assignees
Labels
discussion Open discussion of some problem good first issue Good for newcomers

Comments

@cthulhu-rider
Copy link
Contributor

Currently we print storage node ID (which is actually its public key) in different formats. For example:

keyString := hex.EncodeToString(nodeInfo.PublicKey())
updated := np.netmapSnapshot.touch(keyString, np.epochState.EpochCounter(), nodeInfoBinary)
if updated {
np.log.Info("approving network map candidate",
zap.String("key", keyString))

cmd.Printf("Node %d: %s %s %v\n", i+1,
base58.Encode(node.GetPublicKey()),

While both formats can be casted to each other, it's not really convenient to compare the values visually. I propose to work out for this case and others like it a string format at the convention level. Why conventions? For example, for object/container IDs, a string format is declared at the protocol level.

To conveniently follow the convention, it is proposed to create a special function in the SDK, which will be used whenever it is required to comply with the generally accepted format.

Btw which format do you prefer? For me its hex 🐑. @fyrchik @carpawell

@cthulhu-rider cthulhu-rider added triage discussion Open discussion of some problem and removed community labels Sep 7, 2022
@roman-khimov
Copy link
Member

Btw which format do you prefer?

https://governance.neo.org/

I don't think I've ever seen a public key printed in base58.

@acid-ant
Copy link
Contributor

Blocked by nspcc-dev/neofs-sdk-go#349

@acid-ant
Copy link
Contributor

Reopened because #1880 still in progress

aprasolova pushed a commit to aprasolova/neofs-node that referenced this issue Oct 19, 2022
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Open discussion of some problem good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants