pallet_members::pallet::dispatchables

Function register_member

Source
pub fn register_member<T: Config>(
    network: NetworkId,
    member: AccountId,
    peer_id: PeerId,
)
Expand description

register_member: Registers a member with specified network ID, public key, peer ID, and bond (staking amount).

§Flow

  1. Receives origin (caller’s account), network (NetworkId), peer_id (PeerId).
  2. Ensures the origin is AdminOrigin (authenticated).
  3. Validates the public_key against the origin account.
  4. Checks if the member is already registered and unregisters them if necessary.
  5. Inserts member data into respective storage maps (MemberNetwork::<T>, MemberPeerId::<T>, Heartbeat::<T>).
  6. Marks the member as online (MemberOnline::<T>).
  7. Emits Event::RegisteredMember.
  8. Calls Self::member_online to notify the network election system.
  9. Returns Ok(()) if successful.

§Warning: Doc-Only

This function is an automatically generated, and is doc-only, uncallable stub. See the real version in Pallet::register_member.