@le-space/rootfs 0.3.30 → 0.3.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@le-space/rootfs",
3
- "version": "0.3.30",
3
+ "version": "0.3.31",
4
4
  "description": "Shared rootfs contract parsing, reference profile assets, and build helpers.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -180,13 +180,12 @@ def _run_configure_process(args: list[str], bootstrap_record: dict | None = None
180
180
  except subprocess.CalledProcessError as error:
181
181
  return False, error.stderr.strip() or error.stdout.strip() or str(error)
182
182
 
183
+ _start_metadata_generation()
183
184
  if isinstance(bootstrap_record, dict):
184
185
  try:
185
186
  _publish_vm_bootstrap_config_signal(bootstrap_record)
186
187
  except Exception as error: # pragma: no cover - runtime error path
187
188
  return False, f"configured relay but failed to publish bootstrap config signal: {error}"
188
-
189
- _start_metadata_generation()
190
189
  return True, result.stdout.strip()
191
190
 
192
191
 
@@ -328,6 +327,24 @@ def _publish_vm_bootstrap_config_signal(record: dict) -> None:
328
327
  if not deployment_token or not profile or not instance_item_hash:
329
328
  raise RuntimeError("bootstrap config signal is missing deployment metadata")
330
329
 
330
+ metadata, metadata_error = _fresh_metadata_payload()
331
+ if not metadata:
332
+ raise RuntimeError(
333
+ f"bootstrap config signal metadata is not ready: {metadata_error or 'metadata unavailable'}"
334
+ )
335
+
336
+ peer_id = metadata.get("peer_id")
337
+ probe_multiaddrs = metadata.get("probe_multiaddrs")
338
+ browser_bootstrap_multiaddrs = metadata.get("browser_bootstrap_multiaddrs")
339
+ if not isinstance(peer_id, str) or not peer_id.strip():
340
+ raise RuntimeError("bootstrap config signal is missing peer_id")
341
+ if not isinstance(probe_multiaddrs, list) or not any(
342
+ isinstance(entry, str) and entry.strip() for entry in probe_multiaddrs
343
+ ):
344
+ raise RuntimeError("bootstrap config signal is missing probe_multiaddrs")
345
+ if not isinstance(browser_bootstrap_multiaddrs, list):
346
+ browser_bootstrap_multiaddrs = []
347
+
331
348
  publisher_address = _address_from_private_key(publisher_private_key)
332
349
  now_ms = int(time.time() * 1000)
333
350
  content = {
@@ -343,6 +360,17 @@ def _publish_vm_bootstrap_config_signal(record: dict) -> None:
343
360
  "updatedAt": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime(now_ms / 1000)),
344
361
  "publisherAddress": publisher_address,
345
362
  "authorization": owner_authorization,
363
+ "peerId": peer_id.strip(),
364
+ "probeMultiaddrs": [
365
+ entry.strip()
366
+ for entry in probe_multiaddrs
367
+ if isinstance(entry, str) and entry.strip()
368
+ ],
369
+ "browserBootstrapMultiaddrs": [
370
+ entry.strip()
371
+ for entry in browser_bootstrap_multiaddrs
372
+ if isinstance(entry, str) and entry.strip()
373
+ ],
346
374
  },
347
375
  "time": now_ms,
348
376
  }