2024-01-07 08:13:35 +00:00
|
|
|
package interfaces
|
|
|
|
|
|
|
|
import (
|
|
|
|
"git.lumeweb.com/LumeWeb/libs5-go/encoding"
|
|
|
|
"git.lumeweb.com/LumeWeb/libs5-go/net"
|
|
|
|
"git.lumeweb.com/LumeWeb/libs5-go/structs"
|
|
|
|
"net/url"
|
|
|
|
)
|
|
|
|
|
|
|
|
type P2PService interface {
|
2024-01-07 08:54:32 +00:00
|
|
|
Node() Node
|
|
|
|
Peers() structs.Map
|
2024-01-07 08:13:35 +00:00
|
|
|
Start() error
|
|
|
|
Stop() error
|
|
|
|
Init() error
|
|
|
|
ConnectToNode(connectionUris []*url.URL, retried bool) error
|
2024-01-07 08:54:50 +00:00
|
|
|
OnNewPeer(peer *net.Peer, verifyId bool) error
|
|
|
|
OnNewPeerListen(peer *net.Peer, verifyId bool)
|
|
|
|
ReadNodeScore(nodeId *encoding.NodeId) (NodeVotes, error)
|
|
|
|
GetNodeScore(nodeId *encoding.NodeId) (float64, error)
|
2024-01-07 08:13:35 +00:00
|
|
|
SortNodesByScore(nodes []*encoding.NodeId) ([]*encoding.NodeId, error)
|
|
|
|
}
|