Skip to content

Commit

Permalink
feat: enable Blockstreams and uploader (#1109)
Browse files Browse the repository at this point in the history
Signed-off-by: instamenta <[email protected]>
Signed-off-by: Jeromy Cannon <[email protected]>
Co-authored-by: Jeromy Cannon <[email protected]>
  • Loading branch information
instamenta and jeromy-cannon authored Jan 9, 2025
1 parent c27d1d6 commit ed6527b
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion examples/custom-network-config/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ hedera.profiles.active=TEST
# TODO: this is a workaround until prepareUpgrade freeze will recalculate the weight prior to writing the config.txt
staking.periodMins=1
nodes.updateAccountIdAllowed=true
blockStream.streamMode=RECORDS
blockStream.streamMode=BOTH
2 changes: 1 addition & 1 deletion examples/solo-gke-test/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ hedera.profiles.active=TEST
# TODO: this is a workaround until prepareUpgrade freeze will recalculate the weight prior to writing the config.txt
staking.periodMins=1
nodes.updateAccountIdAllowed=true
blockStream.streamMode=RECORDS
blockStream.streamMode=BOTH

# Override the throttle definitions to be used during genesis.
# This override is required because release <= 0.58.x use a different default path.
Expand Down
3 changes: 1 addition & 2 deletions resources/templates/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ hedera.profiles.active=TEST
# TODO: this is a workaround until prepareUpgrade freeze will recalculate the weight prior to writing the config.txt
staking.periodMins=1
nodes.updateAccountIdAllowed=true
# TODO: remove once we have the uploader enabled, required for current p0 deadline
blockStream.streamMode=RECORDS
blockStream.streamMode=BOTH
# TODO: uncomment this when we are ready to use genesis-network.json
#addressBook.useRosterLifecycle=true
9 changes: 9 additions & 0 deletions src/core/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ export const HEDERA_NODE_INTERNAL_GOSSIP_PORT = process.env.SOLO_NODE_INTERNAL_G
export const HEDERA_NODE_EXTERNAL_GOSSIP_PORT = process.env.SOLO_NODE_EXTERNAL_GOSSIP_PORT || '50111';
export const HEDERA_NODE_DEFAULT_STAKE_AMOUNT = +process.env.SOLO_NODE_DEFAULT_STAKE_AMOUNT || 500;

export const HEDERA_NODE_SIDECARS = [
'recordStreamUploader',
'eventStreamUploader',
'backupUploader',
'accountBalanceUploader',
'otelCollector',
'blockstreamUploader',
];

// --------------- Charts related constants ----------------------------------------------------------------------------
export const SOLO_SETUP_NAMESPACE = 'solo-setup';
export const SOLO_TESTING_CHART_URL = 'oci://ghcr.io/hashgraph/solo-charts';
Expand Down
10 changes: 1 addition & 9 deletions src/core/profile_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ import {inject, injectable} from 'tsyringe-neo';
import {patchInject} from './container_helper.js';
import {HEDERA_PLATFORM_VERSION} from '../../version.js';

const consensusSidecars = [
'recordStreamUploader',
'eventStreamUploader',
'backupUploader',
'accountBalanceUploader',
'otelCollector',
];

@injectable()
export class ProfileManager {
private readonly logger: SoloLogger;
Expand Down Expand Up @@ -275,7 +267,7 @@ export class ProfileManager {
this._setChartItems('defaults.root', profile.consensus.root, yamlRoot);

// set sidecar resources
for (const sidecar of consensusSidecars) {
for (const sidecar of constants.HEDERA_NODE_SIDECARS) {
this._setChartItems(`defaults.sidecars.${sidecar}`, profile.consensus[sidecar], yamlRoot);
}
}
Expand Down
8 changes: 8 additions & 0 deletions test/data/test-profiles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ test:
limits:
cpu: 150m
memory: 250Mi
blockstreamUploader:
resources:
requests:
cpu: 0
memory: 0
limits:
cpu: 150m
memory: 250Mi
eventStreamUploader:
resources:
requests:
Expand Down
8 changes: 1 addition & 7 deletions test/unit/core/profile_manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,7 @@ describe('ProfileManager', () => {
expect(valuesYaml.defaults.root.resources.limits.memory).not.to.be.null;

// check all sidecars have resources
for (const component of [
'recordStreamUploader',
'eventStreamUploader',
'backupUploader',
'accountBalanceUploader',
'otelCollector',
]) {
for (const component of constants.HEDERA_NODE_SIDECARS) {
expect(valuesYaml.defaults.sidecars[component].resources.limits.cpu).not.to.be.null;
expect(valuesYaml.defaults.sidecars[component].resources.limits.memory).not.to.be.null;
}
Expand Down

0 comments on commit ed6527b

Please sign in to comment.