Skip to main content

register_node

Function register_node 

Source
pub fn register_node(
    aida_repo: &Path,
    user_id: u32,
    hostname: &str,
) -> Result<u32>
Expand description

Register a new node in the aida registry via git CAS push loop.

This is the core distributed identity mechanism:

  1. Pull latest from remote
  2. Read node_counter, claim the next ID
  3. Write updated counter + registry entry
  4. Commit and push
  5. If push rejected (someone else registered first), pull and retry

Returns the assigned node_id on success.