update lightest peer and nats behaviors

This commit is contained in:
mr
2026-02-18 14:32:44 +01:00
parent 0250c3b339
commit 88fd05066c
8 changed files with 36 additions and 51 deletions

View File

@@ -33,8 +33,7 @@ type Node struct {
PeerID pp.ID
isIndexer bool
Mu sync.RWMutex
Peers map[pp.ID]bool
Mu sync.RWMutex
}
func InitNode(isNode bool, isIndexer bool, isNativeIndexer bool) (*Node, error) {
@@ -65,7 +64,6 @@ func InitNode(isNode bool, isIndexer bool, isNativeIndexer bool) (*Node, error)
return nil, errors.New("no host no node")
}
node := &Node{
Peers: map[pp.ID]bool{},
PeerID: h.ID(),
isIndexer: isIndexer,
LongLivedStreamRecordedService: common.NewStreamRecordedService[interface{}](h, 1000, false),
@@ -101,13 +99,6 @@ func InitNode(isNode bool, isIndexer bool, isNativeIndexer bool) (*Node, error)
}
}
node.SubscribeToSearch(node.PS, &f)
access := oclib.NewRequestAdmin(oclib.LibDataEnum(oclib.PEER), nil)
peers := access.LoadAll(false)
for _, p := range peers.Data { // fill cache.
if pid, err := pp.Decode(p.(*peer.Peer).PeerID); err == nil {
node.Peers[pid] = p.(*peer.Peer).State == peer.ONLINE
}
}
}
if isIndexer {
logger.Info().Msg("generate opencloud indexer...")
@@ -274,3 +265,19 @@ func (d *Node) claimInfo(
return p, err
//}
}
/*
TODO:
- Le booking est un flow neuf décentralisé :
On check on attend une réponse, on valide, il passe par discovery, on relais.
- Le shared workspace est une affaire de décentralisation,
on communique avec les shared les mouvements
- Un shared remplace la notion de partnership à l'échelle de partnershipping
-> quand on share un workspace on devient partenaire temporaire
qu'on le soit originellement ou non.
-> on a alors les mêmes privilèges.
- Les orchestrations admiralty ont le même fonctionnement.
Un evenement provoque alors une création de clé de service.
On doit pouvoir crud avec verification de signature un DBobject.
*/