<commit_before>
var GethCommands = function(options) {
  this.config = options.config;
  this.name = "Go-Ethereum (https://github.com/ethereum/go-ethereum)";
};

GethCommands.prototype.initGenesisCommmand = function() {
  var config = this.config;
  var cmd = "geth ";

  if (config.networkType === 'testnet') {
    cmd += "--testnet ";
  } else if (config.networkType === 'olympic') {
    cmd += "--olympic ";
  }

  if (config.datadir) {
    cmd += "--datadir=\"" + config.datadir + "\" ";
  }

  if (config.genesisBlock) {
    cmd += "init \"" + config.genesisBlock + "\" ";
  }

  return cmd;
};

GethCommands.prototype.newAccountCommand = function() {
  var config = this.config;
  var cmd = "geth ";

  if (config.networkType === 'testnet') {
    cmd += "--testnet ";
  } else if (config.networkType === 'olympic') {
    cmd += "--olympic ";
  }

  if (config.datadir) {
    cmd += "--datadir=\"" + config.datadir + "\" ";
  }

  if (config.account && config.account.password) {
    cmd += "--password " + config.account.password + " ";
  }

  return cmd + "account new ";
};

GethCommands.prototype.listAccountsCommand = function() {
  var config = this.config;
  var cmd = "geth ";

  if (config.networkType === 'testnet') {
    cmd += "--testnet ";
  } else if (config.networkType === 'olympic') {
    cmd += "--olympic ";
  }

  if (config.datadir) {
    cmd += "--datadir=\"" + config.datadir + "\" ";
  }

  if (config.account && config.account.password) {
    cmd += "--password " + config.account.password + " ";
  }

  return cmd + "account list ";
};

GethCommands.prototype.mainCommand = function(address) {
  var config = this.config;
  var cmd = "geth ";
  var rpc_api = ['eth', 'web3'];

  if (config.datadir) {
    cmd += "--datadir=\"" + config.datadir + "\" ";
  }

  if (config.networkType === 'testnet') {
    cmd += "--testnet ";
  } else if (config.networkType === 'olympic') {
    cmd += "--olympic ";
  }

  if (config.networkType === 'custom') {
    cmd += "--networkid " + config.networkId + " ";
  }

  if (config.account && config.account.password) {
    cmd += "--password " + config.account.password + " ";
  }

  cmd += "--port " + "30303" + " ";
  cmd += "--rpc ";
  cmd += "--rpcport " + config.rpcPort + " ";
  cmd += "--rpcaddr " + config.rpcHost + " ";
  if (config.rpcCorsDomain) {
    // TODO: show gigantic warning when cors is set to *
    cmd += "--rpccorsdomain=\"" + config.rpcCorsDomain + "\" ";
  } else {
    // TODO: show warning when cors is not set
  }

  //"nodiscover": true,

  if (config.mineWhenNeeded || config.mine) {
    cmd += "--mine ";
  }

  if (config.whisper) {
    cmd += "--shh ";
    rpc_api.push('shh');
  }

  cmd += '--rpcapi "' + rpc_api.join(',') + '" ';

  var accountAddress = config.account.address || address;
  if (accountAddress) {
    cmd += "--unlock=" + accountAddress + " ";
  }

  if (config.mineWhenNeeded) {
    cmd += "js .embark/development/js/mine.js";
  }

  return cmd;
};

module.exports = GethCommands;
<commit_msg>support nodiscover option; add warnings to cors settings<commit_after>
var GethCommands = function(options) {
  this.config = options.config;
  this.name = "Go-Ethereum (https://github.com/ethereum/go-ethereum)";
};

GethCommands.prototype.initGenesisCommmand = function() {
  var config = this.config;
  var cmd = "geth ";

  if (config.networkType === 'testnet') {
    cmd += "--testnet ";
  } else if (config.networkType === 'olympic') {
    cmd += "--olympic ";
  }

  if (config.datadir) {
    cmd += "--datadir=\"" + config.datadir + "\" ";
  }

  if (config.genesisBlock) {
    cmd += "init \"" + config.genesisBlock + "\" ";
  }

  return cmd;
};

GethCommands.prototype.newAccountCommand = function() {
  var config = this.config;
  var cmd = "geth ";

  if (config.networkType === 'testnet') {
    cmd += "--testnet ";
  } else if (config.networkType === 'olympic') {
    cmd += "--olympic ";
  }

  if (config.datadir) {
    cmd += "--datadir=\"" + config.datadir + "\" ";
  }

  if (config.account && config.account.password) {
    cmd += "--password " + config.account.password + " ";
  }

  return cmd + "account new ";
};

GethCommands.prototype.listAccountsCommand = function() {
  var config = this.config;
  var cmd = "geth ";

  if (config.networkType === 'testnet') {
    cmd += "--testnet ";
  } else if (config.networkType === 'olympic') {
    cmd += "--olympic ";
  }

  if (config.datadir) {
    cmd += "--datadir=\"" + config.datadir + "\" ";
  }

  if (config.account && config.account.password) {
    cmd += "--password " + config.account.password + " ";
  }

  return cmd + "account list ";
};

GethCommands.prototype.mainCommand = function(address) {
  var config = this.config;
  var cmd = "geth ";
  var rpc_api = ['eth', 'web3'];

  if (config.datadir) {
    cmd += "--datadir=\"" + config.datadir + "\" ";
  }

  if (config.networkType === 'testnet') {
    cmd += "--testnet ";
  } else if (config.networkType === 'olympic') {
    cmd += "--olympic ";
  }

  if (config.networkType === 'custom') {
    cmd += "--networkid " + config.networkId + " ";
  }

  if (config.account && config.account.password) {
    cmd += "--password " + config.account.password + " ";
  }

  cmd += "--port " + "30303" + " ";
  cmd += "--rpc ";
  cmd += "--rpcport " + config.rpcPort + " ";
  cmd += "--rpcaddr " + config.rpcHost + " ";
  if (config.rpcCorsDomain) {
    if (config.rpcCorsDomain === '*') {
      console.log('==================================');
      console.log('make sure you know what you are doing');
      console.log('==================================');
    }
    cmd += "--rpccorsdomain=\"" + config.rpcCorsDomain + "\" ";
  } else {
    console.log('==================================');
    console.log('warning: cors is not set');
    console.log('==================================');
  }

  if (config.nodiscover) {
    cmd += "--nodiscover ";
  }

  if (config.mineWhenNeeded || config.mine) {
    cmd += "--mine ";
  }

  if (config.whisper) {
    cmd += "--shh ";
    rpc_api.push('shh');
  }

  cmd += '--rpcapi "' + rpc_api.join(',') + '" ';

  var accountAddress = config.account.address || address;
  if (accountAddress) {
    cmd += "--unlock=" + accountAddress + " ";
  }

  if (config.mineWhenNeeded) {
    cmd += "js .embark/development/js/mine.js";
  }

  return cmd;
};

module.exports = GethCommands;

{'fraction_non_alphanumeric': 0.2206874901899231, 'fraction_numerical': 0.0018835347669125726, 'mean_word_length': 2.75929203539823, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5732037', 'n_tokens_mistral': 2249, 'n_tokens_neox': 2188, 'n_words': 441}