Skip to content

Commit

Permalink
fixing the nodeSequence, switched to haproxy fQDN for the service end…
Browse files Browse the repository at this point in the history
…point and new version of the solo-charts

Signed-off-by: instamenta <[email protected]>
  • Loading branch information
instamenta committed Dec 20, 2024
1 parent bcdef8b commit 6b8ada1
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/commands/node/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1573,7 +1573,7 @@ export class NodeCommandTasks {
async (ctx: any, task: ListrTaskWrapper<any, any, any>) => {
const config = ctx.config;
const newNodeFullyQualifiedPodName = Templates.renderNetworkPodName(config.nodeAlias);
const nodeId = Templates.nodeIdFromNodeAlias(config.nodeAlias);
const nodeId = Templates.nodeIdFromNodeAlias(config.nodeAlias) - 1;
const savedStateDir = config.lastStateZipPath.match(/\/(\d+)\.zip$/)[1];
const savedStatePath = `${constants.HEDERA_HAPI_PATH}/data/saved/com.hedera.services.ServicesMain/${nodeId}/123/${savedStateDir}`;
await this.k8.execContainer(newNodeFullyQualifiedPodName, constants.ROOT_CONTAINER, [
Expand Down
1 change: 1 addition & 0 deletions src/core/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ export const RELAY_PODS_RUNNING_MAX_ATTEMPTS = +process.env.RELAY_PODS_RUNNING_M
export const RELAY_PODS_RUNNING_DELAY = +process.env.RELAY_PODS_RUNNING_DELAY || 1_000;
export const RELAY_PODS_READY_MAX_ATTEMPTS = +process.env.RELAY_PODS_READY_MAX_ATTEMPTS || 100;
export const RELAY_PODS_READY_DELAY = +process.env.RELAY_PODS_READY_DELAY || 1_000;
export const GRPC_PORT = +process.env.GRPC_PORT || 50_211;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ export class GenesisNetworkDataConstructor implements ToJSON {
private readonly keyManager: KeyManager,
private readonly keysDir: string,
) {
for (const nodeAlias of nodeAliases) {
const nodeId = Templates.nodeIdFromNodeAlias(nodeAlias);
nodeAliases.forEach((nodeAlias, nodeId) => {
// TODO: get nodeId from label in pod.
const adminPrivateKey = PrivateKey.fromStringED25519(constants.GENESIS_KEY);
const adminPubKey = adminPrivateKey.publicKey;

this.nodes[nodeAlias] = new GenesisNetworkNodeDataWrapper(nodeId, adminPubKey, nodeAlias);
}
});
}

public static async initialize(
Expand Down
6 changes: 5 additions & 1 deletion src/core/profile_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,8 @@ export class ProfileManager {
const account = nodeAccountMap.get(nodeAlias);

if (genesisNetworkData) {
// TODO: Use the "nodeSeq"

const nodeDataWrapper = genesisNetworkData.nodes[nodeAlias];

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

const haProxyFqdn = Templates.renderFullyQualifiedHaProxyName(nodeAlias, namespace);

//? Add service endpoints
nodeDataWrapper.addServiceEndpoint(internalIP, internalPort);
nodeDataWrapper.addServiceEndpoint(haProxyFqdn, constants.GRPC_PORT);
}

if (releaseVersion.minor >= 40) {
Expand Down
6 changes: 5 additions & 1 deletion src/core/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {type AccountId} from '@hashgraph/sdk';
import type {IP, NodeAlias, NodeId, PodName} from '../types/aliases.js';
import {GrpcProxyTlsEnums} from './enumerations.js';
import {type ContextClusterStructure} from '../types/config_types.js';
import type {Cluster, Context} from './config/remote/types.js';
import type {Cluster, Context, Namespace} from './config/remote/types.js';

export class Templates {
public static renderNetworkPodName(nodeAlias: NodeAlias): PodName {
Expand Down Expand Up @@ -263,6 +263,10 @@ export class Templates {
return `haproxy-${nodeAlias}`;
}

public static renderFullyQualifiedHaProxyName(nodeAlias: NodeAlias, namespace: Namespace): string {
return `${Templates.renderHaProxyName(nodeAlias)}-svc.${namespace}.svc.cluster.local`;
}

public static parseNodeAliasToIpMapping(unparsed: string): Record<NodeAlias, IP> {
const mapping: Record<NodeAlias, IP> = {};

Expand Down
2 changes: 1 addition & 1 deletion version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

export const JAVA_VERSION = '21.0.1+12';
export const HELM_VERSION = 'v3.14.2';
export const SOLO_CHART_VERSION = '0.37.0';
export const SOLO_CHART_VERSION = '0.38.2';
export const HEDERA_PLATFORM_VERSION = 'v0.57.2';
export const MIRROR_NODE_VERSION = '0.118.1';
export const HEDERA_EXPLORER_VERSION = '0.2.1';
Expand Down

0 comments on commit 6b8ada1

Please sign in to comment.