adding comment

This commit is contained in:
Gabriel mermelstein 2025-04-04 12:06:17 +03:00
parent 1bae379f5d
commit d705661ad3
No known key found for this signature in database
GPG Key ID: 82B8134785FEAE0D

View File

@ -17,6 +17,25 @@ type PeerInfo struct {
}
func ParsePeerInfoFromJSON(jsonStr string) (PeersData, error) {
/*
We expect a JSON string with the format:
{
<peerId1>: {
"protocols": [
"protocol1",
"protocol2",
...
],
"addresses": [
"address1",
"address2",
...
]
},
<peerId2>: ...
}
*/
// Create a temporary map to unmarshal the JSON data
var rawMap map[string]struct {
Protocols []string `json:"protocols"`