From 7e56b688bc75301f0ddfa8da0eea92a3bf60ddc3 Mon Sep 17 00:00:00 2001
From: cgeek <cem.moreau@gmail.com>
Date: Tue, 5 Jul 2016 17:00:04 +0200
Subject: [PATCH] Renaming bin/ucoind to bin/duniter

---
 app/cli.js                       |  2 +-
 app/service/PeeringService.js    |  2 +-
 bin/daemon                       |  6 +++---
 bin/{ucoind => duniter}          |  2 +-
 ci/travis/debian/DEBIAN/postinst |  4 ++--
 doc/HTTP_API.md                  |  2 +-
 doc/manual-config.md             | 22 +++++++++++-----------
 duniter.sh                       |  6 +++---
 gui/package.json                 |  2 +-
 package.json                     |  4 ++--
 server.js                        |  2 +-
 test/eslint.js                   |  2 +-
 test/integration/cli.js          |  2 +-
 13 files changed, 29 insertions(+), 29 deletions(-)
 rename bin/{ucoind => duniter} (93%)
 mode change 100755 => 100644

diff --git a/app/cli.js b/app/cli.js
index 5cf159b81..9ed191d0b 100644
--- a/app/cli.js
+++ b/app/cli.js
@@ -40,7 +40,7 @@ module.exports = (programArgs) => {
 
       if (programArgs.length <= 2) {
 
-        console.log('No command given, using default: ucoind webwait');
+        console.log('No command given, using default: duniter webwait');
         return co(function *() {
           try {
             yield webWait();
diff --git a/app/service/PeeringService.js b/app/service/PeeringService.js
index f209cc1d9..5ca7c22c9 100644
--- a/app/service/PeeringService.js
+++ b/app/service/PeeringService.js
@@ -196,7 +196,7 @@ function PeeringService(server) {
     if (!currency || endpoint == 'BASIC_MERKLED_API') {
       logger.error('It seems there is an issue with your configuration.');
       logger.error('Please restart your node with:');
-      logger.error('$ ucoind restart');
+      logger.error('$ duniter restart');
       return Q.Promise((resolve) => null);
     }
     // Choosing next based-block for our peer record: we basically want the most distant possible from current
diff --git a/bin/daemon b/bin/daemon
index 6d6325026..6a517c731 100755
--- a/bin/daemon
+++ b/bin/daemon
@@ -59,7 +59,7 @@ switch (process.argv[2]) {
 
 function getDaemon(overrideCommand) {
   return require("daemonize2").setup({
-    main: "ucoind",
+    main: "duniter",
     name: directory.INSTANCE_NAME,
     pidfile: path.join(directory.INSTANCE_HOME, "app.pid"),
 
@@ -74,8 +74,8 @@ function getCommand(overrideCommand) {
 }
 
 function getFullCommand(overrideCommand) {
-  let ucoind = path.resolve(path.dirname(process.argv[1]), './ucoind');
-  return [ucoind].concat(getCommand(overrideCommand));
+  let duniter = path.resolve(path.dirname(process.argv[1]), './duniter');
+  return [duniter].concat(getCommand(overrideCommand));
 }
 
 function start(daemonToStart) {
diff --git a/bin/ucoind b/bin/duniter
old mode 100755
new mode 100644
similarity index 93%
rename from bin/ucoind
rename to bin/duniter
index 0291708f8..886ee4d4e
--- a/bin/ucoind
+++ b/bin/duniter
@@ -3,7 +3,7 @@
 
 const co = require('co');
 const cli = require('../app/cli');
-const logger = require('../app/lib/logger')('ucoind');
+const logger = require('../app/lib/logger')('duniter');
 
 // Specific errors handling
 process.on('uncaughtException', (err) => {
diff --git a/ci/travis/debian/DEBIAN/postinst b/ci/travis/debian/DEBIAN/postinst
index 0984d064a..4506c55ce 100755
--- a/ci/travis/debian/DEBIAN/postinst
+++ b/ci/travis/debian/DEBIAN/postinst
@@ -21,8 +21,8 @@ fi
 
 # Duniter CLI executes with embedded node
 if [[ -d $DUN_SOURCES/node ]]; then
-  chmod 755 $DUN_SOURCES/bin/ucoind
-  sed -i "s/usr\/bin\/env node/opt\/duniter\/sources\/node\/bin\/node/g" $DUN_SOURCES/bin/ucoind
+  chmod 755 $DUN_SOURCES/bin/duniter
+  sed -i "s/usr\/bin\/env node/opt\/duniter\/sources\/node\/bin\/node/g" $DUN_SOURCES/bin/duniter
   sed -i "s/DEB_PACKAGING=.*/DEB_PACKAGING=true/g" $DUN_SOURCES/duniter.sh
 fi
 # Else will execute with environment node
diff --git a/doc/HTTP_API.md b/doc/HTTP_API.md
index 5fc80a116..f99c8c801 100644
--- a/doc/HTTP_API.md
+++ b/doc/HTTP_API.md
@@ -230,7 +230,7 @@ Technical informations about the node.
 ```json
 {
   "ucoin": {
-    "software": "ucoind",
+    "software": "duniter",
     "version": "0.10.3",
     "forkWindowSize": 10
   }
diff --git a/doc/manual-config.md b/doc/manual-config.md
index 94e74a3db..b8dd1b35f 100644
--- a/doc/manual-config.md
+++ b/doc/manual-config.md
@@ -3,7 +3,7 @@
 To add mnually configuration parameters to Duniter, use `config` command:
 
 ```bash
-$ ucoind config
+$ duniter config
 ```
 
 ## Currency
@@ -11,7 +11,7 @@ $ ucoind config
 First of all, tell Duniter which currency to be used through command:
 
 ```bash
-$ ucoind config --currency mycurrency
+$ duniter config --currency mycurrency
 ```
 
 Replace `mycurrency` by the name of the currency you want to manage.
@@ -22,7 +22,7 @@ Replace `mycurrency` by the name of the currency you want to manage.
 By default, ucoin runs on port 8033. You may change it using the --port parameter:
 
 ```bash
-$ ucoind config --port 80
+$ duniter config --port 80
 ```
 
 (may require root access to launch on port 80)
@@ -30,25 +30,25 @@ $ ucoind config --port 80
 It is also possible to specify the IPv4 interface:
 
 ```bash
-$ ucoind config -p 8888 --ipv4 127.0.0.1
+$ duniter config -p 8888 --ipv4 127.0.0.1
 ```
 
 Or IPv6 interface:
 
 ```bash
-$ ucoind config -p 8888 --ipv6 ::1
+$ duniter config -p 8888 --ipv6 ::1
 ```
 
 Or both:
 
 ```bash
-$ ucoind config -p 8888 --ipv4 127.0.0.1 --ipv6 ::1
+$ duniter config -p 8888 --ipv4 127.0.0.1 --ipv6 ::1
 ```
 
 Launching Duniter (when completely configured) will results:
 
 ```bash
-$ ucoind start
+$ duniter start
 
 Duniter server listening on 127.0.0.1 port 8888
 Duniter server listening on ::1 port 8888
@@ -72,7 +72,7 @@ As the server may be behind a reverse proxy, or because hosts may change of addr
 You must define at least `--remote4` and `--remotep` not to have any error. Here is an example:
 
 ```bash
-$ ucoind config --remoteh "some.remote.url" --remotep "8844" --remote4 "11.11.11.11" --remote6 "::1"
+$ duniter config --remoteh "some.remote.url" --remotep "8844" --remote4 "11.11.11.11" --remote6 "::1"
 ```
 
 Note that this is not required and may be removed in the future, as Duniter protocol already include peering mecanisms giving network informations.
@@ -82,19 +82,19 @@ Note that this is not required and may be removed in the future, as Duniter prot
 Duniter protocol requires your responses to be signed in order to be interpreted. Such a feature is very important to authenticate nodes' messages. To use this feature, just configure Duniter using `--pgpkey` parameter:
 
 ```bash
-$ ucoind config --pgpkey /path/to/private/key
+$ duniter config --pgpkey /path/to/private/key
 ```
 
 Eventually, you might need to give a password, otherwise Duniter will crash:
 
 ```bash
-$ ucoind config --pgppasswd "ultr[A]!%HiGhly-s3cuR3-p4ssw0d"
+$ duniter config --pgppasswd "ultr[A]!%HiGhly-s3cuR3-p4ssw0d"
 ```
 
 Resulting in:
 
 ```bash
-$ ucoind start
+$ duniter start
 
 Signed requests with PGP: enabled.
 Duniter server listening on 127.0.0.1 port 8888
diff --git a/duniter.sh b/duniter.sh
index 6c3050120..05e8ba52f 100755
--- a/duniter.sh
+++ b/duniter.sh
@@ -3,7 +3,7 @@
 ##########################
 #    UCOIN EXECUTABLE
 #
-# Wraps bin/ucoind.js that is called with Node.js
+# Wraps bin/duniter.js that is called with Node.js
 #
 
 DEB_PACKAGING=
@@ -50,7 +50,7 @@ duniter() {
 		;;
 
 		direct_start)
-		$NODE "$DUNITER_DIR/bin/ucoind" start ${@:2}
+		$NODE "$DUNITER_DIR/bin/duniter" start ${@:2}
 		;;
 
 		logs)
@@ -63,7 +63,7 @@ duniter() {
 		#---------------------------------
 
 		*)
-	  $NODE "$DUNITER_DIR/bin/ucoind" $*
+	  $NODE "$DUNITER_DIR/bin/duniter" $*
 		;;
 
 		esac
diff --git a/gui/package.json b/gui/package.json
index f7b0d515a..0bbf7a7bf 100644
--- a/gui/package.json
+++ b/gui/package.json
@@ -1,7 +1,7 @@
 {
   "name": "v0.20.0a85",
   "main": "index.html",
-  "node-main": "../sources/bin/ucoind",
+  "node-main": "../sources/bin/duniter",
   "window": {
     "icon": "duniter.png",
     "title": "v0.20.0a85",
diff --git a/package.json b/package.json
index d5a6a25f1..e06db23a5 100644
--- a/package.json
+++ b/package.json
@@ -14,7 +14,7 @@
   },
   "scripts": {
     "test": "mocha --growl --timeout 20000 test test/fast test/fast/block test/integration test/",
-    "start": "node bin/ucoind start",
+    "start": "node bin/duniter start",
     "test-travis": "node ./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec --timeout 20000 test test/fast test/fast/block test/integration test/"
   },
   "repository": {
@@ -83,6 +83,6 @@
     "supertest": ""
   },
   "bin": {
-    "ucoind": "./bin/ucoind"
+    "duniter": "./bin/duniter"
   }
 }
diff --git a/server.js b/server.js
index 108803c96..2deac2283 100644
--- a/server.js
+++ b/server.js
@@ -129,7 +129,7 @@ function Server (dbConf, overrideConf) {
           constants.CRYPTO.DEFAULT_KEYPAIR.sec);
     }
     if (!keyPair) {
-      throw Error('This node does not have a keypair. Use `ucoind wizard key` to fix this.');
+      throw Error('This node does not have a keypair. Use `duniter wizard key` to fix this.');
     }
     that.keyPair = keyPair;
     that.sign = keyPair.sign;
diff --git a/test/eslint.js b/test/eslint.js
index b7c3612aa..bcb4e0fbf 100644
--- a/test/eslint.js
+++ b/test/eslint.js
@@ -5,7 +5,7 @@ var lint = require('mocha-eslint');
 // matches a glob pattern
 var paths = [
   'app',
-  'bin/ucoind',
+  'bin/duniter',
   'test'
 ];
 
diff --git a/test/integration/cli.js b/test/integration/cli.js
index 25443a16f..3b5e414e2 100644
--- a/test/integration/cli.js
+++ b/test/integration/cli.js
@@ -54,7 +54,7 @@ function execute(args) {
  */
 function executeSpawn(command) {
   return co(function*() {
-    const duniter = spawn(process.argv[0], [path.join(__dirname, '../../bin/ucoind')].concat(command));
+    const duniter = spawn(process.argv[0], [path.join(__dirname, '../../bin/duniter')].concat(command));
     return new Promise((resolve, reject) => {
       let res = "";
       duniter.stdout.on('data', (data) => {
-- 
GitLab