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

Feat: Extensible config (snapshots, mounting directories, and more) #367

Closed
wants to merge 6 commits into from

Conversation

gabrielhicks
Copy link
Contributor

My goal of this PR is to add extensible config to be used when getting and removing snapshots. On starting it, I determined it would also be nice to add a third disk option if a machine has it available. When looking at formatting and mounting drives, I saw there was an interest in sorting by type so I did a very soft check of the drive name to determine if it is an NVMe or not, and created a prioritized disk array. Added a default snapshot flag to startup scripts when creating a new validator, which will make subsequent fetching and removing snapshots more straightforward.

In this PR:

  • ensureMountAndFiles now includes command to format and mount a potential third drive (snapshots).
  • getLargestDisk updated to prioritize NVMe first sorted by size, followed by SATA sorted by size.
  • createSnapshot adds specified directory for archives from config (/mnt/ledger as default).
  • getCommands defaults to config specification for ledger and snapshots.
  • cli/get/snapshot uses default ledger and snapshot values, and adds rpcUrl to snapshot fetch.
  • mountDirs enables three disks for formatting and mounting.
  • rmSnapshot now uses configured snapshots path (defaults /mnt/ledger).
  • setupV2 adds comments, passes config values into getSnapshot.
  • setup/validator/index passes config into setup scripts.
  • config directory adds defaults for a snapshots directory, as well as adds snapshots, ledger, and accounts directory variables into default config type. Enum is added for triple disk configuration.
  • removeSnapshot and createSnapshot added a config parameter
  • validatorStartup functions take in a config parameter and use them for snapshots flag in addition to ledger and accounts.

I could still probably add something that updates an existing config that does not have the additional parameters, but I tried to ensure if they don't have the latest config, default values that are aligned are passed in. In the snapshot finder command I found it interesting that the path was /mnt/ledger/:/mnt/ledger/snapshot, from my understanding the singular snapshot directory is used on fastboot/cluster restarts, while the plural snapshots directory is the subfolder which is created and leveraged during runtime.

Please feel free to ask questions, add comments, or point any improvements or additions you would like to see in this PR.

Copy link

changeset-bot bot commented Nov 27, 2024

⚠️ No Changeset found

Latest commit: a8e6c00

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@POPPIN-FUMI
Copy link
Collaborator

Thank you so much for your incredible commitment.
I truly appreciate it, as these changes are exactly what I felt I needed to address myself.
Your help is invaluable.

However, there is something I need to share with you.
I am currently preparing for the next version, which involves some significant changes.
Specifically, the introduction of Ansible and Deno. These two changes will bring major updates to the existing system, enabling more stable deployments and centralized management of multiple, diverse nodes.

I haven’t committed these changes to the public repository yet, but I’m working on documentation for the next version.
Once it’s ready, I’ll let you know!

@gabrielhicks
Copy link
Contributor Author

Awesome! That sounds great. Do let me know if you have any estimates when it would be available, I would be happy to contribute there as well.

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.

2 participants