Skip to content

Generate unique local NodeID #78

@Poikilos

Description

@Poikilos

balazs.racz  [12:16 AM]Does you app have a unique ID?You can't have two nodes with the same unique ID on the network. You have to ensure that your app has a unique ID on the network. It can not be 09.00.99.00.00.00.If there are two devices booting at the same time with the same unique ID, then this algorithm will go into an infinite loop, since it is deterministic based on the unique ID. And a bunch of other stuff will also break.[12:17 AM]JMRI has a relatively large range (02.01.12.xx.yy.zz I think) and it uses a hash of the computer's IP address and the process ID within the computer to make up the xx.yy.zz numbers. This allows two JMRIs to be running on the same computer and still have different unique IDs.

Jake Gustafson  [2:10 PM]No it doesn't have a unique ID. I thought incrementing the alias would handle that, but I didn't understand. Thank you.[2:11 PM]I see how that could confuse the nodeid<->alias map. I wondered about that.

-https://tcslcc.slack.com/archives/D048E39PZ27/p1768454186428799

I can work on this in my branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions