Skip to content

Commit 6b8ada1

Browse files
committed
fixing the nodeSequence, switched to haproxy fQDN for the service endpoint and new version of the solo-charts
Signed-off-by: instamenta <[email protected]>
1 parent bcdef8b commit 6b8ada1

File tree

6 files changed

+16
-7
lines changed

6 files changed

+16
-7
lines changed

src/commands/node/tasks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1573,7 +1573,7 @@ export class NodeCommandTasks {
15731573
async (ctx: any, task: ListrTaskWrapper<any, any, any>) => {
15741574
const config = ctx.config;
15751575
const newNodeFullyQualifiedPodName = Templates.renderNetworkPodName(config.nodeAlias);
1576-
const nodeId = Templates.nodeIdFromNodeAlias(config.nodeAlias);
1576+
const nodeId = Templates.nodeIdFromNodeAlias(config.nodeAlias) - 1;
15771577
const savedStateDir = config.lastStateZipPath.match(/\/(\d+)\.zip$/)[1];
15781578
const savedStatePath = `${constants.HEDERA_HAPI_PATH}/data/saved/com.hedera.services.ServicesMain/${nodeId}/123/${savedStateDir}`;
15791579
await this.k8.execContainer(newNodeFullyQualifiedPodName, constants.ROOT_CONTAINER, [

src/core/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ export const RELAY_PODS_RUNNING_MAX_ATTEMPTS = +process.env.RELAY_PODS_RUNNING_M
193193
export const RELAY_PODS_RUNNING_DELAY = +process.env.RELAY_PODS_RUNNING_DELAY || 1_000;
194194
export const RELAY_PODS_READY_MAX_ATTEMPTS = +process.env.RELAY_PODS_READY_MAX_ATTEMPTS || 100;
195195
export const RELAY_PODS_READY_DELAY = +process.env.RELAY_PODS_READY_DELAY || 1_000;
196+
export const GRPC_PORT = +process.env.GRPC_PORT || 50_211;
196197

197198
export const NETWORK_DESTROY_WAIT_TIMEOUT = +process.env.NETWORK_DESTROY_WAIT_TIMEOUT || 120;
198199

src/core/genesis_network_models/genesis_network_data_constructor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ export class GenesisNetworkDataConstructor implements ToJSON {
3636
private readonly keyManager: KeyManager,
3737
private readonly keysDir: string,
3838
) {
39-
for (const nodeAlias of nodeAliases) {
40-
const nodeId = Templates.nodeIdFromNodeAlias(nodeAlias);
39+
nodeAliases.forEach((nodeAlias, nodeId) => {
40+
// TODO: get nodeId from label in pod.
4141
const adminPrivateKey = PrivateKey.fromStringED25519(constants.GENESIS_KEY);
4242
const adminPubKey = adminPrivateKey.publicKey;
4343

4444
this.nodes[nodeAlias] = new GenesisNetworkNodeDataWrapper(nodeId, adminPubKey, nodeAlias);
45-
}
45+
});
4646
}
4747

4848
public static async initialize(

src/core/profile_manager.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,8 @@ export class ProfileManager {
519519
const account = nodeAccountMap.get(nodeAlias);
520520

521521
if (genesisNetworkData) {
522+
// TODO: Use the "nodeSeq"
523+
522524
const nodeDataWrapper = genesisNetworkData.nodes[nodeAlias];
523525

524526
nodeDataWrapper.weight = nodeStakeAmount;
@@ -527,8 +529,10 @@ export class ProfileManager {
527529
//? Add gossip endpoints
528530
nodeDataWrapper.addGossipEndpoint(externalIP, externalPort);
529531

532+
const haProxyFqdn = Templates.renderFullyQualifiedHaProxyName(nodeAlias, namespace);
533+
530534
//? Add service endpoints
531-
nodeDataWrapper.addServiceEndpoint(internalIP, internalPort);
535+
nodeDataWrapper.addServiceEndpoint(haProxyFqdn, constants.GRPC_PORT);
532536
}
533537

534538
if (releaseVersion.minor >= 40) {

src/core/templates.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {type AccountId} from '@hashgraph/sdk';
2323
import type {IP, NodeAlias, NodeId, PodName} from '../types/aliases.js';
2424
import {GrpcProxyTlsEnums} from './enumerations.js';
2525
import {type ContextClusterStructure} from '../types/config_types.js';
26-
import type {Cluster, Context} from './config/remote/types.js';
26+
import type {Cluster, Context, Namespace} from './config/remote/types.js';
2727

2828
export class Templates {
2929
public static renderNetworkPodName(nodeAlias: NodeAlias): PodName {
@@ -263,6 +263,10 @@ export class Templates {
263263
return `haproxy-${nodeAlias}`;
264264
}
265265

266+
public static renderFullyQualifiedHaProxyName(nodeAlias: NodeAlias, namespace: Namespace): string {
267+
return `${Templates.renderHaProxyName(nodeAlias)}-svc.${namespace}.svc.cluster.local`;
268+
}
269+
266270
public static parseNodeAliasToIpMapping(unparsed: string): Record<NodeAlias, IP> {
267271
const mapping: Record<NodeAlias, IP> = {};
268272

version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
export const JAVA_VERSION = '21.0.1+12';
2323
export const HELM_VERSION = 'v3.14.2';
24-
export const SOLO_CHART_VERSION = '0.37.0';
24+
export const SOLO_CHART_VERSION = '0.38.2';
2525
export const HEDERA_PLATFORM_VERSION = 'v0.57.2';
2626
export const MIRROR_NODE_VERSION = '0.118.1';
2727
export const HEDERA_EXPLORER_VERSION = '0.2.1';

0 commit comments

Comments
 (0)