WIP: Json rpc federation, search/getclaimbyid, and shutdown #76
2
main.go
|
@ -43,7 +43,7 @@ func main() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
conn, err := grpc.Dial("localhost:"+string(args.Port),
|
conn, err := grpc.Dial("localhost:"+fmt.Sprintf("%d", args.Port),
|
||||||
grpc.WithTransportCredentials(insecure.NewCredentials()),
|
grpc.WithTransportCredentials(insecure.NewCredentials()),
|
||||||
grpc.WithBlock(),
|
grpc.WithBlock(),
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
|
|||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"errors"
|
||||||
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
|
|||||||
|
|
||||||
pb "github.com/lbryio/herald.go/protobuf/go"
|
|
||||||
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
|
|||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PeersService struct {
|
type PeersService struct {
|
||||||
Server *Server
|
Server *Server
|
||||||
|
// needed for subscribe/unsubscribe
|
||||||
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
|
|||||||
|
sessionMgr *sessionManager
|
||||||
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
|
|||||||
|
session *session
|
||||||
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
|
|||||||
}
|
}
|
||||||
|
|
||||||
type PeersSubscribeReq struct {
|
type PeersSubscribeReq struct {
|
||||||
|
@ -22,23 +24,16 @@ type PeersSubscribeResp string
|
||||||
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
|
|||||||
// Features is the json rpc endpoint for 'server.peers.subcribe'.
|
// Features is the json rpc endpoint for 'server.peers.subcribe'.
|
||||||
func (t *PeersService) Subscribe(req *PeersSubscribeReq, res **PeersSubscribeResp) error {
|
func (t *PeersService) Subscribe(req *PeersSubscribeReq, res **PeersSubscribeResp) error {
|
||||||
log.Println("PeersSubscribe")
|
log.Println("PeersSubscribe")
|
||||||
ctx := context.Background()
|
// var port = "50001"
|
||||||
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
|
|||||||
var port = "50001"
|
|
||||||
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
|
|||||||
|
|
||||||
// FIXME: Get the actual port from the request details
|
// FIXME: Get the actual port from the request details
|
||||||
|
|
||||||
msg := &pb.ServerMessage{
|
if t.sessionMgr == nil || t.session == nil {
|
||||||
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
|
|||||||
Address: req.Ip,
|
|
||||||
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
|
|||||||
Port: port,
|
|
||||||
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
|
|||||||
}
|
|
||||||
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
|
|||||||
|
|
||||||
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
|
|||||||
peers, err := t.Server.PeerSubscribe(ctx, msg)
|
|
||||||
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
|
|||||||
if err != nil {
|
|
||||||
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
|
|||||||
log.Println(err)
|
|
||||||
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
|
|||||||
*res = nil
|
*res = nil
|
||||||
return err
|
return errors.New("no session, rpc not supported")
|
||||||
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
|
|||||||
}
|
}
|
||||||
|
t.sessionMgr.peersSubscribe(t.session, true /*subscribe*/)
|
||||||
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
|
|||||||
|
|
||||||
*res = (*PeersSubscribeResp)(&peers.Value)
|
*res = nil
|
||||||
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have `sessionManager.peersSubs` already in place.
Ahh.... I meant register the subscription in the The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping Ahh.... I meant register the subscription in the `sessionManager.peerSubs` map. It needs registration there as it's communicating by JSONRPC. Then inside `Server.notifyPeerSubs`, call `s.sessionManager.doNotify()` to forward a notification to the session-based mechanism.
The stuff in federation.go is more oriented towards grpc service (and managing the list of known peers). If PeersSubscribe comes in via GRPC, there's a separate mapping `Server.PeerSubs` for those.
Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah Ahh, yeah, just hooking it into the gRPC like this isn't going to quite work I suppose hahah
|
|
@ -313,6 +313,18 @@ func (sm *sessionManager) broadcastTx(rawTx []byte) (*chainhash.Hash, error) {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (sm *sessionManager) peersSubscribe(sess *session, subscribe bool) {
|
||||||
|
sm.sessionsMut.Lock()
|
||||||
|
defer sm.sessionsMut.Unlock()
|
||||||
|
if subscribe {
|
||||||
|
sm.peerSubs[sess.id] = sess
|
||||||
|
sess.peersSub = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
delete(sm.peerSubs, sess.id)
|
||||||
|
sess.peersSub = false
|
||||||
|
}
|
||||||
|
|
||||||
func (sm *sessionManager) headersSubscribe(sess *session, raw bool, subscribe bool) {
|
func (sm *sessionManager) headersSubscribe(sess *session, raw bool, subscribe bool) {
|
||||||
sm.sessionsMut.Lock()
|
sm.sessionsMut.Lock()
|
||||||
defer sm.sessionsMut.Unlock()
|
defer sm.sessionsMut.Unlock()
|
||||||
|
|
Might as well complete this by adding sessionManager to PeersService (or other appropriate pointer). You have
sessionManager.peersSubs
already in place.