Skip to content

Commit 0b2326b

Browse files
committed
changes to the genesis-network.json constructor that resolve the error's while parsing the json inside the node root containerpull
Signed-off-by: instamenta <[email protected]>
1 parent 7ec2527 commit 0b2326b

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

src/core/genesis_network_models/genesisNetworkNodeDataWrapper.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*
1616
*/
17-
import type {AccountId} from '@hashgraph/sdk';
17+
import type {AccountId, PublicKey} from '@hashgraph/sdk';
1818
import type {GenesisNetworkNodeStructure, ServiceEndpoint, ToObject} from '../../types/index.js';
1919

2020
export class GenesisNetworkNodeDataWrapper
@@ -30,7 +30,7 @@ export class GenesisNetworkNodeDataWrapper
3030

3131
constructor(
3232
public readonly nodeId: number,
33-
public readonly adminKey: string,
33+
public readonly adminKey: PublicKey,
3434
public readonly description: string,
3535
) {}
3636

@@ -39,18 +39,17 @@ export class GenesisNetworkNodeDataWrapper
3939
* @param port
4040
*/
4141
public addServiceEndpoint(domainName: string, port: number): void {
42-
this.serviceEndpoint.push({domainName, port});
42+
this.serviceEndpoint.push({domainName, port, ipAddressV4: ''});
4343
}
4444

4545
/**
4646
* @param domainName - a fully qualified domain name
4747
* @param port
4848
*/
4949
public addGossipEndpoint(domainName: string, port: number): void {
50-
this.gossipEndpoint.push({domainName, port});
50+
this.gossipEndpoint.push({domainName, port, ipAddressV4: ''});
5151
}
5252

53-
// @ts-ignore
5453
public toObject() {
5554
return {
5655
node: {

src/core/genesis_network_models/genesis_network_data_constructor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class GenesisNetworkDataConstructor implements ToJSON {
3939
for (const nodeAlias of nodeAliases) {
4040
const nodeId = Templates.nodeIdFromNodeAlias(nodeAlias);
4141
const adminPrivateKey = PrivateKey.fromStringED25519(constants.GENESIS_KEY);
42-
const adminPubKey = adminPrivateKey.publicKey.toStringRaw();
42+
const adminPubKey = adminPrivateKey.publicKey;
4343

4444
this.nodes[nodeAlias] = new GenesisNetworkNodeDataWrapper(nodeId, adminPubKey, nodeAlias);
4545
}
@@ -69,7 +69,7 @@ export class GenesisNetworkDataConstructor implements ToJSON {
6969
const certPem = nodeKeys.certificate.toString();
7070

7171
//* Assign the PEM certificate
72-
this.nodes[nodeAlias].gossipCaCertificate = certPem;
72+
this.nodes[nodeAlias].gossipCaCertificate = nodeKeys.certificate.toString('base64');
7373

7474
//* Decode the PEM to DER format
7575
const tlsCertDer = new Uint8Array(x509.PemConverter.decode(certPem)[0]);

src/types/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import type net from 'net';
1919
import type * as WebSocket from 'ws';
2020
import type crypto from 'crypto';
2121
import type {ListrTask, ListrTaskWrapper} from 'listr2';
22-
import type {AccountId} from '@hashgraph/sdk';
23-
import {type JsonString} from './aliases.js';
22+
import type {AccountId, PublicKey} from '@hashgraph/sdk';
23+
import type {JsonString} from './aliases.js';
2424

2525
// NOTE: DO NOT add any Solo imports in this file to avoid circular dependencies
2626

@@ -98,20 +98,20 @@ export type EmptyContextConfig = object;
9898
export type SoloListrTaskWrapper<T> = ListrTaskWrapper<T, any, any>;
9999

100100
export interface ServiceEndpoint {
101-
ipAddressV4?: Uint8Array;
101+
ipAddressV4?: string;
102102
port: number;
103103
domainName: string;
104104
}
105105

106106
export interface GenesisNetworkNodeStructure {
107107
nodeId: number;
108-
accountId: AccountId | string;
108+
accountId: AccountId;
109109
description: string;
110110
gossipEndpoint: ServiceEndpoint[];
111111
serviceEndpoint: ServiceEndpoint[];
112112
gossipCaCertificate: string;
113113
grpcCertificateHash: string;
114114
weight: number;
115115
deleted: boolean;
116-
adminKey: string;
116+
adminKey: PublicKey;
117117
}

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.36.2';
24+
export const SOLO_CHART_VERSION = '0.36.3';
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)