def setup(options = {})
      @registry = nil

      options = Utils.symbolize_keys options

      @lock.synchronize do
        configuration = {
          addr: "tcp://127.0.0.1:*",
          heartbeat_rate: 5,        # How often to send heartbeats (in seconds)
          heartbeat_timeout: 10,    # How soon until a lost heartbeat triggers a node partition (in seconds)
          request_timeout: 10,      # Timeout on waiting for the response (in seconds)
          ttl_rate: 20,             # How often update TTL in the registry (in seconds)
          id: nil,
          crypto: true,
        }.merge(options)
        if configuration[:crypto]
          configuration[:crypto_keys] = Socket.curve_genkeys
        end
        configuration_accessors configuration

        fail ArgumentError, "no registry adapter given in config" unless @registry
        @id ||= generate_node_id

        if Celluloid.logger
          # :nocov:
          Celluloid.logger.formatter = proc do |severity, datetime, progname, msg|
            "[#{datetime}][#{severity}][#{@id}] #{msg}\n"
          end
          # :nocov:
        end
      end
    end
def setup(options = {})
      @registry = nil

      options = Utils.symbolize_keys options

      @lock.synchronize do
        configuration = {
          addr: "tcp://127.0.0.1:*",
          heartbeat_rate: 5,        # How often to send heartbeats (in seconds)
          heartbeat_timeout: 10,    # How soon until a lost heartbeat triggers a node partition (in seconds)
          request_timeout: 10,      # Timeout on waiting for the response (in seconds)
          ttl_rate: 20,             # How often update TTL in the registry (in seconds)
          id: nil,
          crypto: true,
        }.merge(options)
        if configuration[:crypto]
          configuration[:crypto_keys] = Socket.curve_genkeys
        end
        configuration_accessors configuration

        fail ArgumentError, "no registry adapter given in config" unless @registry
        @id ||= generate_node_id

        if Celluloid.logger
          # :nocov:
          Celluloid.logger.formatter = proc do |severity, datetime, progname, msg|
            "[#{datetime}][#{severity}][#{@id}] #{msg}\n"
          end
          # :nocov:
        end
      end
    end
Configure DCell with the following options:

 * id: to identify the local node, defaults to hostname
 * addr: 0MQ address of the local node (e.g. tcp://4.3.2.1:7777)
 *