Skip to content
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 by Bors] - Add node merge tool #5685

Closed
wants to merge 11 commits into from
Closed

Conversation

fasmat
Copy link
Member

@fasmat fasmat commented Mar 11, 2024

Motivation

Adds a new command / tool for merging two nodes into one. Additionally the CI has been updated to include the new tool in a release and build docker images using the right version.

Description

The CLI tool takes 2 parameters:

  • --from which specifies the data-dir of the source node which's identities shall be merged to the target node
  • --to which specifies the data-dir of the target node that receives the identities and state of the source node, can be an empty directory (so that a user can setup a new node with all their existing identities merged)

The tool only works with nodes that are set up for remote smeshing (i.e. have no local.key or supervised post service configuration). It will copy all identities from the source node to the target node while preserving their (file) names and will fail on conflicts (e.g. trying to merge the state of the same identity twice).

Test Plan

Tests for the new tool have been added.

TODO

  • Explain motivation or link existing issue(s)
  • Test changes and document test plan
  • Update documentation as needed
  • Update changelog as needed

@fasmat fasmat self-assigned this Mar 11, 2024
Copy link

codecov bot commented Mar 11, 2024

Codecov Report

Attention: Patch coverage is 57.14286% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 79.7%. Comparing base (1a35b38) to head (87649bb).

Files Patch % Lines
node/node.go 57.1% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           develop   #5685     +/-   ##
=========================================
- Coverage     79.8%   79.7%   -0.1%     
=========================================
  Files          279     279             
  Lines        28510   28507      -3     
=========================================
- Hits         22760   22739     -21     
- Misses        4185    4199     +14     
- Partials      1565    1569      +4     

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

@fasmat fasmat force-pushed the merge-state-tools branch 3 times, most recently from 865b233 to a666b7e Compare March 12, 2024 16:13
go.mod Show resolved Hide resolved
tortoise/data/README.md Outdated Show resolved Hide resolved
cmd/merge-nodes/main.go Outdated Show resolved Hide resolved
Copy link
Contributor

@dshulyak dshulyak left a comment

Choose a reason for hiding this comment

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

i left some cleanups suggestions, but up to you if to fix them

@fasmat
Copy link
Member Author

fasmat commented Mar 13, 2024

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request Mar 13, 2024
## Motivation

Adds a new command / tool for merging two nodes into one. Additionally the CI has been updated to include the new tool in a release and build docker images using the right version.
@spacemesh-bors
Copy link

Build failed:

@fasmat
Copy link
Member Author

fasmat commented Mar 13, 2024

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request Mar 13, 2024
## Motivation

Adds a new command / tool for merging two nodes into one. Additionally the CI has been updated to include the new tool in a release and build docker images using the right version.
@spacemesh-bors
Copy link

Pull request successfully merged into develop.

Build succeeded:

@spacemesh-bors spacemesh-bors bot changed the title Add node merge tool [Merged by Bors] - Add node merge tool Mar 13, 2024
@spacemesh-bors spacemesh-bors bot closed this Mar 13, 2024
@spacemesh-bors spacemesh-bors bot deleted the merge-state-tools branch March 13, 2024 16:00
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.

None yet

2 participants