diff options
Diffstat (limited to 'src/swarm/bootstrap.rs')
| -rw-r--r-- | src/swarm/bootstrap.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/swarm/bootstrap.rs b/src/swarm/bootstrap.rs index 8665253..76e056d 100644 --- a/src/swarm/bootstrap.rs +++ b/src/swarm/bootstrap.rs @@ -88,6 +88,9 @@ pub(crate) async fn bootstrap(state: &AppState, seeds: &[String], start: Start) }; let recorded = JsonValue::String(swarm_id.clone()); let neighbours = state.neighbours_k; + // Plain names (kebab-case): serializing them can't fail. + let topology = serde_json::to_value(state.configured_ways.0).unwrap_or_default(); + let dissemination = serde_json::to_value(state.configured_ways.1).unwrap_or_default(); state .mutate_doc(move |doc| { store::write_path(doc, &swarm_id_path(), &recorded)?; @@ -95,10 +98,16 @@ pub(crate) async fn bootstrap(state: &AppState, seeds: &[String], start: Start) doc, &crate::swarm::topology::neighbours_path(), &JsonValue::from(neighbours), + )?; + store::write_path(doc, &crate::swarm::topology::topology_path(), &topology)?; + store::write_path( + doc, + &crate::swarm::topology::dissemination_path(), + &dissemination, ) }) .await - .context("Recording the swarm ID and its neighbours")?; + .context("Recording the swarm ID, its neighbours, its topology and dissemination")?; state.initial_sync_done.store(true, Ordering::Release); state.mark_ready(swarm_id).await?; // Remembered members, if any, to find those still running. |
