status method

  1. @override
Future<TailscaleStatus> status()
override

Returns the current node status — lifecycle state, assigned tailnet IPs, health warnings, and MagicDNS suffix. Node inventory is separate; call nodes when you need it.

Safe to call before up — returns NodeState.stopped when persisted credentials exist (ready to reconnect) and NodeState.noState when they don't.

Implementation

@override
Future<TailscaleStatus> status() async {
  if (!_running) {
    return TailscaleStatus(
      state: _started ? NodeState.stopped : NodeState.noState,
      tailscaleIPs: const [],
      health: const [],
    );
  }

  return TailscaleStatus.fromJson({
    'BackendState': 'Running',
    'Self': {
      'ID': 'loopback-$localIp',
      'TailscaleIPs': [localIp],
      'HostName': 'loopback-node',
    },
  });
}