Skip to content

feat: block node commands with state management#379

Open
leninmehedy wants to merge 17 commits intomainfrom
00370-state-management-data-model
Open

feat: block node commands with state management#379
leninmehedy wants to merge 17 commits intomainfrom
00370-state-management-data-model

Conversation

@leninmehedy
Copy link
Member

Description

This pull request refactors the Hedera Block Node CLI commands shifting from direct workflow execution to using a business logic layer (bll) for intent handling. Additionally, configuration types are migrated from the config package to the core package for better organization.

Refactoring command execution and configuration management:

  • Introduced initializeDependencies and prepareUserInputs functions in cmd/weaver/commands/block/node/init.go to centralize dependency initialization and user input validation, improving code reuse and maintainability.
  • Refactored the install, reset, and upgrade commands to use the new dependency and input preparation functions, and to delegate intent handling to the business logic layer via bll.BlockNode().HandleIntent, replacing direct workflow execution. [1] [2]
  • Updated logging in command handlers to provide clearer context by logging the intent and inputs rather than low-level details. [1] [2]

Configuration and type organization:

  • Migrated configuration types such as BlockNodeConfig, BlockNodeStorage, AlloyConfig, and AlloyRemoteConfig from the config package to the core package, updating all references accordingly for improved code organization. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]

Variable management:

  • Promoted flagProfile and flagForce variables to package-level scope in cmd/weaver/commands/block/node/node.go to facilitate their use across the new helper functions.

Related Issues

@leninmehedy leninmehedy requested a review from a team as a code owner February 25, 2026 01:17
@leninmehedy leninmehedy changed the title feat: state management feat: block node install command using state management Feb 25, 2026
@leninmehedy leninmehedy changed the title feat: block node install command using state management feat: block node commands using state management Feb 25, 2026
@leninmehedy leninmehedy removed the request for review from crypto-pablo February 25, 2026 01:31
@leninmehedy leninmehedy changed the title feat: block node commands using state management feat: block node commands with state management Feb 25, 2026
@leninmehedy leninmehedy force-pushed the 00370-state-management-data-model branch from a8b9856 to 33c9dca Compare February 25, 2026 01:38
Signed-off-by: Lenin Mehedy <lenin.mehedy@hashgraph.com>

# Conflicts:
#	cmd/weaver/commands/block/node/install.go
#	cmd/weaver/commands/common/flags.go
#	internal/core/paths.go
#	internal/workflows/blocknode.go

# Conflicts:
#	internal/alloy/manifest.go
#	internal/alloy/render.go
#	internal/alloy/render_test.go
Signed-off-by: Lenin Mehedy <lenin.mehedy@hashgraph.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@hashgraph.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@hashgraph.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@hashgraph.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@hashgraph.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@hashgraph.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@hashgraph.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@hashgraph.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@hashgraph.com>
@leninmehedy leninmehedy force-pushed the 00370-state-management-data-model branch from 33c9dca to 033c456 Compare February 25, 2026 01:39
Signed-off-by: Lenin Mehedy <lenin.mehedy@hashgraph.com>
@leninmehedy leninmehedy force-pushed the 00370-state-management-data-model branch from 033c456 to be8801d Compare February 25, 2026 02:00
Signed-off-by: Lenin Mehedy <lenin.mehedy@hashgraph.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@hashgraph.com>
@leninmehedy leninmehedy force-pushed the 00370-state-management-data-model branch 2 times, most recently from 5d9eca1 to 1c4c4a1 Compare February 26, 2026 02:04
Signed-off-by: Lenin Mehedy <lenin.mehedy@hashgraph.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@hashgraph.com>
@leninmehedy leninmehedy force-pushed the 00370-state-management-data-model branch from 1c4c4a1 to 1edf2f6 Compare February 27, 2026 13:20
Signed-off-by: Lenin Mehedy <lenin.mehedy@hashgraph.com>
@leninmehedy leninmehedy force-pushed the 00370-state-management-data-model branch from 1edf2f6 to 615d1b0 Compare February 27, 2026 13:36
Signed-off-by: Lenin Mehedy <lenin.mehedy@hashgraph.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Design state management data model

1 participant