Skip to content

Add mirage init, update and register commands #876

Merged
dmytrotkk merged 8 commits intomiragefrom
add-init-update
Jul 8, 2025
Merged

Add mirage init, update and register commands #876
dmytrotkk merged 8 commits intomiragefrom
add-init-update

Conversation

@badrogger
Copy link
Copy Markdown
Contributor

@badrogger badrogger commented Jul 4, 2025

This pull request introduces significant updates to the Mirage node CLI functionality, including the implementation of previously placeholder commands, enhancements to Mirage node operations, and improvements to logging and configuration management. The changes also add new API routes and update related tests to ensure comprehensive coverage.

Mirage Node CLI Enhancements:

  • Implemented the init, register, and update commands for Mirage nodes, replacing placeholder functionality. These commands now perform actual operations such as initializing the node, registering it with the Mirage manager, and updating its software. ([[1]](https://github.com/skalenetwork/node-cli/pull/876/files#diff-abc2e839cb0db862602bff22b2829434eee70d497c1a9f1fadf629ffa0690060L47-R65), [[2]](https://github.com/skalenetwork/node-cli/pull/876/files#diff-abc2e839cb0db862602bff22b2829434eee70d497c1a9f1fadf629ffa0690060L66-R76), [[3]](https://github.com/skalenetwork/node-cli/pull/876/files#diff-9b5d6f6bc94706f3b611fcc52e5db037b99121cfc5e9a6bdfa293f6ed338c3dcR121-R154))
  • Added the wallet_info command to retrieve Mirage node wallet information in JSON or text format. ([[1]](https://github.com/skalenetwork/node-cli/pull/876/files#diff-abc2e839cb0db862602bff22b2829434eee70d497c1a9f1fadf629ffa0690060R153-R158), [[2]](https://github.com/skalenetwork/node-cli/pull/876/files#diff-98cb514f69188fc2a0be4e5ed4abfed3499d9e6a13e395f846817bcb5f3fcfc6R1-R37))

API and Configuration Updates:

  • Introduced new API routes for Mirage node operations (/api/v1/mirage-node/info and /api/v1/mirage-node/register) and updated the routes.py configuration accordingly. ([[1]](https://github.com/skalenetwork/node-cli/pull/876/files#diff-12132dde0bdef91d2276291fd892108242ea0254c453d6829b544adc06a76b40R43), [[2]](https://github.com/skalenetwork/node-cli/pull/876/files#diff-d81e73c3c932063b87df06ac64485eb6e3a636abd58caf1b9ac62702ffcbd2faR34-R35))
  • Added DEFAULT_SKALED_BASE_PORT to the configuration for use in Mirage node registration. ([node_cli/configs/__init__.pyR174](https://github.com/skalenetwork/node-cli/pull/876/files#diff-357fbc67877b209aeea4b293a93113b940d93984a71a6c9154f5e156fb2f3078R174))

Logging and Code Refactoring:

  • Improved logging by introducing a dedicated logger for wallet operations and ensuring consistent logging practices across Mirage node operations. ([[1]](https://github.com/skalenetwork/node-cli/pull/876/files#diff-602ac96be48b2f9851d2dfdfac35a853ff3af621df0d976753bdfbc85233c8afR21-R27), [[2]](https://github.com/skalenetwork/node-cli/pull/876/files#diff-9b5d6f6bc94706f3b611fcc52e5db037b99121cfc5e9a6bdfa293f6ed338c3dcL24-R48))
  • Refactored imports and reorganized code in several files for better readability and maintainability. ([[1]](https://github.com/skalenetwork/node-cli/pull/876/files#diff-0ed14c647052f41baec2f3ba4e9b5ed4772788948531b437fca8dc6afb19f1b4R20-R64), [[2]](https://github.com/skalenetwork/node-cli/pull/876/files#diff-796f378da34464a1cdda8177918a4d98652afa9d1f3ee0fec86643f6b5654f6eL42-R47))

Test Updates:

  • Removed outdated tests for placeholder commands and added coverage for new Mirage node functionality and routes. ([[1]](https://github.com/skalenetwork/node-cli/pull/876/files#diff-bd6239dcaa97b6ca05d719d276838866b7f5a66a03ca4e04257d4bb643610213L87-L110), [[2]](https://github.com/skalenetwork/node-cli/pull/876/files#diff-d81e73c3c932063b87df06ac64485eb6e3a636abd58caf1b9ac62702ffcbd2faR34-R35))

Text Updates:

  • Updated text.yml to include new messages and help text for Mirage node operations, such as registration and initialization. ([text.ymlR87-R93](https://github.com/skalenetwork/node-cli/pull/876/files#diff-a185f6208e5ee6aa4a79929f036335951e7bacf86317c6e95fe021c89e05d0d8R87-R93))

@badrogger badrogger changed the title Add mirage init and update commands Add mirage init, update and register commands Jul 6, 2025
@badrogger badrogger linked an issue Jul 6, 2025 that may be closed by this pull request
@badrogger badrogger marked this pull request as ready for review July 6, 2025 12:10
Comment thread node_cli/cli/mirage_node.py Outdated
mirage_cleanup()


@node.command('info', help='Get info about MIRAGE node wallet')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to wallet

inited_node=True,
sync_schains=False,
node_type=NodeType.MIRAGE,
pull_config_for_schain=pull_config_for_schain,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this variable is useless for FAIR Node



@checked_host
def update_mirage_boot(env_filepath: str, env: dict) -> bool:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function is duplicated update_mirage_boot

@dmytrotkk dmytrotkk merged commit 973db9e into mirage Jul 8, 2025
2 checks passed
@dmytrotkk dmytrotkk deleted the add-init-update branch July 8, 2025 17:44
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.

Implement new FAIR node commands

2 participants