-
Notifications
You must be signed in to change notification settings - Fork 15
feat: create the v059x node-override.yaml via solo #1192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jeromy-cannon
merged 41 commits into
main
from
01151-create-the-v059x-network-overrideyml-via-solo
Feb 8, 2025
+145
−39
Merged
Changes from 28 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
67ad483
implemented copying mechanism and created the initial data wrapper fo…
instamenta 82d0a8f
apply recommended changes
instamenta 0ca31f0
updated to latest version of hedera-service main branch
jeromy-cannon 0441417
Merge remote-tracking branch 'origin/main' into 01151-create-the-v059…
instamenta 74d1c16
merge with main and ran npm i
instamenta 401ebac
Merge remote-tracking branch 'origin/main' into 01151-create-the-v059…
instamenta 91329f1
Merge remote-tracking branch 'origin/main' into 01151-create-the-v059…
instamenta 03f86ba
Merge branch 'main' into 01151-create-the-v059x-network-overrideyml-v…
jeromy-cannon 0dccc4d
switch to new structure for the NetworkOverridesModel.toYaml() method…
instamenta d4511e6
add functionality to turn json string inside the node overrides to js…
instamenta bef5aa0
Merge remote-tracking branch 'origin/main' into 01151-create-the-v059…
instamenta ff069c8
swith all calls to the setupNetworkNode method to true on the isGenes…
instamenta ea50860
fix lint errors
instamenta 219af9a
add try catch when trying to get the admin pub key fromStringED25519 …
instamenta 941af82
revert to stable hedera platform version
instamenta 294256e
rename from NetworkOverridesModel to NodeOverridesModel
instamenta 8fc07f5
Merge commit '04b616e16ee224772ac5a1d181d814713400984d' into 01151-cr…
JeffreyDallas fab250b
Update src/commands/node/handlers.ts
JeffreyDallas 444614a
Update src/commands/node/handlers.ts
JeffreyDallas f87b07c
Update src/commands/node/handlers.ts
JeffreyDallas f1035e9
add constant
JeffreyDallas 218eddf
generate new key if not found
JeffreyDallas badbaaf
fix constructor
JeffreyDallas 8a6bfbf
save
JeffreyDallas 1f53f30
Merge branch 'main' into 01151-create-the-v059x-network-overrideyml-v…
JeffreyDallas e5ac290
change to pod name
JeffreyDallas d886d92
Merge commit 'aff675764db0c0d4fac0abc0d299f48465df1ec5' into 01151-cr…
JeffreyDallas 35a2a4b
fix nodealias
JeffreyDallas 1009f5d
Merge commit '136cd7b3ee09f4380314cf52b2fa1f5317b28bff' into 01151-cr…
JeffreyDallas d2e32ff
change to headless service
JeffreyDallas 283956e
Update src/types/index.ts
JeffreyDallas c2fc681
Update src/core/platform_installer.ts
JeffreyDallas cf4905d
Update src/core/platform_installer.ts
JeffreyDallas b2558ed
Update src/commands/node/tasks.ts
JeffreyDallas b9eab0a
Update src/commands/node/tasks.ts
JeffreyDallas 1a2ddea
Update src/commands/node/tasks.ts
JeffreyDallas 6a59b68
Update src/commands/node/tasks.ts
JeffreyDallas 45a2026
Update src/commands/node/tasks.ts
JeffreyDallas 196ef66
rename
JeffreyDallas 29ed473
Merge branch 'main' into 01151-create-the-v059x-network-overrideyml-v…
JeffreyDallas f10ad50
Merge branch '01151-create-the-v059x-network-overrideyml-via-solo' of…
JeffreyDallas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jeromy-cannon marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/** | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
import * as yaml from 'yaml'; | ||
import * as constants from './constants.js'; | ||
import {Templates} from './templates.js'; | ||
import {type NodeAliases} from '../types/aliases.js'; | ||
import {type NetworkNodeServices} from './network_node_services.js'; | ||
import {type GossipEndpoint} from '../types/index.js'; | ||
|
||
export class NodeOverridesModel { | ||
private readonly interfaceBindings: GossipEndpoint[] = []; | ||
private readonly endpointOverrides: GossipEndpoint[] = []; | ||
|
||
public constructor(nodeAliases: NodeAliases, networkNodeServiceMap: Map<string, NetworkNodeServices>) { | ||
nodeAliases.forEach(nodeAlias => { | ||
const namespace = networkNodeServiceMap.get(nodeAlias).namespace; | ||
const nodeId = +networkNodeServiceMap.get(nodeAlias).nodeId; | ||
|
||
const localClusterPort = +constants.HEDERA_NODE_EXTERNAL_GOSSIP_PORT; | ||
const localClusterHostName = Templates.renderFullyQualifiedNetworkPodName(namespace, nodeAlias); | ||
jeromy-cannon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
this.interfaceBindings.push({nodeId, hostname: localClusterHostName, port: localClusterPort}); | ||
// TODO future, add endpointOverrides for addresses external to cluster in multi-cluster support situation | ||
// this.endpointOverrides.push({nodeId, hostname: externalHostname, port: externalPort}); | ||
}); | ||
} | ||
|
||
/** | ||
* Converts the model to YAML as expected to be consumed inside node | ||
* @returns the raw YAML as string | ||
* | ||
* @example | ||
* gossip: | ||
* interfaceBindings: | ||
* - { "nodeId": 0, "hostname": "10.10.10.1", "port": 1234 } | ||
* - { "nodeId": 3, "hostname": "2001:db8:3333:4444:5555:6666:7777:8888", "port": 1237 } | ||
* endpointOverrides: | ||
* - { "nodeId": 5, "hostname": "10.10.10.11", "port": 1238 } | ||
*/ | ||
public toYAML(): string { | ||
const gossipData: {interfaceBindings?: string[]; endpointOverrides?: string[]} = {}; | ||
|
||
if (this.interfaceBindings.length) { | ||
gossipData.interfaceBindings = this.interfaceBindings.map(d => JSON.stringify(d)); | ||
} | ||
|
||
if (this.endpointOverrides.length) { | ||
gossipData.endpointOverrides = this.endpointOverrides.map(d => JSON.stringify(d)); | ||
} | ||
|
||
return yaml.stringify({gossip: gossipData}).replaceAll(/'/g, ''); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.