2024-01-06 11:33:46 +00:00
|
|
|
package service
|
|
|
|
|
|
|
|
import (
|
|
|
|
"git.lumeweb.com/LumeWeb/libs5-go/encoding"
|
|
|
|
"git.lumeweb.com/LumeWeb/libs5-go/net"
|
|
|
|
"git.lumeweb.com/LumeWeb/libs5-go/structs"
|
2024-01-09 11:58:03 +00:00
|
|
|
"git.lumeweb.com/LumeWeb/libs5-go/types"
|
2024-01-06 11:33:46 +00:00
|
|
|
"net/url"
|
2024-01-08 17:06:53 +00:00
|
|
|
"sync"
|
2024-01-06 11:33:46 +00:00
|
|
|
)
|
|
|
|
|
2024-01-30 02:32:13 +00:00
|
|
|
type P2PService interface {
|
2024-01-30 01:52:17 +00:00
|
|
|
SelfConnectionUris() []*url.URL
|
|
|
|
Peers() structs.Map
|
2024-03-05 20:13:25 +00:00
|
|
|
ConnectToNode(connectionUris []*url.URL, retry uint, fromPeer net.Peer) error
|
2024-01-30 01:52:17 +00:00
|
|
|
OnNewPeer(peer net.Peer, verifyId bool) error
|
|
|
|
GetNodeScore(nodeId *encoding.NodeId) (float64, error)
|
|
|
|
SortNodesByScore(nodes []*encoding.NodeId) ([]*encoding.NodeId, error)
|
|
|
|
SignMessageSimple(message []byte) ([]byte, error)
|
|
|
|
AddPeer(peer net.Peer) error
|
|
|
|
SendPublicPeersToPeer(peer net.Peer, peersToSend []net.Peer) error
|
|
|
|
SendHashRequest(hash *encoding.Multihash, kinds []types.StorageLocationType) error
|
|
|
|
UpVote(nodeId *encoding.NodeId) error
|
|
|
|
DownVote(nodeId *encoding.NodeId) error
|
|
|
|
NodeId() *encoding.NodeId
|
|
|
|
WaitOnConnectedPeers()
|
|
|
|
ConnectionTracker() *sync.WaitGroup
|
|
|
|
NetworkId() string
|
|
|
|
HashQueryRoutingTable() structs.Map
|
2024-01-30 02:32:13 +00:00
|
|
|
Service
|
2024-01-29 06:55:36 +00:00
|
|
|
}
|