Versions in this module Expand all Collapse all v1 v1.0.3 Feb 27, 2025 Changes in this version + const DefaultAppStatusPublishDuration + const DefaultAppStatusSyncDuration + const ProtoTagEcApp + const SyncAppPeerClientLoggerName + func Call(clientHost host.Host, protoTag string, call *EdgeCall) ([]byte, error) + func CallWithFrom(clientHost host.Host, protoTag string, call *EdgeCall, from types.Address) ([]byte, error) + func WriteSignedResponse(w http.ResponseWriter, info []byte, endpoint *Endpoint) + type AppPeer struct + Addr string + AppOrigin string + AveragePower float32 + CpuInfo string + Distance *big.Int + GpuInfo string + Guage_height uint64 + Guage_max uint64 + ID string + Mac string + MemInfo string + ModelHash string + Name string + Relay string + Starup_time uint64 + Uptime uint64 + Version string + func (p *AppPeer) IsBetter(t *AppPeer) bool + type Application struct + AppOrigin string + AveragePower float32 + CpuInfo string + GpuInfo string + GuageHeight uint64 + GuageMax uint64 + IpAddr string + Mac string + MemInfo string + ModelHash string + Name string + PeerID peer.ID + RelayHost string + RelayProxyPort uint64 + StartupTime uint64 + Tag string + Uptime uint64 + Version string + func (a *Application) Copy() *Application + type ApplicationStore interface + GetEndpointApplication func() *Application + type EdgeCall struct + Endpoint string + Input json.RawMessage + PeerId string + func DecodeEdgeCallFromInterface(i interface{}) (*EdgeCall, error) + func (e *EdgeCall) Copy() *EdgeCall + type Endpoint struct + func NewApplicationEndpoint(logger hclog.Logger, privateKey *ecdsa.PrivateKey, srvHost host.Host, ...) (*Endpoint, error) + func (e *Endpoint) AddHandler(url string, handler func(w http.ResponseWriter, r *http.Request)) + func (e *Endpoint) Close() + func (e *Endpoint) GetEndpointApplication() *Application + func (e *Endpoint) GetHandlerList() []string + func (e *Endpoint) SetAppOrigin(appOrigin string) + func (e *Endpoint) SetSigner(s proof.Signer) + func (e *Endpoint) SubscribeEvents() Subscription + type EndpointHandler struct + func (h *EndpointHandler) AddHandler(url string, handler func(w http.ResponseWriter, r *http.Request)) + func (h *EndpointHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) + type Event struct + NewApp []*Application + Source string + Type EventType + func (e *Event) AddNewApp(newApp *Application) + func (e *Event) LatestApp() *Application + type EventType int + const EventFork + const EventHead + const EventReorg + type MockSubscription struct + func NewMockSubscription() *MockSubscription + func (m *MockSubscription) Close() + func (m *MockSubscription) GetEvent() *Event + func (m *MockSubscription) GetEventCh() chan *Event + func (m *MockSubscription) Push(e *Event) + type Network interface + AddrInfo func() *peer.AddrInfo + CloseProtocolStream func(protocol string, peerID peer.ID) error + GetPeerDistance func(peer.ID) *big.Int + IsConnected func(peerID peer.ID) bool + NewProtoConnection func(protocol string, peerID peer.ID) (*rawGrpc.ClientConn, error) + NewTopic func(protoID string, obj proto.Message) (*network.Topic, error) + Peers func() []*network.PeerConnInfo + RegisterProtocol func(string, network.Protocol) + SaveProtocolStream func(protocol string, stream *rawGrpc.ClientConn, peerID peer.ID) + SubscribeCh func(context.Context) (<-chan *event.PeerEvent, error) + type PeerMap struct + func NewPeerMap(peers []*AppPeer) *PeerMap + func (m *PeerMap) BestPeer(skipMap map[string]bool) *AppPeer + func (m *PeerMap) Get(id string) *AppPeer + func (m *PeerMap) Put(peers ...*AppPeer) + func (m *PeerMap) Remove(peerID peer.ID) + type Subscription interface + Close func() + GetEvent func() *Event + GetEventCh func() chan *Event + type SyncAppPeerClient interface + Close func() + CloseStream func(peerID peer.ID) error + DisablePublishingPeerStatus func() + EnablePublishingPeerStatus func() + GetConnectedPeerStatuses func() []*AppPeer + GetPeerConnectionUpdateEventCh func() <-chan *event.PeerEvent + GetPeerData func(peerID peer.ID, dataHash string, timeout time.Duration) (map[string][]byte, error) + GetPeerStatus func(id peer.ID) (*AppPeer, error) + GetPeerStatusUpdateCh func() <-chan *AppPeer + PublishApplicationStatus func(status *proto.AppStatus) + Start func(topicSubFlag bool) error + SubscribeAppEvents func() Subscription + func NewSyncAppPeerClient(logger hclog.Logger, network Network, host host.Host, ...) SyncAppPeerClient + type SyncAppPeerService interface + Close func() error + Start func() + func NewSyncAppPeerService(logger hclog.Logger, network *network.Server, ...) SyncAppPeerService + type Syncer interface + Close func() error + GetAppPeer func(id string) *AppPeer + Start func(topicSubFlag bool) error + func NewSyncer(logger hclog.Logger, syncAppPeerClient SyncAppPeerClient, ...) Syncer