From 46f7e322c1b4a8437230e335e7bd643464fa605a Mon Sep 17 00:00:00 2001 From: fboucquez Date: Fri, 4 Feb 2022 07:50:02 -0300 Subject: [PATCH] fix: small fixes fix: added doc link fix: updated bootstrap to 1.1.4 release --- CHANGELOG.md | 9 +++++---- README.md | 2 ++ package-lock.json | 14 +++++++------- package.json | 2 +- src/commands/generateNemesis.ts | 2 +- src/services/NetworkAccountResolver.ts | 2 +- src/services/NetworkConfigurationService.ts | 2 +- src/utils/InitService.ts | 8 ++++++-- 8 files changed, 24 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9518147..cb7df11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,13 @@ All notable changes to this project will be documented in this file. The changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [0.0.1] - NEXT +## [0.0.1] - Feb-4-2022 **Milestone**: Mainnet(1.0.3.1) -| Package | Version | Link | -| -------------- | ------- | -------------------------------------------------------------- | -| Symbol Network | v0.0.1 | [symbol-network](https://www.npmjs.com/package/symbol-network) | +| Package | Version | Link | +|------------------|---------|--------------------------------------------------------------------| +| Symbol Bootstrap | v1.1.4 | [symbol-bootstrap](https://www.npmjs.com/package/symbol-bootstrap) | +| Symbol Network | v0.0.1 | [symbol-bootstrap](https://www.npmjs.com/package/symbol-network) | - Very first version of the tool! diff --git a/README.md b/README.md index 4cf8cf8..eba0b8e 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,8 @@ To handle dozens or hundreds of Symbol Nodes in "cattle" style, where nodes are If you are creating a Symbol node for the first time, please have look at the [symbol-bootstrap](https://github.com/fboucquez/symbol-bootstrap) cli. +For more information, checkout this [guide/blog post](https://dev.to/fboucquez/how-to-create-a-symbol-testnet-network-4hdd). + # Requirements - Node 12.0.0+ diff --git a/package-lock.json b/package-lock.json index d735de6..76cf28d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "lodash": "^4.17.21", "remove": "^0.1.5", "rxjs": "^7.5.2", - "symbol-bootstrap": "^1.1.4-alpha-7dcd80b", + "symbol-bootstrap": "^1.1.4", "symbol-sdk": "^1.0.4-alpha-202112211435", "tslib": "^2.3.1", "winston": "^3.5.1" @@ -7780,9 +7780,9 @@ } }, "node_modules/symbol-bootstrap": { - "version": "1.1.4-alpha-7dcd80b", - "resolved": "https://registry.npmjs.org/symbol-bootstrap/-/symbol-bootstrap-1.1.4-alpha-7dcd80b.tgz", - "integrity": "sha512-uFRU1YQAclX1ltZNkVavhRzL0EMhBbbNut6S0XakKrDNDiLI1bfV96/WKk8L7d1/2xxynIYZbdgmNUafqXUIgg==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/symbol-bootstrap/-/symbol-bootstrap-1.1.4.tgz", + "integrity": "sha512-ys/ZGQpF0XSI2UwEjdcfDjQjcsDtAcXNsp+AaujWerY/cqEKV9M+Yn6dVkRZ3OgiDJFtb0W08McXJm1NGfJfhg==", "dependencies": { "@noble/ed25519": "^1.5.3", "@oclif/command": "^1.8.16", @@ -14499,9 +14499,9 @@ "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" }, "symbol-bootstrap": { - "version": "1.1.4-alpha-7dcd80b", - "resolved": "https://registry.npmjs.org/symbol-bootstrap/-/symbol-bootstrap-1.1.4-alpha-7dcd80b.tgz", - "integrity": "sha512-uFRU1YQAclX1ltZNkVavhRzL0EMhBbbNut6S0XakKrDNDiLI1bfV96/WKk8L7d1/2xxynIYZbdgmNUafqXUIgg==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/symbol-bootstrap/-/symbol-bootstrap-1.1.4.tgz", + "integrity": "sha512-ys/ZGQpF0XSI2UwEjdcfDjQjcsDtAcXNsp+AaujWerY/cqEKV9M+Yn6dVkRZ3OgiDJFtb0W08McXJm1NGfJfhg==", "requires": { "@noble/ed25519": "^1.5.3", "@oclif/command": "^1.8.16", diff --git a/package.json b/package.json index 143e41c..e211ceb 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "lodash": "^4.17.21", "remove": "^0.1.5", "rxjs": "^7.5.2", - "symbol-bootstrap": "^1.1.4-alpha-7dcd80b", + "symbol-bootstrap": "^1.1.4", "symbol-sdk": "^1.0.4-alpha-202112211435", "tslib": "^2.3.1", "winston": "^3.5.1" diff --git a/src/commands/generateNemesis.ts b/src/commands/generateNemesis.ts index 8a13b01..85d9a73 100644 --- a/src/commands/generateNemesis.ts +++ b/src/commands/generateNemesis.ts @@ -59,7 +59,7 @@ After running this command, your new network nemesis seed would be created. It a logger.info(''); logger.info('Nemesis block has been generated. To verify the block using a demo box run:'); logger.info(''); - logger.info(`$ symbol-bootstrap start -t ${nemesisTargetFolder} --noPassword --detached --healthCheck --report`); + logger.info(`$ symbol-bootstrap start -t ${nemesisTargetFolder} --noPassword --detached --healthCheck --report --pullImages`); logger.info(''); logger.info(`Try the demo node by going to:`); logger.info(' - Rest Accounts - http://localhost:3000/accounts'); diff --git a/src/services/NetworkAccountResolver.ts b/src/services/NetworkAccountResolver.ts index 1341ded..e624384 100644 --- a/src/services/NetworkAccountResolver.ts +++ b/src/services/NetworkAccountResolver.ts @@ -40,7 +40,7 @@ export class NetworkAccountResolver implements AccountResolver { if (!nodeName) { return this.promptAccount(networkType, account, keyName, nodeName, operationDescription, generateErrorMessage); } - this.logger.info(`Loading ${keyName} Key for ${nodeName} of ${this.node.number}. Operation ${operationDescription}`); + this.logger.info(`Loading ${keyName} Key for ${nodeName} number ${this.node.number}. Operation ${operationDescription}`); const storedAccount = await this.keyStore.getNodeAccount(networkType, keyName, nodeName, this.node, true); if (!storedAccount) { throw new Error(`${keyName} for node ${nodeName} does not exist!`); diff --git a/src/services/NetworkConfigurationService.ts b/src/services/NetworkConfigurationService.ts index c3a105b..7936334 100644 --- a/src/services/NetworkConfigurationService.ts +++ b/src/services/NetworkConfigurationService.ts @@ -274,7 +274,7 @@ export class NetworkConfigurationService { this.logger.info(''); this.logger.info(`The ${NetworkUtils.NETWORK_FILE} file has been updated!`); this.logger.info(''); - this.logger.info(`Nodes have been created/upgraded. `); + this.logger.info(`Nodes have been created/upgraded. You can deploy them!`); this.logger.info(''); } diff --git a/src/utils/InitService.ts b/src/utils/InitService.ts index 4ee1bd7..89ad247 100644 --- a/src/utils/InitService.ts +++ b/src/utils/InitService.ts @@ -56,6 +56,7 @@ export interface InitServiceParams { export class InitService { constructor(private readonly logger: Logger, private readonly workingDir: string, private readonly params: InitServiceParams) {} + async execute(): Promise { const networkInputFile = NetworkUtils.NETWORK_INPUT_FILE; const customNetworkPresetFile = NetworkUtils.NETWORK_PRESET_FILE; @@ -391,10 +392,13 @@ export class InitService { const nickName = await this.promptName(`Nodes's Nick Name`, 'The nick name of the these nodes', metadata.nickName); const restProtocol = metadata.api ? await this.promptRestProtocol() : undefined; + const { confirmCreate } = await prompt([ { default: true, - message: `Do you want to create ${total} nodes of type ${nodeTypeName} each with balance of ${balances.join(', ')}?`, + message: balances.find((b) => b > 0) + ? `Do you want to create ${total} nodes of type ${nodeTypeName} each with balance of ${balances.join(', ')}?` + : `Do you want to create ${total} nodes of type ${nodeTypeName}?`, type: 'confirm', name: 'confirmCreate', }, @@ -512,6 +516,7 @@ export class InitService { public async generateRandomKey(fieldName: string, message: string, networkType: NetworkType): Promise { return this.promptText(fieldName, message, Account.generateNewAccount(networkType).privateKey, CommandUtils.isValidPrivateKey); } + public async promptName(fieldName: string, message: string, defaultValue: string | undefined): Promise { return this.promptText(fieldName, message, defaultValue, this.isValidName); } @@ -563,7 +568,6 @@ export class InitService { fieldName: string, message: string, defaultValue: string | undefined, - validate?: (input: any) => boolean | string | Promise, ): Promise { return this.confirmedPrompt(