Skip to content
Snippets Groups Projects
Select Git revision
  • dev
  • atelier-gva
  • doc-gva
  • gva-txs_by_block
  • gva-blocks
  • oxyde-bc-db
  • oxyde-dal
  • oxyde-scrypt
  • release/1.8
  • stable
  • feature/oxyde-pow
  • fix/security-vulnerabilities
  • feature/deb-arm-systemd
  • bugfix/invalid-rules-distance-sigqty
  • 1.7
  • 1.6
  • build
  • sync
  • test_prebuilt_nm
  • dependencies-caching
  • v1.8.1
  • v1.8.0
  • v1.8.0-rc1
  • v1.8.0-beta5
  • v1.8.0-beta4
  • v1.8.0-beta3
  • v1.8.0-beta2
  • v1.8.0-beta
  • v1.7.21
  • v1.7.20
  • v1.7.19
  • v1.7.18
  • v1.7.17
  • v1.6.32
  • v1.7.13
  • 2019.0407.1508
  • v1.7.16
  • 2019.0405.1251
  • 2019.0407.1406
  • v1.7.15
40 results

CHANGELOG.md

Blame
  • Forked from nodes / typescript / duniter
    Source project has a limited visibility.
    To find the state of this project's repository at the time of any of these versions, check out the tags.
    daemon 1.06 KiB
    #!/usr/bin/env node
    "use strict";
    
    var directory = require('../app/lib/directory');
    var path = require('path');
    
    var daemon = require("daemonize2").setup({
      main: "ucoind",
      name: directory.INSTANCE_NAME,
      pidfile: path.join(directory.INSTANCE_HOME, "app.pid")
    });
    
    switch (process.argv[2]) {
    
      case "start":
        daemon.start();
        break;
    
      case "stop":
        daemon.stop();
        break;
    
      case "restart":
        daemon = require("daemonize2").setup({
          main: "ucoind",
          name: directory.INSTANCE_NAME,
          pidfile: path.join(directory.INSTANCE_HOME, "app.pid"),
    
          // We must redefine the main argument to 'start' because uCoin will receive it as command argument and does not
          // know about 'restart' command.
          argv: process.argv.slice(2).map((arg, index) => index == 0 ? 'start' : arg)
        });
        daemon.stop(function(err) {
          err && console.error(err);
          daemon.start();
        });
        break;
    
      case "logs":
        console.log(directory.INSTANCE_HOMELOG_FILE);
        process.exit(0);
        break;
    
      default:
        console.log("Usage: [start|stop|restart]");
    }