Skip to content

Commit 7d178ab

Browse files
committed
resolve issue during initial setup
1 parent cd079f2 commit 7d178ab

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

wap/pkg/server/server.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -454,16 +454,11 @@ func exchangePeersHandler(w http.ResponseWriter, r *http.Request) {
454454
return
455455
}
456456

457-
// Return the kubo peerID — mobile connects through kubo's libp2p, not the blox identity directly
458-
kuboPeerID, err := wifi.GetKuboPeerID()
459-
if err != nil {
460-
http.Error(w, fmt.Sprintf("failed to get kubo peer ID: %v", err), http.StatusInternalServerError)
461-
return
462-
}
463-
457+
// bloxPeerID is the kubo-derived peer ID (from deriveKuboKey in /app --initOnly).
458+
// Use it directly — kubo hasn't started yet during initial setup, so GetKuboPeerID() would fail.
464459
w.Header().Set("Content-Type", "application/json")
465460
w.WriteHeader(http.StatusCreated)
466-
jsonErr := json.NewEncoder(w).Encode(map[string]interface{}{"peer_id": kuboPeerID})
461+
jsonErr := json.NewEncoder(w).Encode(map[string]interface{}{"peer_id": bloxPeerID})
467462
if jsonErr != nil {
468463
http.Error(w, fmt.Sprintf("error building the response, %v", err), http.StatusInternalServerError)
469464
return

0 commit comments

Comments
 (0)