Documentation
¶
Index ¶
- Constants
- Variables
- type AliveService
- type PeerConnInfo
- type Protocol
- type RelayClient
- func (s *RelayClient) AddToPeerStore(peerInfo *peer.AddrInfo)
- func (m *RelayClient) Close()
- func (s *RelayClient) CloseProtocolStream(protocol string, peerID peer.ID) error
- func (d *RelayClient) ConnectToBootnodes(bootnodes []*peer.AddrInfo)
- func (s *RelayClient) GetBootnodes() []*peer.AddrInfo
- func (s *RelayClient) GetHost() host.Host
- func (s *RelayClient) GetNotifyBundle() *network.NotifyBundle
- func (s *RelayClient) GetRandomBootnode() *peer.AddrInfo
- func (s *RelayClient) GetRandomRelaynode() *peer.AddrInfo
- func (s *RelayClient) GetRelayPeerInfo() *RelayPeerInfo
- func (s *RelayClient) NewAliveClient(peerID peer.ID) (proto.AliveClient, error)
- func (s *RelayClient) NewProtoConnection(protocol string, peerID peer.ID) (*rawGrpc.ClientConn, error)
- func (s *RelayClient) NewStream(proto string, id peer.ID) (network.Stream, error)
- func (s *RelayClient) RegisterProtocol(id string, p Protocol)
- func (s *RelayClient) RelayPeers() []*RelayPeerInfo
- func (s *RelayClient) RemoveFromPeerStore(peerInfo *peer.AddrInfo)
- func (s *RelayClient) SaveProtocolStream(protocol string, stream *rawGrpc.ClientConn, peerID peer.ID)
- func (s *RelayClient) StartAlive(subscription application.Subscription) error
- func (s *RelayClient) StartRelayReserv() error
- type RelayConnInfo
- type RelayPeerInfo
- type RelayServer
- func (s *RelayServer) GetHost() host.Host
- func (s *RelayServer) GetNotifyBundle() *network.NotifyBundle
- func (s *RelayServer) GetPeerAddrInfo(peerID peer.ID) peer.AddrInfo
- func (s *RelayServer) GetRandomBootnode() *peer.AddrInfo
- func (s *RelayServer) GetRelayProxyAddr() *net.TCPAddr
- func (s *RelayServer) PublishApplicationStatus(status *appProto.AppStatus)
- func (s *RelayServer) RegisterProtocol(id string, p Protocol)
- func (s *RelayServer) SetupAliveService(syncAppPeerClient application.SyncAppPeerClient) error
Constants ¶
const ( MinimumRelayNodes int = 1 MinimumRelayConnections int64 = 1 )
const (
EdgeAliveProto = "/alive/0.2"
)
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AliveService ¶
type AliveService struct { proto.UnimplementedAliveServer // contains filtered or unexported fields }
BOOTNODE QUERIES // AliveService is a service that finds other peers in the network and connects them to the current running node
func NewAliveService ¶
func NewAliveService( server networkingServer, logger hclog.Logger, syncAppPeerClient application.SyncAppPeerClient, ) *AliveService
NewAliveService creates a new instance of the alive service
func (*AliveService) Hello ¶
func (d *AliveService) Hello(ctx context.Context, status *proto.AliveStatus) (*proto.AliveStatusResp, error)
type PeerConnInfo ¶
PeerConnInfo holds the connection information about the peer
type RelayClient ¶
type RelayClient struct {
// contains filtered or unexported fields
}
func NewRelayClient ¶
func NewRelayClient(logger hclog.Logger, config *emcNetwork.Config, relayOn bool, relayNodes []string) (*RelayClient, error)
NewRelayClient returns a new instance of the relay client
func (*RelayClient) AddToPeerStore ¶
func (s *RelayClient) AddToPeerStore(peerInfo *peer.AddrInfo)
AddToPeerStore adds peer information to the node's peer store
func (*RelayClient) Close ¶
func (m *RelayClient) Close()
Close terminates running processes for SyncAppPeerClient
func (*RelayClient) CloseProtocolStream ¶
func (s *RelayClient) CloseProtocolStream(protocol string, peerID peer.ID) error
func (*RelayClient) ConnectToBootnodes ¶
func (d *RelayClient) ConnectToBootnodes(bootnodes []*peer.AddrInfo)
ConnectToBootnodes attempts to connect to the bootnodes and add them to the peer / routing table
func (*RelayClient) GetBootnodes ¶
func (s *RelayClient) GetBootnodes() []*peer.AddrInfo
func (*RelayClient) GetHost ¶
func (s *RelayClient) GetHost() host.Host
func (*RelayClient) GetNotifyBundle ¶
func (s *RelayClient) GetNotifyBundle() *network.NotifyBundle
func (*RelayClient) GetRandomBootnode ¶
func (s *RelayClient) GetRandomBootnode() *peer.AddrInfo
func (*RelayClient) GetRandomRelaynode ¶
func (s *RelayClient) GetRandomRelaynode() *peer.AddrInfo
GetRandomRelaynode fetches a random relaynode that's currently NOT connected, if any
func (*RelayClient) GetRelayPeerInfo ¶
func (s *RelayClient) GetRelayPeerInfo() *RelayPeerInfo
func (*RelayClient) NewAliveClient ¶
func (s *RelayClient) NewAliveClient(peerID peer.ID) (proto.AliveClient, error)
NewAliveClient returns a new or existing alive service client connection
func (*RelayClient) NewProtoConnection ¶
func (s *RelayClient) NewProtoConnection(protocol string, peerID peer.ID) (*rawGrpc.ClientConn, error)
NewProtoConnection opens up a new stream on the set protocol to the peer, and returns a reference to the connection
func (*RelayClient) RegisterProtocol ¶
func (s *RelayClient) RegisterProtocol(id string, p Protocol)
func (*RelayClient) RelayPeers ¶
func (s *RelayClient) RelayPeers() []*RelayPeerInfo
RelayPeers returns a copy of the networking server's relay peer connection info set. Only one (initial) connection (inbound OR outbound) per peer is contained [Thread safe]
func (*RelayClient) RemoveFromPeerStore ¶
func (s *RelayClient) RemoveFromPeerStore(peerInfo *peer.AddrInfo)
func (*RelayClient) SaveProtocolStream ¶
func (s *RelayClient) SaveProtocolStream( protocol string, stream *rawGrpc.ClientConn, peerID peer.ID, )
func (*RelayClient) StartAlive ¶
func (s *RelayClient) StartAlive(subscription application.Subscription) error
setupAlive Sets up the live service for the node
func (*RelayClient) StartRelayReserv ¶
func (s *RelayClient) StartRelayReserv() error
Start starts the networking relay reserve job
type RelayConnInfo ¶
RelayConnInfo holds the connection information about the peer
type RelayPeerInfo ¶
type RelayPeerInfo struct { Info *RelayConnInfo Reservation *client.Reservation }
RelayPeerInfo holds the relay information about the peer
type RelayServer ¶
type RelayServer struct { MaxReservations int // contains filtered or unexported fields }
func NewRelayServer ¶
func NewRelayServer(logger hclog.Logger, secretsManager secrets.SecretsManager, relayListenAddr multiaddr.Multiaddr, proxyAddr *net.TCPAddr, syncAppPeerClient application.SyncAppPeerClient, RelayDiscovery bool, relayNodes []string) (*RelayServer, error)
NewRelayServer returns a new instance of the relay server
func NewRelayServerWithHost ¶
func NewRelayServerWithHost(logger hclog.Logger, host host.Host) (*RelayServer, error)
func (*RelayServer) GetHost ¶
func (s *RelayServer) GetHost() host.Host
func (*RelayServer) GetNotifyBundle ¶
func (s *RelayServer) GetNotifyBundle() *network.NotifyBundle
func (*RelayServer) GetPeerAddrInfo ¶
func (s *RelayServer) GetPeerAddrInfo(peerID peer.ID) peer.AddrInfo
GetPeerAddrInfo fetches the AddrInfo of a peer
func (*RelayServer) GetRandomBootnode ¶
func (s *RelayServer) GetRandomBootnode() *peer.AddrInfo
func (*RelayServer) GetRelayProxyAddr ¶
func (s *RelayServer) GetRelayProxyAddr() *net.TCPAddr
func (*RelayServer) PublishApplicationStatus ¶
func (s *RelayServer) PublishApplicationStatus(status *appProto.AppStatus)
func (*RelayServer) RegisterProtocol ¶
func (s *RelayServer) RegisterProtocol(id string, p Protocol)
func (*RelayServer) SetupAliveService ¶
func (s *RelayServer) SetupAliveService(syncAppPeerClient application.SyncAppPeerClient) error
setupAlive Sets up the live service for the node