@@ -38,6 +38,7 @@ import {ConsensusNodeComponent} from '../core/config/remote/components/consensus
38
38
import { ConsensusNodeStates } from '../core/config/remote/enumerations.js' ;
39
39
import { EnvoyProxyComponent } from '../core/config/remote/components/envoy_proxy_component.js' ;
40
40
import { HaProxyComponent } from '../core/config/remote/components/ha_proxy_component.js' ;
41
+ import { GenesisNetworkDataConstructor } from '../core/models/genesisNetworkDataConstructor.js' ;
41
42
42
43
export interface NetworkDeployConfigClass {
43
44
applicationEnv : string ;
@@ -61,7 +62,7 @@ export interface NetworkDeployConfigClass {
61
62
grpcWebTlsCertificatePath : string ;
62
63
grpcTlsKeyPath : string ;
63
64
grpcWebTlsKeyPath : string ;
64
- genesisNetworkJson : string ;
65
+ genesisNetworkData : GenesisNetworkDataConstructor ;
65
66
getUnusedConfigs : ( ) => string [ ] ;
66
67
haproxyIps : string ;
67
68
envoyIps : string ;
@@ -135,16 +136,16 @@ export class NetworkCommand extends BaseCommand {
135
136
config : {
136
137
chartDirectory ?: string ;
137
138
app ?: string ;
138
- nodeAliases ? : string [ ] ;
139
+ nodeAliases : string [ ] ;
139
140
debugNodeAlias ?: NodeAlias ;
140
141
enablePrometheusSvcMonitor ?: boolean ;
141
142
releaseTag ?: string ;
142
143
persistentVolumeClaims ?: string ;
143
144
valuesFile ?: string ;
144
145
haproxyIpsParsed ?: Record < NodeAlias , IP > ;
145
146
envoyIpsParsed ?: Record < NodeAlias , IP > ;
146
- genesisNetworkJson ?: string ;
147
- } = { } ,
147
+ genesisNetworkData : GenesisNetworkDataConstructor ;
148
+ }
148
149
) {
149
150
let valuesArg = config . chartDirectory
150
151
? `-f ${ path . join ( config . chartDirectory , 'solo-deployment' , 'values.yaml' ) } `
@@ -162,7 +163,7 @@ export class NetworkCommand extends BaseCommand {
162
163
}
163
164
164
165
const profileName = this . configManager . getFlag < string > ( flags . profileName ) as string ;
165
- this . profileValuesFile = await this . profileManager . prepareValuesForSoloChart ( profileName ) ;
166
+ this . profileValuesFile = await this . profileManager . prepareValuesForSoloChart ( profileName , config . genesisNetworkData ) ;
166
167
if ( this . profileValuesFile ) {
167
168
valuesArg += this . prepareValuesFiles ( this . profileValuesFile ) ;
168
169
}
@@ -179,7 +180,7 @@ export class NetworkCommand extends BaseCommand {
179
180
180
181
// Iterate over each node and set static IPs for HAProxy
181
182
if ( config . haproxyIpsParsed ) {
182
- config . nodeAliases ? .forEach ( ( nodeAlias , index ) => {
183
+ config . nodeAliases . forEach ( ( nodeAlias , index ) => {
183
184
const ip = config . haproxyIpsParsed ?. [ nodeAlias ] ;
184
185
185
186
if ( ip ) valuesArg += ` --set "hedera.nodes[${ index } ].haproxyStaticIP=${ ip } "` ;
@@ -188,7 +189,7 @@ export class NetworkCommand extends BaseCommand {
188
189
189
190
// Iterate over each node and set static IPs for Envoy Proxy
190
191
if ( config . envoyIpsParsed ) {
191
- config . nodeAliases ? .forEach ( ( nodeAlias , index ) => {
192
+ config . nodeAliases . forEach ( ( nodeAlias , index ) => {
192
193
const ip = config . envoyIpsParsed ?. [ nodeAlias ] ;
193
194
194
195
if ( ip ) valuesArg += ` --set "hedera.nodes[${ index } ].envoyProxyStaticIP=${ ip } "` ;
@@ -199,7 +200,7 @@ export class NetworkCommand extends BaseCommand {
199
200
valuesArg += this . prepareValuesFiles ( config . valuesFile ) ;
200
201
}
201
202
202
- valuesArg += `--set "hedera.configMaps.genesisNetworkJson=${ config . genesisNetworkJson } "`
203
+ valuesArg += `--set "hedera.configMaps.genesisNetworkJson=${ config . genesisNetworkData . toJSON ( ) } "`
203
204
204
205
this . logger . debug ( 'Prepared helm chart values' , { valuesArg} ) ;
205
206
return valuesArg ;
@@ -261,7 +262,7 @@ export class NetworkCommand extends BaseCommand {
261
262
constants . SOLO_DEPLOYMENT_CHART ,
262
263
) ;
263
264
264
- config . genesisNetworkJson = this . prepareGenesisNetworkJson ( config )
265
+ config . genesisNetworkData = new GenesisNetworkDataConstructor ( config . nodeAliases ) ;
265
266
266
267
config . valuesArg = await this . prepareValuesArg ( config ) ;
267
268
0 commit comments