FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

cmd/network/show: Print entity name by matevz · Pull Request #695 · oasisprotocol/cli · GitHub

cmd/network/show: Print entity name - #695

Draft
matevz wants to merge 1 commit into
masterfrom
matevz/feat/entity-name
Draft

cmd/network/show: Print entity name#695
matevz wants to merge 1 commit into
masterfrom
matevz/feat/entity-name

Conversation

matevz commented Apr 17, 2026
edited
Loading

Copy link
Copy Markdown
Member

Fixes #633

Vibe coded with qwen3.6:35b.

netlify Bot commented Apr 17, 2026
edited
Loading

Copy link
Copy Markdown

Deploy Preview for oasisprotocol-cli canceled.

Name Link
🔨 Latest commit d5ef5b6
🔍 Latest deploy log https://app.netlify.com/projects/oasisprotocol-cli/deploys/69e1d71a1d105b0008050087

Comment thread cmd/network/show.go
if err != nil {
common.Warnf("Warning: failed to query metadata registry: %v\n", err)
}
fromOasisscan, err := metadata.EntitiesFromOasisscan(ctx)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Why do you need data also from Oasis scan?

Comment thread cmd/network/show.go
{&fromRegistry, ""},
{&fromOasisscan, " (from oasisscan)"},
} {
if src.m == nil || *src.m == nil {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Hm ... 🤔

				// Build a lookup map from entity ID to entity name.
				fromRegistry, err := metadata.EntitiesFromRegistry(ctx)
				if err != nil {
					common.Warnf("Warning: failed to query metadata registry: %v\n", err)
				}
				fromOasisscan, err := metadata.EntitiesFromOasisscan(ctx)
				if err != nil {
					common.Warnf("Warning: failed to query oasisscan: %v\n", err)
				}
				entityNameByID := make(map[string]string)
				for _, src := range []struct {
					m      map[types.Address]*metadata.Entity
					suffix string
				}{
					{fromRegistry, ""},
					{fromOasisscan, " (oasisscan)"},
				} {
					for _, ent := range src.m {
						id := ent.ID.String()
						if _, ok := entityNameByID[id]; ok {
							continue
						}
						entityNameByID[id] = ent.Name + src.suffix
					}
				}

Comment thread cmd/network/show.go
}
table := table.New()
table.Header("Entity ID", "Node ID", "Role")
table.Header("Entity Name", "Entity ID", "Node ID", "Role")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Since the entity name is not to be trusted and can be empty, I would not put it in the first column.

Comment thread cmd/network/show.go

name := entityNameByID[node.EntityID.String()]
if name == "" {
name = "unknown"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I would just use "", as one could have an entity with name unknown.

Comment thread cmd/network/show.go
if _, exists := entityNameByID[ent.ID.String()]; exists {
continue
}
entityNameByID[ent.ID.String()] = ent.Name + src.suffix

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

If the name is empty, would this produce name " (from oasiscan)"?

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add validator names to oasis network show committees

2 participants


Back | FazBrowse Home | New Git URL