-
Notifications
You must be signed in to change notification settings - Fork 1
chore: update for merged curio and synapse-sdk PRs #27
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
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -4,12 +4,14 @@ | |
| //! including repository path resolution and deployment checks. | ||
|
|
||
| use crate::config::{Config, Location}; | ||
| use crate::constants::LOCAL_NETWORK_CHAIN_ID; | ||
| use crate::docker::containers::lotus_container_name; | ||
| use crate::docker::core::container_is_running; | ||
| use crate::paths::{foc_devnet_config, foc_devnet_filecoin_services_repo}; | ||
| use std::error::Error; | ||
| use std::fs; | ||
| use std::path::PathBuf; | ||
| use tracing::info; | ||
|
|
||
| /// Get the filecoin-services repository path based on configuration | ||
| /// | ||
|
|
@@ -93,3 +95,39 @@ pub fn check_required_addresses( | |
| global_faucet.clone(), | ||
| )) | ||
| } | ||
|
|
||
| /// Clear cached devnet deployment addresses from deployments.json | ||
| /// | ||
| /// The filecoin-services deployment script reads deployments.json and skips | ||
| /// deployment if addresses already exist for the chain ID. This causes issues | ||
| /// when starting a fresh devnet because the cached addresses point to contracts | ||
| /// that don't exist on the new chain. This function removes the devnet entry | ||
| /// so that contracts are actually deployed. | ||
| pub fn clear_cached_devnet_deployments() -> Result<(), Box<dyn Error>> { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ran into this one once - tried to |
||
| let services_repo = get_filecoin_services_repo_path()?; | ||
| let deployments_file = services_repo.join("service_contracts/deployments.json"); | ||
|
|
||
| if !deployments_file.exists() { | ||
| info!("No deployments.json found, skipping cache clear"); | ||
| return Ok(()); | ||
| } | ||
|
|
||
| let content = fs::read_to_string(&deployments_file)?; | ||
| let mut deployments: serde_json::Value = serde_json::from_str(&content)?; | ||
|
|
||
| let chain_id_str = LOCAL_NETWORK_CHAIN_ID.to_string(); | ||
| if let Some(obj) = deployments.as_object_mut() { | ||
| if obj.remove(&chain_id_str).is_some() { | ||
| info!( | ||
| "Cleared cached devnet (chain {}) addresses from deployments.json", | ||
| chain_id_str | ||
| ); | ||
| let updated = serde_json::to_string_pretty(&deployments)?; | ||
| fs::write(&deployments_file, updated)?; | ||
| } else { | ||
| info!("No cached devnet addresses found in deployments.json"); | ||
| } | ||
| } | ||
|
|
||
| Ok(()) | ||
| } | ||
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why this wasn't a problem before but it was a blocker for me this time