diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index 290bbb43f..dfc774477 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 12.x + node-version: 14.x registry-url: https://registry.npmjs.org - run: npm ci - run: npm run doc @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 12.x + node-version: 14.x registry-url: https://registry.npmjs.org - run: npm ci - run: npm pack diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3dd6783b8..7f0c1e8d8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [12.x, 14.x, 15.x] + node-version: [14.x, 16.x, 18.x] steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 12.x + node-version: 14.x registry-url: https://registry.npmjs.org - run: npm ci - run: npm run lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ab0fbc802..f31c3c3ae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ jobs: uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 12.x + node-version: 14.x registry-url: https://registry.npmjs.org - run: npm ci - id: version @@ -47,7 +47,7 @@ jobs: uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: 12.x + node-version: 14.x registry-url: https://registry.npmjs.org - run: npm ci - run: npm version patch -m "Increasing version to %s" --git-tag-version false diff --git a/CHANGELOG.md b/CHANGELOG.md index 35bd3b797..71e034128 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,48 @@ 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/). +## [1.1.9] - Nov-09-2022 -## [1.1.4] - NEXT +**Milestone**: Mainnet(1.0.3.5) + +| Package | Version | Link | +| ---------------- |---------| ------------------------------------------------------------------ | +| Symbol Bootstrap | v1.1.9 | [symbol-bootstrap](https://www.npmjs.com/package/symbol-bootstrap) | + +- Testnet reset(sainet). +- Update to [Catapult Client v1.0.3.5](https://github.com/symbol/symbol/releases/tag/client%2Fcatapult%2Fv1.0.3.5) + +## [1.1.8] - Oct-25-2022 + +**Milestone**: Mainnet(1.0.3.4) + +| Package | Version | Link | +| ---------------- |---------| ------------------------------------------------------------------ | +| Symbol Bootstrap | v1.1.8 | [symbol-bootstrap](https://www.npmjs.com/package/symbol-bootstrap) | + +- (BREAKING FORK) catapult client register aggregate transaction hash validator and require aggregate version 2 after fork + +## [1.1.6] - Mar-16-2022 + +**Milestone**: Mainnet(1.0.3.3) + +| Package | Version | Link | +| ---------------- |---------| ------------------------------------------------------------------ | +| Symbol Bootstrap | v1.1.6 | [symbol-bootstrap](https://www.npmjs.com/package/symbol-bootstrap) | + +- Fixed openssl security vulnerability [issue](https://www.opencve.io/cve/CVE-2022-0778) + +## [1.1.5] - Mar-1-2022 + +**Milestone**: Mainnet(1.0.3.1) + +| Package | Version | Link | +| ---------------- |---------| ------------------------------------------------------------------ | +| Symbol Bootstrap | v1.1.5 | [symbol-bootstrap](https://www.npmjs.com/package/symbol-bootstrap) | + +- Fixed undefined error circular dependency when using PROMPT_MAIN. Issue #378. + +## [1.1.4] - Feb-4-2022 **Milestone**: Mainnet(1.0.3.1) @@ -14,6 +54,8 @@ The changelog format is based on [Keep a Changelog](https://keepachangelog.com/e - `BootstrapUtils` code clean up split. - Allowing user provided compose services via custom preset. +- Added `services` assembly. +- Lib upgrades. ## [1.1.3] - Jan-21-2022 diff --git a/README.md b/README.md index 93e3871b5..2261be287 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,7 @@ Properties in each file override the previous values (by object deep merge). - [`dual`](presets/assemblies/assembly-dual.yml): A standard dual node that contains 1 Mongo database, 1 API node, 1 REST gateway, 1 broker, and 1 peer node. - [`demo`](presets/assemblies/assembly-demo.yml): A dual node with an additional explorer and faucet for test and demonstration purposes. - [`multinode`](presets/assemblies/assembly-multinode.yml): A special assembly that contains 1 API node and 2 peer-only nodes. This assembly is for testing, it showcases how a private network with 3 nodes runs. +- [`services`](presets/assemblies/assembly-services.yml): A special docker compose that includes the Explorer, Faucet and HTTPS proxy. This is an easy and quick way of running Symbol services when creating a new network. Note that the services are not HA, it's not for production environments. ### Custom preset: diff --git a/config/docker/mongo/mongoDbPrepare.js b/config/docker/mongo/mongoDbPrepare.js index b52e58a33..2c23b5c4b 100644 --- a/config/docker/mongo/mongoDbPrepare.js +++ b/config/docker/mongo/mongoDbPrepare.js @@ -40,12 +40,15 @@ db.transactions.createIndex({ 'transaction.deadline': -1 }); db.transactions.createIndex({ 'transaction.cosignatures.signerPublicKey': 1 }, makeSparse('transaction.cosignatures.signerPublicKey')); db.transactions.createIndex({ 'transaction.id': 1, 'transaction.type': 1 }, makeSparse('transaction.id')); + db.transactions.createIndex({ 'transaction.mosaics.id': 1}); db.createCollection('transactionStatements'); db.transactionStatements.createIndex( { 'statement.height': 1, 'statement.source.primaryId': 1, 'statement.source.secondaryId': 1 }, { unique: true }, ); + db.transactionStatements.createIndex({ 'statement.receipts.targetAddress': 1 }); + db.transactionStatements.createIndex({ 'statement.receipts.senderAddress': 1 }); ['addressResolutionStatements', 'mosaicResolutionStatements'].forEach((collectionName) => { db.createCollection(collectionName); diff --git a/config/node/resources/config-network.properties.mustache b/config/node/resources/config-network.properties.mustache index dc834a9c7..84d67944d 100644 --- a/config/node/resources/config-network.properties.mustache +++ b/config/node/resources/config-network.properties.mustache @@ -141,14 +141,16 @@ totalVotingBalanceCalculationFix = {{{toAmount totalVotingBalanceCalculationFix} treasuryReissuance = {{{toAmount treasuryReissuance}}} strictAggregateTransactionHash = {{{toAmount strictAggregateTransactionHash}}} +{{#treasuryReissuanceTransactionSignatures_has_items}} [treasury_reissuance_transaction_signatures] - +{{/treasuryReissuanceTransactionSignatures_has_items}} {{#each treasuryReissuanceTransactionSignatures}} {{this}} = true {{/each}} +{{#corruptAggregateTransactionHashes_has_items}} [corrupt_aggregate_transaction_hashes] - +{{/corruptAggregateTransactionHashes_has_items}} {{#each corruptAggregateTransactionHashes}} {{this.key}} = {{this.value}} {{/each}} diff --git a/docs/autocomplete.md b/docs/autocomplete.md index f1faaf895..780c31e06 100644 --- a/docs/autocomplete.md +++ b/docs/autocomplete.md @@ -26,4 +26,4 @@ EXAMPLES $ symbol-bootstrap autocomplete --refresh-cache ``` -_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v0.3.0/src/commands/autocomplete/index.ts)_ +_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v1.2.0/src/commands/autocomplete/index.ts)_ diff --git a/docs/clean.md b/docs/clean.md index 2ec1ef63d..1b6e70b41 100644 --- a/docs/clean.md +++ b/docs/clean.md @@ -24,4 +24,4 @@ EXAMPLE $ symbol-bootstrap clean ``` -_See code: [src/commands/clean.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.4/src/commands/clean.ts)_ +_See code: [src/commands/clean.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.7/src/commands/clean.ts)_ diff --git a/docs/compose.md b/docs/compose.md index 6e0a9c03d..741b7eaab 100644 --- a/docs/compose.md +++ b/docs/compose.md @@ -26,6 +26,8 @@ OPTIONS --noPassword When provided, Bootstrap will not use a password, so private keys will be stored in plain text. Use with caution. + --offline If --offline is used, Bootstrap resolves the configuration without querying the running network. + --password=password A password used to encrypt and decrypt private keys in preset files like addresses.yml and preset.yml. Bootstrap prompts for a password by default, can be provided in the command line (--password=XXXX) or disabled in the command line (--noPassword). @@ -36,4 +38,4 @@ EXAMPLE $ symbol-bootstrap compose ``` -_See code: [src/commands/compose.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.4/src/commands/compose.ts)_ +_See code: [src/commands/compose.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.7/src/commands/compose.ts)_ diff --git a/docs/config.md b/docs/config.md index f2f1a4e9e..d1099a574 100644 --- a/docs/config.md +++ b/docs/config.md @@ -16,7 +16,7 @@ USAGE OPTIONS -a, --assembly=assembly The assembly that defines the node(s) layout. It can be provided via custom preset or cli parameter. If not provided, the value is resolved from the target/preset.yml - file. Options are: api, demo, dual, multinode, peer, my-custom-assembly.yml + file. Options are: dual, peer, api, demo, multinode, services, my-custom-assembly.yml (advanced). -c, --customPreset=customPreset External preset file. Values in this file will override the provided presets. @@ -41,6 +41,9 @@ OPTIONS --noPassword When provided, Bootstrap will not use a password, so private keys will be stored in plain text. Use with caution. + --offline If --offline is used, Bootstrap resolves the configuration without querying the + running network. + --password=password A password used to encrypt and decrypt private keys in preset files like addresses.yml and preset.yml. Bootstrap prompts for a password by default, can be provided in the command line (--password=XXXX) or disabled in the command line @@ -62,4 +65,4 @@ EXAMPLES $ echo "$MY_ENV_VAR_PASSWORD" | symbol-bootstrap config -p testnet -a dual ``` -_See code: [src/commands/config.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.4/src/commands/config.ts)_ +_See code: [src/commands/config.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.7/src/commands/config.ts)_ diff --git a/docs/decrypt.md b/docs/decrypt.md index 3e846a029..f7bcad53b 100644 --- a/docs/decrypt.md +++ b/docs/decrypt.md @@ -59,4 +59,4 @@ EXAMPLES plain-addresses.yml ``` -_See code: [src/commands/decrypt.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.4/src/commands/decrypt.ts)_ +_See code: [src/commands/decrypt.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.7/src/commands/decrypt.ts)_ diff --git a/docs/encrypt.md b/docs/encrypt.md index 2db1c9444..151404e30 100644 --- a/docs/encrypt.md +++ b/docs/encrypt.md @@ -49,4 +49,4 @@ EXAMPLES encrypted-custom-preset.yml ``` -_See code: [src/commands/encrypt.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.4/src/commands/encrypt.ts)_ +_See code: [src/commands/encrypt.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.7/src/commands/encrypt.ts)_ diff --git a/docs/healthCheck.md b/docs/healthCheck.md index 4b216ac1f..44fecf446 100644 --- a/docs/healthCheck.md +++ b/docs/healthCheck.md @@ -39,4 +39,4 @@ EXAMPLE $ symbol-bootstrap healthCheck ``` -_See code: [src/commands/healthCheck.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.4/src/commands/healthCheck.ts)_ +_See code: [src/commands/healthCheck.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.7/src/commands/healthCheck.ts)_ diff --git a/docs/help.md b/docs/help.md index 0b62108d2..b114c2dc1 100644 --- a/docs/help.md +++ b/docs/help.md @@ -20,4 +20,4 @@ OPTIONS --all see all commands in CLI ``` -_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.17/src/commands/help.ts)_ +_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.18/src/commands/help.ts)_ diff --git a/docs/link.md b/docs/link.md index 609837c18..24dcf2bf2 100644 --- a/docs/link.md +++ b/docs/link.md @@ -58,4 +58,4 @@ EXAMPLES $ echo "$MY_ENV_VAR_PASSWORD" | symbol-bootstrap link --unlink --useKnownRestGateways ``` -_See code: [src/commands/link.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.4/src/commands/link.ts)_ +_See code: [src/commands/link.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.7/src/commands/link.ts)_ diff --git a/docs/modifyMultisig.md b/docs/modifyMultisig.md index 8bee27de0..97f51b4fa 100644 --- a/docs/modifyMultisig.md +++ b/docs/modifyMultisig.md @@ -69,4 +69,4 @@ EXAMPLES $ echo "$MY_ENV_VAR_PASSWORD" | symbol-bootstrap modifyMultisig --useKnownRestGateways ``` -_See code: [src/commands/modifyMultisig.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.4/src/commands/modifyMultisig.ts)_ +_See code: [src/commands/modifyMultisig.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.7/src/commands/modifyMultisig.ts)_ diff --git a/docs/pack.md b/docs/pack.md index 408d4b64c..4e145de37 100644 --- a/docs/pack.md +++ b/docs/pack.md @@ -16,7 +16,7 @@ USAGE OPTIONS -a, --assembly=assembly The assembly that defines the node(s) layout. It can be provided via custom preset or cli parameter. If not provided, the value is resolved from the target/preset.yml - file. Options are: api, demo, dual, multinode, peer, my-custom-assembly.yml + file. Options are: dual, peer, api, demo, multinode, services, my-custom-assembly.yml (advanced). -c, --customPreset=customPreset External preset file. Values in this file will override the provided presets. @@ -41,6 +41,9 @@ OPTIONS --noPassword When provided, Bootstrap will not use a password, so private keys will be stored in plain text. Use with caution. + --offline If --offline is used, Bootstrap resolves the configuration without querying the + running network. + --password=password A password used to encrypt and decrypt private keys in preset files like addresses.yml and preset.yml. Bootstrap prompts for a password by default, can be provided in the command line (--password=XXXX) or disabled in the command line @@ -63,4 +66,4 @@ EXAMPLES $ echo "$MY_ENV_VAR_PASSWORD" | symbol-bootstrap pack -c custom-preset.yml ``` -_See code: [src/commands/pack.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.4/src/commands/pack.ts)_ +_See code: [src/commands/pack.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.7/src/commands/pack.ts)_ diff --git a/docs/presetGuides.md b/docs/presetGuides.md index b9569b032..47220ef4b 100644 --- a/docs/presetGuides.md +++ b/docs/presetGuides.md @@ -385,3 +385,11 @@ Usage examples: - Replicate integration tests that may use specific values. Keep the generated `addresses.yml` and `preset.yml` in the target folder privately! + +## Services assembly + +When running a `services` assembly with a Faucet, Explorer and HttpProxy, you need to provide the following custom preset: +```yaml +domain: my.domain.com #Your domain, faucet.my.domain.com and explorer.my.domain.com would need to be registered. +faucetPrivateKey: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA # The symbol account private key where the Faucet can transfer the tokens from. +``` diff --git a/docs/renewCertificates.md b/docs/renewCertificates.md index e8154a6d2..bc5c17b15 100644 --- a/docs/renewCertificates.md +++ b/docs/renewCertificates.md @@ -58,4 +58,4 @@ EXAMPLE $ symbol-bootstrap renewCertificates ``` -_See code: [src/commands/renewCertificates.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.4/src/commands/renewCertificates.ts)_ +_See code: [src/commands/renewCertificates.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.7/src/commands/renewCertificates.ts)_ diff --git a/docs/report.md b/docs/report.md index ac770d65f..848358252 100644 --- a/docs/report.md +++ b/docs/report.md @@ -24,4 +24,4 @@ EXAMPLE $ symbol-bootstrap report ``` -_See code: [src/commands/report.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.4/src/commands/report.ts)_ +_See code: [src/commands/report.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.7/src/commands/report.ts)_ diff --git a/docs/resetData.md b/docs/resetData.md index 2c2b123df..9ff61b01c 100644 --- a/docs/resetData.md +++ b/docs/resetData.md @@ -24,4 +24,4 @@ EXAMPLE $ symbol-bootstrap resetData ``` -_See code: [src/commands/resetData.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.4/src/commands/resetData.ts)_ +_See code: [src/commands/resetData.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.7/src/commands/resetData.ts)_ diff --git a/docs/run.md b/docs/run.md index 75f12a245..00a06bebe 100644 --- a/docs/run.md +++ b/docs/run.md @@ -57,4 +57,4 @@ EXAMPLE $ symbol-bootstrap run ``` -_See code: [src/commands/run.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.4/src/commands/run.ts)_ +_See code: [src/commands/run.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.7/src/commands/run.ts)_ diff --git a/docs/start.md b/docs/start.md index 6320eae2e..4c5be9cd0 100644 --- a/docs/start.md +++ b/docs/start.md @@ -16,8 +16,8 @@ USAGE OPTIONS -a, --assembly=assembly The assembly that defines the node(s) layout. It can be provided via custom preset or cli parameter. If not - provided, the value is resolved from the target/preset.yml file. Options are: api, demo, dual, multinode, peer, - my-custom-assembly.yml (advanced). + provided, the value is resolved from the target/preset.yml file. Options are: dual, peer, api, demo, multinode, + services, my-custom-assembly.yml (advanced). -b, --build If provided, docker-compose will run with -b (--build) @@ -67,6 +67,9 @@ OPTIONS --noPassword When provided, Bootstrap will not use a password, so private keys will be stored in plain text. Use with caution. + --offline + If --offline is used, Bootstrap resolves the configuration without querying the running network. + --password=password A password used to encrypt and decrypt private keys in preset files like addresses.yml and preset.yml. Bootstrap prompts for a password by default, can be provided in the command line (--password=XXXX) or disabled in the command @@ -98,4 +101,4 @@ EXAMPLES $ echo "$MY_ENV_VAR_PASSWORD" | symbol-bootstrap start -p testnet -a dual ``` -_See code: [src/commands/start.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.4/src/commands/start.ts)_ +_See code: [src/commands/start.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.7/src/commands/start.ts)_ diff --git a/docs/stop.md b/docs/stop.md index f85c521a4..6a567c0a4 100644 --- a/docs/stop.md +++ b/docs/stop.md @@ -24,4 +24,4 @@ EXAMPLE $ symbol-bootstrap stop ``` -_See code: [src/commands/stop.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.4/src/commands/stop.ts)_ +_See code: [src/commands/stop.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.7/src/commands/stop.ts)_ diff --git a/docs/updateVotingKeys.md b/docs/updateVotingKeys.md index ce9cb9a13..2cffd1324 100644 --- a/docs/updateVotingKeys.md +++ b/docs/updateVotingKeys.md @@ -47,4 +47,4 @@ EXAMPLE $ symbol-bootstrap updateVotingKeys ``` -_See code: [src/commands/updateVotingKeys.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.4/src/commands/updateVotingKeys.ts)_ +_See code: [src/commands/updateVotingKeys.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.7/src/commands/updateVotingKeys.ts)_ diff --git a/docs/verify.md b/docs/verify.md index cdee7268e..a076e8884 100644 --- a/docs/verify.md +++ b/docs/verify.md @@ -23,4 +23,4 @@ EXAMPLE $ symbol-bootstrap verify ``` -_See code: [src/commands/verify.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.4/src/commands/verify.ts)_ +_See code: [src/commands/verify.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.7/src/commands/verify.ts)_ diff --git a/docs/wizard.md b/docs/wizard.md index e98c659ff..f0c4fc851 100644 --- a/docs/wizard.md +++ b/docs/wizard.md @@ -39,4 +39,4 @@ EXAMPLE $ symbol-bootstrap wizard ``` -_See code: [src/commands/wizard.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.4/src/commands/wizard.ts)_ +_See code: [src/commands/wizard.ts](https://github.com/fboucquez/symbol-bootstrap/blob/v1.1.7/src/commands/wizard.ts)_ diff --git a/package.json b/package.json index 32250c999..0a74188f3 100644 --- a/package.json +++ b/package.json @@ -1,28 +1,28 @@ { "name": "twix-bootstrap", - "description": "Symbol tool that allows you creating, configuring and running Symbol's networks", - "version": "1.1.4", + "description": "TWIX tool that allows you creating, configuring and running TWIX networks", + "version": "1.1.9", "author": "Fernando Boucquez ", "bin": { "twix-bootstrap": "bin/run" }, "bugs": "https://github.com/Vladimir7280/twix-bootstrap/issue", "dependencies": { - "@oclif/command": "^1.8.12", - "@oclif/config": "^1.18.2", - "@oclif/plugin-autocomplete": "^0.3.0", - "@oclif/plugin-help": "^3.2.17", - "archiver": "^5.2.0", - "cross-fetch": "^3.1.4", - "figlet": "^1.2.4", + "@noble/ed25519": "^1.5.3", + "@oclif/command": "^1.8.16", + "@oclif/config": "^1.18.3", + "@oclif/plugin-autocomplete": "^1.2.0", + "@oclif/plugin-help": "^5.1.11", + "archiver": "^5.3.0", + "cross-fetch": "^3.1.5", + "figlet": "^1.5.2", "handlebars": "^4.7.7", - "inquirer": "^7.3.3", + "inquirer": "^8.2.0", "js-yaml": "^4.1.0", "lodash": "^4.17.21", "memorystream": "^0.3.1", - "noble-ed25519": "^1.0.3", - "node-stream-zip": "^1.12.0", - "rxjs": "^6.6.3", + "node-stream-zip": "^1.15.0", + "rxjs": "^7.5.2", "semver": "^7.3.5", "shx": "^0.3.2", "symbol-statistics-service-typescript-fetch-client": "^1.1.3", @@ -32,49 +32,46 @@ "winston": "^3.3.3" }, "devDependencies": { - "@oclif/dev-cli": "^1.26.9", + "@oclif/dev-cli": "^1.26.10", "@oclif/test": "^1.2.8", - "@types/archiver": "^5.1.0", - "@types/chai": "^4.2.12", - "@types/figlet": "^1.2.0", + "@types/archiver": "^5.3.1", + "@types/chai": "^4.3.0", + "@types/figlet": "^1.5.4", "@types/handlebars": "^4.1.0", - "@types/inquirer": "^7.3.1", + "@types/inquirer": "^8.2.0", "@types/js-yaml": "^4.0.5", - "@types/lodash": "^4.14.165", + "@types/lodash": "^4.14.178", "@types/memorystream": "^0.3.0", - "@types/mocha": "^8.2.2", - "@types/node": "^10.17.28", - "@types/semver": "^7.3.6", - "@types/sinon": "^10.0.4", + "@types/mocha": "^9.1.0", + "@types/node": "^17.0.14", + "@types/semver": "^7.3.9", + "@types/sinon": "^10.0.9", "@types/winston": "^2.4.4", - "@typescript-eslint/eslint-plugin": "^5.0.0", - "@typescript-eslint/parser": "^5.0.0", - "chai": "^4.2.0", + "@typescript-eslint/eslint-plugin": "^5.10.2", + "@typescript-eslint/parser": "^5.10.2", + "chai": "^4.3.6", "coveralls": "^3.1.1", - "create-ts-index": "^1.13.7", - "dir-compare": "^3.3.0", - "eslint": "^8.0.1", + "create-ts-index": "^1.14.0", + "dir-compare": "^4.0.0", + "eslint": "^8.8.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^4.0.0", "globby": "^10.0.2", - "marked": ">=4.0.10", - "mocha": "^9.1.3", + "marked": ">=4.0.12", + "mocha": "^9.2.0", "mocha-lcov-reporter": "^1.3.0", "mock-stdin": "^1.0.0", - "nock": "^13.1.1", + "nock": "^13.2.2", "nyc": "^15.1.0", - "prettier": "^2.3.2", - "prettier-plugin-organize-imports": "^1.1.1", - "rxjs": "^6.6.3", - "rxjs-compat": "^6.6.3", - "sinon": "^11.1.2", - "ts-node": "^8.10.2", - "tsup": "^6.6.3", - "typedoc": "^0.23.27", - "typescript": "^4.9.4" + "prettier": "^2.5.1", + "prettier-plugin-organize-imports": "^2.3.4", + "sinon": "^13.0.1", + "ts-node": "^10.4.0", + "typedoc": "^0.22.11", + "typescript": "^4.5.5" }, "engines": { - "node": ">=12.0.0" + "node": ">=14.0.0" }, "files": [ "/config", diff --git a/presets/assemblies/assembly-services.yml b/presets/assemblies/assembly-services.yml new file mode 100644 index 000000000..862473746 --- /dev/null +++ b/presets/assemblies/assembly-services.yml @@ -0,0 +1,45 @@ +domain: my.domain.com +faucetPrivateKey: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +explorers: + - name: 'explorer' + openPort: '90' + footer: + link: + - href: https://nemflash.io/ + text: NEM News + icon: IconNewspaper + - href: https://forum.nem.io/ + text: Forum + icon: IconForum + - href: https://t.me/nemred + text: Telegram + icon: IconTelegram + - href: https://www.reddit.com/r/nem/ + text: Reddit + icon: IconReddit + - href: https://github.com/nemtech + text: Github + icon: IconGithub + - href: https://faucet.{{domain}}/ + text: Faucet + icon: IconHomeCurrencyUsd +faucets: + - name: 'faucet' + openPort: '100' + compose: + environment: + FAUCET_PRIVATE_KEY: '{{faucetPrivateKey}}' + NATIVE_CURRENCY_OUT_MAX: 500000000 + NATIVE_CURRENCY_OUT_MIN: 100000000 + MAX_FEE: 5000000 + ENOUGH_BALANCE: 100000000000 + MAX_UNCONFIRMED: 99 + BLACKLIST_MOSAIC_IDS: '[]' + EXPLORER_URL: 'https://explorer.{{domain}}/' +httpsProxies: + - name: 'https-proxy' + openPort: 443 + domains: 'explorer.{{domain}} -> http://explorer:4000, faucet.{{domain}} -> http://faucet:4000' + stage: 'production' + webSocket: 'true' + serverNamesHashBucketSize: 128 diff --git a/src/commands/compose.ts b/src/commands/compose.ts index ca8d10f07..41e2ae4a1 100644 --- a/src/commands/compose.ts +++ b/src/commands/compose.ts @@ -32,6 +32,7 @@ export default class Compose extends Command { description: 'It regenerates the docker compose and utility files from the /docker folder', default: ComposeService.defaultParams.upgrade, }), + offline: CommandUtils.offlineFlag, user: flags.string({ char: 'u', description: `User used to run the services in the docker-compose.yml file. "${Constants.CURRENT_USER}" means the current user.`, diff --git a/src/commands/config.ts b/src/commands/config.ts index f2d569b7d..ae996acf1 100644 --- a/src/commands/config.ts +++ b/src/commands/config.ts @@ -61,7 +61,7 @@ export default class Config extends Command { description: `It regenerates the configuration reusing the previous keys. Use this flag when upgrading the version of bootstrap to keep your node up to date without dropping the local data. Backup the target folder before upgrading.`, default: ConfigService.defaultParams.reset, }), - + offline: CommandUtils.offlineFlag, report: flags.boolean({ description: 'It generates reStructuredText (.rst) reports describing the configuration of each node.', default: ConfigService.defaultParams.report, diff --git a/src/commands/pack.ts b/src/commands/pack.ts index da7f683ea..0c291b980 100644 --- a/src/commands/pack.ts +++ b/src/commands/pack.ts @@ -69,7 +69,7 @@ export default class Pack extends Command { logger.info(''); logger.info(''); if ( - !flags.ready && + (!flags.ready || flags.offline) && !( await prompt([ { diff --git a/src/commands/updateVotingKeys.ts b/src/commands/updateVotingKeys.ts index d43f56d42..cf36c18fc 100644 --- a/src/commands/updateVotingKeys.ts +++ b/src/commands/updateVotingKeys.ts @@ -17,7 +17,7 @@ import { Command, flags } from '@oclif/command'; import { LoggerFactory, System } from '../logger'; import { ConfigPreset } from '../model'; -import { CommandUtils, ConfigLoader, Constants, CryptoUtils, RemoteNodeService, VotingService, YamlUtils } from '../service'; +import { CommandUtils, ConfigLoader, Constants, CryptoUtils, RemoteNodeService, Utils, VotingService, YamlUtils } from '../service'; export default class UpdateVotingKeys extends Command { static description = `It updates the voting files containing the voting keys when required. @@ -64,9 +64,9 @@ When a new voting file is created, Bootstrap will advise running the \`link\` co }); } catch (e) { throw new Error( - `Node's preset cannot be loaded. Have you provided the right --target? If you have, please rerun the 'config' command with --upgrade. Error: ${ - e.message || 'unknown' - }`, + `Node's preset cannot be loaded. Have you provided the right --target? If you have, please rerun the 'config' command with --upgrade. Error: ${Utils.getMessage( + e, + )}`, ); } const addresses = configLoader.loadExistingAddresses(target, password); diff --git a/src/commands/wizard.ts b/src/commands/wizard.ts index a39e70ac2..eb9cd2e56 100644 --- a/src/commands/wizard.ts +++ b/src/commands/wizard.ts @@ -30,6 +30,7 @@ import { ConfigService, Constants, KeyName, + Password, Preset, RuntimeService, YamlUtils, @@ -39,8 +40,9 @@ export const assembliesDescriptions: Record = { [Assembly.dual]: 'Dual Node', [Assembly.peer]: 'Peer Node', [Assembly.api]: 'Api Node', - [Assembly.demo]: 'Demo Node', + [Assembly.demo]: 'Demo Node. A dual node that includes a Faucet and Explorer.', [Assembly.multinode]: 'Multinode Node. A docker compose that includes one api, one rest and two peers.', + [Assembly.services]: 'Services. A docker compose with just Faucet and Explorer.', }; export enum HttpsOption { @@ -112,7 +114,7 @@ export class Wizard { noPassword: boolean; skipPull?: boolean; target: string; - password: string | undefined; + password: Password; network: Network | undefined; customPreset: string; ready?: boolean; @@ -552,7 +554,7 @@ export class Wizard { ); } - public async resolveFileContent(encoding: string, message: string, notFoundMessage: string): Promise { + public async resolveFileContent(encoding: 'base64', message: string, notFoundMessage: string): Promise { const { value } = await prompt([ { name: 'value', diff --git a/src/model/ConfigPreset.ts b/src/model/ConfigPreset.ts index f3dae25fb..05bab54c4 100644 --- a/src/model/ConfigPreset.ts +++ b/src/model/ConfigPreset.ts @@ -382,6 +382,7 @@ export interface CommonConfigPreset extends NodeConfigPreset, GatewayConfigPrese transactionsDirectory: string; faucetUrl?: string; nemesisSeedFolder?: string; // Optional seed folder if user provides an external seed/00000 folder. + domain?: string; // Optional for services assembly. symbolServerImage: string; symbolExplorerImage: string; diff --git a/src/service/AccountResolver.ts b/src/service/AccountResolver.ts index 2717571f7..d80819842 100644 --- a/src/service/AccountResolver.ts +++ b/src/service/AccountResolver.ts @@ -14,7 +14,8 @@ * limitations under the License. */ import { Account, NetworkType } from 'twix-sdk'; -import { CertificatePair, KeyName } from '../'; +import { CertificatePair } from '../model'; +import { KeyName } from '../service'; /** * Delegate that knows how to retrieve or generate accounts. diff --git a/src/service/AddressesService.ts b/src/service/AddressesService.ts index 714e53a36..13d98c838 100644 --- a/src/service/AddressesService.ts +++ b/src/service/AddressesService.ts @@ -2,11 +2,11 @@ import { Account, Address, Convert, Crypto, MosaicId, MosaicNonce, NetworkType, import { Logger } from '../logger'; import { Addresses, ConfigAccount, ConfigPreset, MosaicAccounts, NodeAccount, NodePreset, PrivateKeySecurityMode } from '../model'; import { AccountResolver } from './AccountResolver'; -import { BootstrapUtils } from './BootstrapUtils'; import { KeyName } from './ConfigService'; import { ConfigurationUtils } from './ConfigurationUtils'; import { CryptoUtils } from './CryptoUtils'; import { MigrationService } from './MigrationService'; +import { Utils } from './Utils'; import { YamlUtils } from './YamlUtils'; /** @@ -56,8 +56,8 @@ export class AddressesService { if (!presetData.namespaceRentalFeeSinkAddressV1) { presetData.namespaceRentalFeeSinkAddressV1 = presetData.namespaceRentalFeeSinkAddress; } - presetData.networkIdentifier = BootstrapUtils.getNetworkIdentifier(networkType); - presetData.networkName = BootstrapUtils.getNetworkName(networkType); + presetData.networkIdentifier = Utils.getNetworkIdentifier(networkType); + presetData.networkName = Utils.getNetworkName(networkType); presetData.nemesisGenerationHashSeed = addresses.nemesisGenerationHashSeed; addresses.nodes = await this.resolveNodesAccounts(oldAddresses, presetData, networkType); diff --git a/src/service/AnnounceService.ts b/src/service/AnnounceService.ts index 4fa9f3331..833448602 100644 --- a/src/service/AnnounceService.ts +++ b/src/service/AnnounceService.ts @@ -15,12 +15,12 @@ */ import { flags } from '@oclif/command'; import { prompt } from 'inquirer'; +import { firstValueFrom } from 'rxjs'; import { Account, AccountInfo, Address, AggregateTransaction, - Convert, Currency, Deadline, IListener, @@ -46,6 +46,7 @@ import { AccountResolver } from './AccountResolver'; import { CommandUtils } from './CommandUtils'; import { KeyName } from './ConfigService'; import { TransactionUtils } from './TransactionUtils'; +import { Utils } from './Utils'; export interface TransactionFactoryParams { presetData: ConfigPreset; @@ -123,19 +124,19 @@ export class AnnounceService { presetData, useKnownRestGateways ? undefined : url, ); - const networkType = await repositoryFactory.getNetworkType().toPromise(); + const networkType = await firstValueFrom(repositoryFactory.getNetworkType()); const transactionRepository = repositoryFactory.createTransactionRepository(); const transactionService = new TransactionService(transactionRepository, repositoryFactory.createReceiptRepository()); - const epochAdjustment = await repositoryFactory.getEpochAdjustment().toPromise(); + const epochAdjustment = await firstValueFrom(repositoryFactory.getEpochAdjustment()); const listener = repositoryFactory.createListener(); await listener.open(); const faucetUrl = presetData.faucetUrl; - const currency = (await repositoryFactory.getCurrencies().toPromise()).currency; + const currency = (await firstValueFrom(repositoryFactory.getCurrencies())).currency; const currencyMosaicId = currency.mosaicId; const deadline = Deadline.create(epochAdjustment); - const minFeeMultiplier = (await repositoryFactory.createNetworkRepository().getTransactionFees().toPromise()).minFeeMultiplier; - const latestFinalizedBlockEpoch = (await repositoryFactory.createChainRepository().getChainInfo().toPromise()).latestFinalizedBlock - .finalizationEpoch; + const minFeeMultiplier = (await firstValueFrom(repositoryFactory.createNetworkRepository().getTransactionFees())).minFeeMultiplier; + const latestFinalizedBlockEpoch = (await firstValueFrom(repositoryFactory.createChainRepository().getChainInfo())) + .latestFinalizedBlock.finalizationEpoch; if (!currencyMosaicId) { throw new Error('Mosaic Id must not be null!'); } @@ -145,7 +146,7 @@ export class AnnounceService { this.logger.info(`Node's minFeeMultiplier is ${minFeeMultiplier}`); } - const generationHash = await repositoryFactory.getGenerationHash().toPromise(); + const generationHash = await firstValueFrom(repositoryFactory.getGenerationHash()); if (generationHash?.toUpperCase() !== presetData.nemesisGenerationHashSeed?.toUpperCase()) { throw new Error( `You are connecting to the wrong network. Expected generation hash is ${presetData.nemesisGenerationHashSeed} but got ${generationHash}`, @@ -430,7 +431,7 @@ export class AnnounceService { name: 'privateKey', message: `Enter the 64 HEX private key of one of the addresses ${expectedDescription}. Already entered ${providedAccounts.length} out of ${minApproval} required cosigners.`, type: 'password', - validate: AnnounceService.isValidPrivateKey, + validate: CommandUtils.isValidPrivateKey, }, ]); const privateKey = responses.privateKey; @@ -474,13 +475,9 @@ export class AnnounceService { } } - public static isValidPrivateKey(input: string): boolean | string { - return Convert.isHexString(input, 64) ? true : 'Invalid private key. It must be has 64 hex characters!'; - } - private async getAccountInfo(repositoryFactory: RepositoryFactory, mainAccountAddress: Address): Promise { try { - return await repositoryFactory.createAccountRepository().getAccountInfo(mainAccountAddress).toPromise(); + return await firstValueFrom(repositoryFactory.createAccountRepository().getAccountInfo(mainAccountAddress)); } catch (e) { return undefined; } @@ -494,7 +491,7 @@ export class AnnounceService { const accountRepository = repositoryFactory.createAccountRepository(); for (const cosigner of cosigners) { try { - const accountInfo = await accountRepository.getAccountInfo(cosigner.address).toPromise(); + const accountInfo = await firstValueFrom(accountRepository.getAccountInfo(cosigner.address)); if (!this.isAccountEmpty(accountInfo, currencyMosaicId)) { return cosigner; } @@ -558,7 +555,7 @@ export class AnnounceService { try { this.logger.info(`Announcing ${this.getTransactionDescription(lockFundsTransaction, signedLockFundsTransaction, currency)}`); - await transactionService.announce(signedLockFundsTransaction, listener).toPromise(); + await firstValueFrom(transactionService.announce(signedLockFundsTransaction, listener)); this.logger.info( `${this.getTransactionDescription(lockFundsTransaction, signedLockFundsTransaction, currency)} has been confirmed`, ); @@ -566,7 +563,7 @@ export class AnnounceService { this.logger.info( `Announcing Bonded ${this.getTransactionDescription(aggregateTransaction, signedAggregateTransaction, currency)}`, ); - await transactionService.announceAggregateBonded(signedAggregateTransaction, listener).toPromise(); + await firstValueFrom(transactionService.announceAggregateBonded(signedAggregateTransaction, listener)); this.logger.info( `${this.getTransactionDescription(aggregateTransaction, signedAggregateTransaction, currency)} has been announced`, ); @@ -576,7 +573,7 @@ export class AnnounceService { const message = `Aggregate Bonded Transaction ${signedAggregateTransaction.type} ${ signedAggregateTransaction.hash - } - signer ${signedAggregateTransaction.getSignerAddress().plain()} failed!! ` + e.message; + } - signer ${signedAggregateTransaction.getSignerAddress().plain()} failed!! ` + Utils.getMessage(e); this.logger.error(message); return false; } @@ -616,7 +613,7 @@ export class AnnounceService { } try { this.logger.info(`Announcing ${this.getTransactionDescription(aggregateTransaction, signedAggregateTransaction, currency)}`); - await transactionService.announce(signedAggregateTransaction, listener).toPromise(); + await firstValueFrom(transactionService.announce(signedAggregateTransaction, listener)); this.logger.info( `${this.getTransactionDescription(aggregateTransaction, signedAggregateTransaction, currency)} has been confirmed`, ); @@ -625,7 +622,7 @@ export class AnnounceService { const message = `Aggregate Complete Transaction ${signedAggregateTransaction.type} ${ signedAggregateTransaction.hash - } - signer ${signedAggregateTransaction.getSignerAddress().plain()} failed!! ` + e.message; + } - signer ${signedAggregateTransaction.getSignerAddress().plain()} failed!! ` + Utils.getMessage(e); this.logger.error(message); return false; } @@ -652,14 +649,14 @@ export class AnnounceService { } try { this.logger.info(`Announcing ${this.getTransactionDescription(transaction, signedTransaction, currency)}`); - await transactionService.announce(signedTransaction, listener).toPromise(); + await firstValueFrom(transactionService.announce(signedTransaction, listener)); this.logger.info(`${this.getTransactionDescription(transaction, signedTransaction, currency)} has been confirmed`); return true; } catch (e) { const message = `Simple Transaction ${signedTransaction.type} ${signedTransaction.hash} - signer ${signedTransaction .getSignerAddress() - .plain()} failed!! ` + e.message; + .plain()} failed!! ` + Utils.getMessage(e); this.logger.error(message); return false; } diff --git a/src/service/BootstrapAccountResolver.ts b/src/service/BootstrapAccountResolver.ts index 5c2c966a0..a6b3ae9f0 100644 --- a/src/service/BootstrapAccountResolver.ts +++ b/src/service/BootstrapAccountResolver.ts @@ -15,7 +15,9 @@ */ import { prompt } from 'inquirer'; import { Account, NetworkType, PublicAccount } from 'twix-sdk'; -import { AccountResolver, CertificatePair, CommandUtils, KeyName, KnownError, Logger } from '../'; +import { Logger } from '../logger'; +import { CertificatePair } from '../model'; +import { AccountResolver, CommandUtils, KeyName, KnownError } from './'; /** * Prompt ready implementation of the account resolver. diff --git a/src/service/CertificateService.ts b/src/service/CertificateService.ts index daa25cd4b..35f01183d 100644 --- a/src/service/CertificateService.ts +++ b/src/service/CertificateService.ts @@ -20,10 +20,10 @@ import { Convert, Crypto, NetworkType } from 'twix-sdk'; import { Logger } from '../logger'; import { CertificatePair } from '../model'; import { AccountResolver } from './AccountResolver'; -import { BootstrapUtils } from './BootstrapUtils'; import { KeyName } from './ConfigService'; import { Constants } from './Constants'; import { FileSystemService } from './FileSystemService'; +import { HandlebarsUtils } from './HandlebarsUtils'; import { RuntimeService } from './RuntimeService'; import { Utils } from './Utils'; import { YamlUtils } from './YamlUtils'; @@ -160,7 +160,7 @@ export class CertificateService { await this.fileSystemService.mkdir(certFolder); const generatedContext = { name }; - await BootstrapUtils.generateConfiguration(generatedContext, copyFrom, certFolder, []); + await HandlebarsUtils.generateConfiguration(generatedContext, copyFrom, certFolder, []); CertificateService.createDerFile(mainAccount.privateKey, join(certFolder, 'ca.der')); CertificateService.createDerFile(transportAccount.privateKey, join(certFolder, 'node.der')); @@ -221,7 +221,7 @@ export class CertificateService { metadata.version !== CertificateService.METADATA_VERSION ); } catch (e) { - this.logger.warn(`Cannot load node certificate metadata from file ${metadataFile}. Error: ${e.message}`, e); + this.logger.warn(`Cannot load node certificate metadata from file ${metadataFile}. Error: ${Utils.getMessage(e)}`, e); return true; } } diff --git a/src/service/CommandUtils.ts b/src/service/CommandUtils.ts index 659adc19c..3cdc33010 100644 --- a/src/service/CommandUtils.ts +++ b/src/service/CommandUtils.ts @@ -20,6 +20,7 @@ import { prompt } from 'inquirer'; import { Convert, PublicAccount } from 'twix-sdk'; import { Logger, LoggerFactory, LogType } from '../logger'; import { Constants } from './Constants'; +import { Password } from './YamlUtils'; export class CommandUtils { public static passwordPromptDefaultMessage = `Enter the password used to encrypt and decrypt custom presets, addresses.yml, and preset.yml files. When providing a password, private keys will be encrypted. Keep this password in a secure place!`; @@ -40,6 +41,11 @@ export class CommandUtils { default: false, }); + public static offlineFlag = flags.boolean({ + description: 'If --offline is used, Bootstrap resolves the configuration without querying the running network.', + default: false, + }); + public static showBanner(): void { console.log(textSync('twix-bootstrap', { horizontalLayout: 'fitted' })); } @@ -69,7 +75,7 @@ export class CommandUtils { public static async resolvePassword( logger: Logger, - providedPassword: string | undefined, + providedPassword: Password | undefined, noPassword: boolean, message: string, log: boolean, diff --git a/src/service/ComposeService.ts b/src/service/ComposeService.ts index 593aaa261..30a140738 100644 --- a/src/service/ComposeService.ts +++ b/src/service/ComposeService.ts @@ -19,14 +19,16 @@ import * as _ from 'lodash'; import { join } from 'path'; import { Logger } from '../logger'; import { Addresses, ConfigPreset, DockerCompose, DockerComposeService, DockerServicePreset } from '../model'; -import { BootstrapUtils } from './BootstrapUtils'; import { ConfigLoader } from './ConfigLoader'; import { Constants } from './Constants'; import { FileSystemService } from './FileSystemService'; +import { HandlebarsUtils } from './HandlebarsUtils'; +import { RemoteNodeService } from './RemoteNodeService'; import { RuntimeService } from './RuntimeService'; -import { YamlUtils } from './YamlUtils'; +import { Utils } from './Utils'; +import { Password, YamlUtils } from './YamlUtils'; -export type ComposeParams = { target: string; user?: string; upgrade?: boolean; password?: string; workingDir: string }; +export type ComposeParams = { target: string; user?: string; upgrade?: boolean; password?: Password; workingDir: string; offline: boolean }; const targetNodesFolder = Constants.targetNodesFolder; const targetDatabasesFolder = Constants.targetDatabasesFolder; @@ -44,6 +46,7 @@ export class ComposeService { user: Constants.CURRENT_USER, workingDir: Constants.defaultWorkingDir, upgrade: false, + offline: false, }; public static readonly DEBUG_SERVICE_PARAMS = { @@ -72,7 +75,7 @@ export class ComposeService { public async run(passedPresetData?: ConfigPreset, passedAddresses?: Addresses): Promise { const presetData = passedPresetData ?? this.configLoader.loadExistingPresetData(this.params.target, this.params.password || false); - + const remoteNodeService = new RemoteNodeService(this.logger, presetData, this.params.offline); const currentDir = process.cwd(); const target = join(currentDir, this.params.target); const targetDocker = join(target, `docker`); @@ -86,7 +89,7 @@ export class ComposeService { } await this.fileSystemService.mkdir(targetDocker); - await BootstrapUtils.generateConfiguration(presetData, join(Constants.ROOT_FOLDER, 'config', 'docker'), targetDocker); + await HandlebarsUtils.generateConfiguration(presetData, join(Constants.ROOT_FOLDER, 'config', 'docker'), targetDocker); await this.fileSystemService.chmodRecursive(join(targetDocker, 'mongo'), 0o666); @@ -244,8 +247,9 @@ export class ComposeService { await resolveService(n, { container_name: n.name, user, + environment: { npm_config_cache: nodeWorkingDirectory }, image: presetData.symbolRestImage, - command: 'npm start --prefix /app/catapult-rest/rest /symbol-workdir/rest.json', + command: 'npm start --prefix /app /symbol-workdir/rest.json', stop_signal: 'SIGINT', working_dir: nodeWorkingDirectory, ports: resolvePorts([{ internalPort: restInternalPort, openPort: n.openPort }]), @@ -263,18 +267,22 @@ export class ComposeService { .filter((d) => !d.excludeDockerService) .map(async (n) => { const internalPort = 443; - const host = n.host || presetData.nodes?.[0]?.host; - if (!host) { - throw new Error( - `HTTPS Proxy ${n.name} is invalid, 'host' property could not be resolved. It must be set to a valid DNS record.`, - ); - } + const resolveHost = (): string => { + const host = n.host || presetData.nodes?.[0]?.host; + if (!host) { + throw new Error( + `HTTPS Proxy ${n.name} is invalid, 'host' property could not be resolved. It must be set to a valid DNS record.`, + ); + } + return host; + }; const domains: string | undefined = n.domains || - presetData.gateways?.map((g) => resolveHttpsProxyDomains(host, `http://${g.name}:${restInternalPort}`))[0]; + presetData.gateways?.map((g) => resolveHttpsProxyDomains(resolveHost(), `http://${g.name}:${restInternalPort}`))[0]; if (!domains) { throw new Error(`HTTPS Proxy ${n.name} is invalid, 'domains' property could not be resolved!`); } + const restDependency = presetData.gateways?.[0]?.name; services.push( await resolveService(n, { container_name: n.name, @@ -291,7 +299,7 @@ export class ComposeService { SERVER_NAMES_HASH_BUCKET_SIZE: n.serverNamesHashBucketSize, }, restart: restart, - depends_on: [presetData.gateways![0].name], + depends_on: restDependency ? [restDependency] : [], ...this.resolveDebugOptions(presetData.dockerComposeDebugMode, n.dockerComposeDebugMode), }), ); @@ -329,16 +337,18 @@ export class ComposeService { .map(async (n) => { const mosaicPreset = presetData.nemesis.mosaics[0]; const fullName = `${presetData.baseNamespace}.${mosaicPreset.name}`; - // const nemesisPrivateKey = addresses?.mosaics?[0]?/; + const { defaultNode } = await remoteNodeService.resolveRestUrlsForServices(); services.push( await resolveService(n, { container_name: n.name, image: presetData.symbolFaucetImage, stop_signal: 'SIGINT', environment: { + DEFAULT_NODE: defaultNode, + DEFAULT_NODE_CLIENT: defaultNode, NATIVE_CURRENCY_NAME: fullName, FAUCET_PRIVATE_KEY: this.getMainAccountPrivateKey(passedAddresses) || '', - NATIVE_CURRENCY_ID: BootstrapUtils.toSimpleHex(presetData.currencyMosaicId || ''), + NATIVE_CURRENCY_ID: HandlebarsUtils.toSimpleHex(presetData.currencyMosaicId || ''), }, restart: restart, ports: resolvePorts([{ internalPort: 4000, openPort: n.openPort }]), @@ -369,7 +379,7 @@ export class ComposeService { }, }; - dockerCompose = BootstrapUtils.pruneEmpty(_.merge({}, dockerCompose, presetData.compose)); + dockerCompose = Utils.pruneEmpty(_.merge({}, dockerCompose, presetData.compose)); await YamlUtils.writeYaml(dockerFile, dockerCompose, undefined); this.logger.info(`The docker-compose.yml file created ${dockerFile}`); return dockerCompose; diff --git a/src/service/ConfigLoader.ts b/src/service/ConfigLoader.ts index bd41a2a61..b717d77d7 100644 --- a/src/service/ConfigLoader.ts +++ b/src/service/ConfigLoader.ts @@ -19,11 +19,13 @@ import { join } from 'path'; import { Account, PublicAccount } from 'twix-sdk'; import { Logger } from '../logger'; import { Addresses, ConfigAccount, ConfigPreset, CustomPreset, NodePreset } from '../model'; -import { BootstrapUtils, KnownError, Password } from './BootstrapUtils'; import { Assembly, defaultAssembly } from './ConfigService'; import { Constants } from './Constants'; +import { HandlebarsUtils } from './HandlebarsUtils'; +import { KnownError } from './KnownError'; import { MigrationService } from './MigrationService'; -import { YamlUtils } from './YamlUtils'; +import { Utils } from './Utils'; +import { Password, YamlUtils } from './YamlUtils'; /** * Helper object that knows how to load addresses and preset files. @@ -59,7 +61,7 @@ export class ConfigLoader { private static loadBundledPreset(presetFile: string, bundledLocation: string, workingDir: string, errorMessage: string): CustomPreset { if (YamlUtils.isYmlFile(presetFile)) { - const assemblyFile = BootstrapUtils.resolveWorkingDirPath(workingDir, presetFile); + const assemblyFile = Utils.resolveWorkingDirPath(workingDir, presetFile); if (!existsSync(assemblyFile)) { throw new KnownError(errorMessage); } @@ -214,6 +216,7 @@ export class ConfigLoader { databases: this.expandServicesRepeat(presetData, presetData.databases || []), nodes: this.expandServicesRepeat(presetData, presetData.nodes || []), gateways: this.expandServicesRepeat(presetData, presetData.gateways || []), + httpsProxies: this.expandServicesRepeat(presetData, presetData.httpsProxies || []), explorers: this.expandServicesRepeat(presetData, presetData.explorers || []), faucets: this.expandServicesRepeat(presetData, presetData.faucets || []), nemesis: this.applyValueTemplate(presetData, presetData.nemesis), @@ -236,7 +239,7 @@ export class ConfigLoader { if (!_.isString(value)) { return value; } - return BootstrapUtils.runTemplate(value, context); + return HandlebarsUtils.runTemplate(value, context); } // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types diff --git a/src/service/ConfigService.ts b/src/service/ConfigService.ts index 4965d7584..0f8ac54c4 100644 --- a/src/service/ConfigService.ts +++ b/src/service/ConfigService.ts @@ -34,18 +34,20 @@ import { Logger } from '../logger'; import { Addresses, ConfigPreset, CustomPreset, GatewayConfigPreset, NodeAccount, PeerInfo } from '../model'; import { AccountResolver, DefaultAccountResolver } from './AccountResolver'; import { AddressesService } from './AddressesService'; -import { BootstrapUtils, KnownError, Password } from './BootstrapUtils'; import { CertificateService, RenewMode } from './CertificateService'; import { ConfigLoader } from './ConfigLoader'; import { ConfigurationUtils } from './ConfigurationUtils'; import { Constants } from './Constants'; import { CryptoUtils } from './CryptoUtils'; import { FileSystemService } from './FileSystemService'; +import { HandlebarsUtils } from './HandlebarsUtils'; +import { KnownError } from './KnownError'; import { NemgenService } from './NemgenService'; import { RemoteNodeService } from './RemoteNodeService'; import { ReportParams, ReportService } from './ReportService'; +import { Utils } from './Utils'; import { VotingParams, VotingService } from './VotingService'; -import { YamlUtils } from './YamlUtils'; +import { Password, YamlUtils } from './YamlUtils'; /** * Defined presets. @@ -57,11 +59,12 @@ export enum Preset { } export enum Assembly { + dual = 'dual', + peer = 'peer', api = 'api', demo = 'demo', - dual = 'dual', multinode = 'multinode', - peer = 'peer', + services = 'services', } export const defaultAssembly: Record = { @@ -83,10 +86,10 @@ export interface ConfigParams extends VotingParams, ReportParams { reset: boolean; upgrade: boolean; workingDir: string; - offline?: boolean; + offline: boolean; preset?: string; target: string; - password?: string; + password?: Password; user: string; assembly?: string; customPreset?: string; @@ -185,8 +188,10 @@ export class ConfigService { await this.generateGateways(presetData); await this.generateExplorers(presetData, remoteNodeService); const isUpgrade = !!oldPresetData || !!oldAddresses; - await this.resolveNemesis(presetData, addresses, isUpgrade); - await this.copyNemesis(addresses); + if (presetData.nodes?.length) { + await this.resolveNemesis(presetData, addresses, isUpgrade); + await this.copyNemesis(addresses); + } if (this.params.report) { await new ReportService(this.logger, this.params).run(presetData); } @@ -199,10 +204,10 @@ export class ConfigService { this.logger.info(`Configuration generated.`); return { presetData, addresses }; } catch (e) { - if (e.known) { - this.logger.error(e.message); + if ((e as any).known) { + this.logger.error(Utils.getMessage(e)); } else { - this.logger.error(`Unknown error generating the configuration. ${e.message}`, e); + this.logger.error(`Unknown error generating the configuration. ${Utils.getMessage(e)}`, e); this.logger.error(`The target folder '${target}' should be deleted!!!`); } throw e; @@ -256,7 +261,7 @@ export class ConfigService { if (!presetData.nemesisSeedFolder) { return undefined; } - return BootstrapUtils.resolveWorkingDirPath(this.params.workingDir, presetData.nemesisSeedFolder); + return Utils.resolveWorkingDirPath(this.params.workingDir, presetData.nemesisSeedFolder); }; const presetNemesisSeedFolder = resolvePresetNemesisSeedFolder(); @@ -416,7 +421,7 @@ export class ConfigService { }; this.logger.info(`Generating ${name} server configuration`); - await BootstrapUtils.generateConfiguration({ ...serverRecoveryConfig, ...templateContext }, copyFrom, serverConfig, excludeFiles); + await HandlebarsUtils.generateConfiguration({ ...serverRecoveryConfig, ...templateContext }, copyFrom, serverConfig, excludeFiles); const isPeer = (nodePresetData: PeerInfo): boolean => nodePresetData.metadata.roles.includes('Peer'); const peers = knownPeers.filter((peer) => isPeer(peer) && peer.publicKey != account.main.publicKey); @@ -443,7 +448,7 @@ export class ConfigService { } if (nodePreset.brokerName) { this.logger.info(`Generating ${nodePreset.brokerName} broker configuration`); - await BootstrapUtils.generateConfiguration( + await HandlebarsUtils.generateConfiguration( { ...brokerRecoveryConfig, ...templateContext }, copyFrom, brokerConfig, @@ -516,7 +521,7 @@ export class ConfigService { this.logger.info(`Found ${transactions.length} provided in transactions.`); } - await BootstrapUtils.generateConfiguration(templateContext, copyFrom, moveTo); + await HandlebarsUtils.generateConfiguration(templateContext, copyFrom, moveTo); await new NemgenService(this.logger, this.params).run(presetData); } @@ -621,7 +626,7 @@ export class ConfigService { const templateContext = { ...generatedContext, ...presetData, ...gatewayPreset }; const name = templateContext.name || `rest-gateway-${index}`; const moveTo = this.fileSystemService.getTargetGatewayFolder(this.params.target, false, name); - await BootstrapUtils.generateConfiguration(templateContext, copyFrom, moveTo); + await HandlebarsUtils.generateConfiguration(templateContext, copyFrom, moveTo); const apiNodeConfigFolder = this.fileSystemService.getTargetNodesFolder( this.params.target, false, @@ -635,14 +640,14 @@ export class ConfigService { gatewayPreset.apiNodeName, 'cert', ); - await BootstrapUtils.generateConfiguration( + await HandlebarsUtils.generateConfiguration( {}, apiNodeConfigFolder, join(moveTo, 'api-node-config'), [], ['config-network.properties', 'config-node.properties'], ); - await BootstrapUtils.generateConfiguration( + await HandlebarsUtils.generateConfiguration( {}, apiNodeCertFolder, join(moveTo, 'api-node-config', 'cert'), @@ -692,7 +697,7 @@ export class ConfigService { const copyFrom = join(Constants.ROOT_FOLDER, 'config', 'explorer'); const fullName = `${presetData.baseNamespace}.${this.resolveCurrencyName(presetData)}`; const namespaceId = new NamespaceId(fullName); - const { restNodes, defaultNode } = await this.resolveRests(presetData, remoteNodeService); + const { restNodes, defaultNode } = await remoteNodeService.resolveRestUrlsForServices(); const templateContext = { namespaceName: fullName, namespaceId: namespaceId.toHex(), @@ -703,24 +708,11 @@ export class ConfigService { }; const name = templateContext.name || `explorer-${index}`; const moveTo = this.fileSystemService.getTargetFolder(this.params.target, false, Constants.targetExplorersFolder, name); - await BootstrapUtils.generateConfiguration(templateContext, copyFrom, moveTo); + await HandlebarsUtils.generateConfiguration(templateContext, copyFrom, moveTo); }), ); } - private async resolveRests( - presetData: ConfigPreset, - remoteNodeService: RemoteNodeService, - ): Promise<{ restNodes: string[]; defaultNode: string }> { - const restNodes: string[] = []; - presetData.gateways?.forEach((restService) => { - const nodePreset = presetData.nodes?.find((g) => g.name == restService.apiNodeName); - restNodes.push(`http://${restService.host || nodePreset?.host || 'localhost'}:3000`); - }); - restNodes.push(...(await remoteNodeService.getRestUrls())); - return { restNodes: _.uniq(restNodes), defaultNode: restNodes[0] || 'http://localhost:3000' }; - } - private cleanUpConfiguration(presetData: ConfigPreset) { const target = this.params.target; (presetData.nodes || []).forEach(({ name }) => { diff --git a/src/service/CryptoUtils.ts b/src/service/CryptoUtils.ts index 7c12039dc..7ae18d1d6 100644 --- a/src/service/CryptoUtils.ts +++ b/src/service/CryptoUtils.ts @@ -16,7 +16,7 @@ import * as _ from 'lodash'; import { Crypto } from 'twix-sdk'; import { PrivateKeySecurityMode } from '../model'; -import { KnownError } from './BootstrapUtils'; +import { KnownError } from './KnownError'; export class CryptoUtils { private static readonly ENCRYPT_PREFIX = 'ENCRYPTED:'; diff --git a/src/service/FileSystemService.ts b/src/service/FileSystemService.ts index 98cc56131..98f584cef 100644 --- a/src/service/FileSystemService.ts +++ b/src/service/FileSystemService.ts @@ -2,8 +2,8 @@ import { createWriteStream, existsSync, lstatSync, promises as fsPromises, readd import { get } from 'https'; import { basename, dirname, join } from 'path'; import { Logger } from '../logger'; -import { KnownError } from './BootstrapUtils'; import { Constants } from './Constants'; +import { KnownError } from './KnownError'; import { Utils } from './Utils'; /** @@ -39,8 +39,8 @@ export class FileSystemService { } } - public mkdir(path: string): Promise { - return fsPromises.mkdir(path, { recursive: true }); + public async mkdir(path: string): Promise { + await fsPromises.mkdir(path, { recursive: true }); } public async mkdirParentFolder(fileName: string): Promise { diff --git a/src/service/BootstrapUtils.ts b/src/service/HandlebarsUtils.ts similarity index 70% rename from src/service/BootstrapUtils.ts rename to src/service/HandlebarsUtils.ts index 57b22115c..eaa027805 100644 --- a/src/service/BootstrapUtils.ts +++ b/src/service/HandlebarsUtils.ts @@ -18,18 +18,12 @@ import { promises as fsPromises } from 'fs'; import * as Handlebars from 'handlebars'; import * as _ from 'lodash'; import { totalmem } from 'os'; -import { basename, isAbsolute, join } from 'path'; -import { DtoMapping, NetworkType } from 'twix-sdk'; +import { basename, join } from 'path'; +import { DtoMapping, } from 'twix-sdk'; import { Utils } from './Utils'; import { YamlUtils } from './YamlUtils'; -export type Password = string | false | undefined; - -export class KnownError extends Error { - public readonly known = true; -} - -export class BootstrapUtils { +export class HandlebarsUtils { public static async generateConfiguration( // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types templateContext: any, @@ -62,7 +56,7 @@ export class BootstrapUtils { await fsPromises.writeFile( destinationFile, destinationFile.toLowerCase().endsWith('.json') - ? BootstrapUtils.formatJson(renderedTemplate) + ? HandlebarsUtils.formatJson(renderedTemplate) : renderedTemplate, ); } else { @@ -86,40 +80,24 @@ export class BootstrapUtils { } catch (e) { const securedTemplate = Utils.secureString(template); const securedContext = Utils.secureString(YamlUtils.toYaml(templateContext)); - const securedMessage = Utils.secureString(e.message || 'Unknown'); + const securedMessage = Utils.secureString(Utils.getMessage(e)); const message = `Unknown error rendering template. Error: ${securedMessage}\nTemplate:\n${securedTemplate}.`; throw new Error(`${message}\nContext: \n${securedContext}`); } } - // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types - public static pruneEmpty(obj: any): any { - return (function prune(current: any) { - _.forOwn(current, (value, key) => { - if (_.isUndefined(value) || _.isNull(value) || _.isNaN(value) || (_.isObject(value) && _.isEmpty(prune(value)))) { - delete current[key]; - } - }); - // remove any leftover undefined values from the delete - // operation on an array - if (_.isArray(current)) _.pull(current, undefined); - - return current; - })(_.cloneDeep(obj)); // Do not modify the original object, create a clone instead - } - //HANDLEBARS READY FUNCTIONS: private static initialize = (() => { - Handlebars.registerHelper('toAmount', BootstrapUtils.toAmount); - Handlebars.registerHelper('toHex', BootstrapUtils.toHex); - Handlebars.registerHelper('toSimpleHex', BootstrapUtils.toSimpleHex); - Handlebars.registerHelper('toSeconds', BootstrapUtils.toSeconds); - Handlebars.registerHelper('toJson', BootstrapUtils.toJson); - Handlebars.registerHelper('splitCsv', BootstrapUtils.splitCsv); - Handlebars.registerHelper('add', BootstrapUtils.add); - Handlebars.registerHelper('minus', BootstrapUtils.minus); - Handlebars.registerHelper('computerMemory', BootstrapUtils.computerMemory); + Handlebars.registerHelper('toAmount', HandlebarsUtils.toAmount); + Handlebars.registerHelper('toHex', HandlebarsUtils.toHex); + Handlebars.registerHelper('toSimpleHex', HandlebarsUtils.toSimpleHex); + Handlebars.registerHelper('toSeconds', HandlebarsUtils.toSeconds); + Handlebars.registerHelper('toJson', HandlebarsUtils.toJson); + Handlebars.registerHelper('splitCsv', HandlebarsUtils.splitCsv); + Handlebars.registerHelper('add', HandlebarsUtils.add); + Handlebars.registerHelper('minus', HandlebarsUtils.minus); + Handlebars.registerHelper('computerMemory', HandlebarsUtils.computerMemory); })(); private static add(a: any, b: any): string | number { @@ -158,7 +136,7 @@ export class BootstrapUtils { if (!renderedText) { return ''; } - const numberAsString = BootstrapUtils.toSimpleHex(renderedText); + const numberAsString = HandlebarsUtils.toSimpleHex(renderedText); return '0x' + (numberAsString.match(/\w{1,4}(?=(\w{4})*$)/g) || [numberAsString]).join("'"); } @@ -179,7 +157,7 @@ export class BootstrapUtils { try { return JSON.stringify(JSON.parse(string), null, 2); } catch (e) { - throw new Error(`${e.message}:JSON\n ${string}`); + throw new Error(`${Utils.getMessage(e)}:JSON\n ${string}`); } } @@ -193,26 +171,4 @@ export class BootstrapUtils { public static toSeconds(serverDuration: string): number { return DtoMapping.parseServerDuration(serverDuration).seconds(); } - - public static getNetworkIdentifier(networkType: NetworkType): string { - return BootstrapUtils.getNetworkName(networkType); - } - - public static getNetworkName(networkType: NetworkType): string { - switch (networkType) { - case NetworkType.MAIN_NET: - return 'mainnet'; - case NetworkType.TEST_NET: - return 'testnet'; - } - throw new Error(`Invalid Network Type ${networkType}`); - } - - public static resolveWorkingDirPath(workingDir: string, path: string): string { - if (isAbsolute(path)) { - return path; - } else { - return join(workingDir, path); - } - } } diff --git a/src/service/KnownError.ts b/src/service/KnownError.ts new file mode 100644 index 000000000..2b286e566 --- /dev/null +++ b/src/service/KnownError.ts @@ -0,0 +1,22 @@ +/* + * Copyright 2022 Fernando Boucquez + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Exception with special, not critical, error handling. + */ +export class KnownError extends Error { + public readonly known = true; +} diff --git a/src/service/LinkService.ts b/src/service/LinkService.ts index a0ac88f83..3b722da3a 100644 --- a/src/service/LinkService.ts +++ b/src/service/LinkService.ts @@ -27,7 +27,7 @@ import { } from 'twix-sdk'; import { Logger } from '../logger'; import { Addresses, ConfigPreset, NodeAccount } from '../model'; -import { AccountResolver, BootstrapAccountResolver } from '../service'; +import { AccountResolver, BootstrapAccountResolver, Password } from '../service'; import { AnnounceService, TransactionFactory } from './AnnounceService'; import { ConfigLoader } from './ConfigLoader'; import { Constants } from './Constants'; @@ -38,7 +38,7 @@ import { VotingKeyAccount } from './VotingUtils'; */ export type LinkParams = { target: string; - password?: string; + password?: Password; url: string; maxFee?: number | undefined; unlink: boolean; diff --git a/src/service/ModifyMultisigService.ts b/src/service/ModifyMultisigService.ts index 497fc4a80..3cff1908b 100644 --- a/src/service/ModifyMultisigService.ts +++ b/src/service/ModifyMultisigService.ts @@ -31,13 +31,14 @@ import { BootstrapAccountResolver } from './BootstrapAccountResolver'; import { ConfigLoader } from './ConfigLoader'; import { Constants } from './Constants'; import { TransactionUtils } from './TransactionUtils'; +import { Password } from './YamlUtils'; /** * params necessary to announce multisig account modification transaction to network. */ export type ModifyMultisigParams = { target: string; - password?: string; + password?: Password; url: string; maxFee?: number; useKnownRestGateways: boolean; @@ -84,6 +85,7 @@ export class ModifyMultisigService implements TransactionFactory { this.params.serviceProviderPublicKey, ); } + public async createTransactions({ presetData, deadline, maxFee, mainAccount }: TransactionFactoryParams): Promise { const networkType = presetData.networkType; @@ -193,6 +195,7 @@ export class ModifyMultisigService implements TransactionFactory { }) || [] ); } + private toAddress(addressString: string, networkType: NetworkType): Address { if (!Address.isValidRawAddress(addressString)) { throw new Error(`Address ${addressString} is not valid!`); diff --git a/src/service/NemgenService.ts b/src/service/NemgenService.ts index 6453c90c0..89c8ee0a3 100644 --- a/src/service/NemgenService.ts +++ b/src/service/NemgenService.ts @@ -78,7 +78,7 @@ export class NemgenService { failed = stdout.indexOf('') > -1; } catch (e) { failed = true; - ({ stdout, stderr, message } = e); + ({ stdout, stderr, message } = e as any); } if (failed) { if (message) this.logger.error(message); diff --git a/src/service/RemoteNodeService.ts b/src/service/RemoteNodeService.ts index e0599f63e..c0615dd17 100644 --- a/src/service/RemoteNodeService.ts +++ b/src/service/RemoteNodeService.ts @@ -15,11 +15,14 @@ */ import fetch from 'cross-fetch'; import { lookup } from 'dns'; +import * as _ from 'lodash'; +import { firstValueFrom } from 'rxjs'; import { ChainInfo, RepositoryFactory, RepositoryFactoryHttp, RoleType } from 'twix-sdk'; import { Configuration, NodeApi, NodeListFilter, RequestContext } from 'symbol-statistics-service-typescript-fetch-client'; import { Logger } from '../logger'; import { ConfigPreset, PeerInfo } from '../model'; -import { KnownError } from './BootstrapUtils'; +import { KnownError } from './KnownError'; +import { Utils } from './Utils'; export interface RepositoryInfo { repositoryFactory: RepositoryFactory; @@ -27,11 +30,7 @@ export interface RepositoryInfo { chainInfo: ChainInfo; } export class RemoteNodeService { - constructor( - private readonly logger: Logger, - private readonly presetData: ConfigPreset, - private readonly offline: boolean | undefined, - ) {} + constructor(private readonly logger: Logger, private readonly presetData: ConfigPreset, private readonly offline: boolean) {} private restUrls: string[] | undefined; public async resolveCurrentFinalizationEpoch(): Promise { @@ -104,14 +103,14 @@ export class RemoteNodeService { urls.map(async (restGatewayUrl): Promise => { const repositoryFactory = new RepositoryFactoryHttp(restGatewayUrl); try { - const chainInfo = await repositoryFactory.createChainRepository().getChainInfo().toPromise(); + const chainInfo = await firstValueFrom(repositoryFactory.createChainRepository().getChainInfo()); return { restGatewayUrl, repositoryFactory, chainInfo, }; } catch (e) { - const message = `There has been an error talking to node ${restGatewayUrl}. Error: ${e.message}`; + const message = `There has been an error talking to node ${restGatewayUrl}. Error: ${Utils.getMessage(e)}`; this.logger.warn(message); return undefined; } @@ -138,7 +137,9 @@ export class RemoteNodeService { urls.push(...nodes.map((n) => n.apiStatus?.restGatewayUrl).filter((url): url is string => !!url)); } catch (e) { this.logger.warn( - `There has been an error connecting to statistics ${statisticsServiceUrl}. Rest urls cannot be resolved! Error ${e.message}`, + `There has been an error connecting to statistics ${statisticsServiceUrl}. Rest urls cannot be resolved! Error ${Utils.getMessage( + e, + )}`, ); } } @@ -198,7 +199,9 @@ export class RemoteNodeService { knownPeers.push(...peerInfos); } catch (error) { this.logger.warn( - `There has been an error connecting to statistics ${statisticsServiceUrl}. Peers cannot be resolved! Error ${error.message}`, + `There has been an error connecting to statistics ${statisticsServiceUrl}. Peers cannot be resolved! Error ${Utils.getMessage( + error, + )}`, ); } } @@ -221,4 +224,18 @@ export class RemoteNodeService { }), ); } + + public async resolveRestUrlsForServices(): Promise<{ restNodes: string[]; defaultNode: string }> { + const restNodes: string[] = []; + this.presetData.gateways?.forEach((restService) => { + const nodePreset = this.presetData.nodes?.find((g) => g.name == restService.apiNodeName); + restNodes.push(`http://${restService.host || nodePreset?.host || 'localhost'}:3000`); + }); + restNodes.push(...(await this.getRestUrls())); + const defaultNode = restNodes[0]; + if (!defaultNode) { + throw new Error('Rest node could not be resolved!'); + } + return { restNodes: _.uniq(restNodes), defaultNode: defaultNode }; + } } diff --git a/src/service/RunService.ts b/src/service/RunService.ts index b4685ba63..9ef5b08ec 100644 --- a/src/service/RunService.ts +++ b/src/service/RunService.ts @@ -17,6 +17,7 @@ import { chmodSync, existsSync } from 'fs'; import * as _ from 'lodash'; import { join } from 'path'; +import { firstValueFrom } from 'rxjs'; import { NodeStatusEnum } from 'twix-openapi-typescript-fetch-client'; import { RepositoryFactoryHttp } from 'twix-sdk'; import { Logger } from '../logger'; @@ -30,6 +31,7 @@ import { FileSystemService } from './FileSystemService'; import { OSUtils } from './OSUtils'; import { PortService } from './PortService'; import { RuntimeService } from './RuntimeService'; +import { Utils } from './Utils'; import { YamlUtils } from './YamlUtils'; /** * params necessary to run the docker-compose network. @@ -169,7 +171,7 @@ export class RunService { const testUrl = `${url}/node/health`; this.logger.info(`Testing ${testUrl}`); try { - const healthStatus = await nodeRepository.getNodeHealth().toPromise(); + const healthStatus = await firstValueFrom(nodeRepository.getNodeHealth()); if (healthStatus.apiNode === NodeStatusEnum.Down) { this.logger.warn(`Rest ${testUrl} is NOT up and running YET: Api Node is still Down!`); return false; @@ -181,7 +183,7 @@ export class RunService { this.logger.info(`Rest ${testUrl} is up and running...`); return true; } catch (e) { - this.logger.warn(`Rest ${testUrl} is NOT up and running YET: ${e.message}`); + this.logger.warn(`Rest ${testUrl} is NOT up and running YET: ${Utils.getMessage(e)}`); return false; } } diff --git a/src/service/TransactionUtils.ts b/src/service/TransactionUtils.ts index 3782a1437..6e83f615f 100644 --- a/src/service/TransactionUtils.ts +++ b/src/service/TransactionUtils.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +import { firstValueFrom } from 'rxjs'; import { Address, MultisigAccountInfo, RepositoryFactory } from 'twix-sdk'; import { Logger } from '../logger'; import { ConfigPreset } from '../model'; @@ -34,7 +35,7 @@ export class TransactionUtils { accountAddress: Address, ): Promise { try { - const info = await repositoryFactory.createMultisigRepository().getMultisigAccountInfo(accountAddress).toPromise(); + const info = await firstValueFrom(repositoryFactory.createMultisigRepository().getMultisigAccountInfo(accountAddress)); return info.isMultisig() ? info : undefined; } catch (e) { return undefined; diff --git a/src/service/Utils.ts b/src/service/Utils.ts index 5d541b2eb..2b7669c56 100644 --- a/src/service/Utils.ts +++ b/src/service/Utils.ts @@ -14,7 +14,10 @@ * limitations under the License. */ -import { KnownError } from './BootstrapUtils'; +import * as _ from 'lodash'; +import { isAbsolute, join } from 'path'; +import { NetworkType } from 'symbol-sdk'; +import { KnownError } from './KnownError'; import { OSUtils } from './OSUtils'; /** @@ -48,4 +51,45 @@ export class Utils { } return password; } + + public static getNetworkIdentifier(networkType: NetworkType): string { + return Utils.getNetworkName(networkType); + } + + public static getNetworkName(networkType: NetworkType): string { + switch (networkType) { + case NetworkType.MAIN_NET: + return 'mainnet'; + case NetworkType.TEST_NET: + return 'testnet'; + } + throw new Error(`Invalid Network Type ${networkType}`); + } + + public static resolveWorkingDirPath(workingDir: string, path: string): string { + if (isAbsolute(path)) { + return path; + } else { + return join(workingDir, path); + } + } + + // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types + public static pruneEmpty(obj: any): any { + return (function prune(current: any) { + _.forOwn(current, (value, key) => { + if (_.isUndefined(value) || _.isNull(value) || _.isNaN(value) || (_.isObject(value) && _.isEmpty(prune(value)))) { + delete current[key]; + } + }); + // remove any leftover undefined values from the delete + // operation on an array + if (_.isArray(current)) _.pull(current, undefined); + + return current; + })(_.cloneDeep(obj)); // Do not modify the original object, create a clone instead + } + public static getMessage(e: unknown): string { + return (e as any)['message'] || `${e}`; + } } diff --git a/src/service/VerifyService.ts b/src/service/VerifyService.ts index 703b4b9ef..e8b9431d4 100644 --- a/src/service/VerifyService.ts +++ b/src/service/VerifyService.ts @@ -18,6 +18,7 @@ import * as semver from 'semver'; import { Logger } from '../logger'; import { OSUtils } from './OSUtils'; import { RuntimeService } from './RuntimeService'; +import { Utils } from './Utils'; export interface VerifyReport { platform: string; lines: ReportLine[]; @@ -93,7 +94,7 @@ export class AppVersionService { } catch (e) { return { header, - message: `Error: ${e.message}`, + message: `Error: ${Utils.getMessage(e)}`, recommendation: `${recommendationPrefix} ${recommendationSuffix}`, }; } @@ -155,7 +156,7 @@ export class DockerRunVerifyAction implements VerifyAction { } catch (e) { return { header, - message: `Command '${command}' could not be executed: Error: ${e.message}`, + message: `Command '${command}' could not be executed: Error: ${Utils.getMessage(e)}`, recommendation: `Please check ${recommendationUrl}`, }; } diff --git a/src/service/VotingUtils.ts b/src/service/VotingUtils.ts index 26aebfa4a..da9833868 100644 --- a/src/service/VotingUtils.ts +++ b/src/service/VotingUtils.ts @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import * as noble from '@noble/ed25519'; import { existsSync, lstatSync, readdirSync, readFileSync } from 'fs'; -import * as noble from 'noble-ed25519'; import { join } from 'path'; import { Convert, Crypto } from 'twix-sdk'; import * as nacl from 'tweetnacl'; diff --git a/src/service/YamlUtils.ts b/src/service/YamlUtils.ts index 2e069a196..945ba1720 100644 --- a/src/service/YamlUtils.ts +++ b/src/service/YamlUtils.ts @@ -17,10 +17,12 @@ import { promises as fsPromises, readFileSync } from 'fs'; import * as yaml from 'js-yaml'; import { dirname } from 'path'; -import { KnownError, Password } from './BootstrapUtils'; import { CryptoUtils } from './CryptoUtils'; +import { KnownError } from './KnownError'; import { Utils } from './Utils'; +export type Password = string | false | undefined; + /** * Utility methods in charge of loading and saving yaml files (and text files). */ @@ -29,7 +31,7 @@ export class YamlUtils { return string.toLowerCase().endsWith('.yml') || string.toLowerCase().endsWith('.yaml'); } - public static async writeYaml(path: string, object: unknown, password: string | undefined): Promise { + public static async writeYaml(path: string, object: unknown, password: Password): Promise { const yamlString = this.toYaml(password ? CryptoUtils.encrypt(object, Utils.validatePassword(password)) : object); await this.writeTextFile(path, yamlString); } @@ -65,7 +67,7 @@ export class YamlUtils { const mkdirParentFolder = async (fileName: string): Promise => { const parentFolder = dirname(fileName); if (parentFolder) { - return fsPromises.mkdir(parentFolder, { recursive: true }); + await fsPromises.mkdir(parentFolder, { recursive: true }); } }; await mkdirParentFolder(path); diff --git a/src/service/index.ts b/src/service/index.ts index 4f0fb8f6c..24f6830df 100644 --- a/src/service/index.ts +++ b/src/service/index.ts @@ -6,7 +6,6 @@ export * from './AnnounceService'; export * from './AsyncUtils'; export * from './BootstrapAccountResolver'; export * from './BootstrapService'; -export * from './BootstrapUtils'; export * from './CertificateService'; export * from './CommandUtils'; export * from './ComposeService'; @@ -16,6 +15,8 @@ export * from './ConfigurationUtils'; export * from './Constants'; export * from './CryptoUtils'; export * from './FileSystemService'; +export * from './HandlebarsUtils'; +export * from './KnownError'; export * from './LinkService'; export * from './MigrationService'; export * from './ModifyMultisigService'; diff --git a/test/composes/expected-docker-compose-bootstrap-custom-compose.yml b/test/composes/expected-docker-compose-bootstrap-custom-compose.yml index 666c9e452..6748a054c 100644 --- a/test/composes/expected-docker-compose-bootstrap-custom-compose.yml +++ b/test/composes/expected-docker-compose-bootstrap-custom-compose.yml @@ -23,7 +23,7 @@ services: peer-node-0: user: '1000:1000' container_name: peer-node-0 - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker peer-node-0 NORMAL false stop_signal: SIGINT working_dir: /symbol-workdir @@ -47,7 +47,7 @@ services: peer-node-1: user: '1000:1000' container_name: peer-node-1 - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker peer-node-1 NORMAL false stop_signal: SIGINT working_dir: /symbol-workdir @@ -71,7 +71,7 @@ services: api-node-0: user: '1000:1000' container_name: api-node-0 - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker api-node-0 NORMAL true stop_signal: SIGINT working_dir: /symbol-workdir @@ -90,7 +90,7 @@ services: api-node-broker-0: user: '1000:1000' container_name: api-node-broker-0 - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' working_dir: /symbol-workdir command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data broker server api-node-broker-0 NORMAL ports: @@ -105,8 +105,10 @@ services: rest-gateway-0: container_name: rest-gateway-0 user: '1000:1000' - image: 'symbolplatform/symbol-rest:2.4.0' - command: npm start --prefix /app/catapult-rest/rest /symbol-workdir/rest.json + environment: + npm_config_cache: /symbol-workdir + image: 'symbolplatform/symbol-rest:2.4.2' + command: npm start --prefix /app /symbol-workdir/rest.json stop_signal: SIGINT working_dir: /symbol-workdir ports: diff --git a/test/composes/expected-docker-compose-bootstrap-custom.yml b/test/composes/expected-docker-compose-bootstrap-custom.yml index e1a813a46..5cf98d15a 100644 --- a/test/composes/expected-docker-compose-bootstrap-custom.yml +++ b/test/composes/expected-docker-compose-bootstrap-custom.yml @@ -16,7 +16,7 @@ services: - '../databases/db-0:/dbdata:rw' peer-node-0: container_name: peer-node-0 - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker peer-node-0 DEBUG false stop_signal: SIGINT working_dir: /symbol-workdir @@ -38,7 +38,7 @@ services: hostname: peer-node-0 peer-node-1: container_name: peer-node-1 - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker peer-node-1 DEBUG false stop_signal: SIGINT working_dir: /symbol-workdir @@ -60,7 +60,7 @@ services: hostname: peer-node-1 api-node-0: container_name: api-node-0 - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker api-node-0 DEBUG true stop_signal: SIGINT working_dir: /symbol-workdir @@ -83,7 +83,7 @@ services: hostname: api-node-0 api-node-broker-0: container_name: api-node-broker-0 - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' working_dir: /symbol-workdir command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data broker server api-node-broker-0 DEBUG ports: @@ -103,8 +103,10 @@ services: rest-gateway-0: container_name: rest-gateway-0 user: '1000:1000' - image: 'symbolplatform/symbol-rest:2.4.0' - command: npm start --prefix /app/catapult-rest/rest /symbol-workdir/rest.json + environment: + npm_config_cache: /symbol-workdir + image: 'symbolplatform/symbol-rest:2.4.2' + command: npm start --prefix /app /symbol-workdir/rest.json stop_signal: SIGINT working_dir: /symbol-workdir ports: diff --git a/test/composes/expected-docker-compose-bootstrap-demo.yml b/test/composes/expected-docker-compose-bootstrap-demo.yml index db3c3f700..bcf92f4bb 100644 --- a/test/composes/expected-docker-compose-bootstrap-demo.yml +++ b/test/composes/expected-docker-compose-bootstrap-demo.yml @@ -19,7 +19,7 @@ services: privileged: true node: container_name: node - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker node DEBUG true stop_signal: SIGINT working_dir: /symbol-workdir @@ -39,7 +39,7 @@ services: privileged: true broker: container_name: broker - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' working_dir: /symbol-workdir command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data broker server broker DEBUG stop_signal: SIGINT @@ -57,8 +57,10 @@ services: rest-gateway: container_name: rest-gateway user: '1000:1000' - image: 'symbolplatform/symbol-rest:2.4.0' - command: npm start --prefix /app/catapult-rest/rest /symbol-workdir/rest.json + environment: + npm_config_cache: /symbol-workdir + image: 'symbolplatform/symbol-rest:2.4.2' + command: npm start --prefix /app /symbol-workdir/rest.json stop_signal: SIGINT working_dir: /symbol-workdir ports: diff --git a/test/composes/expected-docker-compose-bootstrap-dual.yml b/test/composes/expected-docker-compose-bootstrap-dual.yml index 4409fc563..5eed636e3 100644 --- a/test/composes/expected-docker-compose-bootstrap-dual.yml +++ b/test/composes/expected-docker-compose-bootstrap-dual.yml @@ -15,7 +15,7 @@ services: node: user: '1000:1000' container_name: node - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker node NORMAL true stop_signal: SIGINT working_dir: /symbol-workdir @@ -31,7 +31,7 @@ services: broker: user: '1000:1000' container_name: broker - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' working_dir: /symbol-workdir command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data broker server broker NORMAL stop_signal: SIGINT @@ -44,8 +44,10 @@ services: rest-gateway: container_name: rest-gateway user: '1000:1000' - image: 'symbolplatform/symbol-rest:2.4.0' - command: npm start --prefix /app/catapult-rest/rest /symbol-workdir/rest.json + environment: + npm_config_cache: /symbol-workdir + image: 'symbolplatform/symbol-rest:2.4.2' + command: npm start --prefix /app /symbol-workdir/rest.json stop_signal: SIGINT working_dir: /symbol-workdir ports: diff --git a/test/composes/expected-docker-compose-bootstrap-repeat.yml b/test/composes/expected-docker-compose-bootstrap-repeat.yml index cb1530972..242318985 100644 --- a/test/composes/expected-docker-compose-bootstrap-repeat.yml +++ b/test/composes/expected-docker-compose-bootstrap-repeat.yml @@ -59,7 +59,7 @@ services: peer-node-0: user: '1000:1000' container_name: peer-node-0 - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker peer-node-0 NORMAL false stop_signal: SIGINT working_dir: /symbol-workdir @@ -77,7 +77,7 @@ services: peer-node-1: user: '1000:1000' container_name: peer-node-1 - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker peer-node-1 NORMAL false stop_signal: SIGINT working_dir: /symbol-workdir @@ -95,7 +95,7 @@ services: peer-node-2: user: '1000:1000' container_name: peer-node-2 - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker peer-node-2 NORMAL false stop_signal: SIGINT working_dir: /symbol-workdir @@ -113,7 +113,7 @@ services: api-node-0: user: '1000:1000' container_name: api-node-0 - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker api-node-0 NORMAL true stop_signal: SIGINT working_dir: /symbol-workdir @@ -132,7 +132,7 @@ services: api-node-1: user: '1000:1000' container_name: api-node-1 - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker api-node-1 NORMAL true stop_signal: SIGINT working_dir: /symbol-workdir @@ -151,7 +151,7 @@ services: api-node-2: user: '1000:1000' container_name: api-node-2 - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker api-node-2 NORMAL true stop_signal: SIGINT working_dir: /symbol-workdir @@ -170,7 +170,7 @@ services: api-node-3: user: '1000:1000' container_name: api-node-3 - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker api-node-3 NORMAL true stop_signal: SIGINT working_dir: /symbol-workdir @@ -189,7 +189,7 @@ services: api-node-broker-0: user: '1000:1000' container_name: api-node-broker-0 - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' working_dir: /symbol-workdir command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data broker server api-node-broker-0 NORMAL ports: @@ -204,7 +204,7 @@ services: api-node-broker-1: user: '1000:1000' container_name: api-node-broker-1 - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' working_dir: /symbol-workdir command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data broker server api-node-broker-1 NORMAL ports: @@ -219,7 +219,7 @@ services: api-node-broker-2: user: '1000:1000' container_name: api-node-broker-2 - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' working_dir: /symbol-workdir command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data broker server api-node-broker-2 NORMAL ports: @@ -234,7 +234,7 @@ services: api-node-broker-3: user: '1000:1000' container_name: api-node-broker-3 - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' working_dir: /symbol-workdir command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data broker server api-node-broker-3 NORMAL ports: @@ -249,8 +249,10 @@ services: rest-gateway-0: container_name: rest-gateway-0 user: '1000:1000' - image: 'symbolplatform/symbol-rest:2.4.0' - command: npm start --prefix /app/catapult-rest/rest /symbol-workdir/rest.json + environment: + npm_config_cache: /symbol-workdir + image: 'symbolplatform/symbol-rest:2.4.2' + command: npm start --prefix /app /symbol-workdir/rest.json stop_signal: SIGINT working_dir: /symbol-workdir ports: @@ -266,8 +268,10 @@ services: rest-gateway-1: container_name: rest-gateway-1 user: '1000:1000' - image: 'symbolplatform/symbol-rest:2.4.0' - command: npm start --prefix /app/catapult-rest/rest /symbol-workdir/rest.json + environment: + npm_config_cache: /symbol-workdir + image: 'symbolplatform/symbol-rest:2.4.2' + command: npm start --prefix /app /symbol-workdir/rest.json stop_signal: SIGINT working_dir: /symbol-workdir ports: @@ -283,8 +287,10 @@ services: rest-gateway-2: container_name: rest-gateway-2 user: '1000:1000' - image: 'symbolplatform/symbol-rest:2.4.0' - command: npm start --prefix /app/catapult-rest/rest /symbol-workdir/rest.json + environment: + npm_config_cache: /symbol-workdir + image: 'symbolplatform/symbol-rest:2.4.2' + command: npm start --prefix /app /symbol-workdir/rest.json stop_signal: SIGINT working_dir: /symbol-workdir ports: @@ -300,8 +306,10 @@ services: rest-gateway-3: container_name: rest-gateway-3 user: '1000:1000' - image: 'symbolplatform/symbol-rest:2.4.0' - command: npm start --prefix /app/catapult-rest/rest /symbol-workdir/rest.json + environment: + npm_config_cache: /symbol-workdir + image: 'symbolplatform/symbol-rest:2.4.2' + command: npm start --prefix /app /symbol-workdir/rest.json stop_signal: SIGINT working_dir: /symbol-workdir ports: diff --git a/test/composes/expected-docker-compose-bootstrap.yml b/test/composes/expected-docker-compose-bootstrap.yml index d397721d8..6374f5673 100644 --- a/test/composes/expected-docker-compose-bootstrap.yml +++ b/test/composes/expected-docker-compose-bootstrap.yml @@ -17,7 +17,7 @@ services: peer-node-0: user: '1000:1000' container_name: peer-node-0 - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker peer-node-0 NORMAL false stop_signal: SIGINT working_dir: /symbol-workdir @@ -35,7 +35,7 @@ services: peer-node-1: user: '1000:1000' container_name: peer-node-1 - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker peer-node-1 NORMAL false stop_signal: SIGINT working_dir: /symbol-workdir @@ -53,7 +53,7 @@ services: api-node-0: user: '1000:1000' container_name: api-node-0 - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker api-node-0 NORMAL true stop_signal: SIGINT working_dir: /symbol-workdir @@ -72,7 +72,7 @@ services: api-node-broker-0: user: '1000:1000' container_name: api-node-broker-0 - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' working_dir: /symbol-workdir command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data broker server api-node-broker-0 NORMAL ports: @@ -87,8 +87,10 @@ services: rest-gateway-0: container_name: rest-gateway-0 user: '1000:1000' - image: 'symbolplatform/symbol-rest:2.4.0' - command: npm start --prefix /app/catapult-rest/rest /symbol-workdir/rest.json + environment: + npm_config_cache: /symbol-workdir + image: 'symbolplatform/symbol-rest:2.4.2' + command: npm start --prefix /app /symbol-workdir/rest.json stop_signal: SIGINT working_dir: /symbol-workdir ports: diff --git a/test/composes/expected-docker-compose-mainnet-services.yml b/test/composes/expected-docker-compose-mainnet-services.yml new file mode 100644 index 000000000..463290e34 --- /dev/null +++ b/test/composes/expected-docker-compose-mainnet-services.yml @@ -0,0 +1,52 @@ +version: '2.4' +services: + https-proxy: + container_name: https-proxy + image: steveltn/https-portal:1.19 + stop_signal: SIGINT + ports: + - '80:80' + - '443:443' + environment: + DOMAINS: explorer.test.domain.com -> http://explorer:4000, faucet.test.domain.com -> http://faucet:4000 + WEBSOCKET: 'true' + STAGE: production + SERVER_NAMES_HASH_BUCKET_SIZE: 128 + restart: on-failure:2 + explorer: + container_name: explorer + image: symbolplatform/symbol-explorer:1.1.1-alpha-202110290945 + entrypoint: ash -c "/bin/ash /symbol-commands/run.sh explorer" + stop_signal: SIGINT + working_dir: /symbol-workdir + ports: + - '90:4000' + restart: on-failure:2 + volumes: + - ../explorers/explorer:/symbol-workdir:ro + - ./explorer:/symbol-commands:ro + faucet: + container_name: faucet + image: symbolplatform/symbol-faucet:1.0.1-alpha-202110131930 + stop_signal: SIGINT + environment: + DEFAULT_NODE: http://some.node.com:3000 + DEFAULT_NODE_CLIENT: http://some.node.com:3000 + NATIVE_CURRENCY_NAME: symbol.xym + FAUCET_PRIVATE_KEY: BBBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + NATIVE_CURRENCY_ID: 6BED913FA20223F8 + NATIVE_CURRENCY_OUT_MAX: 500000000 + NATIVE_CURRENCY_OUT_MIN: 100000000 + MAX_FEE: 5000000 + ENOUGH_BALANCE: 100000000000 + MAX_UNCONFIRMED: 99 + BLACKLIST_MOSAIC_IDS: '[]' + EXPLORER_URL: https://explorer.test.domain.com/ + restart: on-failure:2 + ports: + - '100:4000' +networks: + default: + ipam: + config: + - subnet: 172.20.0.0/24 diff --git a/test/composes/expected-mainnet-api-compose.yml b/test/composes/expected-mainnet-api-compose.yml index 4409fc563..5eed636e3 100644 --- a/test/composes/expected-mainnet-api-compose.yml +++ b/test/composes/expected-mainnet-api-compose.yml @@ -15,7 +15,7 @@ services: node: user: '1000:1000' container_name: node - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker node NORMAL true stop_signal: SIGINT working_dir: /symbol-workdir @@ -31,7 +31,7 @@ services: broker: user: '1000:1000' container_name: broker - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' working_dir: /symbol-workdir command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data broker server broker NORMAL stop_signal: SIGINT @@ -44,8 +44,10 @@ services: rest-gateway: container_name: rest-gateway user: '1000:1000' - image: 'symbolplatform/symbol-rest:2.4.0' - command: npm start --prefix /app/catapult-rest/rest /symbol-workdir/rest.json + environment: + npm_config_cache: /symbol-workdir + image: 'symbolplatform/symbol-rest:2.4.2' + command: npm start --prefix /app /symbol-workdir/rest.json stop_signal: SIGINT working_dir: /symbol-workdir ports: diff --git a/test/composes/expected-mainnet-custom-services.yml b/test/composes/expected-mainnet-custom-services.yml index f0077dd91..bb30a9a86 100644 --- a/test/composes/expected-mainnet-custom-services.yml +++ b/test/composes/expected-mainnet-custom-services.yml @@ -23,7 +23,7 @@ services: node: user: '1000:1000' container_name: node - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker node NORMAL true stop_signal: SIGINT working_dir: /symbol-workdir @@ -52,7 +52,7 @@ services: broker: user: '1000:1000' container_name: broker - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' working_dir: /symbol-workdir command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data broker server broker NORMAL stop_signal: SIGINT @@ -73,8 +73,10 @@ services: rest-gateway: container_name: rest-gateway user: '1000:1000' - image: 'symbolplatform/symbol-rest:2.4.0' - command: npm start --prefix /app/catapult-rest/rest /symbol-workdir/rest.json + environment: + npm_config_cache: /symbol-workdir + image: 'symbolplatform/symbol-rest:2.4.2' + command: npm start --prefix /app /symbol-workdir/rest.json stop_signal: SIGINT working_dir: /symbol-workdir ports: diff --git a/test/composes/expected-mainnet-dual-compose.yml b/test/composes/expected-mainnet-dual-compose.yml index 4409fc563..5eed636e3 100644 --- a/test/composes/expected-mainnet-dual-compose.yml +++ b/test/composes/expected-mainnet-dual-compose.yml @@ -15,7 +15,7 @@ services: node: user: '1000:1000' container_name: node - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker node NORMAL true stop_signal: SIGINT working_dir: /symbol-workdir @@ -31,7 +31,7 @@ services: broker: user: '1000:1000' container_name: broker - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' working_dir: /symbol-workdir command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data broker server broker NORMAL stop_signal: SIGINT @@ -44,8 +44,10 @@ services: rest-gateway: container_name: rest-gateway user: '1000:1000' - image: 'symbolplatform/symbol-rest:2.4.0' - command: npm start --prefix /app/catapult-rest/rest /symbol-workdir/rest.json + environment: + npm_config_cache: /symbol-workdir + image: 'symbolplatform/symbol-rest:2.4.2' + command: npm start --prefix /app /symbol-workdir/rest.json stop_signal: SIGINT working_dir: /symbol-workdir ports: diff --git a/test/composes/expected-mainnet-peer-compose.yml b/test/composes/expected-mainnet-peer-compose.yml index f42c7c2b5..aa66c0653 100644 --- a/test/composes/expected-mainnet-peer-compose.yml +++ b/test/composes/expected-mainnet-peer-compose.yml @@ -3,7 +3,7 @@ services: node: user: '1000:1000' container_name: node - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker node NORMAL false stop_signal: SIGINT working_dir: /symbol-workdir diff --git a/test/composes/expected-testnet-api-compose.yml b/test/composes/expected-testnet-api-compose.yml index 4409fc563..5eed636e3 100644 --- a/test/composes/expected-testnet-api-compose.yml +++ b/test/composes/expected-testnet-api-compose.yml @@ -15,7 +15,7 @@ services: node: user: '1000:1000' container_name: node - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker node NORMAL true stop_signal: SIGINT working_dir: /symbol-workdir @@ -31,7 +31,7 @@ services: broker: user: '1000:1000' container_name: broker - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' working_dir: /symbol-workdir command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data broker server broker NORMAL stop_signal: SIGINT @@ -44,8 +44,10 @@ services: rest-gateway: container_name: rest-gateway user: '1000:1000' - image: 'symbolplatform/symbol-rest:2.4.0' - command: npm start --prefix /app/catapult-rest/rest /symbol-workdir/rest.json + environment: + npm_config_cache: /symbol-workdir + image: 'symbolplatform/symbol-rest:2.4.2' + command: npm start --prefix /app /symbol-workdir/rest.json stop_signal: SIGINT working_dir: /symbol-workdir ports: diff --git a/test/composes/expected-testnet-dual-compose.yml b/test/composes/expected-testnet-dual-compose.yml index 4409fc563..5eed636e3 100644 --- a/test/composes/expected-testnet-dual-compose.yml +++ b/test/composes/expected-testnet-dual-compose.yml @@ -15,7 +15,7 @@ services: node: user: '1000:1000' container_name: node - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker node NORMAL true stop_signal: SIGINT working_dir: /symbol-workdir @@ -31,7 +31,7 @@ services: broker: user: '1000:1000' container_name: broker - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' working_dir: /symbol-workdir command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data broker server broker NORMAL stop_signal: SIGINT @@ -44,8 +44,10 @@ services: rest-gateway: container_name: rest-gateway user: '1000:1000' - image: 'symbolplatform/symbol-rest:2.4.0' - command: npm start --prefix /app/catapult-rest/rest /symbol-workdir/rest.json + environment: + npm_config_cache: /symbol-workdir + image: 'symbolplatform/symbol-rest:2.4.2' + command: npm start --prefix /app /symbol-workdir/rest.json stop_signal: SIGINT working_dir: /symbol-workdir ports: diff --git a/test/composes/expected-testnet-httpsproxy-compose.yml b/test/composes/expected-testnet-httpsproxy-compose.yml index 887208ce1..cf0df5a1d 100644 --- a/test/composes/expected-testnet-httpsproxy-compose.yml +++ b/test/composes/expected-testnet-httpsproxy-compose.yml @@ -15,7 +15,7 @@ services: node: user: '1000:1000' container_name: node - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker node NORMAL true stop_signal: SIGINT working_dir: /symbol-workdir @@ -36,7 +36,7 @@ services: broker: user: '1000:1000' container_name: broker - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' working_dir: /symbol-workdir command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data broker server broker NORMAL stop_signal: SIGINT @@ -49,8 +49,10 @@ services: rest-gateway: container_name: rest-gateway user: '1000:1000' - image: 'symbolplatform/symbol-rest:2.4.0' - command: npm start --prefix /app/catapult-rest/rest /symbol-workdir/rest.json + environment: + npm_config_cache: /symbol-workdir + image: 'symbolplatform/symbol-rest:2.4.2' + command: npm start --prefix /app /symbol-workdir/rest.json stop_signal: SIGINT working_dir: /symbol-workdir ports: diff --git a/test/composes/expected-testnet-native-ssl-compose.yml b/test/composes/expected-testnet-native-ssl-compose.yml index bc4287657..3aaa7ee1e 100644 --- a/test/composes/expected-testnet-native-ssl-compose.yml +++ b/test/composes/expected-testnet-native-ssl-compose.yml @@ -15,7 +15,7 @@ services: node: user: '1000:1000' container_name: node - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker node NORMAL true stop_signal: SIGINT working_dir: /symbol-workdir @@ -36,7 +36,7 @@ services: broker: user: '1000:1000' container_name: broker - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' working_dir: /symbol-workdir command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data broker server broker NORMAL stop_signal: SIGINT @@ -49,8 +49,10 @@ services: rest-gateway: container_name: rest-gateway user: '1000:1000' - image: 'symbolplatform/symbol-rest:2.4.0' - command: npm start --prefix /app/catapult-rest/rest /symbol-workdir/rest.json + environment: + npm_config_cache: /symbol-workdir + image: 'symbolplatform/symbol-rest:2.4.2' + command: npm start --prefix /app /symbol-workdir/rest.json stop_signal: SIGINT working_dir: /symbol-workdir ports: diff --git a/test/composes/expected-testnet-peer-compose.yml b/test/composes/expected-testnet-peer-compose.yml index f42c7c2b5..aa66c0653 100644 --- a/test/composes/expected-testnet-peer-compose.yml +++ b/test/composes/expected-testnet-peer-compose.yml @@ -3,7 +3,7 @@ services: node: user: '1000:1000' container_name: node - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker node NORMAL false stop_signal: SIGINT working_dir: /symbol-workdir diff --git a/test/composes/expected-testnet-voting-compose.yml b/test/composes/expected-testnet-voting-compose.yml index 4409fc563..5eed636e3 100644 --- a/test/composes/expected-testnet-voting-compose.yml +++ b/test/composes/expected-testnet-voting-compose.yml @@ -15,7 +15,7 @@ services: node: user: '1000:1000' container_name: node - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data server broker node NORMAL true stop_signal: SIGINT working_dir: /symbol-workdir @@ -31,7 +31,7 @@ services: broker: user: '1000:1000' container_name: broker - image: 'symbolplatform/symbol-server:gcc-10-1.0.3.1' + image: 'symbolplatform/symbol-server:gcc-1.0.3.5' working_dir: /symbol-workdir command: /bin/bash /symbol-commands/start.sh /usr/catapult ./data broker server broker NORMAL stop_signal: SIGINT @@ -44,8 +44,10 @@ services: rest-gateway: container_name: rest-gateway user: '1000:1000' - image: 'symbolplatform/symbol-rest:2.4.0' - command: npm start --prefix /app/catapult-rest/rest /symbol-workdir/rest.json + environment: + npm_config_cache: /symbol-workdir + image: 'symbolplatform/symbol-rest:2.4.2' + command: npm start --prefix /app /symbol-workdir/rest.json stop_signal: SIGINT working_dir: /symbol-workdir ports: diff --git a/test/reports/bootstrap-voting/api-node-0-config.csv b/test/reports/bootstrap-voting/api-node-0-config.csv index feff47607..cd8f5b9bc 100644 --- a/test/reports/bootstrap-voting/api-node-0-config.csv +++ b/test/reports/bootstrap-voting/api-node-0-config.csv @@ -248,8 +248,7 @@ maxMessageSize; 1024; uint16_t; Maximum transaction message size. fork_heights totalVotingBalanceCalculationFix; 0; uint32_t; Height of fork to fix TotalVotingBalance calculation. treasuryReissuance; 0; ; - -treasury_reissuance_transaction_signatures +strictAggregateTransactionHash; 0; ; config-node.properties diff --git a/test/reports/bootstrap-voting/api-node-0-config.rst b/test/reports/bootstrap-voting/api-node-0-config.rst index bc1470a58..eddbb9f6f 100644 --- a/test/reports/bootstrap-voting/api-node-0-config.rst +++ b/test/reports/bootstrap-voting/api-node-0-config.rst @@ -269,7 +269,7 @@ config-network.properties **fork_heights**; ; ; totalVotingBalanceCalculationFix; 0; uint32_t; Height of fork to fix TotalVotingBalance calculation. treasuryReissuance; 0; ; - **treasury_reissuance_transaction_signatures**; + strictAggregateTransactionHash; 0; ; config-node.properties ====================== diff --git a/test/reports/bootstrap-voting/peer-node-0-config.csv b/test/reports/bootstrap-voting/peer-node-0-config.csv index de83bcbe6..a750a0de6 100644 --- a/test/reports/bootstrap-voting/peer-node-0-config.csv +++ b/test/reports/bootstrap-voting/peer-node-0-config.csv @@ -258,8 +258,7 @@ maxMessageSize; 1024; uint16_t; Maximum transaction message size. fork_heights totalVotingBalanceCalculationFix; 0; uint32_t; Height of fork to fix TotalVotingBalance calculation. treasuryReissuance; 0; ; - -treasury_reissuance_transaction_signatures +strictAggregateTransactionHash; 0; ; config-node.properties diff --git a/test/reports/bootstrap-voting/peer-node-0-config.rst b/test/reports/bootstrap-voting/peer-node-0-config.rst index 935cf0c40..f8540af79 100644 --- a/test/reports/bootstrap-voting/peer-node-0-config.rst +++ b/test/reports/bootstrap-voting/peer-node-0-config.rst @@ -283,7 +283,7 @@ config-network.properties **fork_heights**; ; ; totalVotingBalanceCalculationFix; 0; uint32_t; Height of fork to fix TotalVotingBalance calculation. treasuryReissuance; 0; ; - **treasury_reissuance_transaction_signatures**; + strictAggregateTransactionHash; 0; ; config-node.properties ====================== diff --git a/test/reports/bootstrap-voting/peer-node-1-config.csv b/test/reports/bootstrap-voting/peer-node-1-config.csv index 076d2a5bd..af5e99c29 100644 --- a/test/reports/bootstrap-voting/peer-node-1-config.csv +++ b/test/reports/bootstrap-voting/peer-node-1-config.csv @@ -258,8 +258,7 @@ maxMessageSize; 1024; uint16_t; Maximum transaction message size. fork_heights totalVotingBalanceCalculationFix; 0; uint32_t; Height of fork to fix TotalVotingBalance calculation. treasuryReissuance; 0; ; - -treasury_reissuance_transaction_signatures +strictAggregateTransactionHash; 0; ; config-node.properties diff --git a/test/reports/bootstrap-voting/peer-node-1-config.rst b/test/reports/bootstrap-voting/peer-node-1-config.rst index 9fa867510..7f24369e7 100644 --- a/test/reports/bootstrap-voting/peer-node-1-config.rst +++ b/test/reports/bootstrap-voting/peer-node-1-config.rst @@ -283,7 +283,7 @@ config-network.properties **fork_heights**; ; ; totalVotingBalanceCalculationFix; 0; uint32_t; Height of fork to fix TotalVotingBalance calculation. treasuryReissuance; 0; ; - **treasury_reissuance_transaction_signatures**; + strictAggregateTransactionHash; 0; ; config-node.properties ====================== diff --git a/test/reports/custom-network-dual/node-config.csv b/test/reports/custom-network-dual/node-config.csv index 38472fdd6..2049a72bc 100644 --- a/test/reports/custom-network-dual/node-config.csv +++ b/test/reports/custom-network-dual/node-config.csv @@ -679,8 +679,7 @@ maxMessageSize; 1024; uint16_t; Maximum transaction message size. fork_heights totalVotingBalanceCalculationFix; 0; uint32_t; Height of fork to fix TotalVotingBalance calculation. treasuryReissuance; 0; ; - -treasury_reissuance_transaction_signatures +strictAggregateTransactionHash; 0; ; config-node.properties diff --git a/test/reports/custom-network-dual/node-config.rst b/test/reports/custom-network-dual/node-config.rst index 044745a49..753ad2d3a 100644 --- a/test/reports/custom-network-dual/node-config.rst +++ b/test/reports/custom-network-dual/node-config.rst @@ -704,7 +704,7 @@ config-network.properties **fork_heights**; ; ; totalVotingBalanceCalculationFix; 0; uint32_t; Height of fork to fix TotalVotingBalance calculation. treasuryReissuance; 0; ; - **treasury_reissuance_transaction_signatures**; + strictAggregateTransactionHash; 0; ; config-node.properties ====================== diff --git a/test/reports/mainnet-dual-voting/node-config.csv b/test/reports/mainnet-dual-voting/node-config.csv index 713305371..c6b4bf124 100644 --- a/test/reports/mainnet-dual-voting/node-config.csv +++ b/test/reports/mainnet-dual-voting/node-config.csv @@ -741,6 +741,7 @@ maxMessageSize; 1024; uint16_t; Maximum transaction message size. fork_heights totalVotingBalanceCalculationFix; 528'000; uint32_t; Height of fork to fix TotalVotingBalance calculation. treasuryReissuance; 689'761; ; +strictAggregateTransactionHash; 1'690'500; ; treasury_reissuance_transaction_signatures 0BBEADD37539444D75C09A245102D2B883267925398504623835DCD625290DEE4FA2371341050C49C001DEDD1C9FE241EA4A7DB335B2069FD4DAFF77AF734C03; true @@ -751,6 +752,28 @@ C0BAE301EC15B514C5685A661BC3E23A6596CE9DC412A83F67A8C8611A4415B1B0447E8C09D2816C A317F4EB085C8D3D80435669EF54C6C9C9AD9B57165B14CF051F43879D0112E3A79591DD6D469BFAA850891FA2CB601BA58CD1BAEBFF5D84C49179AC7FE14706; true FDB98C472D0B98FDD766DA177366DEB2DB0E79721BD73DA96A84622A98932DA75BAA327BA9E23D448C6F25344654A6F17F7734C14D1530B327F911A97B4DE30A; true +corrupt_aggregate_transaction_hashes +97CA49FCE55644FF28248C6EA4DCB6E87E53909811DEE2513F0218DAA394679F; 657BE411624B617F51CD8D151735F50FE50A91A5B7D0658192EF3EC4DD0C91C3 +B2813813F709C3011468E23E61AE102BCB55A28A87D0CF74968B8BD2413615AA; 3FEF96C5496E60BC1D33815139BDCD4FA707CE1C2A9A25FF4F7D3B1BE698116C +30FA71E6D1E34DF1E430A07E1B0817BED9A4ED6B0245B7471B0557380A700E1B; AE377EAB7F1970DEC21FF305C39EBDD3ECE413B911EF3E4E11F7DDDC9C9C9748 +E14FB95DA63CDA9899474D7EFD0DCB6A6C9E8931DF12ECA01F22DF2B59B6624C; 342E7C1E6318F7DCE5CE5A09B8FA1820453C4437AEF1B872BD06531E3ADB41C0 +55EB9659C81600F1760C4C0A4F8A7A5C90A39FCEE36E3165143B8E72BBC709E8; 8980CF4407A48410C4E910FE766C135F8C3C84EA9917BFDB7A71434C2CDC625A +D24D000FABBD1AC4BC21006A5CAE76AE9C32792A4920F66D6A6C6F76B438BDF1; 5FDEF85E8B3669FF155B5F3DA98288C6ED8A293CC699338ADB743C0F5E8614ED +26FF5E7174DEEF3147DB25C37C7AE9905157ACBA2D233D40D1F77A65B60D59BC; 3A2F78C2E7B10FF84EB33BF1DD0FD61951F8E3EA3303614D1B20060CD88F6E14 +2DF1D19B5E68102665D11B3CF3069AB5DFED2E60A7690C8788172E0E5E30B72D; 3B64321593D06FF37B191F52FE31E107A8FDB0116AB5374157F8F415B8C73BE4 +8BAA5EC2DDF55EE583ABB7EA4A4FE6EB8A4C16C41ED30CB1E68F6D1F40C3FC5A; 59850BF728A08555D10DAD5745EE2A349FECC0B16810F5D32CF3DFC376DEFFE1 +8CE147B1B64E200FA48B17FE5B6F4FA2FFEC83FF03A1EC0D4725AB8122AF5B05; 1F3D4045C3482A9EED536F61CAA58284323037B72A9A774A0C75932F85999B0F +BC312549DB027287836AD52B6EA30171AA1958B20BEB3D659F843D699DE45FD3; 4AC4B12DE7C5B0D02BFFEA3ED98F4247FAFF701C4CE0A2CFD75E7F633DB0ED60 +B35D60C826470EB38B6963DCEF5A9FE406EDE405676EDB027956999D7618998D; D8915C7EFFDB62B3CB5872597522C0920AF5D55EC44A4548DF8679C08A0C0541 +91C27BE7E5AC8EBCE6A5D576DE250054A3CDC2B674BAD5FA29B554C0A50E2973; 05718908AFBA83B420AE19BE0A11EE36119AC960353BA6C3F180078C8C4B428D +D91689D6A3C9FE7AABB45C3FC44373DA23EF363D71360CB4B7ECD74F0BDE893B; D8915C7EFFDB62B3CB5872597522C0920AF5D55EC44A4548DF8679C08A0C0541 +8090FFF457D88D98ACFDA7872DAAD1A901B4CB081387B1A45AFDA8EEF686EB54; 05718908AFBA83B420AE19BE0A11EE36119AC960353BA6C3F180078C8C4B428D +33937869216924161235BA8E10DC075592022C22F6593042A1064ADD24B64FE8; 9C00D552960DEDC38A009B541681B2C7A68902D94A9D6C089604D2E7EFCCD88E +BDF7755E44E1405C3353AB97651DD82785C6A3A8EAA5EA1CEA0E30DADB0D12F8; B6D02DA3F69C20F69A9209B13192174091544512CD7D2CE53C366909B354B7B1 +852A41F9452A34054DE1C21E46F925EA7B50D26AF97FBA8D745F01CC6DD5097F; 8626BB52F6457D95B01A5C178E6A6977F8BD418CD9A7D5B0A814210E0A4FBBA3 +C1E7404CDAE41ACE07E8649FA2D5E3E2FF5DA502E43E5D1C6073192823F90BE6; A7321E82547506079C0692DC0DFF8C9CB0D56DD2C9E3208F479DB8970B985E6C +C0FAAD2439E9D8017F9A2E5F67A46850195209402C1EE55CF99880426D0F454F; 3B74892D50665E4A989C89EDCE88905937B81BF260A679653E86886407812F83 + config-node.properties node diff --git a/test/reports/mainnet-dual-voting/node-config.rst b/test/reports/mainnet-dual-voting/node-config.rst index c33ddd93a..8f269e7fe 100644 --- a/test/reports/mainnet-dual-voting/node-config.rst +++ b/test/reports/mainnet-dual-voting/node-config.rst @@ -766,6 +766,7 @@ config-network.properties **fork_heights**; ; ; totalVotingBalanceCalculationFix; 528'000; uint32_t; Height of fork to fix TotalVotingBalance calculation. treasuryReissuance; 689'761; ; + strictAggregateTransactionHash; 1'690'500; ; **treasury_reissuance_transaction_signatures**; 0BBEADD37539444D75C09A245102D2B883267925398504623835DCD625290DEE4FA2371341050C49C001DEDD1C9FE241EA4A7DB335B2069FD4DAFF77AF734C03; true 89447704270E8B2F8EED19526587DB58870D90A02ACEF8AE2A54311DEB95C227201CD39662A0229D5746FFB84074EA6C7DD9620A2CE5AA69065C508DC0335201; true @@ -774,6 +775,27 @@ config-network.properties C0BAE301EC15B514C5685A661BC3E23A6596CE9DC412A83F67A8C8611A4415B1B0447E8C09D2816CAE0D750C4AB1ED8FE9C85C05D448C2114147A2C935030708; true A317F4EB085C8D3D80435669EF54C6C9C9AD9B57165B14CF051F43879D0112E3A79591DD6D469BFAA850891FA2CB601BA58CD1BAEBFF5D84C49179AC7FE14706; true FDB98C472D0B98FDD766DA177366DEB2DB0E79721BD73DA96A84622A98932DA75BAA327BA9E23D448C6F25344654A6F17F7734C14D1530B327F911A97B4DE30A; true + **corrupt_aggregate_transaction_hashes**; + 97CA49FCE55644FF28248C6EA4DCB6E87E53909811DEE2513F0218DAA394679F; 657BE411624B617F51CD8D151735F50FE50A91A5B7D0658192EF3EC4DD0C91C3 + B2813813F709C3011468E23E61AE102BCB55A28A87D0CF74968B8BD2413615AA; 3FEF96C5496E60BC1D33815139BDCD4FA707CE1C2A9A25FF4F7D3B1BE698116C + 30FA71E6D1E34DF1E430A07E1B0817BED9A4ED6B0245B7471B0557380A700E1B; AE377EAB7F1970DEC21FF305C39EBDD3ECE413B911EF3E4E11F7DDDC9C9C9748 + E14FB95DA63CDA9899474D7EFD0DCB6A6C9E8931DF12ECA01F22DF2B59B6624C; 342E7C1E6318F7DCE5CE5A09B8FA1820453C4437AEF1B872BD06531E3ADB41C0 + 55EB9659C81600F1760C4C0A4F8A7A5C90A39FCEE36E3165143B8E72BBC709E8; 8980CF4407A48410C4E910FE766C135F8C3C84EA9917BFDB7A71434C2CDC625A + D24D000FABBD1AC4BC21006A5CAE76AE9C32792A4920F66D6A6C6F76B438BDF1; 5FDEF85E8B3669FF155B5F3DA98288C6ED8A293CC699338ADB743C0F5E8614ED + 26FF5E7174DEEF3147DB25C37C7AE9905157ACBA2D233D40D1F77A65B60D59BC; 3A2F78C2E7B10FF84EB33BF1DD0FD61951F8E3EA3303614D1B20060CD88F6E14 + 2DF1D19B5E68102665D11B3CF3069AB5DFED2E60A7690C8788172E0E5E30B72D; 3B64321593D06FF37B191F52FE31E107A8FDB0116AB5374157F8F415B8C73BE4 + 8BAA5EC2DDF55EE583ABB7EA4A4FE6EB8A4C16C41ED30CB1E68F6D1F40C3FC5A; 59850BF728A08555D10DAD5745EE2A349FECC0B16810F5D32CF3DFC376DEFFE1 + 8CE147B1B64E200FA48B17FE5B6F4FA2FFEC83FF03A1EC0D4725AB8122AF5B05; 1F3D4045C3482A9EED536F61CAA58284323037B72A9A774A0C75932F85999B0F + BC312549DB027287836AD52B6EA30171AA1958B20BEB3D659F843D699DE45FD3; 4AC4B12DE7C5B0D02BFFEA3ED98F4247FAFF701C4CE0A2CFD75E7F633DB0ED60 + B35D60C826470EB38B6963DCEF5A9FE406EDE405676EDB027956999D7618998D; D8915C7EFFDB62B3CB5872597522C0920AF5D55EC44A4548DF8679C08A0C0541 + 91C27BE7E5AC8EBCE6A5D576DE250054A3CDC2B674BAD5FA29B554C0A50E2973; 05718908AFBA83B420AE19BE0A11EE36119AC960353BA6C3F180078C8C4B428D + D91689D6A3C9FE7AABB45C3FC44373DA23EF363D71360CB4B7ECD74F0BDE893B; D8915C7EFFDB62B3CB5872597522C0920AF5D55EC44A4548DF8679C08A0C0541 + 8090FFF457D88D98ACFDA7872DAAD1A901B4CB081387B1A45AFDA8EEF686EB54; 05718908AFBA83B420AE19BE0A11EE36119AC960353BA6C3F180078C8C4B428D + 33937869216924161235BA8E10DC075592022C22F6593042A1064ADD24B64FE8; 9C00D552960DEDC38A009B541681B2C7A68902D94A9D6C089604D2E7EFCCD88E + BDF7755E44E1405C3353AB97651DD82785C6A3A8EAA5EA1CEA0E30DADB0D12F8; B6D02DA3F69C20F69A9209B13192174091544512CD7D2CE53C366909B354B7B1 + 852A41F9452A34054DE1C21E46F925EA7B50D26AF97FBA8D745F01CC6DD5097F; 8626BB52F6457D95B01A5C178E6A6977F8BD418CD9A7D5B0A814210E0A4FBBA3 + C1E7404CDAE41ACE07E8649FA2D5E3E2FF5DA502E43E5D1C6073192823F90BE6; A7321E82547506079C0692DC0DFF8C9CB0D56DD2C9E3208F479DB8970B985E6C + C0FAAD2439E9D8017F9A2E5F67A46850195209402C1EE55CF99880426D0F454F; 3B74892D50665E4A989C89EDCE88905937B81BF260A679653E86886407812F83 config-node.properties ====================== diff --git a/test/reports/mainnet-dual/node-config.csv b/test/reports/mainnet-dual/node-config.csv index 634363f3c..39284f31a 100644 --- a/test/reports/mainnet-dual/node-config.csv +++ b/test/reports/mainnet-dual/node-config.csv @@ -741,6 +741,7 @@ maxMessageSize; 1024; uint16_t; Maximum transaction message size. fork_heights totalVotingBalanceCalculationFix; 528'000; uint32_t; Height of fork to fix TotalVotingBalance calculation. treasuryReissuance; 689'761; ; +strictAggregateTransactionHash; 1'690'500; ; treasury_reissuance_transaction_signatures 0BBEADD37539444D75C09A245102D2B883267925398504623835DCD625290DEE4FA2371341050C49C001DEDD1C9FE241EA4A7DB335B2069FD4DAFF77AF734C03; true @@ -751,6 +752,28 @@ C0BAE301EC15B514C5685A661BC3E23A6596CE9DC412A83F67A8C8611A4415B1B0447E8C09D2816C A317F4EB085C8D3D80435669EF54C6C9C9AD9B57165B14CF051F43879D0112E3A79591DD6D469BFAA850891FA2CB601BA58CD1BAEBFF5D84C49179AC7FE14706; true FDB98C472D0B98FDD766DA177366DEB2DB0E79721BD73DA96A84622A98932DA75BAA327BA9E23D448C6F25344654A6F17F7734C14D1530B327F911A97B4DE30A; true +corrupt_aggregate_transaction_hashes +97CA49FCE55644FF28248C6EA4DCB6E87E53909811DEE2513F0218DAA394679F; 657BE411624B617F51CD8D151735F50FE50A91A5B7D0658192EF3EC4DD0C91C3 +B2813813F709C3011468E23E61AE102BCB55A28A87D0CF74968B8BD2413615AA; 3FEF96C5496E60BC1D33815139BDCD4FA707CE1C2A9A25FF4F7D3B1BE698116C +30FA71E6D1E34DF1E430A07E1B0817BED9A4ED6B0245B7471B0557380A700E1B; AE377EAB7F1970DEC21FF305C39EBDD3ECE413B911EF3E4E11F7DDDC9C9C9748 +E14FB95DA63CDA9899474D7EFD0DCB6A6C9E8931DF12ECA01F22DF2B59B6624C; 342E7C1E6318F7DCE5CE5A09B8FA1820453C4437AEF1B872BD06531E3ADB41C0 +55EB9659C81600F1760C4C0A4F8A7A5C90A39FCEE36E3165143B8E72BBC709E8; 8980CF4407A48410C4E910FE766C135F8C3C84EA9917BFDB7A71434C2CDC625A +D24D000FABBD1AC4BC21006A5CAE76AE9C32792A4920F66D6A6C6F76B438BDF1; 5FDEF85E8B3669FF155B5F3DA98288C6ED8A293CC699338ADB743C0F5E8614ED +26FF5E7174DEEF3147DB25C37C7AE9905157ACBA2D233D40D1F77A65B60D59BC; 3A2F78C2E7B10FF84EB33BF1DD0FD61951F8E3EA3303614D1B20060CD88F6E14 +2DF1D19B5E68102665D11B3CF3069AB5DFED2E60A7690C8788172E0E5E30B72D; 3B64321593D06FF37B191F52FE31E107A8FDB0116AB5374157F8F415B8C73BE4 +8BAA5EC2DDF55EE583ABB7EA4A4FE6EB8A4C16C41ED30CB1E68F6D1F40C3FC5A; 59850BF728A08555D10DAD5745EE2A349FECC0B16810F5D32CF3DFC376DEFFE1 +8CE147B1B64E200FA48B17FE5B6F4FA2FFEC83FF03A1EC0D4725AB8122AF5B05; 1F3D4045C3482A9EED536F61CAA58284323037B72A9A774A0C75932F85999B0F +BC312549DB027287836AD52B6EA30171AA1958B20BEB3D659F843D699DE45FD3; 4AC4B12DE7C5B0D02BFFEA3ED98F4247FAFF701C4CE0A2CFD75E7F633DB0ED60 +B35D60C826470EB38B6963DCEF5A9FE406EDE405676EDB027956999D7618998D; D8915C7EFFDB62B3CB5872597522C0920AF5D55EC44A4548DF8679C08A0C0541 +91C27BE7E5AC8EBCE6A5D576DE250054A3CDC2B674BAD5FA29B554C0A50E2973; 05718908AFBA83B420AE19BE0A11EE36119AC960353BA6C3F180078C8C4B428D +D91689D6A3C9FE7AABB45C3FC44373DA23EF363D71360CB4B7ECD74F0BDE893B; D8915C7EFFDB62B3CB5872597522C0920AF5D55EC44A4548DF8679C08A0C0541 +8090FFF457D88D98ACFDA7872DAAD1A901B4CB081387B1A45AFDA8EEF686EB54; 05718908AFBA83B420AE19BE0A11EE36119AC960353BA6C3F180078C8C4B428D +33937869216924161235BA8E10DC075592022C22F6593042A1064ADD24B64FE8; 9C00D552960DEDC38A009B541681B2C7A68902D94A9D6C089604D2E7EFCCD88E +BDF7755E44E1405C3353AB97651DD82785C6A3A8EAA5EA1CEA0E30DADB0D12F8; B6D02DA3F69C20F69A9209B13192174091544512CD7D2CE53C366909B354B7B1 +852A41F9452A34054DE1C21E46F925EA7B50D26AF97FBA8D745F01CC6DD5097F; 8626BB52F6457D95B01A5C178E6A6977F8BD418CD9A7D5B0A814210E0A4FBBA3 +C1E7404CDAE41ACE07E8649FA2D5E3E2FF5DA502E43E5D1C6073192823F90BE6; A7321E82547506079C0692DC0DFF8C9CB0D56DD2C9E3208F479DB8970B985E6C +C0FAAD2439E9D8017F9A2E5F67A46850195209402C1EE55CF99880426D0F454F; 3B74892D50665E4A989C89EDCE88905937B81BF260A679653E86886407812F83 + config-node.properties node diff --git a/test/reports/mainnet-dual/node-config.rst b/test/reports/mainnet-dual/node-config.rst index a04ccc1e4..cfa3b5215 100644 --- a/test/reports/mainnet-dual/node-config.rst +++ b/test/reports/mainnet-dual/node-config.rst @@ -766,6 +766,7 @@ config-network.properties **fork_heights**; ; ; totalVotingBalanceCalculationFix; 528'000; uint32_t; Height of fork to fix TotalVotingBalance calculation. treasuryReissuance; 689'761; ; + strictAggregateTransactionHash; 1'690'500; ; **treasury_reissuance_transaction_signatures**; 0BBEADD37539444D75C09A245102D2B883267925398504623835DCD625290DEE4FA2371341050C49C001DEDD1C9FE241EA4A7DB335B2069FD4DAFF77AF734C03; true 89447704270E8B2F8EED19526587DB58870D90A02ACEF8AE2A54311DEB95C227201CD39662A0229D5746FFB84074EA6C7DD9620A2CE5AA69065C508DC0335201; true @@ -774,6 +775,27 @@ config-network.properties C0BAE301EC15B514C5685A661BC3E23A6596CE9DC412A83F67A8C8611A4415B1B0447E8C09D2816CAE0D750C4AB1ED8FE9C85C05D448C2114147A2C935030708; true A317F4EB085C8D3D80435669EF54C6C9C9AD9B57165B14CF051F43879D0112E3A79591DD6D469BFAA850891FA2CB601BA58CD1BAEBFF5D84C49179AC7FE14706; true FDB98C472D0B98FDD766DA177366DEB2DB0E79721BD73DA96A84622A98932DA75BAA327BA9E23D448C6F25344654A6F17F7734C14D1530B327F911A97B4DE30A; true + **corrupt_aggregate_transaction_hashes**; + 97CA49FCE55644FF28248C6EA4DCB6E87E53909811DEE2513F0218DAA394679F; 657BE411624B617F51CD8D151735F50FE50A91A5B7D0658192EF3EC4DD0C91C3 + B2813813F709C3011468E23E61AE102BCB55A28A87D0CF74968B8BD2413615AA; 3FEF96C5496E60BC1D33815139BDCD4FA707CE1C2A9A25FF4F7D3B1BE698116C + 30FA71E6D1E34DF1E430A07E1B0817BED9A4ED6B0245B7471B0557380A700E1B; AE377EAB7F1970DEC21FF305C39EBDD3ECE413B911EF3E4E11F7DDDC9C9C9748 + E14FB95DA63CDA9899474D7EFD0DCB6A6C9E8931DF12ECA01F22DF2B59B6624C; 342E7C1E6318F7DCE5CE5A09B8FA1820453C4437AEF1B872BD06531E3ADB41C0 + 55EB9659C81600F1760C4C0A4F8A7A5C90A39FCEE36E3165143B8E72BBC709E8; 8980CF4407A48410C4E910FE766C135F8C3C84EA9917BFDB7A71434C2CDC625A + D24D000FABBD1AC4BC21006A5CAE76AE9C32792A4920F66D6A6C6F76B438BDF1; 5FDEF85E8B3669FF155B5F3DA98288C6ED8A293CC699338ADB743C0F5E8614ED + 26FF5E7174DEEF3147DB25C37C7AE9905157ACBA2D233D40D1F77A65B60D59BC; 3A2F78C2E7B10FF84EB33BF1DD0FD61951F8E3EA3303614D1B20060CD88F6E14 + 2DF1D19B5E68102665D11B3CF3069AB5DFED2E60A7690C8788172E0E5E30B72D; 3B64321593D06FF37B191F52FE31E107A8FDB0116AB5374157F8F415B8C73BE4 + 8BAA5EC2DDF55EE583ABB7EA4A4FE6EB8A4C16C41ED30CB1E68F6D1F40C3FC5A; 59850BF728A08555D10DAD5745EE2A349FECC0B16810F5D32CF3DFC376DEFFE1 + 8CE147B1B64E200FA48B17FE5B6F4FA2FFEC83FF03A1EC0D4725AB8122AF5B05; 1F3D4045C3482A9EED536F61CAA58284323037B72A9A774A0C75932F85999B0F + BC312549DB027287836AD52B6EA30171AA1958B20BEB3D659F843D699DE45FD3; 4AC4B12DE7C5B0D02BFFEA3ED98F4247FAFF701C4CE0A2CFD75E7F633DB0ED60 + B35D60C826470EB38B6963DCEF5A9FE406EDE405676EDB027956999D7618998D; D8915C7EFFDB62B3CB5872597522C0920AF5D55EC44A4548DF8679C08A0C0541 + 91C27BE7E5AC8EBCE6A5D576DE250054A3CDC2B674BAD5FA29B554C0A50E2973; 05718908AFBA83B420AE19BE0A11EE36119AC960353BA6C3F180078C8C4B428D + D91689D6A3C9FE7AABB45C3FC44373DA23EF363D71360CB4B7ECD74F0BDE893B; D8915C7EFFDB62B3CB5872597522C0920AF5D55EC44A4548DF8679C08A0C0541 + 8090FFF457D88D98ACFDA7872DAAD1A901B4CB081387B1A45AFDA8EEF686EB54; 05718908AFBA83B420AE19BE0A11EE36119AC960353BA6C3F180078C8C4B428D + 33937869216924161235BA8E10DC075592022C22F6593042A1064ADD24B64FE8; 9C00D552960DEDC38A009B541681B2C7A68902D94A9D6C089604D2E7EFCCD88E + BDF7755E44E1405C3353AB97651DD82785C6A3A8EAA5EA1CEA0E30DADB0D12F8; B6D02DA3F69C20F69A9209B13192174091544512CD7D2CE53C366909B354B7B1 + 852A41F9452A34054DE1C21E46F925EA7B50D26AF97FBA8D745F01CC6DD5097F; 8626BB52F6457D95B01A5C178E6A6977F8BD418CD9A7D5B0A814210E0A4FBBA3 + C1E7404CDAE41ACE07E8649FA2D5E3E2FF5DA502E43E5D1C6073192823F90BE6; A7321E82547506079C0692DC0DFF8C9CB0D56DD2C9E3208F479DB8970B985E6C + C0FAAD2439E9D8017F9A2E5F67A46850195209402C1EE55CF99880426D0F454F; 3B74892D50665E4A989C89EDCE88905937B81BF260A679653E86886407812F83 config-node.properties ====================== diff --git a/test/reports/mainnet-peer/node-config.csv b/test/reports/mainnet-peer/node-config.csv index 9236d6622..5ff63f8cb 100644 --- a/test/reports/mainnet-peer/node-config.csv +++ b/test/reports/mainnet-peer/node-config.csv @@ -741,6 +741,7 @@ maxMessageSize; 1024; uint16_t; Maximum transaction message size. fork_heights totalVotingBalanceCalculationFix; 528'000; uint32_t; Height of fork to fix TotalVotingBalance calculation. treasuryReissuance; 689'761; ; +strictAggregateTransactionHash; 1'690'500; ; treasury_reissuance_transaction_signatures 0BBEADD37539444D75C09A245102D2B883267925398504623835DCD625290DEE4FA2371341050C49C001DEDD1C9FE241EA4A7DB335B2069FD4DAFF77AF734C03; true @@ -751,6 +752,28 @@ C0BAE301EC15B514C5685A661BC3E23A6596CE9DC412A83F67A8C8611A4415B1B0447E8C09D2816C A317F4EB085C8D3D80435669EF54C6C9C9AD9B57165B14CF051F43879D0112E3A79591DD6D469BFAA850891FA2CB601BA58CD1BAEBFF5D84C49179AC7FE14706; true FDB98C472D0B98FDD766DA177366DEB2DB0E79721BD73DA96A84622A98932DA75BAA327BA9E23D448C6F25344654A6F17F7734C14D1530B327F911A97B4DE30A; true +corrupt_aggregate_transaction_hashes +97CA49FCE55644FF28248C6EA4DCB6E87E53909811DEE2513F0218DAA394679F; 657BE411624B617F51CD8D151735F50FE50A91A5B7D0658192EF3EC4DD0C91C3 +B2813813F709C3011468E23E61AE102BCB55A28A87D0CF74968B8BD2413615AA; 3FEF96C5496E60BC1D33815139BDCD4FA707CE1C2A9A25FF4F7D3B1BE698116C +30FA71E6D1E34DF1E430A07E1B0817BED9A4ED6B0245B7471B0557380A700E1B; AE377EAB7F1970DEC21FF305C39EBDD3ECE413B911EF3E4E11F7DDDC9C9C9748 +E14FB95DA63CDA9899474D7EFD0DCB6A6C9E8931DF12ECA01F22DF2B59B6624C; 342E7C1E6318F7DCE5CE5A09B8FA1820453C4437AEF1B872BD06531E3ADB41C0 +55EB9659C81600F1760C4C0A4F8A7A5C90A39FCEE36E3165143B8E72BBC709E8; 8980CF4407A48410C4E910FE766C135F8C3C84EA9917BFDB7A71434C2CDC625A +D24D000FABBD1AC4BC21006A5CAE76AE9C32792A4920F66D6A6C6F76B438BDF1; 5FDEF85E8B3669FF155B5F3DA98288C6ED8A293CC699338ADB743C0F5E8614ED +26FF5E7174DEEF3147DB25C37C7AE9905157ACBA2D233D40D1F77A65B60D59BC; 3A2F78C2E7B10FF84EB33BF1DD0FD61951F8E3EA3303614D1B20060CD88F6E14 +2DF1D19B5E68102665D11B3CF3069AB5DFED2E60A7690C8788172E0E5E30B72D; 3B64321593D06FF37B191F52FE31E107A8FDB0116AB5374157F8F415B8C73BE4 +8BAA5EC2DDF55EE583ABB7EA4A4FE6EB8A4C16C41ED30CB1E68F6D1F40C3FC5A; 59850BF728A08555D10DAD5745EE2A349FECC0B16810F5D32CF3DFC376DEFFE1 +8CE147B1B64E200FA48B17FE5B6F4FA2FFEC83FF03A1EC0D4725AB8122AF5B05; 1F3D4045C3482A9EED536F61CAA58284323037B72A9A774A0C75932F85999B0F +BC312549DB027287836AD52B6EA30171AA1958B20BEB3D659F843D699DE45FD3; 4AC4B12DE7C5B0D02BFFEA3ED98F4247FAFF701C4CE0A2CFD75E7F633DB0ED60 +B35D60C826470EB38B6963DCEF5A9FE406EDE405676EDB027956999D7618998D; D8915C7EFFDB62B3CB5872597522C0920AF5D55EC44A4548DF8679C08A0C0541 +91C27BE7E5AC8EBCE6A5D576DE250054A3CDC2B674BAD5FA29B554C0A50E2973; 05718908AFBA83B420AE19BE0A11EE36119AC960353BA6C3F180078C8C4B428D +D91689D6A3C9FE7AABB45C3FC44373DA23EF363D71360CB4B7ECD74F0BDE893B; D8915C7EFFDB62B3CB5872597522C0920AF5D55EC44A4548DF8679C08A0C0541 +8090FFF457D88D98ACFDA7872DAAD1A901B4CB081387B1A45AFDA8EEF686EB54; 05718908AFBA83B420AE19BE0A11EE36119AC960353BA6C3F180078C8C4B428D +33937869216924161235BA8E10DC075592022C22F6593042A1064ADD24B64FE8; 9C00D552960DEDC38A009B541681B2C7A68902D94A9D6C089604D2E7EFCCD88E +BDF7755E44E1405C3353AB97651DD82785C6A3A8EAA5EA1CEA0E30DADB0D12F8; B6D02DA3F69C20F69A9209B13192174091544512CD7D2CE53C366909B354B7B1 +852A41F9452A34054DE1C21E46F925EA7B50D26AF97FBA8D745F01CC6DD5097F; 8626BB52F6457D95B01A5C178E6A6977F8BD418CD9A7D5B0A814210E0A4FBBA3 +C1E7404CDAE41ACE07E8649FA2D5E3E2FF5DA502E43E5D1C6073192823F90BE6; A7321E82547506079C0692DC0DFF8C9CB0D56DD2C9E3208F479DB8970B985E6C +C0FAAD2439E9D8017F9A2E5F67A46850195209402C1EE55CF99880426D0F454F; 3B74892D50665E4A989C89EDCE88905937B81BF260A679653E86886407812F83 + config-node.properties node diff --git a/test/reports/mainnet-peer/node-config.rst b/test/reports/mainnet-peer/node-config.rst index 88f053669..083daef05 100644 --- a/test/reports/mainnet-peer/node-config.rst +++ b/test/reports/mainnet-peer/node-config.rst @@ -766,6 +766,7 @@ config-network.properties **fork_heights**; ; ; totalVotingBalanceCalculationFix; 528'000; uint32_t; Height of fork to fix TotalVotingBalance calculation. treasuryReissuance; 689'761; ; + strictAggregateTransactionHash; 1'690'500; ; **treasury_reissuance_transaction_signatures**; 0BBEADD37539444D75C09A245102D2B883267925398504623835DCD625290DEE4FA2371341050C49C001DEDD1C9FE241EA4A7DB335B2069FD4DAFF77AF734C03; true 89447704270E8B2F8EED19526587DB58870D90A02ACEF8AE2A54311DEB95C227201CD39662A0229D5746FFB84074EA6C7DD9620A2CE5AA69065C508DC0335201; true @@ -774,6 +775,27 @@ config-network.properties C0BAE301EC15B514C5685A661BC3E23A6596CE9DC412A83F67A8C8611A4415B1B0447E8C09D2816CAE0D750C4AB1ED8FE9C85C05D448C2114147A2C935030708; true A317F4EB085C8D3D80435669EF54C6C9C9AD9B57165B14CF051F43879D0112E3A79591DD6D469BFAA850891FA2CB601BA58CD1BAEBFF5D84C49179AC7FE14706; true FDB98C472D0B98FDD766DA177366DEB2DB0E79721BD73DA96A84622A98932DA75BAA327BA9E23D448C6F25344654A6F17F7734C14D1530B327F911A97B4DE30A; true + **corrupt_aggregate_transaction_hashes**; + 97CA49FCE55644FF28248C6EA4DCB6E87E53909811DEE2513F0218DAA394679F; 657BE411624B617F51CD8D151735F50FE50A91A5B7D0658192EF3EC4DD0C91C3 + B2813813F709C3011468E23E61AE102BCB55A28A87D0CF74968B8BD2413615AA; 3FEF96C5496E60BC1D33815139BDCD4FA707CE1C2A9A25FF4F7D3B1BE698116C + 30FA71E6D1E34DF1E430A07E1B0817BED9A4ED6B0245B7471B0557380A700E1B; AE377EAB7F1970DEC21FF305C39EBDD3ECE413B911EF3E4E11F7DDDC9C9C9748 + E14FB95DA63CDA9899474D7EFD0DCB6A6C9E8931DF12ECA01F22DF2B59B6624C; 342E7C1E6318F7DCE5CE5A09B8FA1820453C4437AEF1B872BD06531E3ADB41C0 + 55EB9659C81600F1760C4C0A4F8A7A5C90A39FCEE36E3165143B8E72BBC709E8; 8980CF4407A48410C4E910FE766C135F8C3C84EA9917BFDB7A71434C2CDC625A + D24D000FABBD1AC4BC21006A5CAE76AE9C32792A4920F66D6A6C6F76B438BDF1; 5FDEF85E8B3669FF155B5F3DA98288C6ED8A293CC699338ADB743C0F5E8614ED + 26FF5E7174DEEF3147DB25C37C7AE9905157ACBA2D233D40D1F77A65B60D59BC; 3A2F78C2E7B10FF84EB33BF1DD0FD61951F8E3EA3303614D1B20060CD88F6E14 + 2DF1D19B5E68102665D11B3CF3069AB5DFED2E60A7690C8788172E0E5E30B72D; 3B64321593D06FF37B191F52FE31E107A8FDB0116AB5374157F8F415B8C73BE4 + 8BAA5EC2DDF55EE583ABB7EA4A4FE6EB8A4C16C41ED30CB1E68F6D1F40C3FC5A; 59850BF728A08555D10DAD5745EE2A349FECC0B16810F5D32CF3DFC376DEFFE1 + 8CE147B1B64E200FA48B17FE5B6F4FA2FFEC83FF03A1EC0D4725AB8122AF5B05; 1F3D4045C3482A9EED536F61CAA58284323037B72A9A774A0C75932F85999B0F + BC312549DB027287836AD52B6EA30171AA1958B20BEB3D659F843D699DE45FD3; 4AC4B12DE7C5B0D02BFFEA3ED98F4247FAFF701C4CE0A2CFD75E7F633DB0ED60 + B35D60C826470EB38B6963DCEF5A9FE406EDE405676EDB027956999D7618998D; D8915C7EFFDB62B3CB5872597522C0920AF5D55EC44A4548DF8679C08A0C0541 + 91C27BE7E5AC8EBCE6A5D576DE250054A3CDC2B674BAD5FA29B554C0A50E2973; 05718908AFBA83B420AE19BE0A11EE36119AC960353BA6C3F180078C8C4B428D + D91689D6A3C9FE7AABB45C3FC44373DA23EF363D71360CB4B7ECD74F0BDE893B; D8915C7EFFDB62B3CB5872597522C0920AF5D55EC44A4548DF8679C08A0C0541 + 8090FFF457D88D98ACFDA7872DAAD1A901B4CB081387B1A45AFDA8EEF686EB54; 05718908AFBA83B420AE19BE0A11EE36119AC960353BA6C3F180078C8C4B428D + 33937869216924161235BA8E10DC075592022C22F6593042A1064ADD24B64FE8; 9C00D552960DEDC38A009B541681B2C7A68902D94A9D6C089604D2E7EFCCD88E + BDF7755E44E1405C3353AB97651DD82785C6A3A8EAA5EA1CEA0E30DADB0D12F8; B6D02DA3F69C20F69A9209B13192174091544512CD7D2CE53C366909B354B7B1 + 852A41F9452A34054DE1C21E46F925EA7B50D26AF97FBA8D745F01CC6DD5097F; 8626BB52F6457D95B01A5C178E6A6977F8BD418CD9A7D5B0A814210E0A4FBBA3 + C1E7404CDAE41ACE07E8649FA2D5E3E2FF5DA502E43E5D1C6073192823F90BE6; A7321E82547506079C0692DC0DFF8C9CB0D56DD2C9E3208F479DB8970B985E6C + C0FAAD2439E9D8017F9A2E5F67A46850195209402C1EE55CF99880426D0F454F; 3B74892D50665E4A989C89EDCE88905937B81BF260A679653E86886407812F83 config-node.properties ====================== diff --git a/test/reports/testnet-api/node-config.csv b/test/reports/testnet-api/node-config.csv index d0620f740..a60a37373 100644 --- a/test/reports/testnet-api/node-config.csv +++ b/test/reports/testnet-api/node-config.csv @@ -574,16 +574,16 @@ listenInterface; 0.0.0.0 config-network.properties network identifier; testnet; NetworkIdentifier; Network identifier. -nemesisSignerPublicKey; FD0A6FAFEF047C5E251F60DBC2A30327AB401E629806A52BB4ED3007EC32C9B7; Key; Nemesis public key. +nemesisSignerPublicKey; 76E94661562762111FF7E592B00398554973396D8A4B922F3E3D139892F7C35C; Key; Nemesis public key. nodeEqualityStrategy; host; NodeIdentityEqualityStrategy; Node equality strategy. -generationHashSeed; 7FCCD304802016BEBBCD342A332F91FF1F3BB5E902988B352697BE245F48E836; ; -epochAdjustment; 1637848847s; utils::TimeSpan; Nemesis epoch time adjustment. +generationHashSeed; 49D6E1CE276A85B70EAFE52349AACCA389302E7A9754BCF1221E79494FC665A4; ; +epochAdjustment; 1667250467s; utils::TimeSpan; Nemesis epoch time adjustment. chain enableVerifiableState; true; bool; Set to true if block chain should calculate state hashes so that state is fully verifiable at each block. enableVerifiableReceipts; true; bool; Set to true if block chain should calculate receipts so that state changes are fully verifiable at each block. -currencyMosaicId; 0x3A84'16DB'2D53'B6C8; MosaicId; Mosaic id used as primary chain currency. -harvestingMosaicId; 0x3A84'16DB'2D53'B6C8; MosaicId; Mosaic id used to provide harvesting ability. +currencyMosaicId; 0x72C0'212E'67A0'8BCE; MosaicId; Mosaic id used as primary chain currency. +harvestingMosaicId; 0x72C0'212E'67A0'8BCE; MosaicId; Mosaic id used to provide harvesting ability. blockGenerationTargetTime; 30s; utils::TimeSpan; Targeted time between blocks. blockTimeSmoothingFactor; 3000; uint32_t; Note: A higher value makes the network more biased. Note: This can lower security because it will increase the influence of time relative to importance. importanceGrouping; 180; uint64_t; Number of blocks that should be treated as a group for importance purposes. Note: Importances will only be calculated at blocks that are multiples of this grouping number. @@ -605,8 +605,8 @@ minVotingKeyLifetime; 28; uint32_t; Minimum number of finalization rounds for wh maxVotingKeyLifetime; 720; uint32_t; Maximum number of finalization rounds for which voting key can be registered. harvestBeneficiaryPercentage; 25; uint8_t; Percentage of the harvested fee that is collected by the beneficiary account. harvestNetworkPercentage; 5; uint8_t; Percentage of the harvested fee that is collected by the network. -harvestNetworkFeeSinkAddressV1; TBR3XLCYWLI4AC5CRMBMHOLFROA3WC2IXQGKGTI; ; -harvestNetworkFeeSinkAddress; TBR3XLCYWLI4AC5CRMBMHOLFROA3WC2IXQGKGTI; Address; Address of the harvest network fee sink account. +harvestNetworkFeeSinkAddressV1; TBC3AX4TMSYWTCWR6LDHPKWQQL7KPCOMHECN2II; ; +harvestNetworkFeeSinkAddress; TBC3AX4TMSYWTCWR6LDHPKWQQL7KPCOMHECN2II; Address; Address of the harvest network fee sink account. maxTransactionsPerBlock; 6'000; uint32_t; Maximum number of transactions per block. plugin:catapult.plugins.accountlink @@ -635,8 +635,8 @@ plugin:catapult.plugins.mosaic maxMosaicsPerAccount; 1'000; uint16_t; Maximum number of mosaics that an account can own. maxMosaicDuration; 3650d; utils::BlockSpan; Maximum mosaic duration. maxMosaicDivisibility; 6; uint8_t; Maximum mosaic divisibility. -mosaicRentalFeeSinkAddressV1; TDFYDFR4V6U3NOU7RELXNVXE2UJDKWNEYSU2ODQ; ; -mosaicRentalFeeSinkAddress; TDFYDFR4V6U3NOU7RELXNVXE2UJDKWNEYSU2ODQ; Address; Address of the mosaic rental fee sink account. +mosaicRentalFeeSinkAddressV1; TA53AVLYMT5HCP5TJ23CGKGTUXQHNPBTJ4Z2LIQ; ; +mosaicRentalFeeSinkAddress; TA53AVLYMT5HCP5TJ23CGKGTUXQHNPBTJ4Z2LIQ; Address; Address of the mosaic rental fee sink account. mosaicRentalFee; 500000; Amount; Mosaic rental fee. plugin:catapult.plugins.multisig @@ -652,8 +652,8 @@ minNamespaceDuration; 30d; utils::BlockSpan; Minimum namespace duration. maxNamespaceDuration; 1825d; utils::BlockSpan; Maximum namespace duration. namespaceGracePeriodDuration; 1d; utils::BlockSpan; Grace period during which time only the previous owner can renew an expired namespace. reservedRootNamespaceNames; symbol, symbl, xym, xem, nem, user, account, org, com, biz, net, edu, mil, gov, info; unordered_set; Reserved root namespaces that cannot be claimed. -namespaceRentalFeeSinkAddressV1; TANQYMTLDSIQYXDV37IXJBK5HNDCRTIMJDKCKJQ; ; -namespaceRentalFeeSinkAddress; TANQYMTLDSIQYXDV37IXJBK5HNDCRTIMJDKCKJQ; Address; Address of the namespace rental fee sink account. +namespaceRentalFeeSinkAddressV1; TDVFW6NZN3YI6O4ZRYZHGY73KADCW4HX6IDIKZI; ; +namespaceRentalFeeSinkAddress; TDVFW6NZN3YI6O4ZRYZHGY73KADCW4HX6IDIKZI; Address; Address of the namespace rental fee sink account. rootNamespaceRentalFeePerBlock; 2; Amount; Root namespace rental fee per block. childNamespaceRentalFee; 100000; Amount; Child namespace rental fee. @@ -669,8 +669,7 @@ maxMessageSize; 1024; uint16_t; Maximum transaction message size. fork_heights totalVotingBalanceCalculationFix; 0; uint32_t; Height of fork to fix TotalVotingBalance calculation. treasuryReissuance; 0; ; - -treasury_reissuance_transaction_signatures +strictAggregateTransactionHash; 0; ; config-node.properties diff --git a/test/reports/testnet-api/node-config.rst b/test/reports/testnet-api/node-config.rst index 09417b20c..bda782965 100644 --- a/test/reports/testnet-api/node-config.rst +++ b/test/reports/testnet-api/node-config.rst @@ -608,15 +608,15 @@ config-network.properties **network**; ; ; identifier; testnet; NetworkIdentifier; Network identifier. - nemesisSignerPublicKey; FD0A6FAFEF047C5E251F60DBC2A30327AB401E629806A52BB4ED3007EC32C9B7; Key; Nemesis public key. + nemesisSignerPublicKey; 76E94661562762111FF7E592B00398554973396D8A4B922F3E3D139892F7C35C; Key; Nemesis public key. nodeEqualityStrategy; host; NodeIdentityEqualityStrategy; Node equality strategy. - generationHashSeed; 7FCCD304802016BEBBCD342A332F91FF1F3BB5E902988B352697BE245F48E836; ; - epochAdjustment; 1637848847s; utils::TimeSpan; Nemesis epoch time adjustment. + generationHashSeed; 49D6E1CE276A85B70EAFE52349AACCA389302E7A9754BCF1221E79494FC665A4; ; + epochAdjustment; 1667250467s; utils::TimeSpan; Nemesis epoch time adjustment. **chain**; ; ; enableVerifiableState; true; bool; Set to true if block chain should calculate state hashes so that state is fully verifiable at each block. enableVerifiableReceipts; true; bool; Set to true if block chain should calculate receipts so that state changes are fully verifiable at each block. - currencyMosaicId; 0x3A84'16DB'2D53'B6C8; MosaicId; Mosaic id used as primary chain currency. - harvestingMosaicId; 0x3A84'16DB'2D53'B6C8; MosaicId; Mosaic id used to provide harvesting ability. + currencyMosaicId; 0x72C0'212E'67A0'8BCE; MosaicId; Mosaic id used as primary chain currency. + harvestingMosaicId; 0x72C0'212E'67A0'8BCE; MosaicId; Mosaic id used to provide harvesting ability. blockGenerationTargetTime; 30s; utils::TimeSpan; Targeted time between blocks. blockTimeSmoothingFactor; 3000; uint32_t; Note: A higher value makes the network more biased. Note: This can lower security because it will increase the influence of time relative to importance. importanceGrouping; 180; uint64_t; Number of blocks that should be treated as a group for importance purposes. Note: Importances will only be calculated at blocks that are multiples of this grouping number. @@ -638,8 +638,8 @@ config-network.properties maxVotingKeyLifetime; 720; uint32_t; Maximum number of finalization rounds for which voting key can be registered. harvestBeneficiaryPercentage; 25; uint8_t; Percentage of the harvested fee that is collected by the beneficiary account. harvestNetworkPercentage; 5; uint8_t; Percentage of the harvested fee that is collected by the network. - harvestNetworkFeeSinkAddressV1; TBR3XLCYWLI4AC5CRMBMHOLFROA3WC2IXQGKGTI; ; - harvestNetworkFeeSinkAddress; TBR3XLCYWLI4AC5CRMBMHOLFROA3WC2IXQGKGTI; Address; Address of the harvest network fee sink account. + harvestNetworkFeeSinkAddressV1; TBC3AX4TMSYWTCWR6LDHPKWQQL7KPCOMHECN2II; ; + harvestNetworkFeeSinkAddress; TBC3AX4TMSYWTCWR6LDHPKWQQL7KPCOMHECN2II; Address; Address of the harvest network fee sink account. maxTransactionsPerBlock; 6'000; uint32_t; Maximum number of transactions per block. **plugin:catapult.plugins.accountlink**; dummy; to trigger plugin load @@ -662,8 +662,8 @@ config-network.properties maxMosaicsPerAccount; 1'000; uint16_t; Maximum number of mosaics that an account can own. maxMosaicDuration; 3650d; utils::BlockSpan; Maximum mosaic duration. maxMosaicDivisibility; 6; uint8_t; Maximum mosaic divisibility. - mosaicRentalFeeSinkAddressV1; TDFYDFR4V6U3NOU7RELXNVXE2UJDKWNEYSU2ODQ; ; - mosaicRentalFeeSinkAddress; TDFYDFR4V6U3NOU7RELXNVXE2UJDKWNEYSU2ODQ; Address; Address of the mosaic rental fee sink account. + mosaicRentalFeeSinkAddressV1; TA53AVLYMT5HCP5TJ23CGKGTUXQHNPBTJ4Z2LIQ; ; + mosaicRentalFeeSinkAddress; TA53AVLYMT5HCP5TJ23CGKGTUXQHNPBTJ4Z2LIQ; Address; Address of the mosaic rental fee sink account. mosaicRentalFee; 500000; Amount; Mosaic rental fee. **plugin:catapult.plugins.multisig**; ; ; maxMultisigDepth; 3; uint8_t; Maximum number of multisig levels. @@ -677,8 +677,8 @@ config-network.properties maxNamespaceDuration; 1825d; utils::BlockSpan; Maximum namespace duration. namespaceGracePeriodDuration; 1d; utils::BlockSpan; Grace period during which time only the previous owner can renew an expired namespace. reservedRootNamespaceNames; symbol, symbl, xym, xem, nem, user, account, org, com, biz, net, edu, mil, gov, info; unordered_set; Reserved root namespaces that cannot be claimed. - namespaceRentalFeeSinkAddressV1; TANQYMTLDSIQYXDV37IXJBK5HNDCRTIMJDKCKJQ; ; - namespaceRentalFeeSinkAddress; TANQYMTLDSIQYXDV37IXJBK5HNDCRTIMJDKCKJQ; Address; Address of the namespace rental fee sink account. + namespaceRentalFeeSinkAddressV1; TDVFW6NZN3YI6O4ZRYZHGY73KADCW4HX6IDIKZI; ; + namespaceRentalFeeSinkAddress; TDVFW6NZN3YI6O4ZRYZHGY73KADCW4HX6IDIKZI; Address; Address of the namespace rental fee sink account. rootNamespaceRentalFeePerBlock; 2; Amount; Root namespace rental fee per block. childNamespaceRentalFee; 100000; Amount; Child namespace rental fee. **plugin:catapult.plugins.restrictionaccount**; ; ; @@ -690,7 +690,7 @@ config-network.properties **fork_heights**; ; ; totalVotingBalanceCalculationFix; 0; uint32_t; Height of fork to fix TotalVotingBalance calculation. treasuryReissuance; 0; ; - **treasury_reissuance_transaction_signatures**; + strictAggregateTransactionHash; 0; ; config-node.properties ====================== diff --git a/test/reports/testnet-api/rest-gateway-rest.json b/test/reports/testnet-api/rest-gateway-rest.json index 37401fc14..c17bb15af 100644 --- a/test/reports/testnet-api/rest-gateway-rest.json +++ b/test/reports/testnet-api/rest-gateway-rest.json @@ -1,7 +1,7 @@ { "network": { "name": "testnet", - "description": "Symbol Joeynet Network" + "description": "Symbol Sainet Network" }, "port": 3000, "protocol": "HTTP", diff --git a/test/reports/testnet-dual-voting/node-config.csv b/test/reports/testnet-dual-voting/node-config.csv index 3ca6ec9d7..867aa0aa5 100644 --- a/test/reports/testnet-dual-voting/node-config.csv +++ b/test/reports/testnet-dual-voting/node-config.csv @@ -584,16 +584,16 @@ listenInterface; 0.0.0.0 config-network.properties network identifier; testnet; NetworkIdentifier; Network identifier. -nemesisSignerPublicKey; FD0A6FAFEF047C5E251F60DBC2A30327AB401E629806A52BB4ED3007EC32C9B7; Key; Nemesis public key. +nemesisSignerPublicKey; 76E94661562762111FF7E592B00398554973396D8A4B922F3E3D139892F7C35C; Key; Nemesis public key. nodeEqualityStrategy; host; NodeIdentityEqualityStrategy; Node equality strategy. -generationHashSeed; 7FCCD304802016BEBBCD342A332F91FF1F3BB5E902988B352697BE245F48E836; ; -epochAdjustment; 1637848847s; utils::TimeSpan; Nemesis epoch time adjustment. +generationHashSeed; 49D6E1CE276A85B70EAFE52349AACCA389302E7A9754BCF1221E79494FC665A4; ; +epochAdjustment; 1667250467s; utils::TimeSpan; Nemesis epoch time adjustment. chain enableVerifiableState; true; bool; Set to true if block chain should calculate state hashes so that state is fully verifiable at each block. enableVerifiableReceipts; true; bool; Set to true if block chain should calculate receipts so that state changes are fully verifiable at each block. -currencyMosaicId; 0x3A84'16DB'2D53'B6C8; MosaicId; Mosaic id used as primary chain currency. -harvestingMosaicId; 0x3A84'16DB'2D53'B6C8; MosaicId; Mosaic id used to provide harvesting ability. +currencyMosaicId; 0x72C0'212E'67A0'8BCE; MosaicId; Mosaic id used as primary chain currency. +harvestingMosaicId; 0x72C0'212E'67A0'8BCE; MosaicId; Mosaic id used to provide harvesting ability. blockGenerationTargetTime; 30s; utils::TimeSpan; Targeted time between blocks. blockTimeSmoothingFactor; 3000; uint32_t; Note: A higher value makes the network more biased. Note: This can lower security because it will increase the influence of time relative to importance. importanceGrouping; 180; uint64_t; Number of blocks that should be treated as a group for importance purposes. Note: Importances will only be calculated at blocks that are multiples of this grouping number. @@ -615,8 +615,8 @@ minVotingKeyLifetime; 28; uint32_t; Minimum number of finalization rounds for wh maxVotingKeyLifetime; 720; uint32_t; Maximum number of finalization rounds for which voting key can be registered. harvestBeneficiaryPercentage; 25; uint8_t; Percentage of the harvested fee that is collected by the beneficiary account. harvestNetworkPercentage; 5; uint8_t; Percentage of the harvested fee that is collected by the network. -harvestNetworkFeeSinkAddressV1; TBR3XLCYWLI4AC5CRMBMHOLFROA3WC2IXQGKGTI; ; -harvestNetworkFeeSinkAddress; TBR3XLCYWLI4AC5CRMBMHOLFROA3WC2IXQGKGTI; Address; Address of the harvest network fee sink account. +harvestNetworkFeeSinkAddressV1; TBC3AX4TMSYWTCWR6LDHPKWQQL7KPCOMHECN2II; ; +harvestNetworkFeeSinkAddress; TBC3AX4TMSYWTCWR6LDHPKWQQL7KPCOMHECN2II; Address; Address of the harvest network fee sink account. maxTransactionsPerBlock; 6'000; uint32_t; Maximum number of transactions per block. plugin:catapult.plugins.accountlink @@ -645,8 +645,8 @@ plugin:catapult.plugins.mosaic maxMosaicsPerAccount; 1'000; uint16_t; Maximum number of mosaics that an account can own. maxMosaicDuration; 3650d; utils::BlockSpan; Maximum mosaic duration. maxMosaicDivisibility; 6; uint8_t; Maximum mosaic divisibility. -mosaicRentalFeeSinkAddressV1; TDFYDFR4V6U3NOU7RELXNVXE2UJDKWNEYSU2ODQ; ; -mosaicRentalFeeSinkAddress; TDFYDFR4V6U3NOU7RELXNVXE2UJDKWNEYSU2ODQ; Address; Address of the mosaic rental fee sink account. +mosaicRentalFeeSinkAddressV1; TA53AVLYMT5HCP5TJ23CGKGTUXQHNPBTJ4Z2LIQ; ; +mosaicRentalFeeSinkAddress; TA53AVLYMT5HCP5TJ23CGKGTUXQHNPBTJ4Z2LIQ; Address; Address of the mosaic rental fee sink account. mosaicRentalFee; 500000; Amount; Mosaic rental fee. plugin:catapult.plugins.multisig @@ -662,8 +662,8 @@ minNamespaceDuration; 30d; utils::BlockSpan; Minimum namespace duration. maxNamespaceDuration; 1825d; utils::BlockSpan; Maximum namespace duration. namespaceGracePeriodDuration; 1d; utils::BlockSpan; Grace period during which time only the previous owner can renew an expired namespace. reservedRootNamespaceNames; symbol, symbl, xym, xem, nem, user, account, org, com, biz, net, edu, mil, gov, info; unordered_set; Reserved root namespaces that cannot be claimed. -namespaceRentalFeeSinkAddressV1; TANQYMTLDSIQYXDV37IXJBK5HNDCRTIMJDKCKJQ; ; -namespaceRentalFeeSinkAddress; TANQYMTLDSIQYXDV37IXJBK5HNDCRTIMJDKCKJQ; Address; Address of the namespace rental fee sink account. +namespaceRentalFeeSinkAddressV1; TDVFW6NZN3YI6O4ZRYZHGY73KADCW4HX6IDIKZI; ; +namespaceRentalFeeSinkAddress; TDVFW6NZN3YI6O4ZRYZHGY73KADCW4HX6IDIKZI; Address; Address of the namespace rental fee sink account. rootNamespaceRentalFeePerBlock; 2; Amount; Root namespace rental fee per block. childNamespaceRentalFee; 100000; Amount; Child namespace rental fee. @@ -679,8 +679,7 @@ maxMessageSize; 1024; uint16_t; Maximum transaction message size. fork_heights totalVotingBalanceCalculationFix; 0; uint32_t; Height of fork to fix TotalVotingBalance calculation. treasuryReissuance; 0; ; - -treasury_reissuance_transaction_signatures +strictAggregateTransactionHash; 0; ; config-node.properties diff --git a/test/reports/testnet-dual-voting/node-config.rst b/test/reports/testnet-dual-voting/node-config.rst index 6fdcc17b7..58b592cdd 100644 --- a/test/reports/testnet-dual-voting/node-config.rst +++ b/test/reports/testnet-dual-voting/node-config.rst @@ -622,15 +622,15 @@ config-network.properties **network**; ; ; identifier; testnet; NetworkIdentifier; Network identifier. - nemesisSignerPublicKey; FD0A6FAFEF047C5E251F60DBC2A30327AB401E629806A52BB4ED3007EC32C9B7; Key; Nemesis public key. + nemesisSignerPublicKey; 76E94661562762111FF7E592B00398554973396D8A4B922F3E3D139892F7C35C; Key; Nemesis public key. nodeEqualityStrategy; host; NodeIdentityEqualityStrategy; Node equality strategy. - generationHashSeed; 7FCCD304802016BEBBCD342A332F91FF1F3BB5E902988B352697BE245F48E836; ; - epochAdjustment; 1637848847s; utils::TimeSpan; Nemesis epoch time adjustment. + generationHashSeed; 49D6E1CE276A85B70EAFE52349AACCA389302E7A9754BCF1221E79494FC665A4; ; + epochAdjustment; 1667250467s; utils::TimeSpan; Nemesis epoch time adjustment. **chain**; ; ; enableVerifiableState; true; bool; Set to true if block chain should calculate state hashes so that state is fully verifiable at each block. enableVerifiableReceipts; true; bool; Set to true if block chain should calculate receipts so that state changes are fully verifiable at each block. - currencyMosaicId; 0x3A84'16DB'2D53'B6C8; MosaicId; Mosaic id used as primary chain currency. - harvestingMosaicId; 0x3A84'16DB'2D53'B6C8; MosaicId; Mosaic id used to provide harvesting ability. + currencyMosaicId; 0x72C0'212E'67A0'8BCE; MosaicId; Mosaic id used as primary chain currency. + harvestingMosaicId; 0x72C0'212E'67A0'8BCE; MosaicId; Mosaic id used to provide harvesting ability. blockGenerationTargetTime; 30s; utils::TimeSpan; Targeted time between blocks. blockTimeSmoothingFactor; 3000; uint32_t; Note: A higher value makes the network more biased. Note: This can lower security because it will increase the influence of time relative to importance. importanceGrouping; 180; uint64_t; Number of blocks that should be treated as a group for importance purposes. Note: Importances will only be calculated at blocks that are multiples of this grouping number. @@ -652,8 +652,8 @@ config-network.properties maxVotingKeyLifetime; 720; uint32_t; Maximum number of finalization rounds for which voting key can be registered. harvestBeneficiaryPercentage; 25; uint8_t; Percentage of the harvested fee that is collected by the beneficiary account. harvestNetworkPercentage; 5; uint8_t; Percentage of the harvested fee that is collected by the network. - harvestNetworkFeeSinkAddressV1; TBR3XLCYWLI4AC5CRMBMHOLFROA3WC2IXQGKGTI; ; - harvestNetworkFeeSinkAddress; TBR3XLCYWLI4AC5CRMBMHOLFROA3WC2IXQGKGTI; Address; Address of the harvest network fee sink account. + harvestNetworkFeeSinkAddressV1; TBC3AX4TMSYWTCWR6LDHPKWQQL7KPCOMHECN2II; ; + harvestNetworkFeeSinkAddress; TBC3AX4TMSYWTCWR6LDHPKWQQL7KPCOMHECN2II; Address; Address of the harvest network fee sink account. maxTransactionsPerBlock; 6'000; uint32_t; Maximum number of transactions per block. **plugin:catapult.plugins.accountlink**; dummy; to trigger plugin load @@ -676,8 +676,8 @@ config-network.properties maxMosaicsPerAccount; 1'000; uint16_t; Maximum number of mosaics that an account can own. maxMosaicDuration; 3650d; utils::BlockSpan; Maximum mosaic duration. maxMosaicDivisibility; 6; uint8_t; Maximum mosaic divisibility. - mosaicRentalFeeSinkAddressV1; TDFYDFR4V6U3NOU7RELXNVXE2UJDKWNEYSU2ODQ; ; - mosaicRentalFeeSinkAddress; TDFYDFR4V6U3NOU7RELXNVXE2UJDKWNEYSU2ODQ; Address; Address of the mosaic rental fee sink account. + mosaicRentalFeeSinkAddressV1; TA53AVLYMT5HCP5TJ23CGKGTUXQHNPBTJ4Z2LIQ; ; + mosaicRentalFeeSinkAddress; TA53AVLYMT5HCP5TJ23CGKGTUXQHNPBTJ4Z2LIQ; Address; Address of the mosaic rental fee sink account. mosaicRentalFee; 500000; Amount; Mosaic rental fee. **plugin:catapult.plugins.multisig**; ; ; maxMultisigDepth; 3; uint8_t; Maximum number of multisig levels. @@ -691,8 +691,8 @@ config-network.properties maxNamespaceDuration; 1825d; utils::BlockSpan; Maximum namespace duration. namespaceGracePeriodDuration; 1d; utils::BlockSpan; Grace period during which time only the previous owner can renew an expired namespace. reservedRootNamespaceNames; symbol, symbl, xym, xem, nem, user, account, org, com, biz, net, edu, mil, gov, info; unordered_set; Reserved root namespaces that cannot be claimed. - namespaceRentalFeeSinkAddressV1; TANQYMTLDSIQYXDV37IXJBK5HNDCRTIMJDKCKJQ; ; - namespaceRentalFeeSinkAddress; TANQYMTLDSIQYXDV37IXJBK5HNDCRTIMJDKCKJQ; Address; Address of the namespace rental fee sink account. + namespaceRentalFeeSinkAddressV1; TDVFW6NZN3YI6O4ZRYZHGY73KADCW4HX6IDIKZI; ; + namespaceRentalFeeSinkAddress; TDVFW6NZN3YI6O4ZRYZHGY73KADCW4HX6IDIKZI; Address; Address of the namespace rental fee sink account. rootNamespaceRentalFeePerBlock; 2; Amount; Root namespace rental fee per block. childNamespaceRentalFee; 100000; Amount; Child namespace rental fee. **plugin:catapult.plugins.restrictionaccount**; ; ; @@ -704,7 +704,7 @@ config-network.properties **fork_heights**; ; ; totalVotingBalanceCalculationFix; 0; uint32_t; Height of fork to fix TotalVotingBalance calculation. treasuryReissuance; 0; ; - **treasury_reissuance_transaction_signatures**; + strictAggregateTransactionHash; 0; ; config-node.properties ====================== diff --git a/test/reports/testnet-dual-voting/rest-gateway-rest.json b/test/reports/testnet-dual-voting/rest-gateway-rest.json index 4fef3eb50..54fa0794f 100644 --- a/test/reports/testnet-dual-voting/rest-gateway-rest.json +++ b/test/reports/testnet-dual-voting/rest-gateway-rest.json @@ -1,7 +1,7 @@ { "network": { "name": "testnet", - "description": "Symbol Joeynet Network" + "description": "Symbol Sainet Network" }, "port": 3000, "protocol": "HTTP", diff --git a/test/reports/testnet-peer-non-harvesting-voting/node-config.csv b/test/reports/testnet-peer-non-harvesting-voting/node-config.csv index 7eec212ea..a10ef9ef0 100644 --- a/test/reports/testnet-peer-non-harvesting-voting/node-config.csv +++ b/test/reports/testnet-peer-non-harvesting-voting/node-config.csv @@ -574,16 +574,16 @@ listenInterface; 0.0.0.0 config-network.properties network identifier; testnet; NetworkIdentifier; Network identifier. -nemesisSignerPublicKey; FD0A6FAFEF047C5E251F60DBC2A30327AB401E629806A52BB4ED3007EC32C9B7; Key; Nemesis public key. +nemesisSignerPublicKey; 76E94661562762111FF7E592B00398554973396D8A4B922F3E3D139892F7C35C; Key; Nemesis public key. nodeEqualityStrategy; host; NodeIdentityEqualityStrategy; Node equality strategy. -generationHashSeed; 7FCCD304802016BEBBCD342A332F91FF1F3BB5E902988B352697BE245F48E836; ; -epochAdjustment; 1637848847s; utils::TimeSpan; Nemesis epoch time adjustment. +generationHashSeed; 49D6E1CE276A85B70EAFE52349AACCA389302E7A9754BCF1221E79494FC665A4; ; +epochAdjustment; 1667250467s; utils::TimeSpan; Nemesis epoch time adjustment. chain enableVerifiableState; true; bool; Set to true if block chain should calculate state hashes so that state is fully verifiable at each block. enableVerifiableReceipts; true; bool; Set to true if block chain should calculate receipts so that state changes are fully verifiable at each block. -currencyMosaicId; 0x3A84'16DB'2D53'B6C8; MosaicId; Mosaic id used as primary chain currency. -harvestingMosaicId; 0x3A84'16DB'2D53'B6C8; MosaicId; Mosaic id used to provide harvesting ability. +currencyMosaicId; 0x72C0'212E'67A0'8BCE; MosaicId; Mosaic id used as primary chain currency. +harvestingMosaicId; 0x72C0'212E'67A0'8BCE; MosaicId; Mosaic id used to provide harvesting ability. blockGenerationTargetTime; 30s; utils::TimeSpan; Targeted time between blocks. blockTimeSmoothingFactor; 3000; uint32_t; Note: A higher value makes the network more biased. Note: This can lower security because it will increase the influence of time relative to importance. importanceGrouping; 180; uint64_t; Number of blocks that should be treated as a group for importance purposes. Note: Importances will only be calculated at blocks that are multiples of this grouping number. @@ -605,8 +605,8 @@ minVotingKeyLifetime; 28; uint32_t; Minimum number of finalization rounds for wh maxVotingKeyLifetime; 720; uint32_t; Maximum number of finalization rounds for which voting key can be registered. harvestBeneficiaryPercentage; 25; uint8_t; Percentage of the harvested fee that is collected by the beneficiary account. harvestNetworkPercentage; 5; uint8_t; Percentage of the harvested fee that is collected by the network. -harvestNetworkFeeSinkAddressV1; TBR3XLCYWLI4AC5CRMBMHOLFROA3WC2IXQGKGTI; ; -harvestNetworkFeeSinkAddress; TBR3XLCYWLI4AC5CRMBMHOLFROA3WC2IXQGKGTI; Address; Address of the harvest network fee sink account. +harvestNetworkFeeSinkAddressV1; TBC3AX4TMSYWTCWR6LDHPKWQQL7KPCOMHECN2II; ; +harvestNetworkFeeSinkAddress; TBC3AX4TMSYWTCWR6LDHPKWQQL7KPCOMHECN2II; Address; Address of the harvest network fee sink account. maxTransactionsPerBlock; 6'000; uint32_t; Maximum number of transactions per block. plugin:catapult.plugins.accountlink @@ -635,8 +635,8 @@ plugin:catapult.plugins.mosaic maxMosaicsPerAccount; 1'000; uint16_t; Maximum number of mosaics that an account can own. maxMosaicDuration; 3650d; utils::BlockSpan; Maximum mosaic duration. maxMosaicDivisibility; 6; uint8_t; Maximum mosaic divisibility. -mosaicRentalFeeSinkAddressV1; TDFYDFR4V6U3NOU7RELXNVXE2UJDKWNEYSU2ODQ; ; -mosaicRentalFeeSinkAddress; TDFYDFR4V6U3NOU7RELXNVXE2UJDKWNEYSU2ODQ; Address; Address of the mosaic rental fee sink account. +mosaicRentalFeeSinkAddressV1; TA53AVLYMT5HCP5TJ23CGKGTUXQHNPBTJ4Z2LIQ; ; +mosaicRentalFeeSinkAddress; TA53AVLYMT5HCP5TJ23CGKGTUXQHNPBTJ4Z2LIQ; Address; Address of the mosaic rental fee sink account. mosaicRentalFee; 500000; Amount; Mosaic rental fee. plugin:catapult.plugins.multisig @@ -652,8 +652,8 @@ minNamespaceDuration; 30d; utils::BlockSpan; Minimum namespace duration. maxNamespaceDuration; 1825d; utils::BlockSpan; Maximum namespace duration. namespaceGracePeriodDuration; 1d; utils::BlockSpan; Grace period during which time only the previous owner can renew an expired namespace. reservedRootNamespaceNames; symbol, symbl, xym, xem, nem, user, account, org, com, biz, net, edu, mil, gov, info; unordered_set; Reserved root namespaces that cannot be claimed. -namespaceRentalFeeSinkAddressV1; TANQYMTLDSIQYXDV37IXJBK5HNDCRTIMJDKCKJQ; ; -namespaceRentalFeeSinkAddress; TANQYMTLDSIQYXDV37IXJBK5HNDCRTIMJDKCKJQ; Address; Address of the namespace rental fee sink account. +namespaceRentalFeeSinkAddressV1; TDVFW6NZN3YI6O4ZRYZHGY73KADCW4HX6IDIKZI; ; +namespaceRentalFeeSinkAddress; TDVFW6NZN3YI6O4ZRYZHGY73KADCW4HX6IDIKZI; Address; Address of the namespace rental fee sink account. rootNamespaceRentalFeePerBlock; 2; Amount; Root namespace rental fee per block. childNamespaceRentalFee; 100000; Amount; Child namespace rental fee. @@ -669,8 +669,7 @@ maxMessageSize; 1024; uint16_t; Maximum transaction message size. fork_heights totalVotingBalanceCalculationFix; 0; uint32_t; Height of fork to fix TotalVotingBalance calculation. treasuryReissuance; 0; ; - -treasury_reissuance_transaction_signatures +strictAggregateTransactionHash; 0; ; config-node.properties diff --git a/test/reports/testnet-peer-non-harvesting-voting/node-config.rst b/test/reports/testnet-peer-non-harvesting-voting/node-config.rst index 3f41672ce..c78ca110e 100644 --- a/test/reports/testnet-peer-non-harvesting-voting/node-config.rst +++ b/test/reports/testnet-peer-non-harvesting-voting/node-config.rst @@ -608,15 +608,15 @@ config-network.properties **network**; ; ; identifier; testnet; NetworkIdentifier; Network identifier. - nemesisSignerPublicKey; FD0A6FAFEF047C5E251F60DBC2A30327AB401E629806A52BB4ED3007EC32C9B7; Key; Nemesis public key. + nemesisSignerPublicKey; 76E94661562762111FF7E592B00398554973396D8A4B922F3E3D139892F7C35C; Key; Nemesis public key. nodeEqualityStrategy; host; NodeIdentityEqualityStrategy; Node equality strategy. - generationHashSeed; 7FCCD304802016BEBBCD342A332F91FF1F3BB5E902988B352697BE245F48E836; ; - epochAdjustment; 1637848847s; utils::TimeSpan; Nemesis epoch time adjustment. + generationHashSeed; 49D6E1CE276A85B70EAFE52349AACCA389302E7A9754BCF1221E79494FC665A4; ; + epochAdjustment; 1667250467s; utils::TimeSpan; Nemesis epoch time adjustment. **chain**; ; ; enableVerifiableState; true; bool; Set to true if block chain should calculate state hashes so that state is fully verifiable at each block. enableVerifiableReceipts; true; bool; Set to true if block chain should calculate receipts so that state changes are fully verifiable at each block. - currencyMosaicId; 0x3A84'16DB'2D53'B6C8; MosaicId; Mosaic id used as primary chain currency. - harvestingMosaicId; 0x3A84'16DB'2D53'B6C8; MosaicId; Mosaic id used to provide harvesting ability. + currencyMosaicId; 0x72C0'212E'67A0'8BCE; MosaicId; Mosaic id used as primary chain currency. + harvestingMosaicId; 0x72C0'212E'67A0'8BCE; MosaicId; Mosaic id used to provide harvesting ability. blockGenerationTargetTime; 30s; utils::TimeSpan; Targeted time between blocks. blockTimeSmoothingFactor; 3000; uint32_t; Note: A higher value makes the network more biased. Note: This can lower security because it will increase the influence of time relative to importance. importanceGrouping; 180; uint64_t; Number of blocks that should be treated as a group for importance purposes. Note: Importances will only be calculated at blocks that are multiples of this grouping number. @@ -638,8 +638,8 @@ config-network.properties maxVotingKeyLifetime; 720; uint32_t; Maximum number of finalization rounds for which voting key can be registered. harvestBeneficiaryPercentage; 25; uint8_t; Percentage of the harvested fee that is collected by the beneficiary account. harvestNetworkPercentage; 5; uint8_t; Percentage of the harvested fee that is collected by the network. - harvestNetworkFeeSinkAddressV1; TBR3XLCYWLI4AC5CRMBMHOLFROA3WC2IXQGKGTI; ; - harvestNetworkFeeSinkAddress; TBR3XLCYWLI4AC5CRMBMHOLFROA3WC2IXQGKGTI; Address; Address of the harvest network fee sink account. + harvestNetworkFeeSinkAddressV1; TBC3AX4TMSYWTCWR6LDHPKWQQL7KPCOMHECN2II; ; + harvestNetworkFeeSinkAddress; TBC3AX4TMSYWTCWR6LDHPKWQQL7KPCOMHECN2II; Address; Address of the harvest network fee sink account. maxTransactionsPerBlock; 6'000; uint32_t; Maximum number of transactions per block. **plugin:catapult.plugins.accountlink**; dummy; to trigger plugin load @@ -662,8 +662,8 @@ config-network.properties maxMosaicsPerAccount; 1'000; uint16_t; Maximum number of mosaics that an account can own. maxMosaicDuration; 3650d; utils::BlockSpan; Maximum mosaic duration. maxMosaicDivisibility; 6; uint8_t; Maximum mosaic divisibility. - mosaicRentalFeeSinkAddressV1; TDFYDFR4V6U3NOU7RELXNVXE2UJDKWNEYSU2ODQ; ; - mosaicRentalFeeSinkAddress; TDFYDFR4V6U3NOU7RELXNVXE2UJDKWNEYSU2ODQ; Address; Address of the mosaic rental fee sink account. + mosaicRentalFeeSinkAddressV1; TA53AVLYMT5HCP5TJ23CGKGTUXQHNPBTJ4Z2LIQ; ; + mosaicRentalFeeSinkAddress; TA53AVLYMT5HCP5TJ23CGKGTUXQHNPBTJ4Z2LIQ; Address; Address of the mosaic rental fee sink account. mosaicRentalFee; 500000; Amount; Mosaic rental fee. **plugin:catapult.plugins.multisig**; ; ; maxMultisigDepth; 3; uint8_t; Maximum number of multisig levels. @@ -677,8 +677,8 @@ config-network.properties maxNamespaceDuration; 1825d; utils::BlockSpan; Maximum namespace duration. namespaceGracePeriodDuration; 1d; utils::BlockSpan; Grace period during which time only the previous owner can renew an expired namespace. reservedRootNamespaceNames; symbol, symbl, xym, xem, nem, user, account, org, com, biz, net, edu, mil, gov, info; unordered_set; Reserved root namespaces that cannot be claimed. - namespaceRentalFeeSinkAddressV1; TANQYMTLDSIQYXDV37IXJBK5HNDCRTIMJDKCKJQ; ; - namespaceRentalFeeSinkAddress; TANQYMTLDSIQYXDV37IXJBK5HNDCRTIMJDKCKJQ; Address; Address of the namespace rental fee sink account. + namespaceRentalFeeSinkAddressV1; TDVFW6NZN3YI6O4ZRYZHGY73KADCW4HX6IDIKZI; ; + namespaceRentalFeeSinkAddress; TDVFW6NZN3YI6O4ZRYZHGY73KADCW4HX6IDIKZI; Address; Address of the namespace rental fee sink account. rootNamespaceRentalFeePerBlock; 2; Amount; Root namespace rental fee per block. childNamespaceRentalFee; 100000; Amount; Child namespace rental fee. **plugin:catapult.plugins.restrictionaccount**; ; ; @@ -690,7 +690,7 @@ config-network.properties **fork_heights**; ; ; totalVotingBalanceCalculationFix; 0; uint32_t; Height of fork to fix TotalVotingBalance calculation. treasuryReissuance; 0; ; - **treasury_reissuance_transaction_signatures**; + strictAggregateTransactionHash; 0; ; config-node.properties ====================== diff --git a/test/reports/testnet-peer-voting/node-config.csv b/test/reports/testnet-peer-voting/node-config.csv index f05628df9..474a4e28b 100644 --- a/test/reports/testnet-peer-voting/node-config.csv +++ b/test/reports/testnet-peer-voting/node-config.csv @@ -584,16 +584,16 @@ listenInterface; 0.0.0.0 config-network.properties network identifier; testnet; NetworkIdentifier; Network identifier. -nemesisSignerPublicKey; FD0A6FAFEF047C5E251F60DBC2A30327AB401E629806A52BB4ED3007EC32C9B7; Key; Nemesis public key. +nemesisSignerPublicKey; 76E94661562762111FF7E592B00398554973396D8A4B922F3E3D139892F7C35C; Key; Nemesis public key. nodeEqualityStrategy; host; NodeIdentityEqualityStrategy; Node equality strategy. -generationHashSeed; 7FCCD304802016BEBBCD342A332F91FF1F3BB5E902988B352697BE245F48E836; ; -epochAdjustment; 1637848847s; utils::TimeSpan; Nemesis epoch time adjustment. +generationHashSeed; 49D6E1CE276A85B70EAFE52349AACCA389302E7A9754BCF1221E79494FC665A4; ; +epochAdjustment; 1667250467s; utils::TimeSpan; Nemesis epoch time adjustment. chain enableVerifiableState; true; bool; Set to true if block chain should calculate state hashes so that state is fully verifiable at each block. enableVerifiableReceipts; true; bool; Set to true if block chain should calculate receipts so that state changes are fully verifiable at each block. -currencyMosaicId; 0x3A84'16DB'2D53'B6C8; MosaicId; Mosaic id used as primary chain currency. -harvestingMosaicId; 0x3A84'16DB'2D53'B6C8; MosaicId; Mosaic id used to provide harvesting ability. +currencyMosaicId; 0x72C0'212E'67A0'8BCE; MosaicId; Mosaic id used as primary chain currency. +harvestingMosaicId; 0x72C0'212E'67A0'8BCE; MosaicId; Mosaic id used to provide harvesting ability. blockGenerationTargetTime; 30s; utils::TimeSpan; Targeted time between blocks. blockTimeSmoothingFactor; 3000; uint32_t; Note: A higher value makes the network more biased. Note: This can lower security because it will increase the influence of time relative to importance. importanceGrouping; 180; uint64_t; Number of blocks that should be treated as a group for importance purposes. Note: Importances will only be calculated at blocks that are multiples of this grouping number. @@ -615,8 +615,8 @@ minVotingKeyLifetime; 28; uint32_t; Minimum number of finalization rounds for wh maxVotingKeyLifetime; 720; uint32_t; Maximum number of finalization rounds for which voting key can be registered. harvestBeneficiaryPercentage; 25; uint8_t; Percentage of the harvested fee that is collected by the beneficiary account. harvestNetworkPercentage; 5; uint8_t; Percentage of the harvested fee that is collected by the network. -harvestNetworkFeeSinkAddressV1; TBR3XLCYWLI4AC5CRMBMHOLFROA3WC2IXQGKGTI; ; -harvestNetworkFeeSinkAddress; TBR3XLCYWLI4AC5CRMBMHOLFROA3WC2IXQGKGTI; Address; Address of the harvest network fee sink account. +harvestNetworkFeeSinkAddressV1; TBC3AX4TMSYWTCWR6LDHPKWQQL7KPCOMHECN2II; ; +harvestNetworkFeeSinkAddress; TBC3AX4TMSYWTCWR6LDHPKWQQL7KPCOMHECN2II; Address; Address of the harvest network fee sink account. maxTransactionsPerBlock; 6'000; uint32_t; Maximum number of transactions per block. plugin:catapult.plugins.accountlink @@ -645,8 +645,8 @@ plugin:catapult.plugins.mosaic maxMosaicsPerAccount; 1'000; uint16_t; Maximum number of mosaics that an account can own. maxMosaicDuration; 3650d; utils::BlockSpan; Maximum mosaic duration. maxMosaicDivisibility; 6; uint8_t; Maximum mosaic divisibility. -mosaicRentalFeeSinkAddressV1; TDFYDFR4V6U3NOU7RELXNVXE2UJDKWNEYSU2ODQ; ; -mosaicRentalFeeSinkAddress; TDFYDFR4V6U3NOU7RELXNVXE2UJDKWNEYSU2ODQ; Address; Address of the mosaic rental fee sink account. +mosaicRentalFeeSinkAddressV1; TA53AVLYMT5HCP5TJ23CGKGTUXQHNPBTJ4Z2LIQ; ; +mosaicRentalFeeSinkAddress; TA53AVLYMT5HCP5TJ23CGKGTUXQHNPBTJ4Z2LIQ; Address; Address of the mosaic rental fee sink account. mosaicRentalFee; 500000; Amount; Mosaic rental fee. plugin:catapult.plugins.multisig @@ -662,8 +662,8 @@ minNamespaceDuration; 30d; utils::BlockSpan; Minimum namespace duration. maxNamespaceDuration; 1825d; utils::BlockSpan; Maximum namespace duration. namespaceGracePeriodDuration; 1d; utils::BlockSpan; Grace period during which time only the previous owner can renew an expired namespace. reservedRootNamespaceNames; symbol, symbl, xym, xem, nem, user, account, org, com, biz, net, edu, mil, gov, info; unordered_set; Reserved root namespaces that cannot be claimed. -namespaceRentalFeeSinkAddressV1; TANQYMTLDSIQYXDV37IXJBK5HNDCRTIMJDKCKJQ; ; -namespaceRentalFeeSinkAddress; TANQYMTLDSIQYXDV37IXJBK5HNDCRTIMJDKCKJQ; Address; Address of the namespace rental fee sink account. +namespaceRentalFeeSinkAddressV1; TDVFW6NZN3YI6O4ZRYZHGY73KADCW4HX6IDIKZI; ; +namespaceRentalFeeSinkAddress; TDVFW6NZN3YI6O4ZRYZHGY73KADCW4HX6IDIKZI; Address; Address of the namespace rental fee sink account. rootNamespaceRentalFeePerBlock; 2; Amount; Root namespace rental fee per block. childNamespaceRentalFee; 100000; Amount; Child namespace rental fee. @@ -679,8 +679,7 @@ maxMessageSize; 1024; uint16_t; Maximum transaction message size. fork_heights totalVotingBalanceCalculationFix; 0; uint32_t; Height of fork to fix TotalVotingBalance calculation. treasuryReissuance; 0; ; - -treasury_reissuance_transaction_signatures +strictAggregateTransactionHash; 0; ; config-node.properties diff --git a/test/reports/testnet-peer-voting/node-config.rst b/test/reports/testnet-peer-voting/node-config.rst index 63ae20d39..d60826e80 100644 --- a/test/reports/testnet-peer-voting/node-config.rst +++ b/test/reports/testnet-peer-voting/node-config.rst @@ -622,15 +622,15 @@ config-network.properties **network**; ; ; identifier; testnet; NetworkIdentifier; Network identifier. - nemesisSignerPublicKey; FD0A6FAFEF047C5E251F60DBC2A30327AB401E629806A52BB4ED3007EC32C9B7; Key; Nemesis public key. + nemesisSignerPublicKey; 76E94661562762111FF7E592B00398554973396D8A4B922F3E3D139892F7C35C; Key; Nemesis public key. nodeEqualityStrategy; host; NodeIdentityEqualityStrategy; Node equality strategy. - generationHashSeed; 7FCCD304802016BEBBCD342A332F91FF1F3BB5E902988B352697BE245F48E836; ; - epochAdjustment; 1637848847s; utils::TimeSpan; Nemesis epoch time adjustment. + generationHashSeed; 49D6E1CE276A85B70EAFE52349AACCA389302E7A9754BCF1221E79494FC665A4; ; + epochAdjustment; 1667250467s; utils::TimeSpan; Nemesis epoch time adjustment. **chain**; ; ; enableVerifiableState; true; bool; Set to true if block chain should calculate state hashes so that state is fully verifiable at each block. enableVerifiableReceipts; true; bool; Set to true if block chain should calculate receipts so that state changes are fully verifiable at each block. - currencyMosaicId; 0x3A84'16DB'2D53'B6C8; MosaicId; Mosaic id used as primary chain currency. - harvestingMosaicId; 0x3A84'16DB'2D53'B6C8; MosaicId; Mosaic id used to provide harvesting ability. + currencyMosaicId; 0x72C0'212E'67A0'8BCE; MosaicId; Mosaic id used as primary chain currency. + harvestingMosaicId; 0x72C0'212E'67A0'8BCE; MosaicId; Mosaic id used to provide harvesting ability. blockGenerationTargetTime; 30s; utils::TimeSpan; Targeted time between blocks. blockTimeSmoothingFactor; 3000; uint32_t; Note: A higher value makes the network more biased. Note: This can lower security because it will increase the influence of time relative to importance. importanceGrouping; 180; uint64_t; Number of blocks that should be treated as a group for importance purposes. Note: Importances will only be calculated at blocks that are multiples of this grouping number. @@ -652,8 +652,8 @@ config-network.properties maxVotingKeyLifetime; 720; uint32_t; Maximum number of finalization rounds for which voting key can be registered. harvestBeneficiaryPercentage; 25; uint8_t; Percentage of the harvested fee that is collected by the beneficiary account. harvestNetworkPercentage; 5; uint8_t; Percentage of the harvested fee that is collected by the network. - harvestNetworkFeeSinkAddressV1; TBR3XLCYWLI4AC5CRMBMHOLFROA3WC2IXQGKGTI; ; - harvestNetworkFeeSinkAddress; TBR3XLCYWLI4AC5CRMBMHOLFROA3WC2IXQGKGTI; Address; Address of the harvest network fee sink account. + harvestNetworkFeeSinkAddressV1; TBC3AX4TMSYWTCWR6LDHPKWQQL7KPCOMHECN2II; ; + harvestNetworkFeeSinkAddress; TBC3AX4TMSYWTCWR6LDHPKWQQL7KPCOMHECN2II; Address; Address of the harvest network fee sink account. maxTransactionsPerBlock; 6'000; uint32_t; Maximum number of transactions per block. **plugin:catapult.plugins.accountlink**; dummy; to trigger plugin load @@ -676,8 +676,8 @@ config-network.properties maxMosaicsPerAccount; 1'000; uint16_t; Maximum number of mosaics that an account can own. maxMosaicDuration; 3650d; utils::BlockSpan; Maximum mosaic duration. maxMosaicDivisibility; 6; uint8_t; Maximum mosaic divisibility. - mosaicRentalFeeSinkAddressV1; TDFYDFR4V6U3NOU7RELXNVXE2UJDKWNEYSU2ODQ; ; - mosaicRentalFeeSinkAddress; TDFYDFR4V6U3NOU7RELXNVXE2UJDKWNEYSU2ODQ; Address; Address of the mosaic rental fee sink account. + mosaicRentalFeeSinkAddressV1; TA53AVLYMT5HCP5TJ23CGKGTUXQHNPBTJ4Z2LIQ; ; + mosaicRentalFeeSinkAddress; TA53AVLYMT5HCP5TJ23CGKGTUXQHNPBTJ4Z2LIQ; Address; Address of the mosaic rental fee sink account. mosaicRentalFee; 500000; Amount; Mosaic rental fee. **plugin:catapult.plugins.multisig**; ; ; maxMultisigDepth; 3; uint8_t; Maximum number of multisig levels. @@ -691,8 +691,8 @@ config-network.properties maxNamespaceDuration; 1825d; utils::BlockSpan; Maximum namespace duration. namespaceGracePeriodDuration; 1d; utils::BlockSpan; Grace period during which time only the previous owner can renew an expired namespace. reservedRootNamespaceNames; symbol, symbl, xym, xem, nem, user, account, org, com, biz, net, edu, mil, gov, info; unordered_set; Reserved root namespaces that cannot be claimed. - namespaceRentalFeeSinkAddressV1; TANQYMTLDSIQYXDV37IXJBK5HNDCRTIMJDKCKJQ; ; - namespaceRentalFeeSinkAddress; TANQYMTLDSIQYXDV37IXJBK5HNDCRTIMJDKCKJQ; Address; Address of the namespace rental fee sink account. + namespaceRentalFeeSinkAddressV1; TDVFW6NZN3YI6O4ZRYZHGY73KADCW4HX6IDIKZI; ; + namespaceRentalFeeSinkAddress; TDVFW6NZN3YI6O4ZRYZHGY73KADCW4HX6IDIKZI; Address; Address of the namespace rental fee sink account. rootNamespaceRentalFeePerBlock; 2; Amount; Root namespace rental fee per block. childNamespaceRentalFee; 100000; Amount; Child namespace rental fee. **plugin:catapult.plugins.restrictionaccount**; ; ; @@ -704,7 +704,7 @@ config-network.properties **fork_heights**; ; ; totalVotingBalanceCalculationFix; 0; uint32_t; Height of fork to fix TotalVotingBalance calculation. treasuryReissuance; 0; ; - **treasury_reissuance_transaction_signatures**; + strictAggregateTransactionHash; 0; ; config-node.properties ====================== diff --git a/test/service/AddressesService.test.ts b/test/service/AddressesService.test.ts index f96a18301..679f359d5 100644 --- a/test/service/AddressesService.test.ts +++ b/test/service/AddressesService.test.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { describe } from 'mocha'; import { Account, NetworkType } from 'twix-sdk'; -import { DefaultAccountResolver, KeyName, LoggerFactory, LogType, PrivateKeySecurityMode } from '../../src'; +import { DefaultAccountResolver, KeyName, LoggerFactory, LogType, PrivateKeySecurityMode, Utils } from '../../src'; import { AddressesService } from '../../src/service/AddressesService'; const accountResolver = new DefaultAccountResolver(); @@ -278,7 +278,7 @@ describe('', () => { await service.resolveAccount(networkType, securityMode, KeyName.Main, nodeName, undefined, undefined); expect(false).eq(true); } catch (e) { - expect(e.message).eq( + expect(Utils.getMessage(e)).eq( "Account Main cannot be generated when Private Key Security Mode is PROMPT_MAIN. Account won't be stored anywhere!. Please use ENCRYPT, or provider your Main account with custom presets!", ); } diff --git a/test/service/BootstrapAccountResolver.test.ts b/test/service/BootstrapAccountResolver.test.ts new file mode 100644 index 000000000..448930cf9 --- /dev/null +++ b/test/service/BootstrapAccountResolver.test.ts @@ -0,0 +1,76 @@ +/* + * Copyright 2022 Fernando Boucquez + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { expect } from 'chai'; +import { it } from 'mocha'; +import { Account, NetworkType } from 'symbol-sdk'; +import { BootstrapAccountResolver, KeyName, LoggerFactory, LogType, Utils } from '../../src'; +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore +import { StdUtils } from '../utils/StdUtils'; + +describe('BootstrapAccountResolver', () => { + const logger = LoggerFactory.getLogger(LogType.Silent); + const networkType = NetworkType.TEST_NET; + const resolver = new BootstrapAccountResolver(logger); + const testAccount = Account.generateNewAccount(networkType); + + it('should resolveAccount when private key is provided', async () => { + const account = await resolver.resolveAccount( + networkType, + { + privateKey: testAccount.privateKey, + publicKey: testAccount.publicKey, + }, + KeyName.Main, + 'some node', + 'some description', + undefined, + ); + expect(account).to.be.deep.eq(testAccount); + }); + + it('should resolveAccount prompt private key when private key is provided', async () => { + // first 2 are invalid, last one passes. + StdUtils.in(['INVALID', '\n', testAccount.publicKey, '\n', testAccount.privateKey, '\n']); + const account = await resolver.resolveAccount( + networkType, + { + publicKey: testAccount.publicKey, + }, + KeyName.Main, + 'some node', + 'some description', + undefined, + ); + expect(account).to.be.deep.eq(testAccount); + }); + + it('should resolveAccount generate account when no account is not provided', async () => { + const account = await resolver.resolveAccount(networkType, undefined, KeyName.Main, 'some node', 'some description', undefined); + expect(account).to.not.be.undefined; + expect(account).to.be.not.deep.eq(testAccount); + }); + + it('should resolveAccount raise error when no account is not provided', async () => { + try { + await resolver.resolveAccount(networkType, undefined, KeyName.Main, 'some node', 'some description', 'DO NOT GENERATE'); + expect.fail('Should raise error!'); + } catch (e) { + expect(Utils.getMessage(e)).to.be.eq('DO NOT GENERATE'); + } + }); +}); diff --git a/test/service/BootstrapServce.test.ts b/test/service/BootstrapServce.test.ts index 059c474fb..8cd6f1d46 100644 --- a/test/service/BootstrapServce.test.ts +++ b/test/service/BootstrapServce.test.ts @@ -23,6 +23,7 @@ describe('BootstrapService', () => { it(' bootstrap config compose bootstrap/default', async () => { const service = new BootstrapService(logger); const config: StartParams = { + offline: true, report: false, workingDir: Constants.defaultWorkingDir, preset: Preset.bootstrap, @@ -45,6 +46,7 @@ describe('BootstrapService', () => { it(' bootstrap config compose testnet/dual', async () => { const service = new BootstrapService(logger); const config: StartParams = { + offline: true, report: false, workingDir: Constants.defaultWorkingDir, preset: Preset.testnet, diff --git a/test/service/BootstrapUtils.test.ts b/test/service/BootstrapUtils.test.ts deleted file mode 100644 index 5c21385fe..000000000 --- a/test/service/BootstrapUtils.test.ts +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright 2022 Fernando Boucquez - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { expect } from 'chai'; -import * as _ from 'lodash'; -import 'mocha'; -import { it } from 'mocha'; -import { totalmem } from 'os'; -import { BootstrapUtils } from '../../src/service'; - -describe('BootstrapUtils', () => { - it('BootstrapUtils.toAmount', async () => { - expect(() => BootstrapUtils.toAmount(12345678.9)).to.throw; - expect(() => BootstrapUtils.toAmount('12345678.9')).to.throw; - expect(() => BootstrapUtils.toAmount('abc')).to.throw; - expect(() => BootstrapUtils.toAmount('')).to.throw; - expect(BootstrapUtils.toAmount(12345678)).to.be.eq("12'345'678"); - expect(BootstrapUtils.toAmount('12345678')).to.be.eq("12'345'678"); - expect(BootstrapUtils.toAmount("12'3456'78")).to.be.eq("12'345'678"); - }); - - it('BootstrapUtils.computerMemory', async () => { - const totalMemory = totalmem(); - expect(totalMemory).to.be.gt(1024 * 1024); - expect(BootstrapUtils.computerMemory(100)).to.be.eq(totalMemory); - expect(BootstrapUtils.computerMemory(50)).to.be.eq(totalMemory / 2); - }); - - it('BootstrapUtils.toHex', async () => { - expect(BootstrapUtils.toHex("5E62990DCAC5'BE8A")).to.be.eq("0x5E62'990D'CAC5'BE8A"); - expect(BootstrapUtils.toHex("0x5E62'990D'CAC5'BE8A")).to.be.eq("0x5E62'990D'CAC5'BE8A"); - expect(BootstrapUtils.toHex('0x5E62990DCAC5BE8A')).to.be.eq("0x5E62'990D'CAC5'BE8A"); - expect(BootstrapUtils.toHex("5E62'990D'CAC5'BE8A")).to.be.eq("0x5E62'990D'CAC5'BE8A"); - }); - - it('mergeTest', async () => { - const a = { a: 1, list: ['1', '1', '3'], c: 'A', beneficiaryAddress: 'abc' }; - const b = { a: undefined, c: 'B' }; - const c = { list: ['a', 'b'], a: undefined, c: 'C', beneficiaryAddress: '' }; - const expected = { - a: 1, - beneficiaryAddress: '', - c: 'C', - list: ['a', 'b', '3'], - }; - - expect(_.merge(a, b, c)).deep.equals(expected); - - expect(_.merge(a, b, c)).deep.equals(expected); - }); - - it('should remove null values', () => { - const compose = { - version: '2.4', - services: { - db: { - user: '', - environment: { - MONGO_INITDB_DATABASE: 'null', - }, - container_name: 'db', - image: 'mongo:4.4.3-bionic', - command: 'mongod --dbpath=/dbdata --bind_ip=db', - stop_signal: 'SIGINT', - working_dir: '/docker-entrypoint-initdb.d', - ports: [], - volumes: ['./mongo:/docker-entrypoint-initdb.d:ro', '../databases/db:/dbdata:rw'], - mem_limit: null, - }, - networks: { - default: { - ipam: { - config: [ - { - subnet: '172.20.0.0/24', - }, - ], - }, - }, - }, - }, - }; - - const composePruned = { - version: '2.4', - services: { - db: { - user: '', - environment: { - MONGO_INITDB_DATABASE: 'null', - }, - container_name: 'db', - image: 'mongo:4.4.3-bionic', - command: 'mongod --dbpath=/dbdata --bind_ip=db', - stop_signal: 'SIGINT', - working_dir: '/docker-entrypoint-initdb.d', - volumes: ['./mongo:/docker-entrypoint-initdb.d:ro', '../databases/db:/dbdata:rw'], - }, - networks: { - default: { - ipam: { - config: [ - { - subnet: '172.20.0.0/24', - }, - ], - }, - }, - }, - }, - }; - - expect(BootstrapUtils.pruneEmpty(compose)).to.deep.eq(composePruned); - }); -}); diff --git a/test/service/ComposeService.test.ts b/test/service/ComposeService.test.ts index 8e42aa168..28f61fedb 100644 --- a/test/service/ComposeService.test.ts +++ b/test/service/ComposeService.test.ts @@ -252,7 +252,7 @@ ${YamlUtils.toYaml(dockerCompose)} ...LinkService.defaultParams, target: 'target/tests/ComposeService-mainnet-custom-services', customPreset: './test/unit-test-profiles/custom_compose_service.yml', - reset: true, + reset: false, preset: Preset.testnet, assembly: Assembly.dual, }; @@ -295,6 +295,24 @@ ${YamlUtils.toYaml(dockerCompose)} await assertDockerCompose(params, 'expected-docker-compose-bootstrap-dual.yml'); }); + it('Compose mainnet services', async () => { + const params: StartParams = { + ...ConfigService.defaultParams, + ...LinkService.defaultParams, + customPreset: './test/unit-test-profiles/services_custom_preset.yml', + customPresetObject: { + knownRestGateways: ['http://some.node.com:3000'], + }, + offline: true, + target: 'target/tests/ComposeService-mainnet-services.dual', + password, + reset: false, + assembly: Assembly.services, + preset: Preset.mainnet, + }; + await assertDockerCompose(params, 'expected-docker-compose-mainnet-services.yml'); + }); + it('Compose bootstrap repeat', async () => { const params = { ...ConfigService.defaultParams, diff --git a/test/service/ConfigLoader.test.ts b/test/service/ConfigLoader.test.ts index 8add7c3ae..549dab7ed 100644 --- a/test/service/ConfigLoader.test.ts +++ b/test/service/ConfigLoader.test.ts @@ -16,7 +16,7 @@ import { expect } from 'chai'; import 'mocha'; -import { Assembly, Constants, LoggerFactory, LogType, YamlUtils } from '../../src'; +import { Assembly, Constants, LoggerFactory, LogType, Utils, YamlUtils } from '../../src'; import { ConfigLoader, Preset } from '../../src/service'; const logger = LoggerFactory.getLogger(LogType.Silent); @@ -35,7 +35,7 @@ describe('ConfigLoader', () => { }); expect(false).to.be.eq(true); // should have raised an error! } catch (e) { - expect(e.message).eq( + expect(Utils.getMessage(e)).eq( 'Preset value could not be resolved from target folder contents. Please provide the --preset parameter when running the config/start command.', ); } @@ -54,8 +54,8 @@ describe('ConfigLoader', () => { }); expect(false).to.be.eq(true); // should have raised an error! } catch (e) { - expect(e.message).eq( - 'Preset testnet requires assembly (-a, --assembly option). Possible values are: api, demo, dual, multinode, peer', + expect(Utils.getMessage(e)).eq( + 'Preset testnet requires assembly (-a, --assembly option). Possible values are: dual, peer, api, demo, multinode, services', ); } }); @@ -73,7 +73,7 @@ describe('ConfigLoader', () => { }); expect(false).to.be.eq(true); // should have raised an error! } catch (e) { - expect(e.message).eq( + expect(Utils.getMessage(e)).eq( "Assembly 'invalid-assembly.yml' is not valid for preset 'testnet'. Have you provided the right --preset --assembly ?", ); } @@ -92,7 +92,7 @@ describe('ConfigLoader', () => { }); expect(false).to.be.eq(true); // should have raised an error! } catch (e) { - expect(e.message).eq("Preset 'invalid-preset.yml' does not exist. Have you provided the right --preset ?"); + expect(Utils.getMessage(e)).eq("Preset 'invalid-preset.yml' does not exist. Have you provided the right --preset ?"); } }); @@ -388,7 +388,7 @@ describe('ConfigLoader', () => { password: 'abc', }); } catch (e) { - expect(e.message).eq('Password is too short. It should have at least 4 characters!'); + expect(Utils.getMessage(e)).eq('Password is too short. It should have at least 4 characters!'); } }); diff --git a/test/service/ConfigService.test.ts b/test/service/ConfigService.test.ts index 2ff3891cb..ba7c90fbe 100644 --- a/test/service/ConfigService.test.ts +++ b/test/service/ConfigService.test.ts @@ -18,7 +18,7 @@ import { expect } from 'chai'; import * as _ from 'lodash'; import 'mocha'; import { join } from 'path'; -import { Assembly, CustomPreset, LoggerFactory, LogType } from '../../src'; +import { Assembly, CustomPreset, LoggerFactory, LogType, Utils } from '../../src'; import { ConfigService, CryptoUtils, Preset } from '../../src/service'; // Local test utils // eslint-disable-next-line @typescript-eslint/ban-ts-comment @@ -130,7 +130,7 @@ describe('ConfigService', () => { }).run(); expect(false).to.be.eq(true); // should have raised an error! } catch (e) { - expect(e.message).eq(`${join('test', `customNetwork`, 'nemesis-seed-invalid')} folder does not exist`); + expect(Utils.getMessage(e)).eq(`${join('test', `customNetwork`, 'nemesis-seed-invalid')} folder does not exist`); } }); @@ -703,7 +703,7 @@ describe('ConfigService', () => { }).run(); expect(false).to.be.eq(true); // should have raised an error! } catch (e) { - expect(e.message).eq("Mosaic currency's fixed distributed supply 1000005 is grater than mosaic total supply 1000000"); + expect(Utils.getMessage(e)).eq("Mosaic currency's fixed distributed supply 1000005 is grater than mosaic total supply 1000000"); } }); }); diff --git a/test/service/CryptoUtils.test.ts b/test/service/CryptoUtils.test.ts index 78aad76eb..eb0cf9321 100644 --- a/test/service/CryptoUtils.test.ts +++ b/test/service/CryptoUtils.test.ts @@ -16,6 +16,7 @@ import { expect } from 'chai'; import 'mocha'; +import { Utils } from '../../src'; import { PrivateKeySecurityMode } from '../../src/model'; import { CryptoUtils } from '../../src/service/CryptoUtils'; @@ -125,7 +126,7 @@ describe('CryptoUtils', () => { CryptoUtils.decrypt(encryptedObject, 'invalidPassword'); expect(1).eq(0); } catch (e) { - expect(e.message).eq('Value could not be decrypted!'); + expect(Utils.getMessage(e)).eq('Value could not be decrypted!'); } }); diff --git a/test/service/FileSystemService.test.ts b/test/service/FileSystemService.test.ts index 5a5d88122..5950f3295 100644 --- a/test/service/FileSystemService.test.ts +++ b/test/service/FileSystemService.test.ts @@ -18,7 +18,7 @@ import { expect } from 'chai'; import { statSync } from 'fs'; import 'mocha'; import { it } from 'mocha'; -import { FileSystemService, LoggerFactory, LogType, YamlUtils } from '../../src'; +import { FileSystemService, LoggerFactory, LogType, Utils, YamlUtils } from '../../src'; import nock = require('nock'); const logger = LoggerFactory.getLogger(LogType.Silent); const fileSystemService = new FileSystemService(logger); @@ -52,7 +52,7 @@ describe('FileSystemService', () => { await fileSystemService.download(url + '/boat.png', 'boat.png'); expect(false).eq(true); } catch (e) { - expect(e.message).eq('Server responded with 404'); + expect(Utils.getMessage(e)).eq('Server responded with 404'); } }); }); diff --git a/test/service/HandlebarsUtils.test.ts b/test/service/HandlebarsUtils.test.ts new file mode 100644 index 000000000..af52483fc --- /dev/null +++ b/test/service/HandlebarsUtils.test.ts @@ -0,0 +1,64 @@ +/* + * Copyright 2022 Fernando Boucquez + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { expect } from 'chai'; +import * as _ from 'lodash'; +import 'mocha'; +import { it } from 'mocha'; +import { totalmem } from 'os'; +import { HandlebarsUtils } from '../../src/service'; + +describe('HandlebarsUtils', () => { + it('HandlebarsUtils.toAmount', async () => { + expect(() => HandlebarsUtils.toAmount(12345678.9)).to.throw; + expect(() => HandlebarsUtils.toAmount('12345678.9')).to.throw; + expect(() => HandlebarsUtils.toAmount('abc')).to.throw; + expect(() => HandlebarsUtils.toAmount('')).to.throw; + expect(HandlebarsUtils.toAmount(12345678)).to.be.eq("12'345'678"); + expect(HandlebarsUtils.toAmount('12345678')).to.be.eq("12'345'678"); + expect(HandlebarsUtils.toAmount("12'3456'78")).to.be.eq("12'345'678"); + }); + + it('HandlebarsUtils.computerMemory', async () => { + const totalMemory = totalmem(); + expect(totalMemory).to.be.gt(1024 * 1024); + expect(HandlebarsUtils.computerMemory(100)).to.be.eq(totalMemory); + expect(HandlebarsUtils.computerMemory(50)).to.be.eq(totalMemory / 2); + }); + + it('HandlebarsUtils.toHex', async () => { + expect(HandlebarsUtils.toHex("5E62990DCAC5'BE8A")).to.be.eq("0x5E62'990D'CAC5'BE8A"); + expect(HandlebarsUtils.toHex("0x5E62'990D'CAC5'BE8A")).to.be.eq("0x5E62'990D'CAC5'BE8A"); + expect(HandlebarsUtils.toHex('0x5E62990DCAC5BE8A')).to.be.eq("0x5E62'990D'CAC5'BE8A"); + expect(HandlebarsUtils.toHex("5E62'990D'CAC5'BE8A")).to.be.eq("0x5E62'990D'CAC5'BE8A"); + }); + + it('mergeTest', async () => { + const a = { a: 1, list: ['1', '1', '3'], c: 'A', beneficiaryAddress: 'abc' }; + const b = { a: undefined, c: 'B' }; + const c = { list: ['a', 'b'], a: undefined, c: 'C', beneficiaryAddress: '' }; + const expected = { + a: 1, + beneficiaryAddress: '', + c: 'C', + list: ['a', 'b', '3'], + }; + + expect(_.merge(a, b, c)).deep.equals(expected); + + expect(_.merge(a, b, c)).deep.equals(expected); + }); +}); diff --git a/test/service/LinkService.test.ts b/test/service/LinkService.test.ts index 4799633d7..220e7c519 100644 --- a/test/service/LinkService.test.ts +++ b/test/service/LinkService.test.ts @@ -29,7 +29,7 @@ import { UInt64, VotingKeyLinkTransaction, } from 'twix-sdk'; -import { Assembly, LoggerFactory, LogType } from '../../src'; +import { Assembly, LoggerFactory, LogType, Utils } from '../../src'; import { BootstrapService, ConfigService, LinkService, LinkServiceTransactionFactoryParams, Preset } from '../../src/service'; const logger = LoggerFactory.getLogger(LogType.Silent); const password = '1234'; @@ -125,8 +125,8 @@ describe('LinkService', () => { await new BootstrapService(logger).config(params); await new BootstrapService(logger).link(params); } catch (e) { - expect(e.message.indexOf('No up and running node could be found out of:'), e.message).to.be.greaterThan(-1); - expect(e.message.indexOf('http://localhost:3000'), e.message).to.be.greaterThan(-1); + expect(Utils.getMessage(e).indexOf('No up and running node could be found out of:'), Utils.getMessage(e)).to.be.greaterThan(-1); + expect(Utils.getMessage(e).indexOf('http://localhost:3000'), Utils.getMessage(e)).to.be.greaterThan(-1); } }); diff --git a/test/service/ModifyMultisigService.test.ts b/test/service/ModifyMultisigService.test.ts index 02c871df3..3dc530c9f 100644 --- a/test/service/ModifyMultisigService.test.ts +++ b/test/service/ModifyMultisigService.test.ts @@ -17,7 +17,7 @@ import { expect } from 'chai'; import { restore, stub } from 'sinon'; import { Account, Deadline, MultisigAccountModificationTransaction, NetworkType, TransactionType, UInt64 } from 'twix-sdk'; -import { LoggerFactory, LogType } from '../../src'; +import { LoggerFactory, LogType, Utils } from '../../src'; import { ConfigPreset } from '../../src/model'; import { ModifyMultisigParams, ModifyMultisigService, TransactionFactoryParams, TransactionUtils } from '../../src/service'; import { StdUtils } from '../utils/StdUtils'; @@ -163,7 +163,7 @@ describe('ModifyMultisigService', () => { cosignatoryAddresses: [cosigner1.address], }); } catch (err) { - expect(err.message).to.be.eq( + expect(Utils.getMessage(err)).to.be.eq( 'There are 2 more required cosignatories than available cosignatories for min. approval. Please add cosignatories or reduce the min. approval delta.', ); } @@ -179,7 +179,7 @@ describe('ModifyMultisigService', () => { cosignatoryAddresses: [cosigner1.address], }); } catch (err) { - expect(err.message).to.be.eq( + expect(Utils.getMessage(err)).to.be.eq( 'There are 2 more required cosignatories than available cosignatories for min removal. Please add cosignatories or reduce the min. removal delta.', ); } @@ -195,7 +195,7 @@ describe('ModifyMultisigService', () => { cosignatoryAddresses: [cosigner1.address], }); } catch (err) { - expect(err.message).to.be.eq( + expect(Utils.getMessage(err)).to.be.eq( 'Minimum approval and/or minimum removal cannot be set to 0 while there are 1 cosignatories in your list.', ); } @@ -211,7 +211,7 @@ describe('ModifyMultisigService', () => { cosignatoryAddresses: [cosigner1.address], }); } catch (err) { - expect(err.message.startsWith('Cannot add cosignatory!')).to.be.true; + expect(Utils.getMessage(err).startsWith('Cannot add cosignatory!')).to.be.true; } }); @@ -225,7 +225,7 @@ describe('ModifyMultisigService', () => { cosignatoryAddresses: [cosigner1.address], }); } catch (err) { - expect(err.message.startsWith('Cannot remove cosignatory!')).to.be.true; + expect(Utils.getMessage(err).startsWith('Cannot remove cosignatory!')).to.be.true; } }); }); diff --git a/test/service/RunService.test.ts b/test/service/RunService.test.ts index 482ea7b88..2cfec9293 100644 --- a/test/service/RunService.test.ts +++ b/test/service/RunService.test.ts @@ -18,7 +18,7 @@ import { expect } from 'chai'; import { existsSync } from 'fs'; import 'mocha'; import { join } from 'path'; -import { ConfigService, FileSystemService, LoggerFactory, LogType } from '../../src'; +import { ConfigService, FileSystemService, LoggerFactory, LogType, Utils } from '../../src'; import { BootstrapService, Preset, RunService, StartParams } from '../../src/service'; const logger = LoggerFactory.getLogger(LogType.Silent); const fileSystemService = new FileSystemService(logger); @@ -48,7 +48,7 @@ describe('RunService', () => { try { await service.healthCheck(500); } catch (e) { - expect(e.message).to.equal('Network did NOT start!!!'); + expect(Utils.getMessage(e)).to.equal('Network did NOT start!!!'); return; } throw new Error('This should fail!'); diff --git a/test/service/RuntimeService.test.ts b/test/service/RuntimeService.test.ts index bc4c7bb5a..6e90d02d9 100644 --- a/test/service/RuntimeService.test.ts +++ b/test/service/RuntimeService.test.ts @@ -16,7 +16,7 @@ import { expect } from 'chai'; import { it } from 'mocha'; -import { LoggerFactory, LogType, OSUtils, RuntimeService } from '../../src'; +import { LoggerFactory, LogType, OSUtils, RuntimeService, Utils } from '../../src'; const logger = LoggerFactory.getLogger(LogType.Silent); const service = new RuntimeService(logger); describe('RuntimeService', async () => { @@ -33,11 +33,12 @@ describe('RuntimeService', async () => { await service.exec('wrong!'); expect(true).eq(false); //Should fail!! } catch (e) { - expect(e.message.indexOf('wrong!')).not.eq(-1); - expect(e.stderr.indexOf('wrong!')).not.eq(-1); - expect(e.stdout).eq(''); - expect(e.cmd).eq('wrong!'); - expect(e.code).eq(OSUtils.isWindows() ? 1 : 127); + const error = e as any; + expect(Utils.getMessage(e).indexOf('wrong!')).not.eq(-1); + expect(error.stderr.indexOf('wrong!')).not.eq(-1); + expect(error.stdout).eq(''); + expect(error.cmd).eq('wrong!'); + expect(error.code).eq(OSUtils.isWindows() ? 1 : 127); } }); @@ -58,7 +59,7 @@ describe('RuntimeService', async () => { expect(true).eq(false); //Should fail!! } catch (e) { const code = OSUtils.isWindows() ? 1 : 127; - expect(e.message).eq(`Process exited with code ${code}\nCheck console for output....`); + expect(Utils.getMessage(e)).eq(`Process exited with code ${code}\nCheck console for output....`); } }); diff --git a/test/service/Utils.test.ts b/test/service/Utils.test.ts index 3bfe2d0d2..540fd0a60 100644 --- a/test/service/Utils.test.ts +++ b/test/service/Utils.test.ts @@ -34,4 +34,68 @@ describe('Utils', () => { 'Running image using Exec: symbolplatform/symbol-server:tools-gcc-0.10.0.5 /usr/catapult/bin/catapult.tools.votingkey --secret=HIDDEN_KEY --startEpoch=1 --endEpoch=26280 --output=/votingKeys/private_key_tree1.dat\n', ); }); + + it('should remove null values', () => { + const compose = { + version: '2.4', + services: { + db: { + user: '', + environment: { + MONGO_INITDB_DATABASE: 'null', + }, + container_name: 'db', + image: 'mongo:4.4.3-bionic', + command: 'mongod --dbpath=/dbdata --bind_ip=db', + stop_signal: 'SIGINT', + working_dir: '/docker-entrypoint-initdb.d', + ports: [], + volumes: ['./mongo:/docker-entrypoint-initdb.d:ro', '../databases/db:/dbdata:rw'], + mem_limit: null, + }, + networks: { + default: { + ipam: { + config: [ + { + subnet: '172.20.0.0/24', + }, + ], + }, + }, + }, + }, + }; + + const composePruned = { + version: '2.4', + services: { + db: { + user: '', + environment: { + MONGO_INITDB_DATABASE: 'null', + }, + container_name: 'db', + image: 'mongo:4.4.3-bionic', + command: 'mongod --dbpath=/dbdata --bind_ip=db', + stop_signal: 'SIGINT', + working_dir: '/docker-entrypoint-initdb.d', + volumes: ['./mongo:/docker-entrypoint-initdb.d:ro', '../databases/db:/dbdata:rw'], + }, + networks: { + default: { + ipam: { + config: [ + { + subnet: '172.20.0.0/24', + }, + ], + }, + }, + }, + }, + }; + + expect(Utils.pruneEmpty(compose)).to.deep.eq(composePruned); + }); }); diff --git a/test/service/VerifyService.test.ts b/test/service/VerifyService.test.ts index 15f61ad22..0df22a27f 100644 --- a/test/service/VerifyService.test.ts +++ b/test/service/VerifyService.test.ts @@ -82,7 +82,7 @@ describe('VerifyService', () => { it('VerifyService verify current installation when too old', async () => { const expectedVersions = { - node: '18.0.0', + node: '19.0.0', docker: '21.4.0', dockerCompose: '1.29.5', }; diff --git a/test/service/YamlUtils.test.ts b/test/service/YamlUtils.test.ts index 0326beb3f..ff530bbf1 100644 --- a/test/service/YamlUtils.test.ts +++ b/test/service/YamlUtils.test.ts @@ -19,7 +19,7 @@ import * as _ from 'lodash'; import 'mocha'; import { it } from 'mocha'; import { Account, NetworkType } from 'twix-sdk'; -import { ConfigurationUtils, YamlUtils } from '../../src'; +import { ConfigurationUtils, Utils, YamlUtils } from '../../src'; import { ConfigAccount } from '../../src/model'; import { CryptoUtils } from '../../src/service'; @@ -44,21 +44,21 @@ describe('YamlUtils', () => { YamlUtils.loadYaml('test/encrypted.yml', 'abc'); expect(1).eq(0); } catch (e) { - expect(e.message).eq('Password is too short. It should have at least 4 characters!'); + expect(Utils.getMessage(e)).eq('Password is too short. It should have at least 4 characters!'); } try { YamlUtils.loadYaml('test/encrypted.yml', 'abcd'); expect(1).eq(0); } catch (e) { - expect(e.message).eq('Cannot decrypt file test/encrypted.yml. Have you used the right password?'); + expect(Utils.getMessage(e)).eq('Cannot decrypt file test/encrypted.yml. Have you used the right password?'); } try { YamlUtils.loadYaml('test/encrypted.yml', ''); expect(1).eq(0); } catch (e) { - expect(e.message).eq( + expect(Utils.getMessage(e)).eq( 'File test/encrypted.yml seems to be encrypted but no password has been provided. Have you entered the right password?', ); } @@ -67,7 +67,7 @@ describe('YamlUtils', () => { YamlUtils.loadYaml('test/encrypted.yml', undefined); expect(1).eq(0); } catch (e) { - expect(e.message).eq( + expect(Utils.getMessage(e)).eq( 'File test/encrypted.yml seems to be encrypted but no password has been provided. Have you entered the right password?', ); } diff --git a/test/unit-test-profiles/services_custom_preset.yml b/test/unit-test-profiles/services_custom_preset.yml new file mode 100644 index 000000000..79e1bf20d --- /dev/null +++ b/test/unit-test-profiles/services_custom_preset.yml @@ -0,0 +1,2 @@ +domain: test.domain.com #Your domain, faucet.my.domain.com and explorer.my.domain.com would need to be registered. +faucetPrivateKey: BBBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA # The symbol account private key where the Faucet can transfer the tokens from.