Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ability to deploy different software package to a subset of nodes #232

Merged
merged 46 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
05ce52e
clone hedera repo
JeffreyDallas Apr 15, 2024
8928b0e
Merge commit '05768c074dba79638b8365722450ef33b3352869' into 00207-D-…
JeffreyDallas Apr 15, 2024
1cdf25a
code check
JeffreyDallas Apr 15, 2024
1a487e0
setup java
JeffreyDallas Apr 15, 2024
89d95e6
update
JeffreyDallas Apr 15, 2024
c2d4811
update description
JeffreyDallas Apr 16, 2024
a97275c
add check
JeffreyDallas Apr 16, 2024
44231be
add flag
JeffreyDallas Apr 16, 2024
535e4f7
save
JeffreyDallas Apr 16, 2024
5c1508c
minor update
JeffreyDallas Apr 19, 2024
2785d5f
Merge branch 'main' into 00207-D-local-build
JeffreyDallas Apr 19, 2024
986f7e4
save
JeffreyDallas Apr 22, 2024
28372de
rename
JeffreyDallas Apr 23, 2024
f353f32
update readme
JeffreyDallas Apr 23, 2024
83e7203
platform running
JeffreyDallas Apr 23, 2024
55440df
add ptt test
JeffreyDallas Apr 24, 2024
3e8c5a3
Merge commit '11d076a1ef01fcdf3a8b227c501f6b7510ed0b94' into 00207-D-…
JeffreyDallas Apr 24, 2024
960d460
code check
JeffreyDallas Apr 24, 2024
cec2404
Merge branch '00244-D-relay-test' into 00207-D-local-build
JeffreyDallas May 10, 2024
8ae6da7
Merge branch 'main' into 00207-D-local-build
JeffreyDallas May 10, 2024
10bd963
setup java/gradle
JeffreyDallas May 10, 2024
033d677
remove
JeffreyDallas May 10, 2024
d0c7ef7
include new node test
JeffreyDallas May 10, 2024
b144dd6
Merge branch 'main' into 00207-D-local-build
JeffreyDallas May 10, 2024
98d242f
code check
JeffreyDallas May 10, 2024
f33c64c
Merge commit '5dbc60bdde4dcf32381808731ffabad5fc8c14fd' into 00207-D-…
JeffreyDallas May 13, 2024
bc7feb2
save
JeffreyDallas May 13, 2024
6f8dd9f
save
JeffreyDallas May 13, 2024
7e85c52
fix
JeffreyDallas May 13, 2024
9213d52
save
JeffreyDallas May 13, 2024
4761345
fix
JeffreyDallas May 13, 2024
da2cf66
update
JeffreyDallas May 14, 2024
147e9e2
Merge commit '62d8a06cfafc211772b527ada57d00c447b56567' into 00207-D-…
JeffreyDallas May 14, 2024
f531cdf
save
JeffreyDallas May 14, 2024
e2b42c7
save
JeffreyDallas May 14, 2024
07b1884
save
JeffreyDallas May 14, 2024
66c6c5f
fix typo
JeffreyDallas May 15, 2024
a0382d9
fix
JeffreyDallas May 15, 2024
ad0807a
Merge branch 'main' into 00207-D-local-build
JeffreyDallas May 15, 2024
1e26d61
fix
JeffreyDallas May 15, 2024
72232f7
add missing
JeffreyDallas May 15, 2024
58e9acd
fix
JeffreyDallas May 15, 2024
0d2182a
save
JeffreyDallas May 15, 2024
c1ffe4b
save
JeffreyDallas May 15, 2024
c0a1cac
fix type in env vars file
jeromy-cannon May 16, 2024
7963fdf
put gradle under cgroup
jeromy-cannon May 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/zxc-e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,29 @@ jobs:
- name: Pull Kind Docker Image
run: docker image pull kindest/node:v1.27.3@sha256:3966ac761ae0136263ffdb6cfd4db23ef8a83cba8a463690e98317add2c9ba72

- name: Setup Java
if: ${{ runner.os == 'linux' && inputs.enable-e2e-tests && !cancelled() && !failure() }}
jeromy-cannon marked this conversation as resolved.
Show resolved Hide resolved
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
with:
jeromy-cannon marked this conversation as resolved.
Show resolved Hide resolved
distribution: temurin
java-version: 21.0.1

- name: Setup Gradle
if: ${{ runner.os == 'linux' && inputs.enable-e2e-tests && !cancelled() && !failure() }}
jeromy-cannon marked this conversation as resolved.
Show resolved Hide resolved
uses: gradle/gradle-build-action@29c0906b64b8fc82467890bfb7a0a7ef34bda89e # v3.1.0
with:
cache-read-only: false

- name: Build Hedera code locally
if: ${{ runner.os == 'linux' && inputs.enable-e2e-tests && !cancelled() && !failure() }}
jeromy-cannon marked this conversation as resolved.
Show resolved Hide resolved
run: |
cd ..
git clone https://github.com/hashgraph/hedera-services.git
cd hedera-services
ls -ltr
./gradlew assemble
cd ../solo

- name: Setup E2E Tests
run: |
npm link
Expand Down
17 changes: 17 additions & 0 deletions README.md.template
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,24 @@ $ solo node start

# output is similar to example-1
```
## For Developer Working on Hedera Repo

To set customized `settings.txt` file, edit the file
`./resources/templates/settings.txt` before `node setup` command.
leninmehedy marked this conversation as resolved.
Show resolved Hide resolved

To deploy node with local build hedera code, first run `./gradlew assemble` at the root directory of hedera repo, then
run the following command:
```
$ solo node setup --local-build-path node0=<path-to-hedera-repo>,node1=<path-to-hedera-repo>,node2=<path-to-hedera-repo>
leninmehedy marked this conversation as resolved.
Show resolved Hide resolved
```
To have nodes running with different versions of hedera application, please clone the repo in multiple directories,
leninmehedy marked this conversation as resolved.
Show resolved Hide resolved
checkout to the respective version and build the code. Then run the above command
and provide the path to the respective node.

To deploy node with local build PTT code, run the following command:
leninmehedy marked this conversation as resolved.
Show resolved Hide resolved
```
$ solo node setup --local-build-path node0=<path-to-hedera-repo>,node1=<path-to-hedera-repo>,node2=<path-to-hedera-repo> --ptt-test-config PlatformTestingTool.jar,<path-to-test-json>
leninmehedy marked this conversation as resolved.
Show resolved Hide resolved
```
## Support

If you have a question on how to use the product, please see our [support guide](https://github.com/hashgraph/.github/blob/main/SUPPORT.md).
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"test-e2e-all": "NODE_OPTIONS=--experimental-vm-modules JEST_SUITE_NAME='Jest E2E All Tests' JEST_JUNIT_OUTPUT_NAME='junit-e2e.xml' jest --runInBand --detectOpenHandles --forceExit --coverage --coverageDirectory='coverage/e2e' --testPathIgnorePatterns=\".*/unit/.*\"",
"test-e2e": "NODE_OPTIONS=--experimental-vm-modules JEST_SUITE_NAME='Jest E2E Tests' JEST_JUNIT_OUTPUT_NAME='junit-e2e.xml' jest --runInBand --detectOpenHandles --forceExit --coverage --coverageDirectory='coverage/e2e' --testPathIgnorePatterns=\".*/unit/.*\" --testPathIgnorePatterns=\".*/e2e/commands/mirror_node.*\" --testPathIgnorePatterns=\".*/e2e/commands/node.*\" --testPathIgnorePatterns=\".*/e2e/commands/relay.*\"",
"test-e2e-mirror-node": "NODE_OPTIONS=--experimental-vm-modules JEST_SUITE_NAME='Jest E2E Mirror Node Tests' JEST_JUNIT_OUTPUT_NAME='junit-e2e-mirror-node.xml' jest --runInBand --detectOpenHandles --forceExit --coverage --coverageDirectory='coverage/e2e-mirror-node' --testRegex=\".*\\/e2e\\/commands\\/mirror_node\\.test\\.mjs\"",
"test-e2e-node": "NODE_OPTIONS=--experimental-vm-modules JEST_SUITE_NAME='Jest E2E Node Tests' JEST_JUNIT_OUTPUT_NAME='junit-e2e-node.xml' jest --runInBand --detectOpenHandles --forceExit --coverage --coverageDirectory='coverage/e2e-node' --testRegex=\".*\\/e2e\\/commands\\/node\\.test\\.mjs\"",
"test-e2e-node": "NODE_OPTIONS=--experimental-vm-modules JEST_SUITE_NAME='Jest E2E Node Tests' JEST_JUNIT_OUTPUT_NAME='junit-e2e-node.xml' jest --runInBand --detectOpenHandles --forceExit --coverage --coverageDirectory='coverage/e2e-node' --testRegex=\".*\\/e2e\\/commands\\/node*\\.test\\.mjs\"",
jeromy-cannon marked this conversation as resolved.
Show resolved Hide resolved
"test-e2e-relay": "NODE_OPTIONS=--experimental-vm-modules JEST_SUITE_NAME='Jest E2E Relay Tests' JEST_JUNIT_OUTPUT_NAME='junit-e2e-relay.xml' jest --runInBand --detectOpenHandles --forceExit --coverage --coverageDirectory='coverage/e2e-relay' --testRegex=\".*\\/e2e\\/commands\\/relay\\.test\\.mjs\"",
"merge-clean": "rm -rf .nyc_output && mkdir .nyc_output && rm -rf coverage/lcov-report && rm -rf coverage/solo && rm coverage/*.*",
"merge-e2e": "nyc merge ./coverage/e2e/ .nyc_output/coverage.json",
Expand Down
22 changes: 21 additions & 1 deletion src/commands/flags.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,24 @@ export const settingTxt = {
}
}

export const pttTestConfig = {
name: 'ptt-test-config',
definition: {
describe: 'PTT test jar and config file',
defaultValue: '',
type: 'string'
}
}

export const localBuildPath = {
name: 'local-build-path',
definition: {
describe: 'path of hedera local repo',
defaultValue: '',
type: 'string'
}
}

export const log4j2Xml = {
name: 'log4j2-xml',
definition: {
Expand Down Expand Up @@ -507,7 +525,9 @@ export const allFlags = [
amount,
applicationEnv,
profileFile,
profileName
profileName,
localBuildPath,
pttTestConfig
]

export const allFlagsMap = new Map(allFlags.map(f => [f.name, f]))
Expand Down
111 changes: 96 additions & 15 deletions src/commands/node.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,14 @@
}
}

async checkNetworkNodeState (nodeId, maxAttempt = 100, status = 'ACTIVE') {
async checkNetworkNodeState (nodeId, maxAttempt = 100, status = 'ACTIVE', logfile = 'output/hgcaa.log') {
nodeId = nodeId.trim()
const podName = Templates.renderNetworkPodName(nodeId)
const logfilePath = `${constants.HEDERA_HAPI_PATH}/output/hgcaa.log`
const logfilePath = `${constants.HEDERA_HAPI_PATH}/${logfile}`
let attempt = 0
let isActive = false

this.logger.debug(`Checking if node ${nodeId} is ${status}...`)
// check log file is accessible
let logFileAccessible = false
while (attempt++ < maxAttempt) {
Expand All @@ -116,9 +117,10 @@
attempt = 0
while (attempt < maxAttempt) {
try {
const output = await this.k8.execContainer(podName, constants.ROOT_CONTAINER, ['tail', '-10', logfilePath])
const output = await this.k8.execContainer(podName, constants.ROOT_CONTAINER, ['tail', '-100', logfilePath])
if (output && output.indexOf('Terminating Netty') < 0 && // make sure we are not at the beginning of a restart
(output.indexOf(`Now current platform status = ${status}`) > 0 ||
output.indexOf(`Platform Status Change ${status}`) > 0 ||
output.indexOf(`is ${status}`) > 0)) { // 'is ACTIVE' is for newer versions, first seen in v0.49.0
this.logger.debug(`Node ${nodeId} is ${status} [ attempt: ${attempt}/${maxAttempt}]`)
isActive = true
Expand Down Expand Up @@ -356,6 +358,50 @@
}
}

uploadPlatformSoftware (ctx, task, localBuildPath) {
leninmehedy marked this conversation as resolved.
Show resolved Hide resolved
const self = this
const subTasks = []

Check warning on line 363 in src/commands/node.mjs

View check run for this annotation

Codecov / codecov/patch

src/commands/node.mjs#L361-L363

Added lines #L361 - L363 were not covered by tests

const config = ctx.config
self.logger.debug('no need to fetch, use local build jar files')

Check warning on line 366 in src/commands/node.mjs

View check run for this annotation

Codecov / codecov/patch

src/commands/node.mjs#L365-L366

Added lines #L365 - L366 were not covered by tests
// localBuildPath example input 'node0=../hedera-services/,node1=../hedera-services/,node2=../hedera2/hedera-services/'
// split the input string by ','
const parameterPairs = localBuildPath.split(',')
const pttTestConfig = self.configManager.getFlag(flags.pttTestConfig)
for (const parameterPair of parameterPairs) {

Check warning on line 371 in src/commands/node.mjs

View check run for this annotation

Codecov / codecov/patch

src/commands/node.mjs#L369-L371

Added lines #L369 - L371 were not covered by tests
// split the localBuildPath by '='
const [nodeId, localBuildPath] = parameterPair.split('=')
let localDataLibBuildPath = path.join(localBuildPath, 'hedera-node', 'data')

Check warning on line 374 in src/commands/node.mjs

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/commands/node.mjs#L374

Detected possible user input going into a `path.join` or `path.resolve` function.

Check warning on line 374 in src/commands/node.mjs

View check run for this annotation

Codecov / codecov/patch

src/commands/node.mjs#L373-L374

Added lines #L373 - L374 were not covered by tests
if (pttTestConfig !== '' && fs.existsSync(pttTestConfig)) {
localDataLibBuildPath = path.join(localBuildPath, 'platform-sdk', 'sdk', 'data')

Check warning on line 376 in src/commands/node.mjs

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/commands/node.mjs#L376

Detected possible user input going into a `path.join` or `path.resolve` function.

Check warning on line 376 in src/commands/node.mjs

View check run for this annotation

Codecov / codecov/patch

src/commands/node.mjs#L376

Added line #L376 was not covered by tests
}

// if the path does not exist, throw an error
if (!fs.existsSync(localDataLibBuildPath)) {
throw new FullstackTestingError(`local build path does not exist: ${localDataLibBuildPath}`)

Check warning on line 381 in src/commands/node.mjs

View check run for this annotation

Codecov / codecov/patch

src/commands/node.mjs#L381

Added line #L381 was not covered by tests
}
const podName = config.podNames[nodeId]
const [pttJar, testJson] = pttTestConfig.split(',')
self.logger.debug(`PTT test jar: ${pttJar}, test json: ${testJson}`)
subTasks.push({

Check warning on line 386 in src/commands/node.mjs

View check run for this annotation

Codecov / codecov/patch

src/commands/node.mjs#L383-L386

Added lines #L383 - L386 were not covered by tests
title: `Copy local build to Node: ${chalk.yellow(nodeId)} from ${localDataLibBuildPath}`,
task: async () => {
this.logger.debug(`Copying build files to pod: ${podName} from ${localDataLibBuildPath}`)
await self.k8.copyTo(podName, constants.ROOT_CONTAINER, localDataLibBuildPath, `${constants.HEDERA_HAPI_PATH}`)
const pttTestConfig = self.configManager.getFlag(flags.pttTestConfig)

Check warning on line 391 in src/commands/node.mjs

View check run for this annotation

Codecov / codecov/patch

src/commands/node.mjs#L388-L391

Added lines #L388 - L391 were not covered by tests
if (pttTestConfig !== '' && fs.existsSync(pttTestConfig)) {
await self.k8.copyTo(podName, constants.ROOT_CONTAINER, testJson, `${constants.HEDERA_HAPI_PATH}`)

Check warning on line 393 in src/commands/node.mjs

View check run for this annotation

Codecov / codecov/patch

src/commands/node.mjs#L393

Added line #L393 was not covered by tests
}
}
})
}
// set up the sub-tasks
return task.newListr(subTasks, {

Check warning on line 399 in src/commands/node.mjs

View check run for this annotation

Codecov / codecov/patch

src/commands/node.mjs#L399

Added line #L399 was not covered by tests
concurrent: true,
rendererOptions: constants.LISTR_DEFAULT_RENDERER_OPTION
})
}

fetchPlatformSoftware (ctx, task, platformInstaller) {
const config = ctx.config

Expand Down Expand Up @@ -501,7 +547,17 @@
const config = ctx.config
const configTxtPath = `${config.stagingDir}/config.txt`
const template = `${constants.RESOURCES_DIR}/templates/config.template`
await self.platformInstaller.prepareConfigTxt(config.nodeIds, configTxtPath, config.releaseTag, config.chainId, template)
const pttTestConfig = self.configManager.getFlag(flags.pttTestConfig)
if (pttTestConfig !== '' && fs.existsSync(pttTestConfig)) {
const [pttJar, testJson] = pttTestConfig.split(',')
self.logger.debug(`PTT test jar: ${pttJar}, test json: ${testJson}`)

Check warning on line 553 in src/commands/node.mjs

View check run for this annotation

Codecov / codecov/patch

src/commands/node.mjs#L552-L553

Added lines #L552 - L553 were not covered by tests
if (!fs.existsSync(testJson)) {
throw new FullstackTestingError(`test json file does not exist: ${testJson}`)

Check warning on line 555 in src/commands/node.mjs

View check run for this annotation

Codecov / codecov/patch

src/commands/node.mjs#L555

Added line #L555 was not covered by tests
}
await self.platformInstaller.prepareConfigTxt(config.nodeIds, configTxtPath, config.releaseTag, config.chainId, template, pttJar)

Check warning on line 557 in src/commands/node.mjs

View check run for this annotation

Codecov / codecov/patch

src/commands/node.mjs#L557

Added line #L557 was not covered by tests
} else {
await self.platformInstaller.prepareConfigTxt(config.nodeIds, configTxtPath, config.releaseTag, config.chainId, template)
}
}
}
]
Expand All @@ -516,7 +572,12 @@
title: 'Fetch platform software into network nodes',
task:
async (ctx, task) => {
return self.fetchPlatformSoftware(ctx, task, self.platformInstaller)
const localBuildPath = self.configManager.getFlag(flags.localBuildPath)
if (localBuildPath !== '') {
return self.uploadPlatformSoftware(ctx, task, localBuildPath)

Check warning on line 577 in src/commands/node.mjs

View check run for this annotation

Codecov / codecov/patch

src/commands/node.mjs#L577

Added line #L577 was not covered by tests
} else {
return self.fetchPlatformSoftware(ctx, task, self.platformInstaller)
}
}
},
{
Expand Down Expand Up @@ -616,10 +677,18 @@
task: (ctx, task) => {
const subTasks = []
for (const nodeId of ctx.config.nodeIds) {
subTasks.push({
title: `Check node: ${chalk.yellow(nodeId)}`,
task: () => self.checkNetworkNodeState(nodeId)
})
const pttTestConfig = self.configManager.getFlag(flags.pttTestConfig)
if (pttTestConfig !== '' && fs.existsSync(pttTestConfig)) {
subTasks.push({

Check warning on line 682 in src/commands/node.mjs

View check run for this annotation

Codecov / codecov/patch

src/commands/node.mjs#L682

Added line #L682 was not covered by tests
title: `Check node: ${chalk.yellow(nodeId)}`,
task: () => self.checkNetworkNodeState(nodeId, 100, 'ACTIVE', 'logs/swirlds.log')

Check warning on line 684 in src/commands/node.mjs

View check run for this annotation

Codecov / codecov/patch

src/commands/node.mjs#L684

Added line #L684 was not covered by tests
})
} else {
subTasks.push({
title: `Check node: ${chalk.yellow(nodeId)}`,
task: () => self.checkNetworkNodeState(nodeId)
})
}
}

// set up the sub-tasks
Expand Down Expand Up @@ -650,7 +719,8 @@
collapseSubtasks: false
}
})
}
},
skip: (ctx, _) => self.configManager.getFlag(flags.pttTestConfig) !== ''
}], {
concurrent: false,
rendererOptions: constants.LISTR_DEFAULT_RENDERER_OPTION
Expand Down Expand Up @@ -1031,10 +1101,18 @@
task: (ctx, task) => {
const subTasks = []
for (const nodeId of ctx.config.nodeIds) {
subTasks.push({
title: `Check node: ${chalk.yellow(nodeId)}`,
task: () => self.checkNetworkNodeState(nodeId)
})
const pttTestConfig = self.configManager.getFlag(flags.pttTestConfig)
if (pttTestConfig !== '' && fs.existsSync(pttTestConfig)) {
subTasks.push({

Check warning on line 1106 in src/commands/node.mjs

View check run for this annotation

Codecov / codecov/patch

src/commands/node.mjs#L1106

Added line #L1106 was not covered by tests
title: `Check node: ${chalk.yellow(nodeId)}`,
task: () => self.checkNetworkNodeState(nodeId, 100, 'ACTIVE', 'logs/swirlds.log')

Check warning on line 1108 in src/commands/node.mjs

View check run for this annotation

Codecov / codecov/patch

src/commands/node.mjs#L1108

Added line #L1108 was not covered by tests
})
} else {
subTasks.push({
title: `Check node: ${chalk.yellow(nodeId)}`,
task: () => self.checkNetworkNodeState(nodeId)
})
}
}

// set up the sub-tasks
Expand Down Expand Up @@ -1067,7 +1145,8 @@
collapseSubtasks: false
}
})
}
},
skip: (ctx, _) => self.configManager.getFlag(flags.pttTestConfig) !== ''
}], {
concurrent: false,
rendererOptions: constants.LISTR_DEFAULT_RENDERER_OPTION
Expand Down Expand Up @@ -1558,6 +1637,8 @@
flags.apiPermissionProperties,
flags.bootstrapProperties,
flags.settingTxt,
flags.localBuildPath,
flags.pttTestConfig,
flags.log4j2Xml
),
handler: argv => {
Expand Down
3 changes: 1 addition & 2 deletions src/core/platform_installer.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export class PlatformInstaller {
* @param chainId chain ID (298 for local network)
* @returns {Promise<unknown>}
*/
async prepareConfigTxt (nodeIDs, destPath, releaseTag, chainId = constants.HEDERA_CHAIN_ID, template = `${constants.RESOURCES_DIR}/templates/config.template`) {
async prepareConfigTxt (nodeIDs, destPath, releaseTag, chainId = constants.HEDERA_CHAIN_ID, template = `${constants.RESOURCES_DIR}/templates/config.template`, appName = constants.HEDERA_APP_NAME) {
if (!nodeIDs || nodeIDs.length === 0) throw new MissingArgumentError('list of node IDs is required')
if (!destPath) throw new MissingArgumentError('destPath is required')
if (!template) throw new MissingArgumentError('config templatePath is required')
Expand All @@ -283,7 +283,6 @@ export class PlatformInstaller {
const accountIdPrefix = `${startAccountId.realm}.${startAccountId.shard}`
const internalPort = constants.HEDERA_NODE_INTERNAL_GOSSIP_PORT
const externalPort = constants.HEDERA_NODE_EXTERNAL_GOSSIP_PORT
const appName = constants.HEDERA_APP_NAME
const nodeStakeAmount = constants.HEDERA_NODE_DEFAULT_STAKE_AMOUNT

const releaseVersion = semver.parse(releaseTag, { includePrerelease: true })
Expand Down
51 changes: 51 additions & 0 deletions test/e2e/commands/node-local-hedera.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* Copyright (C) 2024 Hedera Hashgraph, LLC
*
* 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 {
afterAll,
describe
} from '@jest/globals'
import { flags } from '../../../src/commands/index.mjs'
import {
constants
} from '../../../src/core/index.mjs'
import {
bootstrapNetwork,
getDefaultArgv,
TEST_CLUSTER
} from '../../test_util.js'

describe('Node local build', () => {
const LOCAL_HEDERA = 'local-hedera-app'
const argv = getDefaultArgv()
argv[flags.keyFormat.name] = constants.KEY_FORMAT_PFX
argv[flags.nodeIDs.name] = 'node0,node1,node2'
argv[flags.generateGossipKeys.name] = true
argv[flags.generateTlsKeys.name] = true
argv[flags.clusterName.name] = TEST_CLUSTER
let hederaK8
afterAll(async () => {
await hederaK8.deleteNamespace(LOCAL_HEDERA)
}, 120000)

describe('Node for hedera app should start successfully', () => {
console.log('Starting local build for Hedera app')
argv[flags.localBuildPath.name] = 'node0=../hedera-services/,node1=../hedera-services/,node2=../hedera-services/'
argv[flags.namespace.name] = LOCAL_HEDERA
const bootstrapResp = bootstrapNetwork(LOCAL_HEDERA, argv)
hederaK8 = bootstrapResp.opts.k8
})
})
Loading
Loading