-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add general config and secrets opts to snapshot creator (#2471)
## What ❔ <!-- What are the changes this PR brings about? --> <!-- Example: This PR adds a PR template to the repo. --> <!-- (For bigger PRs adding more context is appreciated) --> This PR adds `--config-path` and `--secrets-path` options to `/core/bin/snapshots_creator`. Allowing the binary to source configurations from files. ## Why ❔ <!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? --> <!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> Needed in order to run the command within `zk_toolbox`. ## Checklist <!-- Check your PR fulfills the following items. --> <!-- For draft PRs check the boxes as you complete them. --> - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [x] Tests for the changes have been added / updated. - [x] Documentation comments have been added / updated. - [x] Code has been formatted via `zk fmt` and `zk lint`.
- Loading branch information
1 parent
e02b411
commit 0f475c9
Showing
6 changed files
with
48 additions
and
21 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
use zksync_config::SnapshotsCreatorConfig; | ||
|
||
use crate::{envy_load, FromEnv}; | ||
use crate::{envy_load, object_store::SnapshotsObjectStoreConfig, FromEnv}; | ||
|
||
impl FromEnv for SnapshotsCreatorConfig { | ||
fn from_env() -> anyhow::Result<Self> { | ||
envy_load("snapshots_creator", "SNAPSHOTS_CREATOR_") | ||
let mut snapshot_creator: SnapshotsCreatorConfig = | ||
envy_load("snapshots_creator", "SNAPSHOTS_CREATOR_")?; | ||
|
||
snapshot_creator.object_store = SnapshotsObjectStoreConfig::from_env().map(|a| a.0).ok(); | ||
Ok(snapshot_creator) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters