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

Load and persist peer vector clocks #86

Merged
merged 4 commits into from
Jan 17, 2024
Merged

Load and persist peer vector clocks #86

merged 4 commits into from
Jan 17, 2024

Conversation

mycognosist
Copy link
Owner

Following the same approach taken by ssb-ebt (used in Manyverse), we persist peer vector clocks to the ebt directory in the application's root configuration directory (~/.local/share/solar in the case of solar).

Each file is created using the @-prefixed SSB ID of the author as the filename; all instances of / are replaced with - and the = before .ed25519 is removed. For example: @HIYqoOhH6U-muCXsnvXzRQmoPpPXrELnJlqSjId2Fg8.ed25519

The file then contains a JSON string of the vector clock for that peer. For example: {"@HIYqoOhH6U+muCXsnvXzRQmoPpPXrELnJlqSjId2Fg8=.ed25519":32,"@HZnU6wM+F17J0RSLXP05x3Lag2jGv3F3LzHMjh72coE=.ed25519":7712}

Clocks are loaded from file when the EBT manager starts and persisted to file just before it shuts down.

@mycognosist mycognosist added the enhancement New feature or request label Jan 17, 2024
@mycognosist mycognosist merged commit 79514e9 into main Jan 17, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant