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

Clarification - Node Identifiers - AccountId vs. EntityId vs. NodeId #834

Open
iamjpotts opened this issue Sep 3, 2024 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@iamjpotts
Copy link
Contributor

Problem

Currently, when creating a Client with a custom network (a custom mapping of node ids with host/port pairs) rather than one of the default networks (e.g. for mainnet or testnet), that mapping is defined as HashMap<String, AccountId> where the key is a host/port pair and the value is a node id.

Elsewhere in the crate, there is an EntityId type similar to AccountId but with different semantics. There is no NodeId type currently.

Is AccountId the appropriate type to model a node id, or should the existing EntityId or a new NodeId be used instead?

Solution

Refactor usages of this host to node map to have a different value type for the node other than AccountId.

Alternatives

  • For node identifiers, in place of AccountId, use existing EntityId type
  • For node identifiers, in place of AccountId, use a new NodeId type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant