Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
Signed-off-by: instamenta <[email protected]>
  • Loading branch information
instamenta committed Dec 13, 2024
1 parent a13e9db commit d1020c4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
5 changes: 0 additions & 5 deletions src/commands/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,6 @@ export class NetworkCommand extends BaseCommand {
valuesArg += this.prepareValuesFiles(this.profileValuesFile);
}

const genesisNetworkDataFile = await this.profileManager.prepareValuesForGenesisNetwork(config.genesisNetworkData);
if (genesisNetworkDataFile) {
valuesArg += this.prepareValuesFiles(genesisNetworkDataFile);
}

// do not deploy mirror node until after we have the updated address book
valuesArg += ` --set "telemetry.prometheus.svcMonitor.enabled=${config.enablePrometheusSvcMonitor}"`;

Expand Down
17 changes: 7 additions & 10 deletions src/core/profile_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,13 @@ export class ProfileManager {
path.join(stagingDir, 'templates', 'bootstrap.properties'),
yamlRoot,
);

const genesisNetworkJson = path.join(stagingDir, 'genesis-network.json');

fs.writeFileSync(genesisNetworkJson, genesisNetworkData.toJSON());

Check warning on line 270 in src/core/profile_manager.ts

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/core/profile_manager.ts#L270

The application dynamically constructs file or path information.

this._setFileContentsAsValue('hedera.configMaps.genesisNetworkJson', genesisNetworkJson, yamlRoot);

if (this.configManager.getFlag(flags.applicationEnv)) {
this._setFileContentsAsValue(
'hedera.configMaps.applicationEnv',
Expand Down Expand Up @@ -371,15 +378,6 @@ export class ProfileManager {
return this.writeToYaml(cachedValuesFile, yamlRoot);
}

public prepareValuesForGenesisNetwork(genesisNetworkData: GenesisNetworkDataConstructor): Promise<string> {
const yamlRoot = {};

this._setValue('hedera.configMaps.genesisNetworkJson', genesisNetworkData.toJSON(), yamlRoot);

const cachedValuesFile = path.join(this.cacheDir, 'genesis-network.yaml');
return this.writeToYaml(cachedValuesFile, yamlRoot);
}

/**
* Prepare a values file for rpc-relay Helm chart
* @param profileName - resource profile name
Expand Down Expand Up @@ -525,7 +523,6 @@ export class ProfileManager {

//? Add gossip endpoints
nodeDataWrapper.addGossipEndpoint(externalIP, externalPort);
nodeDataWrapper.addGossipEndpoint(internalIP, internalPort);

//? Add service endpoints
nodeDataWrapper.addServiceEndpoint(internalIP, internalPort);
Expand Down

0 comments on commit d1020c4

Please sign in to comment.