 defmodule Genomu.Config do
   use ExConfig.Object
 
-  @shortdoc "Node name"
-  defproperty node_name, default: "genomu"
+  @shortdoc "Instance name"
+  defproperty instance_name, default: "genomu"
   @shortdoc "Riak Core handoff port"
   defproperty handoff_port, default: 8099
   @shortdoc "Data directory where Genomu will store all files"

          end ++
          [
           {:lager_file_backend, [
            {to_char_list(Path.join([config.log_dir, to_binary(config.node_name), "debug.log"])), :debug, 10485760, '$D0', 5},
            {to_char_list(Path.join([config.log_dir, to_binary(config.node_name), "error.log"])), :error, 10485760, '$D0', 5},
            {to_char_list(Path.join([config.log_dir, to_binary(config.node_name), "console.log"])), :info, 10485760, '$D0', 5},
          ]
         }
        ],

  def sys_config(config) do
    [
     genomu: [
       data_dir: Path.join(config.data_dir, to_binary(config.instance_name)),
     ],
     riak_core: [
       ring_state_dir: to_char_list(Path.join([config.data_dir, to_binary(config.instance_name), "ring"])),
       vnode_modules: [{:kernel, Genomu.VNode}],
       handoff_port: config.handoff_port
     ],
