Skip to content
Snippets Groups Projects
Select Git revision
  • feature/oxyde-pow
  • dev default protected
  • release/1.9.1 protected
  • pini-1.8-docker
  • pini-sync-onlypeers
  • duniter-v2s-issue-123-industrialize-releases
  • feature/build-aarch64-nodejs16
  • release/1.8 protected
  • pini-docker
  • ci_tags
  • fix/1448/1.8/txs_not_stored
  • feature/node-20
  • fix/1441/node_summary_with_storage
  • fix/1442/improve_bma_tx_history
  • feature/wotwizard-1.8
  • release/1.9 protected
  • 1.7 protected
  • feature/docker-set-latest protected
  • feature/fast-docker-build-1.8.4
  • fast-docker-build protected
  • feature/dump-distance
  • v1.8.7 protected
  • v1.8.7-rc4 protected
  • v1.8.7-rc3 protected
  • v1.8.7-rc2 protected
  • v1.8.7-rc1 protected
  • v1.8.6 protected
  • v1.7.23 protected
  • v1.8.5 protected
  • v1.8.4 protected
  • v1.8.3 protected
  • v1.8.2 protected
  • v1.8.1 protected
  • v1.8.0 protected
  • v1.8.0-rc1 protected
  • v1.8.0-beta5 protected
  • v1.8.0-beta4 protected
  • v1.8.0-beta3 protected
  • v1.8.0-beta2 protected
  • v1.8.0-beta protected
  • v1.7.21 protected
41 results

index.ts

Blame
  • index.ts 20.26 KiB
    // Source file from duniter: Crypto-currency software to manage libre currency such as Ğ1
    // Copyright (C) 2018  Cedric Moreau <cem.moreau@gmail.com>
    //
    // This program is free software: you can redistribute it and/or modify
    // it under the terms of the GNU Affero General Public License as published by
    // the Free Software Foundation, either version 3 of the License, or
    // (at your option) any later version.
    //
    // This program is distributed in the hope that it will be useful,
    // but WITHOUT ANY WARRANTY; without even the implied warranty of
    // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    // GNU Affero General Public License for more details.
    
    import {ExecuteCommand} from "./app/cli"
    import * as stream from "stream"
    import {Server} from "./server"
    import {ConfDTO} from "./app/lib/dto/ConfDTO"
    import {ProverDependency} from "./app/modules/prover/index"
    import {KeypairDependency} from "./app/modules/keypair/index"
    import {CrawlerDependency} from "./app/modules/crawler/index"
    import {BmaDependency} from "./app/modules/bma/index"
    import {WS2PDependency} from "./app/modules/ws2p/index"
    import {ProverConstants} from "./app/modules/prover/lib/constants"
    import {ProxiesConf} from './app/lib/proxy';
    import {RouterDependency} from "./app/modules/router"
    import {OtherConstants} from "./app/lib/other_constants"
    import {Directory} from "./app/lib/system/directory"
    import {Underscore} from "./app/lib/common-libs/underscore"
    import {CliCommand, DuniterDependency, DuniterModule} from "./app/modules/DuniterModule"
    import {ProgramOptions} from "./app/lib/common-libs/programOptions"
    import {ExitCodes} from "./app/lib/common-libs/exit-codes"
    
    const path = require('path');
    const constants = require('./app/lib/constants');
    const logger = require('./app/lib/logger').NewLogger('duniter');
    
    const configDependency    = require('./app/modules/config');
    const wizardDependency    = require('./app/modules/wizard');
    const resetDependency     = require('./app/modules/reset');
    const checkConfDependency = require('./app/modules/check-config');
    const exportBcDependency  = require('./app/modules/export-bc');
    const reapplyDependency   = require('./app/modules/reapply');
    const revertDependency    = require('./app/modules/revert');
    const daemonDependency    = require('./app/modules/daemon');
    const pSignalDependency   = require('./app/modules/peersignal');
    const pluginDependency    = require('./app/modules/plugin');
    const dumpDependency      = require('./app/modules/dump');
    
    let sigintListening = false
    
    // Trace errors
    process.on('unhandledRejection', (reason) => {
      logger.error('Unhandled rejection: ' + reason);
      logger.error(reason);
    });
    
    export class Stacks {
    
      static todoOnRunDone:() => any = () => process.exit()
    
      static async quickRun(...args:any[]) {
        const deps = Array.from(args).map((f, index) => {
          const canonicalPath = path.resolve(f)
          return {
            name: 'duniter-quick-module-' + index,
            required: require(canonicalPath)
          }
        })
        const stack = Stacks.autoStack(deps)
        let res