Skip to content

feat(side-dag): implement side_dag CLI command#1039

Merged
glevco merged 1 commit intomasterfrom
feat/side-dag/cli
Jun 10, 2024
Merged

feat(side-dag): implement side_dag CLI command#1039
glevco merged 1 commit intomasterfrom
feat/side-dag/cli

Conversation

@glevco
Copy link
Contributor

@glevco glevco commented May 23, 2024

Depends on #1040

Motivation

Implement a new side_dag CLI command that is able to run two independent full nodes, each in its own separate process. The command accepts the same options as the run_node command, however options can be duplicate with a --side-dag prefix. Each full node is configured with the respective set of options. Processes are automatically terminated when one of the full nodes exits.

Here's an example on how this command could be used:

 $ python -m hathor side_dag
     --testnet
     --procname-prefix testnet-
     --memory-storage
     --disable-logs
     --side-dag-config-yaml ./my-side-dag.yml
     --side-dag-procname-prefix my-side-dag-
     --side-dag-memory-storage
     --side-dag-json-logs

Acceptance Criteria

  • Implement new cli.util.process_logging_options().
  • Change execute_from_command_line() so it supports modules opting out of the setup_logging() call.
  • Update create_parser() so it accepts a custom env var prefix.
  • Add support to disabling logs.
  • Implement side_dag CLI command.
  • Implement HathorSettings.GENESIS_TOKENS calculated property, removing the GENESIS_TOKENS constant.

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged

@glevco glevco self-assigned this May 23, 2024
@glevco glevco force-pushed the feat/side-dag/cli branch from 6b473e0 to 789a0fa Compare May 23, 2024 13:00
@codecov
Copy link

codecov bot commented May 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.95%. Comparing base (b20be70) to head (2310be5).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1039      +/-   ##
==========================================
+ Coverage   84.87%   84.95%   +0.08%     
==========================================
  Files         300      300              
  Lines       22943    22943              
  Branches     3470     3470              
==========================================
+ Hits        19473    19492      +19     
+ Misses       2778     2766      -12     
+ Partials      692      685       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@glevco glevco force-pushed the feat/side-dag/cli branch from d4ea383 to c8d54fd Compare May 23, 2024 18:52
@glevco glevco changed the base branch from master to fix/logging-errors May 23, 2024 18:52
@glevco glevco force-pushed the feat/side-dag/cli branch 7 times, most recently from 3ad82a0 to af8e08b Compare May 24, 2024 17:39
@glevco glevco marked this pull request as ready for review May 24, 2024 17:39
@glevco glevco requested review from jansegre and msbrogli as code owners May 24, 2024 17:39
@glevco glevco force-pushed the fix/logging-errors branch 2 times, most recently from 5bfc088 to 973afe6 Compare May 28, 2024 19:51
Base automatically changed from fix/logging-errors to master May 28, 2024 23:43
@glevco glevco force-pushed the feat/side-dag/cli branch 3 times, most recently from e9121a7 to bd05cd8 Compare June 3, 2024 14:35
@glevco glevco force-pushed the feat/side-dag/cli branch from bd05cd8 to fbf9caf Compare June 4, 2024 16:37
msbrogli
msbrogli previously approved these changes Jun 4, 2024
jansegre
jansegre previously approved these changes Jun 7, 2024
@glevco glevco force-pushed the feat/side-dag/cli branch from fbf9caf to d5f3d3b Compare June 7, 2024 15:31
@glevco glevco dismissed stale reviews from jansegre and msbrogli via 90a0606 June 10, 2024 16:07
@glevco glevco force-pushed the feat/side-dag/cli branch from 90a0606 to 2310be5 Compare June 10, 2024 17:55
@glevco glevco merged commit 83c9190 into master Jun 10, 2024
@glevco glevco deleted the feat/side-dag/cli branch June 10, 2024 19:24
This was referenced Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants