-
Notifications
You must be signed in to change notification settings - Fork 9
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
chore: account init before relay deployment #1154
base: main
Are you sure you want to change the base?
Changes from all commits
f9a870c
e9a2326
135a4f0
f263913
52e56fc
3c087e2
2b08294
9dd76c4
bc4e3fc
b4aaf2b
28e1c75
0e0c8d2
1ed5977
86b4f76
2c19987
e5aa20f
e6b93e1
925f2f8
7432ce4
e150d38
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ | |
import * as path from 'node:path'; | ||
import type {Optional, SoloListrTask} from '../types/index.js'; | ||
import type {Namespace} from '../core/config/remote/types.js'; | ||
import * as Base64 from 'js-base64'; | ||
|
||
interface MirrorNodeDeployConfigClass { | ||
chartDirectory: string; | ||
|
@@ -263,9 +264,23 @@ | |
const pod = networkPods[0]; | ||
ctx.config.valuesArg += ` --set monitor.config.hedera.mirror.monitor.nodes.0.accountId=${startAccId}`; | ||
ctx.config.valuesArg += ` --set monitor.config.hedera.mirror.monitor.nodes.0.host=${pod.status.podIP}`; | ||
ctx.config.valuesArg += ' --set monitor.config.hedera.mirror.monitor.nodes.0.nodeId=0'; | ||
|
||
ctx.config.valuesArg += ` --set monitor.config.hedera.mirror.monitor.operator.accountId=${constants.OPERATOR_ID}`; | ||
ctx.config.valuesArg += ` --set monitor.config.hedera.mirror.monitor.operator.privateKey=${constants.OPERATOR_KEY}`; | ||
|
||
// get operatorKey from k8s secret since it could have been changed | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The user can use an SDK to change the key, and then the one in the secrets would be invalid. if the user supplied the operator key, use that |
||
const secrets = await self.k8.getSecretsByLabel([ | ||
`solo.hedera.com/account-id=${constants.OPERATOR_ID}`, | ||
]); | ||
if (secrets.length === 0) { | ||
this.logger.info( | ||
`No secret found for operator account id ${constants.OPERATOR_ID} from k8s, use default one`, | ||
); | ||
ctx.config.valuesArg += ` --set monitor.config.hedera.mirror.monitor.operator.privateKey=${constants.OPERATOR_KEY}`; | ||
} else { | ||
const operatorKeyFromK8 = Base64.decode(secrets[0].data.privateKey); | ||
ctx.config.valuesArg += ` --set monitor.config.hedera.mirror.monitor.operator.privateKey=${operatorKeyFromK8}`; | ||
} | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ | |
import {ListrLease} from '../core/lease/listr_lease.js'; | ||
import {RelayComponent} from '../core/config/remote/components/relay_component.js'; | ||
import {ComponentType} from '../core/config/remote/enumerations.js'; | ||
import * as Base64 from 'js-base64'; | ||
|
||
export class RelayCommand extends BaseCommand { | ||
private readonly profileManager: ProfileManager; | ||
|
@@ -109,8 +110,13 @@ | |
valuesArg += ` --set config.OPERATOR_ID_MAIN=${operatorID}`; | ||
} | ||
|
||
if (operatorKey) { | ||
valuesArg += ` --set config.OPERATOR_KEY_MAIN=${operatorKey}`; | ||
const secrets = await this.k8.getSecretsByLabel([`solo.hedera.com/account-id=${constants.OPERATOR_ID}`]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The user can use an SDK to change the key, and then the one in the secrets would be invalid. if the user supplied the operator key, use that |
||
if (secrets.length === 0) { | ||
this.logger.info(`No k8s secret found for operator account id ${constants.OPERATOR_ID}, use default one`); | ||
valuesArg += ` --set config.OPERATOR_KEY_MAIN=${constants.OPERATOR_KEY}`; | ||
} else { | ||
const operatorKeyFromK8 = Base64.decode(secrets[0].data.privateKey); | ||
valuesArg += ` --set config.OPERATOR_KEY_MAIN=${operatorKeyFromK8}`; | ||
} | ||
|
||
if (!nodeAliases) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if possible I would like to validate that the monitor/pinger functionality is active and running correctly