anchor.diff:      State;
   
   %% message from comm:init_and_wait_for_valid_IP/0 (no reply needed)
  -on({hi}, State) ->
  +on({comm_says_hi}, {Nodes, _CommHasStarted, SupHasStarted}) ->
  +    {Nodes, true, SupHasStarted};
  +
  +on({scalaris_says_hi}, {Nodes, CommHasStarted, _SupHasStarted}) ->
  +    {Nodes, CommHasStarted, true};
  +
  +on({is_ready_local, Pid}, {_Nodes, CommHasStarted, SupHasStarted} = State) ->
  +    comm:send_local(Pid, {is_ready_local_response, CommHasStarted andalso SupHasStarted}),
       State.
   
   -spec get_service() -> comm:mypid() | failed.
  
positive.code:         Service -> comm:send_local(Service, {deregister_dht_node, Pid})
      end.
  
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % Server process
  
negative.code:     %% find my IP address
      comm:init_and_wait_for_valid_IP(),
      msg_delay:send_trigger(10, {trigger_gc}),
      {[], false, false}.
  
  -spec on(Message :: message(), State :: state()) -> state().
  
  % @doc registers a dht node
  on({register_dht_node, Pid}, {Nodes, CommHasStarted, SupHasStarted}) ->
      % only local processes may register!
      MonRef = erlang:monitor(process, comm:make_local(comm:get_plain_pid(Pid))),
      {[{MonRef, Pid} | Nodes], CommHasStarted, SupHasStarted};
  
  % @doc de-registers a dht node
  on({deregister_dht_node, Pid}, {Nodes, CommHasStarted, SupHasStarted} = State) ->
      case lists:keytake(Pid, 2, Nodes) of
          {value, {MonRef, Pid}, Rest} ->
              % allow erlang_demonitor to take its DOWN message off the message
              % queue if present!
              erlang:demonitor(MonRef, [flush]),
              {Rest, CommHasStarted, SupHasStarted};
          false -> State
      end;
  
  on({'DOWN', MonitorRef, process, _LocalPid, _Info1}, {Nodes, CommHasStarted, SupHasStarted}) ->
      % compare the monitor reference only (it is tied to the Pid and unique)
      {[X || {MonRef, _Node} = X <- Nodes, MonRef =/= MonitorRef], CommHasStarted, SupHasStarted};
  
  % @doc replies with the list of registered dht nodes
  on({get_dht_nodes, Pid}, {Nodes, _CommHasStarted, _SupHasStarted} = State) ->
      case comm:is_valid(Pid) of
          true ->
              Pids = [Node || {_MonRef, Node} <- Nodes],
              comm:send(Pid, {get_dht_nodes_response, Pids});
          false ->
              ok
      end,
  