Skip to content
Snippets Groups Projects
Select Git revision
  • b1ca24ce2c21aae8896d69805161caeb142ecaad
  • master default protected
  • 308-add-a-runtime-api-to-simulate-max-net-tx-cost-for-the-end-user-fees-refund
  • 270-parametrage-de-la-gtest
  • network/gdev-800 protected
  • cgeek/issue-297-cpu
  • gdev-800-tests
  • update-docker-compose-rpc-squid-names
  • fix-252
  • 1000i100-test
  • hugo/tmp-0.9.1
  • network/gdev-803 protected
  • hugo/endpoint-gossip
  • network/gdev-802 protected
  • hugo/distance-precompute
  • network/gdev-900 protected
  • tuxmain/anonymous-tx
  • debug/podman
  • hugo/195-doc
  • hugo/195-graphql-schema
  • hugo-tmp-dockerfile-cache
  • gdev-900-0.10.1 protected
  • gdev-900-0.10.0 protected
  • gdev-900-0.9.2 protected
  • gdev-800-0.8.0 protected
  • gdev-900-0.9.1 protected
  • gdev-900-0.9.0 protected
  • gdev-803 protected
  • gdev-802 protected
  • runtime-801 protected
  • gdev-800 protected
  • runtime-800-bis protected
  • runtime-800 protected
  • runtime-800-backup protected
  • runtime-701 protected
  • runtime-700 protected
  • runtime-600 protected
  • runtime-500 protected
  • v0.4.1 protected
  • runtime-401 protected
  • v0.4.0 protected
41 results

chain_spec.rs

Blame
  • server.ts 25.25 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 {IdentityService} from "./app/service/IdentityService"
    import {MembershipService} from "./app/service/MembershipService"
    import {PeeringService} from "./app/service/PeeringService"
    import {BlockchainService} from "./app/service/BlockchainService"
    import {TransactionService} from "./app/service/TransactionsService"
    import {ConfDTO} from "./app/lib/dto/ConfDTO"
    import {FileDAL, FileDALParams} from "./app/lib/dal/fileDAL"
    import * as stream from "stream"
    import {KeyGen, randomKey} from "./app/lib/common-libs/crypto/keyring"
    import {parsers} from "./app/lib/common-libs/parsers/index"
    import {Cloneable} from "./app/lib/dto/Cloneable"
    import {DuniterDocument, duniterDocument2str} from "./app/lib/common-libs/constants"
    import {GlobalFifoPromise} from "./app/service/GlobalFifoPromise"
    import {BlockchainContext} from "./app/lib/computation/BlockchainContext"
    import {BlockDTO} from "./app/lib/dto/BlockDTO"
    import {DBIdentity} from "./app/lib/dal/sqliteDAL/IdentityDAL"
    import {CertificationDTO} from "./app/lib/dto/CertificationDTO"
    import {MembershipDTO} from "./app/lib/dto/MembershipDTO"
    import {RevocationDTO} from "./app/lib/dto/RevocationDTO"
    import {TransactionDTO} from "./app/lib/dto/TransactionDTO"
    import {PeerDTO} from "./app/lib/dto/PeerDTO"
    import {OtherConstants} from "./app/lib/other_constants"
    import {WS2PCluster} from "./app/modules/ws2p/lib/WS2PCluster"
    import {DBBlock} from "./app/lib/db/DBBlock"
    import {ProxiesConf} from './app/lib/proxy';
    import {Directory, FileSystem} from "./app/lib/system/directory"
    import {DataErrors} from "./app/lib/common-libs/errors"
    import {DBPeer} from "./app/lib/db/DBPeer"
    import {Underscore} from "./app/lib/common-libs/underscore"
    import {SQLiteDriver} from "./app/lib/dal/drivers/SQLiteDriver"
    import {LevelUp} from "levelup";
    
    export interface HookableServer {
      generatorGetJoinData: (...args:any[]) => Promise<any>
      generatorComputeNewCerts: (...args:any[]) => Promise<any>
      generatorNewCertsToLinks: (...args:any[]) => Promise<any>
      onPluggedFSHook: (...args:any[]) => Promise<any>
      resetDataHook: (...args:any[]) => Promise<any>
      resetConfigHook: (...args:any[]) => Promise<any>
    }
    
    const path        = require('path');
    const archiver    = require('archiver');
    const unzip       = require('unzip2');
    const fs          = require('fs');
    const es          = require('event-stream');
    const daemonize   = require("daemonize2")
    const constants   = require('./app/lib/constants');
    const jsonpckg    = require('./package.json');
    const logger      = require('./app/lib/logger').NewLogger('server');
    
    export class Server extends stream.Duplex implements HookableServer {
    
      private paramsP:Promise<FileDALParams>
      private endpointsDefinitions:(()=>Promise<string>)[] = []
      private wrongEndpointsFilters:((endpoints:string[])=>Promise<string[]>)[] = []
      startService:()=>Promise<void>