diff --git a/app/lib/blockchain/DuniterBlockchain.ts b/app/lib/blockchain/DuniterBlockchain.ts index 976d6c34ef91c69af913a7e42a1f6cf469c1c09a..fab8449fab9e987d860a8d75b0af37ba08ecf063 100644 --- a/app/lib/blockchain/DuniterBlockchain.ts +++ b/app/lib/blockchain/DuniterBlockchain.ts @@ -38,7 +38,8 @@ import {DBTx} from "../db/DBTx" import {Underscore} from "../common-libs/underscore" import {OtherConstants} from "../other_constants" import {MonitorExecutionTime} from "../debug/MonitorExecutionTime" -import {WoTBInstance} from "../wot" +import {Wot} from "dubp-wot-rs" +import { Directory } from "../system/directory" export class DuniterBlockchain { @@ -252,8 +253,13 @@ export class DuniterBlockchain { await this.deleteTransactions(block, dal); await dal.trimSandboxes(block); + // Saves the block (DAL) await dal.saveBlock(dbb); + + // Save wot file + let wotbFilepath = await Directory.getWotbFilePath(dal.rootPath); + dal.wotb.writeInFile(wotbFilepath); return dbb } @@ -289,7 +295,7 @@ export class DuniterBlockchain { } @MonitorExecutionTime() - static async createNewcomers(iindex:IindexEntry[], dal:FileDAL, logger:any, instance?: WoTBInstance) { + static async createNewcomers(iindex:IindexEntry[], dal:FileDAL, logger:any, instance?: Wot) { const wotb = instance || dal.wotb for (const i of iindex) { if (i.op == CommonConstants.IDX_CREATE) { @@ -304,7 +310,7 @@ export class DuniterBlockchain { } } - static async updateMembers(block:BlockDTO, dal:FileDAL, instance?: WoTBInstance) { + static async updateMembers(block:BlockDTO, dal:FileDAL, instance?: Wot) { const wotb = instance || dal.wotb // Joiners (come back) for (const inlineMS of block.joiners) { @@ -420,7 +426,9 @@ export class DuniterBlockchain { if (entry.op === CommonConstants.IDX_CREATE) { // Does not matter which one it really was, we pop the last X identities NewLogger().trace('removeNode') - dal.wotb.removeNode(); + if (dal.wotb.getWoTSize() > 0) { + dal.wotb.removeNode(); + } await dal.dividendDAL.deleteMember(entry.pub) } } diff --git a/app/lib/dal/fileDAL.ts b/app/lib/dal/fileDAL.ts index cb5fc4a3797fd95b312efed6e623beedfe01232e..ef4a60730f3f39ec84f3120c9623e08aeef39298 100644 --- a/app/lib/dal/fileDAL.ts +++ b/app/lib/dal/fileDAL.ts @@ -43,7 +43,7 @@ import {MetaDAL} from "./sqliteDAL/MetaDAL" import {DataErrors} from "../common-libs/errors" import {BasicRevocableIdentity, IdentityDTO} from "../dto/IdentityDTO" import {FileSystem} from "../system/directory" -import {WoTBInstance} from "../wot" +import {Wot} from "dubp-wot-rs" import {IIndexDAO} from "./indexDAL/abstract/IIndexDAO" import {BIndexDAO} from "./indexDAL/abstract/BIndexDAO" import {MIndexDAO} from "./indexDAL/abstract/MIndexDAO" @@ -91,7 +91,7 @@ export interface FileDALParams { home:string fs:FileSystem dbf:() => SQLiteDriver - wotbf:() => WoTBInstance + wotbf:() => Wot } export interface IndexBatch { @@ -106,7 +106,7 @@ export class FileDAL implements ServerDAO { rootPath:string fs: FileSystem sqliteDriver:SQLiteDriver - wotb:WoTBInstance + wotb:Wot profile:string // Simple file accessors @@ -1016,7 +1016,7 @@ export class FileDAL implements ServerDAO { return { HEAD, mindex, iindex, sindex, cindex, dividends }; } - async updateWotbLinks(cindex:CindexEntry[], instance?: WoTBInstance) { + async updateWotbLinks(cindex:CindexEntry[], instance?: Wot) { const wotb = instance || this.wotb for (const entry of cindex) { const from = await this.getWrittenIdtyByPubkeyForWotbID(entry.issuer); diff --git a/app/lib/indexer.ts b/app/lib/indexer.ts index bb6a18363c4bffbbbc4bcad9bb8c71fa81d6ecf1..e27a8a66a9c13ae4a0b626bce7408a378e5e6482 100644 --- a/app/lib/indexer.ts +++ b/app/lib/indexer.ts @@ -31,6 +31,7 @@ import {Underscore} from "./common-libs/underscore" import {DataErrors} from "./common-libs/errors" import {MonitorExecutionTime} from "./debug/MonitorExecutionTime" import {NewLogger} from "./logger" +import { wotMemCopy } from "dubp-wot-rs" const constants = CommonConstants @@ -2020,8 +2021,7 @@ export function reduceBy<T extends IndexEntry>(reducables: T[], properties: (key } async function checkPeopleAreNotOudistanced (pubkeys: string[], newLinks: { [k:string]: string[] }, newcomers: string[], conf: ConfDTO, dal:FileDAL) { - // let wotb = dal.wotb; - let wotb = dal.wotb.memCopy(); + let wotb = wotMemCopy(dal.wotb); let current = await dal.getCurrentBlockOrNull(); let membersCount = current ? current.membersCount : 0; // We add temporarily the newcomers to the WoT, to integrate their new links @@ -2054,10 +2054,6 @@ async function checkPeopleAreNotOudistanced (pubkeys: string[], newLinks: { [k:s break; } } - // Undo temp links/nodes - tempLinks.forEach((link) => wotb.removeLink(link.from, link.to)); - newcomers.forEach(() => wotb.removeNode()); - wotb.clear(); return error ? true : false; } diff --git a/app/lib/system/directory.ts b/app/lib/system/directory.ts index 74cd623e611e8853e6917199837a8e417f5f9593..28db38d9f8f786e83c85a1f1e76339beaef3d172 100644 --- a/app/lib/system/directory.ts +++ b/app/lib/system/directory.ts @@ -15,7 +15,7 @@ import * as path from "path" import * as fs from 'fs' import {SQLiteDriver} from "../dal/drivers/SQLiteDriver" import {CFSCore} from "../dal/fileDALs/CFSCore" -import {WoTBInstance, WoTBObject} from "../wot" +import {Wot} from "dubp-wot-rs" import {FileDALParams} from "../dal/fileDAL" import {cliprogram} from "../common-libs/programOptions" import {LevelDBDriver} from "../dal/drivers/LevelDBDriver" @@ -127,7 +127,10 @@ export const Directory = { INSTANCE_HOMELOG_FILE: getLogsPath(opts.mdb, opts.home), DUNITER_DB_NAME: 'duniter', LOKI_DB_DIR: 'loki', - WOTB_FILE: 'wotb.bin', + DATA_DIR: 'data', + OLD_WOTB_FILE: 'wotb.bin', + NEW_WOTB_FILE: 'wotb.bin.gz', + getHome: (profile:string|null = null, directory:string|null = null) => getHomePath(profile, directory), @@ -165,28 +168,44 @@ export const Directory = { return params; }, + getWotbFilePathSync: (home: string): string => { + let wotbFilePath = path.join(home, Directory.OLD_WOTB_FILE); + let existsFile = fs.existsSync(wotbFilePath) + if (!existsFile) { + let datas_dir = path.join(home, Directory.DATA_DIR); + wotbFilePath = path.join(datas_dir, Directory.NEW_WOTB_FILE); + } + return wotbFilePath; + }, + + getWotbFilePath: async (home: string): Promise<string> => { + let wotbFilePath = path.join(home, Directory.OLD_WOTB_FILE); + let existsFile = await qfs.exists(wotbFilePath) + if (!existsFile) { + let datas_dir = path.join(home, Directory.DATA_DIR); + wotbFilePath = path.join(datas_dir, Directory.NEW_WOTB_FILE); + } + return wotbFilePath; + }, + getHomeParams: async (isMemory:boolean, theHome:string): Promise<FileDALParams> => { const params = await Directory.getHomeFS(isMemory, theHome) const home = params.home; let dbf: () => SQLiteDriver - let wotbf: () => WoTBInstance + let wotbf: () => Wot if (isMemory) { // Memory DB dbf = () => new SQLiteDriver(':memory:'); - wotbf = () => WoTBObject.memoryInstance() + wotbf = () => new Wot(100) } else { // File DB const sqlitePath = path.join(home, Directory.DUNITER_DB_NAME + '.db'); dbf = () => new SQLiteDriver(sqlitePath); - const wotbFilePath = path.join(home, Directory.WOTB_FILE); - let existsFile = await qfs.exists(wotbFilePath) - if (!existsFile) { - fs.closeSync(fs.openSync(wotbFilePath, 'w')); - } - wotbf = () => WoTBObject.fileInstance(wotbFilePath) + let wotbFilePath = await Directory.getWotbFilePath(home); + wotbf = () => new Wot(wotbFilePath) } return { home: params.home, diff --git a/app/lib/wot.ts b/app/lib/wot.ts deleted file mode 100644 index bb23a251cd98f5daece9acf57ade404748ac0c2e..0000000000000000000000000000000000000000 --- a/app/lib/wot.ts +++ /dev/null @@ -1,196 +0,0 @@ -// 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. - -const wotb = require('wotb'); - -export interface WoTBInstance { - - readonly instanceID:number - readonly filePath:string - - /** - * Gets this instance ID. - * @returns {number} The instance technical ID. - */ - getId(): number - - /** - * Makes a memory copy of the WoT instance, and returns this new instance. - * @returns {WoTBInstance} The new memory instance. - */ - memCopy(): WoTBInstance - - /** - * Makes a file copy of the WoT instance, and returns this new instance. - * @returns {WoTBInstance} The new file instance. - */ - fileCopy(path: string): WoTBInstance - - /** - * Remove the WoT from the computer's memory. - */ - clear(): void - - /** - * Returns a dump of the WoT as a string. - * @returns {string} The dump. - */ - dumpWoT(): string - - /** - * Makes a dump of the WoT on standard output. - */ - showGraph(): void - - /** - * Removes any node and certification from the WoT. - */ - resetWoT(): void - - /** - * Gets the total number of nodes in the WoT, enabled or not. - * @returns {number} The total of nodes ever added to the WoT. - */ - getWoTSize(): number - - /** - * Add a node and returns its wotb_id. - * @returns {number} The new node identifier. - */ - addNode(): number - - /** - * Remove the lastly added node from the WoT, as well as the certifications it received. - */ - removeNode(): void - - /** - * Sets the maximum number of certifications a node can emit. - * @param {number} max The maximum number of emitted certifications. - */ - setMaxCert(max:number): void - - /** - * Gets the maximum number of certifications a node can emit in the WoT. - * @returns {number} The maximum's value. - */ - getMaxCert(): number - - /** - * Tells wether a node is enabled or not (= member or not). - * @param node Node's ID. - * @returns {boolean} True if enabled, false otherwise. - */ - isEnabled(node:number): boolean - - /** - * Enables or disables a node. - * @param enabled True to enable, False to disable. - * @param node The node to change. - */ - setEnabled(enabled:boolean, node:number): void - - /** - * Tells wether a link exists from a member to another. - * @param from The emitting node. - * @param to The receiving node. - * @returns {boolean} - */ - existsLink(from:number, to:number): boolean - - /** - * Adds a link from a node to another. - * @param from The emitting node. - * @param to The receiving node. - * @returns {boolean} True if the link was added, false otherwise (for example if it from exceeded the maximum quota). - */ - addLink(from:number, to:number): boolean - - /** - * Removes a link from a node to another. Returns the new number of links issued to the destination node. - * @param from Issuer. - * @param to Receiver. - * @returns {number} The new number of links reaching Receiver. - */ - removeLink(from:number, to:number): number - - /** - * Tells wether a node is outdistanced from the WoT. - * @param {number} node The node we want to test. - * @param {number} d_min The minimum number of both issued and received certifications to be considered a sentry. - * @param {number} k_max The maximum distance from the sentries to the node. - * @param {number} x_percent The percentage of sentries to reach to not be considered outdistanced. - * @returns {boolean} True is the node is outdistanced, false otherwise. - */ - isOutdistanced(node:number, d_min:number, k_max:number, x_percent:number): boolean - - /** - * Gives details about the distance of a node from the WoT. - * @param {number} node The node we want to test. - * @param {number} d_min The minimum number of both issued and received certifications to be considered a sentry. - * @param {number} k_max The maximum distance from the sentries to the node. - * @param {number} x_percent The percentage of sentries to reach to not be considered outdistanced. - * @returns {{nbSuccess: number; nbSentries: number; nbReached: number; isOutdistanced: boolean}} The number of reached sentries, the number of sentries, the number of reached members, the distance test. - */ - detailedDistance(node:number, d_min:number, k_max:number, x_percent:number): { - nbSuccess: number - nbSentries: number - nbReached: number - isOutdistanced: boolean - } - - /** - * Returns the sentries of the WoT. - * @param {number} d_min The minimum number of both issued and received certifications to be considered a sentry. - * @returns {number} An array of node ID (= array of integers). - */ - getSentries(d_min:number): number[] - - /** - * Returns the non-sentires of the WoT. - * @param {number} d_min The minimum number of both issued and received certifications to be considered a sentry. - * @returns {number} An array of node ID (= array of integers). - */ - getNonSentries(d_min:number): number[] - - /** - * Returns the non-members of the WoT. - * @returns {number} An array of node ID (= array of integers). - */ - getDisabled(): number[] - - /** - * Returns the list of existing paths from a node to another, using a maximum of k_max steps. - * @param {number} from The departure node. - * @param {number} to The arrival node. - * @param {number} k_max The maximum number of steps allowed for reaching the arrival node from departure node. - * @returns {number[][]} A list of paths. Example of paths from ID 5 to ID 189 using k_max 4 - * [0] = [5, 822, 333, 12, 189] - * [1] = [5, 29, 189] - * [2] = [5, 189] - */ - getPaths(from:number, to:number, k_max:number): number[][] -} - -export interface WoTBInterface { - fileInstance: (filepath:string) => any - memoryInstance: () => any - setVerbose: (verbose:boolean) => void -} - -export const WoTBObject:WoTBInterface = { - - fileInstance: (filepath:string) => wotb.newFileInstance(filepath), - memoryInstance: () => wotb.newMemoryInstance(), - setVerbose: wotb.setVerbose -} diff --git a/app/modules/crawler/lib/sync.ts b/app/modules/crawler/lib/sync.ts index 69f6f21b86547f8229385b59140341c4b41f97c5..8b3f56cc78e465bfc2c97bd9bb944f358c51ce71 100644 --- a/app/modules/crawler/lib/sync.ts +++ b/app/modules/crawler/lib/sync.ts @@ -165,7 +165,16 @@ export class Synchroniser extends stream.Duplex { this.watcher) const localIndexer = new LocalIndexStream() - const globalIndexer = new GlobalIndexStream(this.server.conf, this.server.dal, to, localNumber, cautious, this.syncStrategy, this.watcher) + const globalIndexer = new GlobalIndexStream( + this.server.conf, + this.server.dal, + to, + localNumber, + cautious, + this.syncStrategy, + this.watcher, + + ) await new Promise((res, rej) => { milestonesStream diff --git a/app/modules/crawler/lib/sync/v2/GlobalIndexStream.ts b/app/modules/crawler/lib/sync/v2/GlobalIndexStream.ts index 5a808dfecc5de8dbde5c3370e2e0fb5be7e55154..85b5c507ccbdc909a36de4f2b4f0cbd7f5e69961 100644 --- a/app/modules/crawler/lib/sync/v2/GlobalIndexStream.ts +++ b/app/modules/crawler/lib/sync/v2/GlobalIndexStream.ts @@ -15,7 +15,7 @@ import {DuniterBlockchain, requiredBindexSizeForTail} from "../../../../../lib/b import {BlockDTO} from "../../../../../lib/dto/BlockDTO" import {Underscore} from "../../../../../lib/common-libs/underscore" import {MonitorExecutionTime} from "../../../../../lib/debug/MonitorExecutionTime" -import {WoTBInstance, WoTBObject} from "../../../../../lib/wot" +import {Wot} from "dubp-wot-rs" import {NewLogger} from "../../../../../lib/logger" import {CommonConstants} from "../../../../../lib/common-libs/constants" import {DBBlock} from "../../../../../lib/db/DBBlock" @@ -25,6 +25,7 @@ import {DBHead} from "../../../../../lib/db/DBHead" import {Watcher} from "../Watcher" import {DataErrors} from "../../../../../lib/common-libs/errors" import {ProtocolIndexesStream} from "./ProtocolIndexesStream" +import { Directory } from '../../../../../lib/system/directory' const constants = require('../../constants') @@ -71,7 +72,9 @@ export class GlobalIndexStream extends Duplex { private sync_currConf: CurrencyConfDTO; - private wotbMem: WoTBInstance = WoTBObject.memoryInstance() + private wotbMem: Wot = new Wot(100); + + private wotbFilePath: string; private memSyncInjection: Promise<void> @@ -91,6 +94,7 @@ export class GlobalIndexStream extends Duplex { ) { super({ objectMode: true }) this.wotbMem = dal.wotb + this.wotbFilePath = Directory.getWotbFilePathSync(dal.rootPath); const nbBlocksToDownload = Math.max(0, to - localNumber) this.numberOfChunksToDownload = Math.ceil(nbBlocksToDownload / syncStrategy.chunkSize) @@ -426,7 +430,7 @@ export class GlobalIndexStream extends Duplex { NewLogger().info('Mem2File [wotb]...') // Persist the memory wotb - this.wotbMem.fileCopy(this.dal.wotb.filePath) + this.wotbMem.writeInFile(this.wotbFilePath) const that = this // Disabled for now diff --git a/app/modules/dump.ts b/app/modules/dump.ts index 295b93b5b4fbd53afaa827a4b4115e9e4a4760a2..5b3d4cfe4a2ac859a2be69ba70c773f354c54b13 100644 --- a/app/modules/dump.ts +++ b/app/modules/dump.ts @@ -374,7 +374,7 @@ async function dumpHistory(server: Server, pub: string) { } async function dumpWot(server: Server) { - const data = server.dal.wotb.dumpWoT() + const data = server.dal.wotb.dump() console.log(data) await newResolveTimeoutPromise(1000, null) } diff --git a/app/service/BlockchainService.ts b/app/service/BlockchainService.ts index 5bfaf36ec1e06b90af48d1e3bf24fb4d21c36e36..7b164f69c58a44ae821e295b7ad9d6d45a2e79ef 100644 --- a/app/service/BlockchainService.ts +++ b/app/service/BlockchainService.ts @@ -11,7 +11,6 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. -import {IdentityForRequirements} from './BlockchainService'; import {Server} from "../../server" import {GlobalFifoPromise} from "./GlobalFifoPromise" import {BlockchainContext} from "../lib/computation/BlockchainContext" diff --git a/package.json b/package.json index ef6820e9253a2d88be44775d0f0aaedd9e4083ca..e29d139ef1dc809085029514af2ea482b44458b5 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,7 @@ "cors": "2.8.2", "daemonize2": "0.4.2", "ddos": "0.1.16", + "dubp-wot-rs": "0.6.0", "errorhandler": "1.5.0", "event-stream": "3.3.4", "express": "4.15.2", @@ -105,7 +106,6 @@ "unzip": "0.1.11", "unzip2": "0.2.5", "winston": "2.3.1", - "wotb": "0.6.6", "ws": "1.1.5" }, "devDependencies": { diff --git a/release/arch/linux/build-lin.sh b/release/arch/linux/build-lin.sh index e62e05d3ae10064404d8ead7fec3e22fff40ff6e..84ef27abd0eb4773936e62c54ab46d80fce94648 100644 --- a/release/arch/linux/build-lin.sh +++ b/release/arch/linux/build-lin.sh @@ -197,14 +197,7 @@ cp -r "${RELEASES}/duniter" "${RELEASES}/server_" || exit 1 echo "${NW_RELEASE}" -# FIX: bug of nw.js, we need to patch first. -# TODO: remove this patch once a correct version of Nw.js is out (NodeJS 8 or 9 if the above modules are compliant) -cd "${RELEASES}/desktop_/node_modules/wotb" -node-pre-gyp --runtime=node-webkit --target=$NW_VERSION configure \ - || echo "This failure is expected" - cd "${RELEASES}/desktop_/node_modules/" -nw_compile wotb nw_copy nw_compile naclb nw_copy nw_compile leveldown nw_copy "build/Release/" nw_compile sqlite3 nw_copy_node diff --git a/server.ts b/server.ts index 598cdf76050ff6488ce72a5af8b7850652af0357..91b49cb944eb32ea6b20e3dc75215566239c3525 100644 --- a/server.ts +++ b/server.ts @@ -387,7 +387,7 @@ export class Server extends stream.Duplex implements HookableServer { async resetAll(done:any = null) { await this.resetDataHook() await this.resetConfigHook() - const files = ['stats', 'cores', 'current', Directory.DUNITER_DB_NAME, Directory.DUNITER_DB_NAME + '.db', Directory.DUNITER_DB_NAME + '.log', Directory.WOTB_FILE, 'export.zip', 'import.zip', 'conf'] + const files = ['stats', 'cores', 'current', Directory.DUNITER_DB_NAME, Directory.DUNITER_DB_NAME + '.db', Directory.DUNITER_DB_NAME + '.log', Directory.OLD_WOTB_FILE, 'export.zip', 'import.zip', 'conf'] .concat(Directory.DATA_FILES) .concat(Directory.WW_FILES) const dirs = ['archives', 'loki', 'blocks', 'blockchain', 'ud_history', 'branches', 'certs', 'txs', 'cores', 'sources', 'links', 'ms', 'identities', 'peers', 'indicators', 'leveldb'] @@ -397,7 +397,7 @@ export class Server extends stream.Duplex implements HookableServer { async resetData(done:any = null) { await this.resetDataHook() - const files = ['stats', 'cores', 'current', Directory.DUNITER_DB_NAME, Directory.DUNITER_DB_NAME + '.db', Directory.DUNITER_DB_NAME + '.log', Directory.WOTB_FILE] + const files = ['stats', 'cores', 'current', Directory.DUNITER_DB_NAME, Directory.DUNITER_DB_NAME + '.db', Directory.DUNITER_DB_NAME + '.log', Directory.OLD_WOTB_FILE] .concat(Directory.DATA_FILES) .concat(Directory.WW_FILES) const dirs = ['archives', 'loki', 'blocks', 'ud_history', 'branches', 'certs', 'txs', 'cores', 'sources', 'links', 'ms', 'identities', 'peers', 'indicators', 'leveldb'] diff --git a/test/integration/certification/certification-expiry.ts b/test/integration/certification/certification-expiry.ts index 3c24878b4b8308177d0e63fd146882d97613022c..98830f4dc9071a9f4f7415ae1db93490e68ca7ad 100644 --- a/test/integration/certification/certification-expiry.ts +++ b/test/integration/certification/certification-expiry.ts @@ -40,10 +40,11 @@ describe('Certification expiry + trimming', () => writeBasicTestWithConfAnd2User await s1.commit({ time: now, version: 10 }) await s1.commit({ time: now }) // Circular WoT - assertEqual(s1._server.dal.wotb.dumpWoT(), `[M] [E] [R] [I] -> Links[maxCert = 40] -[0] [1] [1] [1] -> 2 | -[1] [1] [1] [1] -> 0 | -[2] [1] [1] [1] -> 1 | + assertEqual(s1._server.dal.wotb.dump(), `max_links=40 +nodes_count=3 +000: [2] +001: [0] +002: [1] `) }) @@ -56,10 +57,11 @@ describe('Certification expiry + trimming', () => writeBasicTestWithConfAnd2User await tac.cert(cat) await s1.commit({ time: now + 8 }) // Wot adds a certificat for tac to cat - assertEqual(s1._server.dal.wotb.dumpWoT(), `[M] [E] [R] [I] -> Links[maxCert = 40] -[0] [1] [2] [1] -> 2 | 1 | -[1] [1] [1] [2] -> 0 | -[2] [1] [1] [1] -> 1 | + assertEqual(s1._server.dal.wotb.dump(), `max_links=40 +nodes_count=3 +000: [1, 2] +001: [0] +002: [1] `) }) @@ -70,30 +72,33 @@ describe('Certification expiry + trimming', () => writeBasicTestWithConfAnd2User await s1.commit({ time: now + 9 }) // <-- it is now t+9 await toc.cert(tac) await s1.commit({ time: now + 9 }) - assertEqual(s1._server.dal.wotb.dumpWoT(), `[M] [E] [R] [I] -> Links[maxCert = 40] -[0] [1] [2] [1] -> 2 | 1 | -[1] [1] [2] [2] -> 0 | 2 | -[2] [1] [1] [2] -> 1 | + assertEqual(s1._server.dal.wotb.dump(), `max_links=40 +nodes_count=3 +000: [1, 2] +001: [0, 2] +002: [1] `) }) test('at t+10, only cat -> tac cert should be removed (it has not been replayed)', async (s1) => { await s1.commit({ time: now + 10 }) // Change `Time` await s1.commit({ time: now + 10 }) // <-- it is now t+10 - assertEqual(s1._server.dal.wotb.dumpWoT(), `[M] [E] [R] [I] -> Links[maxCert = 40] -[0] [1] [2] [0] -> 2 | 1 | -[1] [1] [1] [2] -> 2 | -[2] [1] [1] [2] -> 1 | + assertEqual(s1._server.dal.wotb.dump(), `max_links=40 +nodes_count=3 +000: [1, 2] +001: [2] +002: [1] `) }) test('at t+14, tac -> toc cert should be removed', async (s1) => { await s1.commit({ time: now + 14 }) // Change `Time` await s1.commit({ time: now + 14 }) // Change `MedianTime` - assertEqual(s1._server.dal.wotb.dumpWoT(), `[M] [E] [R] [I] -> Links[maxCert = 40] -[0] [1] [2] [0] -> 2 | 1 | -[1] [1] [1] [1] -> 2 | -[2] [1] [0] [2] -> + assertEqual(s1._server.dal.wotb.dump(), `max_links=40 +nodes_count=3 +000: [1, 2] +001: [2] +002: [] `) }) @@ -101,10 +106,11 @@ describe('Certification expiry + trimming', () => writeBasicTestWithConfAnd2User await s1._server.dal.cindexDAL.trimExpiredCerts(16) // <-- **THIS** is what was triggering the core dump await s1.commit({ time: now + 16 }) // Change `Time` await s1.commit({ time: now + 16 }) // Change `MedianTime` - assertEqual(s1._server.dal.wotb.dumpWoT(), `[M] [E] [R] [I] -> Links[maxCert = 40] -[0] [1] [1] [0] -> 2 | -[1] [1] [1] [0] -> 2 | -[2] [0] [0] [2] -> + assertEqual(s1._server.dal.wotb.dump(), `max_links=40 +nodes_count=3 +000: [2] +001: [2] +002: disabled [] `) }) diff --git a/test/integration/certification/certification-replay.ts b/test/integration/certification/certification-replay.ts index f67a69358ddbc6d274dd8123ff8a97a16060690a..69bbce26e007da01543d3a5acf2cc57da0db27fd 100644 --- a/test/integration/certification/certification-replay.ts +++ b/test/integration/certification/certification-replay.ts @@ -73,9 +73,10 @@ describe('Certification replay', () => writeBasicTestWithConfAnd2Users({ }) test('should correctly update wotb: current state', async (s1) => { - assertEqual(s1._server.dal.wotb.dumpWoT(), `[M] [E] [R] [I] -> Links[maxCert = 40] -[0] [1] [1] [1] -> 1 | -[1] [1] [1] [1] -> 0 | + assertEqual(s1._server.dal.wotb.dump(), `max_links=40 +nodes_count=2 +000: [1] +001: [0] `) }) @@ -87,10 +88,11 @@ describe('Certification replay', () => writeBasicTestWithConfAnd2Users({ await tac.cert(toc) await toc.join() await s1.commit({ time: now + 6 }) - assertEqual(s1._server.dal.wotb.dumpWoT(), `[M] [E] [R] [I] -> Links[maxCert = 40] -[0] [1] [1] [2] -> 1 | -[1] [1] [1] [2] -> 0 | -[2] [1] [2] [0] -> 0 | 1 | + assertEqual(s1._server.dal.wotb.dump(), `max_links=40 +nodes_count=3 +000: [1] +001: [0] +002: [0, 1] `) }) @@ -98,19 +100,21 @@ describe('Certification replay', () => writeBasicTestWithConfAnd2Users({ await s1.commit({ time: now + 6 }) await toc.cert(cat) await s1.commit({ time: now + 12 }) - assertEqual(s1._server.dal.wotb.dumpWoT(), `[M] [E] [R] [I] -> Links[maxCert = 40] -[0] [1] [2] [2] -> 1 | 2 | -[1] [1] [1] [2] -> 0 | -[2] [1] [2] [1] -> 0 | 1 | + assertEqual(s1._server.dal.wotb.dump(), `max_links=40 +nodes_count=3 +000: [1, 2] +001: [0] +002: [0, 1] `) }) test('should correctly update wotb: cat loses 1 cert', async (s1) => { await s1.commit({ time: now + 12 }) - assertEqual(s1._server.dal.wotb.dumpWoT(), `[M] [E] [R] [I] -> Links[maxCert = 40] -[0] [1] [1] [2] -> 2 | -[1] [1] [1] [1] -> 0 | -[2] [1] [2] [1] -> 0 | 1 | + assertEqual(s1._server.dal.wotb.dump(), `max_links=40 +nodes_count=3 +000: [2] +001: [0] +002: [0, 1] `) }) @@ -118,10 +122,11 @@ describe('Certification replay', () => writeBasicTestWithConfAnd2Users({ await s1.commit({ time: now + 14 }) // Change `Time` await s1.commit({ time: now + 14 }) // Change `MedianTime` await s1.commit({ time: now + 14 }) // Kick - assertEqual(s1._server.dal.wotb.dumpWoT(), `[M] [E] [R] [I] -> Links[maxCert = 40] -[0] [1] [1] [1] -> 2 | -[1] [0] [0] [1] -> -[2] [1] [2] [1] -> 0 | 1 | + assertEqual(s1._server.dal.wotb.dump(), `max_links=40 +nodes_count=3 +000: [2] +001: disabled [] +002: [0, 1] `) }) diff --git a/test/integration/wot/wotb.ts b/test/integration/wot/wotb.ts index e72ed7cfcfe5053fe967acee993856b97ec03398..74fb35f9622af88ba766fa972d2edd72c36becb8 100644 --- a/test/integration/wot/wotb.ts +++ b/test/integration/wot/wotb.ts @@ -14,7 +14,7 @@ import {TestUser} from "../tools/TestUser" import {NewTestingServer, TestingServer} from "../tools/toolbox" import {BmaDependency} from "../../../app/modules/bma/index" -import {WoTBInstance} from "../../../app/lib/wot" +import {Wot, wotMemCopy} from "dubp-wot-rs" import {Underscore} from "../../../app/lib/common-libs/underscore" import {shutDownEngine} from "../tools/shutdown-engine" import {CommonConstants} from "../../../app/lib/common-libs/constants" @@ -55,7 +55,7 @@ describe("WOTB module", () => { describe("Server 1", () => { - let wotb:WoTBInstance + let wotb:Wot before(async () => { @@ -149,9 +149,17 @@ describe("WOTB module", () => { wotb.existsLink(0, 1).should.equal(true); wotb.existsLink(1, 0).should.equal(true); wotb.existsLink(1, 1).should.equal(false); - wotb.existsLink(1, 2).should.equal(false); + try { + wotb.existsLink(1, 2) + } catch (e) { + should.equal("unknown target", e.message) + } wotb.existsLink(0, 0).should.equal(false); - wotb.existsLink(0, 2).should.equal(false); + try { + wotb.existsLink(0, 2) + } catch (e) { + should.equal("unknown target", e.message) + } wotb.isOutdistanced(0, FROM_1_LINK_SENTRIES, MAX_DISTANCE_1, _100_PERCENT).should.equal(__OK__); }); @@ -179,7 +187,7 @@ describe("WOTB module", () => { describe("Server 2", () => { - let wotb:WoTBInstance + let wotb:Wot before(async () => { /** @@ -264,7 +272,7 @@ describe("WOTB module", () => { describe("Server 3", () => { - let wotb:WoTBInstance + let wotb:Wot before(async () => { await s3.initWithDAL().then(BmaDependency.duniter.methods.bma).then((bmapi) => bmapi.openConnections()); @@ -298,8 +306,16 @@ describe("WOTB module", () => { wotb.existsLink(0, 1).should.equal(true); wotb.existsLink(1, 0).should.equal(true); // tic3 <==> toc3 - wotb.existsLink(1, 2).should.equal(false); - wotb.existsLink(2, 1).should.equal(false); + try { + wotb.existsLink(1, 2) + } catch (e) { + should.equal("unknown target", e.message) + } + try { + wotb.existsLink(2, 1) + } catch (e) { + should.equal("unknown source", e.message) + } }); it('third & fourth commits: toc should have joined', async () => { @@ -433,22 +449,22 @@ describe("WOTB module", () => { wotb.existsLink(0, 1).should.equal(true); wotb.existsLink(1, 0).should.equal(true); // tic3 <==> toc3 - wotb.existsLink(1, 2).should.equal(false); - wotb.existsLink(2, 1).should.equal(false); + try { + wotb.existsLink(1, 2) + } catch (e) { + should.equal("unknown target", e.message) + } + try { + wotb.existsLink(2, 1) + } catch (e) { + should.equal("unknown source", e.message) + } }); it('revert first & second commits', async () => { await s3.revert(); await s3.revert(); - wotb.isEnabled(0).should.equal(false); - wotb.isEnabled(1).should.equal(false); - wotb.isEnabled(2).should.equal(false); - // cat3 <==> tic3 - wotb.existsLink(0, 1).should.equal(false); - wotb.existsLink(1, 0).should.equal(false); - // tic3 <==> toc3 - wotb.existsLink(1, 2).should.equal(false); - wotb.existsLink(2, 1).should.equal(false); + should.equal(wotb.getWoTSize(), 0) }); after(() => { diff --git a/yarn.lock b/yarn.lock index f926b33e5e011f6a525e8bd25da91b2ed17fb791..fe30842956a31207d2eca821665a2393637a30d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -213,6 +213,13 @@ amdefine@>=0.0.4: resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= +ansi-escape-sequences@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-escape-sequences/-/ansi-escape-sequences-4.1.0.tgz#2483c8773f50dd9174dd9557e92b1718f1816097" + integrity sha512-dzW9kHxH011uBsidTXd14JXgzye/YLb2LzeKZ4bsgl/Knwx8AtbSFkkGxagdNOoh0DlqHCmfiEjWKBaqjOanVw== + dependencies: + array-back "^3.0.1" + ansi-escapes@^1.1.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" @@ -243,7 +250,7 @@ ansi-styles@^2.2.1: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= -ansi-styles@^3.2.1: +ansi-styles@^3.1.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== @@ -255,11 +262,6 @@ ansi-styles@~1.0.0: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.0.0.tgz#cb102df1c56f5123eab8b67cd7b98027a0279178" integrity sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg= -ansi@^0.3.0, ansi@~0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/ansi/-/ansi-0.3.1.tgz#0c42d4fb17160d5a9af1e484bace1c66922c1b21" - integrity sha1-DELU+xcWDVqa8eSEus4cZpIsGyE= - append-transform@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-0.4.0.tgz#d76ebf8ca94d276e247a36bad44a4b74ab611991" @@ -349,6 +351,25 @@ arr-union@^3.1.0: resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= +array-back@^1.0.3, array-back@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-1.0.4.tgz#644ba7f095f7ffcf7c43b5f0dc39d3c1f03c063b" + integrity sha1-ZEun8JX3/898Q7Xw3DnTwfA8Bjs= + dependencies: + typical "^2.6.0" + +array-back@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-2.0.0.tgz#6877471d51ecc9c9bfa6136fb6c7d5fe69748022" + integrity sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw== + dependencies: + typical "^2.6.1" + +array-back@^3.0.1: + version "3.1.0" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-3.1.0.tgz#b8859d7a508871c9a7b2cf42f99428f65e96bfb0" + integrity sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q== + array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" @@ -751,6 +772,11 @@ buffers@~0.1.1: resolved "https://registry.yarnpkg.com/buffers/-/buffers-0.1.1.tgz#b24579c3bed4d6d396aeee6d9a8ae7f5482ab7bb" integrity sha1-skV5w77U1tOWru5tmorn9Ugqt7s= +builtins@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" + integrity sha1-y5T662HIaWRR2zZTThQi+U8K7og= + busboy@*: version "0.3.1" resolved "https://registry.yarnpkg.com/busboy/-/busboy-0.3.1.tgz#170899274c5bf38aae27d5c62b71268cd585fd1b" @@ -850,6 +876,15 @@ chalk@~0.4.0: has-color "~0.1.0" strip-ansi "~0.1.0" +chalk@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.1.0.tgz#ac5becf14fa21b99c6c92ca7a7d7cfd5b17e743e" + integrity sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ== + dependencies: + ansi-styles "^3.1.0" + escape-string-regexp "^1.0.5" + supports-color "^4.0.0" + chardet@^0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" @@ -993,6 +1028,32 @@ combined-stream@~0.0.4: dependencies: delayed-stream "0.0.5" +command-line-args@^4.0.2: + version "4.0.7" + resolved "https://registry.yarnpkg.com/command-line-args/-/command-line-args-4.0.7.tgz#f8d1916ecb90e9e121eda6428e41300bfb64cc46" + integrity sha512-aUdPvQRAyBvQd2n7jXcsMDz68ckBJELXNzBybCHOibUWEg0mWTnaYCSRU8h9R+aNRSvDihJtssSRCiDRpLaezA== + dependencies: + array-back "^2.0.0" + find-replace "^1.0.3" + typical "^2.6.1" + +command-line-commands@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/command-line-commands/-/command-line-commands-2.0.1.tgz#c58aa13dc78c06038ed67077e57ad09a6f858f46" + integrity sha512-m8c2p1DrNd2ruIAggxd/y6DgygQayf6r8RHwchhXryaLF8I6koYjoYroVP+emeROE9DXN5b9sP1Gh+WtvTTdtQ== + dependencies: + array-back "^2.0.0" + +command-line-usage@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/command-line-usage/-/command-line-usage-4.1.0.tgz#a6b3b2e2703b4dcf8bd46ae19e118a9a52972882" + integrity sha512-MxS8Ad995KpdAC0Jopo/ovGIroV/m0KHwzKfXxKag6FHOkGsH8/lv5yjgablcRxCJJC0oJeUMuO/gmaq+Wq46g== + dependencies: + ansi-escape-sequences "^4.0.0" + array-back "^2.0.0" + table-layout "^0.4.2" + typical "^2.6.1" + commander@2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" @@ -1269,7 +1330,7 @@ decompress-response@^3.3.0: dependencies: mimic-response "^1.0.0" -deep-extend@^0.6.0: +deep-extend@^0.6.0, deep-extend@~0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== @@ -1390,6 +1451,13 @@ doctrine@^2.1.0: dependencies: esutils "^2.0.2" +dubp-wot-rs@0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/dubp-wot-rs/-/dubp-wot-rs-0.6.0.tgz#42ecaae435840a77bfc2cf023c4a8d4f7b22924d" + integrity sha512-5imOlrpD15zAVCoBPhNF2nQPA/vcr90Rs/0SZ71SgdNtQbMFOWCkcr3LQecazsaqLzJkBEUkFyABvQF4AI1MJw== + dependencies: + neon-cli "^0.4.0" + duplexer@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" @@ -2001,6 +2069,14 @@ find-cache-dir@^0.1.1: mkdirp "^0.5.1" pkg-dir "^1.0.0" +find-replace@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-1.0.3.tgz#b88e7364d2d9c959559f388c66670d6130441fa0" + integrity sha1-uI5zZNLZyVlVnziMZmcNYTBEH6A= + dependencies: + array-back "^1.0.4" + test-value "^2.1.0" + find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" @@ -2179,17 +2255,6 @@ functional-red-black-tree@^1.0.1, functional-red-black-tree@~1.0.1: resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= -gauge@~1.2.5: - version "1.2.7" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-1.2.7.tgz#e9cec5483d3d4ee0ef44b60a7d99e4935e136d93" - integrity sha1-6c7FSD09TuDvRLYKfZnkk14TbZM= - dependencies: - ansi "^0.3.0" - has-unicode "^2.0.0" - lodash.pad "^4.1.0" - lodash.padend "^4.1.0" - lodash.padstart "^4.1.0" - gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" @@ -2226,6 +2291,13 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" +git-config@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/git-config/-/git-config-0.0.7.tgz#a9c8a3ef07a776c3d72261356d8b727b62202b28" + integrity sha1-qcij7wendsPXImE1bYtye2IgKyg= + dependencies: + iniparser "~1.0.5" + github-from-package@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce" @@ -2330,7 +2402,7 @@ growl@1.9.2: resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" integrity sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8= -handlebars@^4.0.3, handlebars@^4.0.6: +handlebars@^4.0.3, handlebars@^4.0.6, handlebars@^4.1.0: version "4.7.3" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.3.tgz#8ece2797826886cf8082d1726ff21d2a022550ee" integrity sha512-SRGwSYuNfx8DwHD/6InAPzD6RgeruWLT+B8e8a7gGs8FWgHzlExpTFMEq2IA6QpAfOClpKHy6+8IqTjeBCu6Kg== @@ -2384,6 +2456,11 @@ has-flag@^1.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" integrity sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo= +has-flag@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" + integrity sha1-6CB68cx7MNRGzHC3NLXovhj4jVE= + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -2578,6 +2655,11 @@ ini@~1.3.0: resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== +iniparser@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/iniparser/-/iniparser-1.0.5.tgz#836d6befe6dfbfcee0bccf1cf9f2acc7027f783d" + integrity sha1-g21r7+bfv87gvM8c+fKsxwJ/eD0= + inquirer@3.0.6: version "3.0.6" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.0.6.tgz#e04aaa9d05b7a3cb9b0f407d04375f0447190347" @@ -3238,21 +3320,11 @@ lodash.keys@^3.0.0: lodash.isarguments "^3.0.0" lodash.isarray "^3.0.0" -lodash.pad@^4.1.0: - version "4.5.1" - resolved "https://registry.yarnpkg.com/lodash.pad/-/lodash.pad-4.5.1.tgz#4330949a833a7c8da22cc20f6a26c4d59debba70" - integrity sha1-QzCUmoM6fI2iLMIPaibE1Z3runA= - -lodash.padend@^4.1.0: +lodash.padend@^4.6.1: version "4.6.1" resolved "https://registry.yarnpkg.com/lodash.padend/-/lodash.padend-4.6.1.tgz#53ccba047d06e158d311f45da625f4e49e6f166e" integrity sha1-U8y6BH0G4VjTEfRdpiX05J5vFm4= -lodash.padstart@^4.1.0: - version "4.6.1" - resolved "https://registry.yarnpkg.com/lodash.padstart/-/lodash.padstart-4.6.1.tgz#d2e3eebff0d9d39ad50f5cbd1b52a7bce6bb611b" - integrity sha1-0uPuv/DZ05rVD1y9G1KnvOa7YRs= - lodash@^3.3.1: version "3.10.1" resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" @@ -3698,6 +3770,28 @@ neo-async@^2.6.0: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== +neon-cli@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/neon-cli/-/neon-cli-0.4.0.tgz#d89e0a55b8db577324af70470e2b4e67157205f6" + integrity sha512-66HhHb8rk+zHSG64CI6jhyOQqpibBAald8ObdQPCjXcCjzSEVnkQHutUE8dyNlHRNT7xLfrZGkDbtwrYh2p+6w== + dependencies: + chalk "~2.1.0" + command-line-args "^4.0.2" + command-line-commands "^2.0.0" + command-line-usage "^4.0.0" + git-config "0.0.7" + handlebars "^4.1.0" + inquirer "^3.0.6" + mkdirp "^0.5.1" + quickly-copy-file "^1.0.0" + rimraf "^2.6.1" + rsvp "^4.6.1" + semver "^5.1.0" + toml "^2.3.0" + ts-typed-json "^0.2.2" + validate-npm-package-license "^3.0.1" + validate-npm-package-name "^3.0.0" + next-tick@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" @@ -3710,21 +3804,6 @@ node-abi@^2.7.0: dependencies: semver "^5.4.1" -node-pre-gyp@0.6.23: - version "0.6.23" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.23.tgz#155bf3683abcfcde008aedab1248891a0773db95" - integrity sha1-FVvzaDq8/N4Aiu2rEkiJGgdz25U= - dependencies: - mkdirp "~0.5.0" - nopt "~3.0.1" - npmlog "~2.0.0" - rc "~1.1.0" - request "2.x" - rimraf "~2.5.0" - semver "~5.1.0" - tar "~2.2.0" - tar-pack "~3.1.0" - node-pre-gyp@0.6.33: version "0.6.33" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.33.tgz#640ac55198f6a925972e0c16c4ac26a034d5ecc9" @@ -3810,7 +3889,7 @@ nopt@^4.0.1: abbrev "1" osenv "^0.1.4" -nopt@~3.0.1, nopt@~3.0.6: +nopt@~3.0.6: version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" integrity sha1-xkZdvwirzU2zWTF/eaxopkayj/k= @@ -3864,15 +3943,6 @@ npmlog@^4.0.1, npmlog@^4.0.2: gauge "~2.7.3" set-blocking "~2.0.0" -npmlog@~2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-2.0.4.tgz#98b52530f2514ca90d09ec5b22c8846722375692" - integrity sha1-mLUlMPJRTKkNCexbIsiEZyI3VpI= - dependencies: - ansi "~0.3.1" - are-we-there-yet "~1.1.2" - gauge "~1.2.5" - number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" @@ -4380,6 +4450,13 @@ querablep@^0.1.0: resolved "https://registry.yarnpkg.com/querablep/-/querablep-0.1.0.tgz#b2cd2b3e75fcd45d5dd7ade4c1811ab547849a84" integrity sha1-ss0rPnX81F1d163kwYEatUeEmoQ= +quickly-copy-file@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/quickly-copy-file/-/quickly-copy-file-1.0.0.tgz#9f8ff066230510ee7422b0121472b093a8690859" + integrity sha1-n4/wZiMFEO50IrASFHKwk6hpCFk= + dependencies: + mkdirp "~0.5.0" + ramda@^0.22.1: version "0.22.1" resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.22.1.tgz#031da0c3df417c5b33c96234757eb37033f36a0e" @@ -4418,7 +4495,7 @@ rc@^1.1.7, rc@^1.2.7: minimist "^1.2.0" strip-json-comments "~2.0.1" -rc@~1.1.0, rc@~1.1.6: +rc@~1.1.6: version "1.1.7" resolved "https://registry.yarnpkg.com/rc/-/rc-1.1.7.tgz#c5ea564bb07aff9fd3a5b32e906c1d3a65940fea" integrity sha1-xepWS7B6/5/TpbMukGwdOmWUD+o= @@ -4505,6 +4582,11 @@ rechoir@^0.6.2: dependencies: resolve "^1.1.6" +reduce-flatten@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/reduce-flatten/-/reduce-flatten-1.0.1.tgz#258c78efd153ddf93cb561237f61184f3696e327" + integrity sha1-JYx479FT3fk8tWEjf2EYTzaW4yc= + regenerator-runtime@^0.11.0: version "0.11.1" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" @@ -4611,7 +4693,7 @@ request@2.81.0: tunnel-agent "^0.6.0" uuid "^3.0.0" -request@2.x, request@^2.79.0, request@^2.81.0, request@^2.87.0: +request@^2.79.0, request@^2.81.0, request@^2.87.0: version "2.88.0" resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== @@ -4707,13 +4789,23 @@ rimraf@2, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@~2. dependencies: glob "^7.1.3" -rimraf@~2.5.0, rimraf@~2.5.1, rimraf@~2.5.4: +rimraf@~2.5.1, rimraf@~2.5.4: version "2.5.4" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04" integrity sha1-loAAk8vxoMhr2VtGJUZ1NcKd+gQ= dependencies: glob "^7.0.5" +rsvp@^3.5.0: + version "3.6.2" + resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-3.6.2.tgz#2e96491599a96cde1b515d5674a8f7a91452926a" + integrity sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw== + +rsvp@^4.6.1: + version "4.8.5" + resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" + integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== + run-async@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" @@ -4775,10 +4867,10 @@ seedrandom@3.0.1: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== -semver@~5.1.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.1.1.tgz#a3292a373e6f3e0798da0b20641b9a9c5bc47e19" - integrity sha1-oykqNz5vPgeY2gsgZBuanFvEfhk= +semver@^5.1.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== semver@~5.3.0: version "5.3.0" @@ -5333,6 +5425,13 @@ supports-color@^3.1.2: dependencies: has-flag "^1.0.0" +supports-color@^4.0.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" + integrity sha1-vnoN5ITexcXN34s9WRJQRJEvY1s= + dependencies: + has-flag "^2.0.0" + supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -5340,6 +5439,17 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" +table-layout@^0.4.2: + version "0.4.5" + resolved "https://registry.yarnpkg.com/table-layout/-/table-layout-0.4.5.tgz#d906de6a25fa09c0c90d1d08ecd833ecedcb7378" + integrity sha512-zTvf0mcggrGeTe/2jJ6ECkJHAQPIYEwDoqsiqBjI24mvRmQbInK5jq33fyypaCBxX08hMkfmdOqj6haT33EqWw== + dependencies: + array-back "^2.0.0" + deep-extend "~0.6.0" + lodash.padend "^4.6.1" + typical "^2.6.1" + wordwrapjs "^3.0.0" + table@4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" @@ -5381,20 +5491,6 @@ tar-pack@^3.4.0: tar "^2.2.1" uid-number "^0.0.6" -tar-pack@~3.1.0: - version "3.1.4" - resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.1.4.tgz#bc8cf9a22f5832739f12f3910dac1eb97b49708c" - integrity sha1-vIz5oi9YMnOfEvORDaweuXtJcIw= - dependencies: - debug "~2.2.0" - fstream "~1.0.10" - fstream-ignore "~1.0.5" - once "~1.3.3" - readable-stream "~2.1.4" - rimraf "~2.5.1" - tar "~2.2.1" - uid-number "~0.0.6" - tar-pack@~3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.3.0.tgz#30931816418f55afc4d21775afdd6720cee45dae" @@ -5422,7 +5518,7 @@ tar-stream@^1.1.2, tar-stream@^1.5.0: to-buffer "^1.1.1" xtend "^4.0.0" -tar@^2.2.1, tar@~2.2.0, tar@~2.2.1: +tar@^2.2.1, tar@~2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" integrity sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE= @@ -5455,6 +5551,14 @@ test-exclude@^4.2.0: read-pkg-up "^1.0.1" require-main-filename "^1.0.1" +test-value@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/test-value/-/test-value-2.1.0.tgz#11da6ff670f3471a73b625ca4f3fdcf7bb748291" + integrity sha1-Edpv9nDzRxpztiXKTz/c97t0gpE= + dependencies: + array-back "^1.0.3" + typical "^2.6.0" + text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" @@ -5519,6 +5623,11 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" +toml@^2.3.0: + version "2.3.6" + resolved "https://registry.yarnpkg.com/toml/-/toml-2.3.6.tgz#25b0866483a9722474895559088b436fd11f861b" + integrity sha512-gVweAectJU3ebq//Ferr2JUY4WKSDe5N+z0FvjDncLGyHmIDoxgY/2Ie4qfEIDm4IS7OA6Rmdm7pdEEdMcV/xQ== + tough-cookie@>=0.12.0: version "3.0.1" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-3.0.1.tgz#9df4f57e739c26930a018184887f4adb7dca73b2" @@ -5574,6 +5683,13 @@ ts-node@^3.3.0: v8flags "^3.0.0" yn "^2.0.0" +ts-typed-json@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/ts-typed-json/-/ts-typed-json-0.2.2.tgz#53184bee893e45991b73c8c463a38b59e27cd47e" + integrity sha1-UxhL7ok+RZkbc8jEY6OLWeJ81H4= + dependencies: + rsvp "^3.5.0" + tsconfig@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/tsconfig/-/tsconfig-6.0.0.tgz#6b0e8376003d7af1864f8df8f89dd0059ffcd032" @@ -5667,6 +5783,11 @@ typescript@^3.4.3: resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.5.tgz#2d2618d10bb566572b8d7aad5180d84257d70a99" integrity sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw== +typical@^2.6.0, typical@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/typical/-/typical-2.6.1.tgz#5c080e5d661cbbe38259d2e70a3c7253e873881d" + integrity sha1-XAgOXWYcu+OCWdLnCjxyU+hziB0= + uglify-js@^3.1.4: version "3.7.7" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.7.7.tgz#21e52c7dccda80a53bf7cde69628a7e511aec9c9" @@ -5819,6 +5940,13 @@ validate-npm-package-license@^3.0.1: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" +validate-npm-package-name@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz#5fa912d81eb7d0c74afc140de7317f0ca7df437e" + integrity sha1-X6kS2B630MdK/BQN5zF/DKffQ34= + dependencies: + builtins "^1.0.3" + vary@^1, vary@~1.1.0: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" @@ -5884,14 +6012,13 @@ wordwrap@~1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= -wotb@0.6.6: - version "0.6.6" - resolved "https://registry.yarnpkg.com/wotb/-/wotb-0.6.6.tgz#66708725e4d38bb0501b7e3bb921c72aef9e6faf" - integrity sha512-oi/3/Heq2IWCb+RMbHIAHfWoPKCDhMjc2HsgNLTEXHTTIy8sZzbizSXzSe3xLSvfpmOfjQfczvi0kMqsbpEKng== +wordwrapjs@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/wordwrapjs/-/wordwrapjs-3.0.0.tgz#c94c372894cadc6feb1a66bff64e1d9af92c5d1e" + integrity sha512-mO8XtqyPvykVCsrwj5MlOVWvSnCdT+C+QVbm6blradR7JExAhbkZ7hZ9A+9NUtwzSqrlUo9a67ws0EiILrvRpw== dependencies: - bindings "1.2.1" - nan "2.13.2" - node-pre-gyp "0.6.23" + reduce-flatten "^1.0.1" + typical "^2.6.1" wrap-ansi@^2.0.0: version "2.1.0"