diff --git a/.github/workflows/flow-task-test.yaml b/.github/workflows/flow-task-test.yaml index 5f3d17286..22d553e15 100644 --- a/.github/workflows/flow-task-test.yaml +++ b/.github/workflows/flow-task-test.yaml @@ -73,6 +73,7 @@ jobs: - name: Run Example Task File Test with type ${{ matrix.type }} run: | + export CONSENSUS_NODE_VERSION=v0.58.3 task default .github/workflows/script/solo_smoke_test.sh ${{ matrix.type }} task clean diff --git a/.github/workflows/zxc-e2e-test.yaml b/.github/workflows/zxc-e2e-test.yaml index 5a9ddc0c8..bbde0a076 100644 --- a/.github/workflows/zxc-e2e-test.yaml +++ b/.github/workflows/zxc-e2e-test.yaml @@ -167,7 +167,7 @@ jobs: if: ${{ runner.os == 'linux' && (inputs.npm-test-script == 'test-e2e-node-local-hedera' || inputs.npm-test-script == 'test-e2e-node-local-ptt' || inputs.npm-test-script == 'test-e2e-node-add-local') && !cancelled() && !failure() }} run: | cd .. - git clone https://github.com/hashgraph/hedera-services.git --depth 1 --branch v0.58.1 + git clone https://github.com/hashgraph/hedera-services.git --depth 1 --branch v0.58.3 cd hedera-services ls -ltr ${{ env.CG_EXEC }} ./gradlew assemble --stacktrace --info diff --git a/Taskfile.helper.yml b/Taskfile.helper.yml index 8b7dcdccd..2953abee8 100644 --- a/Taskfile.helper.yml +++ b/Taskfile.helper.yml @@ -196,7 +196,7 @@ tasks: cmds: - | if [[ "${CONSENSUS_NODE_VERSION}" != "" ]]; then - export CONSENSUS_NODE_FLAG='--release-tag ${CONSENSUS_NODE_VERSION}' + export CONSENSUS_NODE_FLAG='--release-tag {{.CONSENSUS_NODE_VERSION}}' fi SOLO_HOME_DIR=${SOLO_HOME_DIR} npm run solo -- node setup --namespace "${SOLO_NAMESPACE}" --node-aliases-unparsed {{.node_identifiers}} ${CONSENSUS_NODE_FLAG} ${LOCAL_BUILD_FLAG} -q --dev diff --git a/examples/performance-tuning/latitude/Taskfile.yml b/examples/performance-tuning/latitude/Taskfile.yml index ba356d4e5..147efbd11 100644 --- a/examples/performance-tuning/latitude/Taskfile.yml +++ b/examples/performance-tuning/latitude/Taskfile.yml @@ -8,7 +8,7 @@ vars: env: SOLO_NETWORK_SIZE: 10 SOLO_NAMESPACE: %SOLO_NAMESPACE% - SOLO_CHART_VERSION: 0.42.3 + SOLO_CHART_VERSION: 0.42.10 #CONSENSUS_NODE_VERSION: 0.0.0 VALUES_FLAG: "--values-file {{.USER_WORKING_DIR}}/init-containers-values.yaml" SETTINGS_FLAG: "--settings-txt {{.USER_WORKING_DIR}}/settings.txt" diff --git a/examples/performance-tuning/latitude/application.properties b/examples/performance-tuning/latitude/application.properties index 03e4cc076..f8e26acb9 100644 --- a/examples/performance-tuning/latitude/application.properties +++ b/examples/performance-tuning/latitude/application.properties @@ -1,3 +1,5 @@ contracts.chainId=298 entities.unlimitedAutoAssociationsEnabled=true bootstrap.throttleJsonDef.resource=genesis/throttles-dev.json +networkAdmin.exportCandidateRoster=true +addressBook.useRosterLifecycle=true diff --git a/resources/templates/application.env b/resources/templates/application.env new file mode 100644 index 000000000..e69de29bb diff --git a/resources/templates/application.properties b/resources/templates/application.properties index 0b4fdccdf..31d655cf6 100644 --- a/resources/templates/application.properties +++ b/resources/templates/application.properties @@ -18,3 +18,5 @@ blockStream.streamMode=RECORDS scheduling.longTermEnabled=false # TODO: uncomment this when we are ready to use genesis-network.json #addressBook.useRosterLifecycle=true +# TODO: we can remove this after we no longer need less than v0.59.x +networkAdmin.exportCandidateRoster=true diff --git a/src/commands/flags.ts b/src/commands/flags.ts index 1af812d92..82e2fb637 100644 --- a/src/commands/flags.ts +++ b/src/commands/flags.ts @@ -884,8 +884,10 @@ export class Flags { constName: 'applicationEnv', name: 'application-env', definition: { - describe: 'application.env file for node', - defaultValue: '', + describe: + 'the application.env file for the node provides environment variables to the solo-container' + + ' to be used when the hedera platform is started', + defaultValue: path.join(constants.SOLO_CACHE_DIR, 'templates', 'application.env'), type: 'string', }, prompt: undefined, @@ -1838,6 +1840,7 @@ export class Flags { static readonly nodeConfigFileFlags = new Map( [ Flags.apiPermissionProperties, + Flags.applicationEnv, Flags.applicationProperties, Flags.bootstrapProperties, Flags.log4j2Xml, diff --git a/src/core/profile_manager.ts b/src/core/profile_manager.ts index 29ce21e84..d323ae1c9 100644 --- a/src/core/profile_manager.ts +++ b/src/core/profile_manager.ts @@ -34,7 +34,7 @@ import type {AnyObject, DirPath, NodeAlias, NodeAliases, Path} from '../types/al import type {Optional} from '../types/index.js'; import {inject, injectable} from 'tsyringe-neo'; import {patchInject} from './container_helper.js'; -import {HEDERA_PLATFORM_VERSION} from '../../version.js'; +import * as versions from '../../version.js'; @injectable() export class ProfileManager { @@ -254,13 +254,11 @@ export class ProfileManager { yamlRoot, ); - if (this.configManager.getFlag(flags.applicationEnv)) { - this._setFileContentsAsValue( - 'hedera.configMaps.applicationEnv', - this.configManager.getFlag(flags.applicationEnv), - yamlRoot, - ); - } + this._setFileContentsAsValue( + 'hedera.configMaps.applicationEnv', + path.join(stagingDir, 'templates', 'application.env'), + yamlRoot, + ); if (profile.consensus) { // set default for consensus pod @@ -473,7 +471,7 @@ export class ProfileManager { throw new MissingArgumentError('nodeAccountMap the map of node IDs to account IDs is required'); } - if (!releaseTag) releaseTag = HEDERA_PLATFORM_VERSION; + if (!releaseTag) releaseTag = versions.HEDERA_PLATFORM_VERSION; if (!fs.existsSync(destPath)) { throw new IllegalArgumentError(`config destPath does not exist: ${destPath}`, destPath); @@ -494,7 +492,32 @@ export class ProfileManager { let nodeSeq = 0; for (const nodeAlias of nodeAccountMap.keys()) { - const internalIP = Templates.renderFullyQualifiedNetworkPodName(namespace, nodeAlias); + let internalIP: string; + + //? Explanation: for v0.59.x the internal IP address is set to 127.0.0.1 to avoid an ISS + + // for versions that satisfy 0.59.x + if (semver.satisfies(releaseVersion, '^0.59.0', {includePrerelease: true})) { + internalIP = '127.0.0.1'; + } + + // versions less than 0.59.0 + else if ( + semver.lt( + releaseVersion, + '0.59.0', + // @ts-expect-error TS2353: Object literal may only specify known properties + {includePrerelease: true}, + ) + ) { + internalIP = Templates.renderFullyQualifiedNetworkPodName(namespace, nodeAlias); + } + + // versions greater than 0.59.0 + else { + internalIP = '127.0.0.1'; + } + const externalIP = Templates.renderFullyQualifiedNetworkSvcName(namespace, nodeAlias); const account = nodeAccountMap.get(nodeAlias); diff --git a/test/e2e/commands/node_local_hedera.test.ts b/test/e2e/commands/node_local_hedera.test.ts index 556e70dcd..bf794d57b 100644 --- a/test/e2e/commands/node_local_hedera.test.ts +++ b/test/e2e/commands/node_local_hedera.test.ts @@ -28,6 +28,7 @@ import {Duration} from '../../../src/core/time/duration.js'; import {type NodeCommand} from '../../../src/commands/node/index.js'; import {type AccountCommand} from '../../../src/commands/account.js'; import {type AccountManager} from '../../../src/core/account_manager.js'; +import {LOCAL_HEDERA_PLATFORM_VERSION} from '../../../version.js'; const LOCAL_HEDERA = 'local-hedera-app'; const argv = getDefaultArgv(); @@ -43,6 +44,7 @@ let hederaK8: K8; console.log('Starting local build for Hedera app'); argv[flags.localBuildPath.name] = 'node1=../hedera-services/hedera-node/data/,../hedera-services/hedera-node/data'; argv[flags.namespace.name] = LOCAL_HEDERA; +argv[flags.releaseTag.name] = LOCAL_HEDERA_PLATFORM_VERSION; e2eTestSuite( LOCAL_HEDERA, diff --git a/test/e2e/commands/node_local_ptt.test.ts b/test/e2e/commands/node_local_ptt.test.ts index 341d572fa..fb4e7b93d 100644 --- a/test/e2e/commands/node_local_ptt.test.ts +++ b/test/e2e/commands/node_local_ptt.test.ts @@ -20,6 +20,7 @@ import {Flags as flags} from '../../../src/commands/flags.js'; import {e2eTestSuite, getDefaultArgv, TEST_CLUSTER} from '../../test_util.js'; import {Duration} from '../../../src/core/time/duration.js'; import {type K8} from '../../../src/core/k8.js'; +import {LOCAL_HEDERA_PLATFORM_VERSION} from '../../../version.js'; const LOCAL_PTT = 'local-ptt-app'; const argv = getDefaultArgv(); @@ -37,6 +38,7 @@ argv[flags.app.name] = 'PlatformTestingTool.jar'; argv[flags.appConfig.name] = '../hedera-services/platform-sdk/platform-apps/tests/PlatformTestingTool/src/main/resources/FCMFCQ-Basic-2.5k-5m.json'; argv[flags.namespace.name] = LOCAL_PTT; +argv[flags.releaseTag.name] = LOCAL_HEDERA_PLATFORM_VERSION; e2eTestSuite(LOCAL_PTT, argv, undefined, undefined, undefined, undefined, undefined, undefined, true, bootstrapResp => { describe('Node for platform app should start successfully', () => { diff --git a/test/test_add.ts b/test/test_add.ts index 0cf7de96f..8ed2a8856 100644 --- a/test/test_add.ts +++ b/test/test_add.ts @@ -31,6 +31,7 @@ import * as NodeCommandConfigs from '../src/commands/node/configs.js'; import type {NodeAlias} from '../src/types/aliases.js'; import type {NetworkNodeServices} from '../src/core/network_node_services.js'; import {Duration} from '../src/core/time/duration.js'; +import {LOCAL_HEDERA_PLATFORM_VERSION} from '../version.js'; const defaultTimeout = Duration.ofMinutes(2).toMillis(); @@ -48,7 +49,8 @@ export function testNodeAdd( argv[flags.generateTlsKeys.name] = true; // set the env variable SOLO_CHARTS_DIR if developer wants to use local Solo charts argv[flags.chartDirectory.name] = process.env.SOLO_CHARTS_DIR ?? undefined; - argv[flags.releaseTag.name] = HEDERA_PLATFORM_VERSION_TAG; + argv[flags.releaseTag.name] = + !localBuildPath || localBuildPath === '' ? HEDERA_PLATFORM_VERSION_TAG : LOCAL_HEDERA_PLATFORM_VERSION; argv[flags.namespace.name] = namespace; argv[flags.force.name] = true; argv[flags.persistentVolumeClaims.name] = true; diff --git a/test/unit/core/profile_manager.test.ts b/test/unit/core/profile_manager.test.ts index 0803368e6..2f3c880da 100644 --- a/test/unit/core/profile_manager.test.ts +++ b/test/unit/core/profile_manager.test.ts @@ -29,11 +29,13 @@ import * as version from '../../../version.js'; import type {NodeAlias} from '../../../src/types/aliases.js'; import {container} from 'tsyringe-neo'; import {resetTestContainer} from '../../test_container.js'; +import {Templates} from '../../../src/core/templates.js'; describe('ProfileManager', () => { let tmpDir: string, configManager: ConfigManager, profileManager: ProfileManager, cacheDir: string; const testProfileFile = path.join('test', 'data', 'test-profiles.yaml'); + let stagingDir = ''; before(() => { resetTestContainer(); @@ -45,10 +47,18 @@ describe('ProfileManager', () => { configManager.setFlag(flags.releaseTag, version.HEDERA_PLATFORM_VERSION); cacheDir = configManager.getFlag(flags.cacheDir) as string; configManager.setFlag(flags.apiPermissionProperties, path.join(cacheDir, 'templates', 'api-permission.properties')); + configManager.setFlag(flags.applicationEnv, path.join(cacheDir, 'templates', 'application.env')); configManager.setFlag(flags.applicationProperties, path.join(cacheDir, 'templates', 'application.properties')); configManager.setFlag(flags.bootstrapProperties, path.join(cacheDir, 'templates', 'bootstrap.properties')); configManager.setFlag(flags.log4j2Xml, path.join(cacheDir, 'templates', 'log4j2.xml')); configManager.setFlag(flags.settingTxt, path.join(cacheDir, 'templates', 'settings.txt')); + stagingDir = Templates.renderStagingDir( + configManager.getFlag(flags.cacheDir), + configManager.getFlag(flags.releaseTag), + ); + if (!fs.existsSync(stagingDir)) { + fs.mkdirSync(stagingDir, {recursive: true}); + } }); after(() => { @@ -130,10 +140,12 @@ describe('ProfileManager', () => { configManager.setFlag(flags.profileFile, testProfileFile); // profileManager.loadProfiles(true) - const file = path.join(tmpDir, '_setFileContentsAsValue.txt'); + const file = path.join(tmpDir, 'application.env'); const fileContents = '# row 1\n# row 2\n# row 3'; fs.writeFileSync(file, fileContents); configManager.setFlag(flags.applicationEnv, file); + const destFile = path.join(stagingDir, 'templates', 'application.env'); + fs.cpSync(file, destFile, {force: true}); const cachedValuesFile = await profileManager.prepareValuesForSoloChart('test'); const valuesYaml: any = yaml.parse(fs.readFileSync(cachedValuesFile).toString()); expect(valuesYaml.hedera.configMaps.applicationEnv).to.equal(fileContents); diff --git a/version.ts b/version.ts index 6396fd36a..0b2b6bdfc 100644 --- a/version.ts +++ b/version.ts @@ -20,8 +20,9 @@ */ export const HELM_VERSION = 'v3.14.2'; -export const SOLO_CHART_VERSION = '0.42.4'; -export const HEDERA_PLATFORM_VERSION = 'v0.58.3'; +export const SOLO_CHART_VERSION = '0.42.10'; +export const HEDERA_PLATFORM_VERSION = 'v0.59.0-main.x5322bdc'; +export const LOCAL_HEDERA_PLATFORM_VERSION = 'v0.58.3'; export const MIRROR_NODE_VERSION = '0.120.1'; export const HEDERA_EXPLORER_VERSION = '0.2.1'; export const HEDERA_JSON_RPC_RELAY_VERSION = 'v0.63.2';