Skip to content

Commit

Permalink
update the defaults and the prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinaPetr committed Sep 2, 2024
1 parent 15b70b0 commit 4c89550
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
16 changes: 11 additions & 5 deletions ceramic-config/src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,19 @@ impl Into<crate::daemon::DaemonConfig> for crate::Config {
admin_dids: Some(self.http_api.admin_dids),
cors_allowed_origins: cors,
});
let ipfs = Some(crate::daemon::DaemonIpfsConfig {
let ipfs = Some(if let crate::Ipfs::Remote(r) = self.ipfs {
crate::daemon::DaemonIpfsConfig {
mode: Some(crate::daemon::DaemonIpfsConfigMode::Remote),
host: Some("http://localhost:5101".to_string()),
host: Some(r.host),
pinning_endpoints: None,
disable_peer_data_sync: Some(false),
})
;
}
} else {
crate::daemon::DaemonIpfsConfig {
mode: Some(crate::daemon::DaemonIpfsConfigMode::Bundled),
host: None,
pinning_endpoints: None,
}
});
let logger = Some(if let Some(l) = self.logger.file {
crate::daemon::DaemonLoggerConfig {
log_to_files: Some(l.enabled),
Expand Down
1 change: 0 additions & 1 deletion ceramic-config/src/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ pub struct DaemonIpfsConfig {
pub host: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub pinning_endpoints: Option<Vec<String>>,
pub disable_peer_data_sync: Option<bool>,
}

#[derive(Serialize)]
Expand Down
4 changes: 2 additions & 2 deletions ceramic-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub struct IpfsRemote {
impl Default for IpfsRemote {
fn default() -> Self {
Self {
host: "/ipfs".to_string(),
host: "http://localhost:5101".to_string(),
}
}
}
Expand All @@ -38,7 +38,7 @@ impl std::fmt::Display for Ipfs {

impl Default for Ipfs {
fn default() -> Self {
Self::Bundled
Self::Remote(IpfsRemote::default())
}
}

Expand Down
4 changes: 2 additions & 2 deletions cli/src/prompt/ceramic_advanced_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ pub async fn prompt(

pub fn configure_ipfs(cfg: &mut Config) -> anyhow::Result<()> {
let ans = Select::new(
"Bundled or Remote IPFS (default=Bundled)",
vec![Ipfs::Bundled, Ipfs::Remote(IpfsRemote::default())],
"Bundled or Remote IPFS (default=Remote)",
vec![Ipfs::Remote(IpfsRemote::default()), Ipfs::Bundled],
)
.prompt()?;

Expand Down

0 comments on commit 4c89550

Please sign in to comment.