// reqHandler: remote peer request handler (received request from peer)
remote peer request handler (received request from peer)
// reqHandler : remote peer request handler ( received request from peer )
func (rpc *RPC) reqHandler(s inet.Stream) {
	req := &pb.Request{}
	reader := bufio.NewReader(s)
	decoder := protobufCodec.Multicodec(nil).Decoder(reader)
	if err := decoder.Decode(req); err != nil {
		log.Warn(err)
		return
	}
	log.WithFields(log.Fields{
		"peer-id": req.GetPeerId(),
		"req-id":  req.GetRequestId(),
		"method":  req.GetMethod(),
	}).Info("Received request from peer")
}
func ( rpc * RPC ) reqHandler ( s inet . Stream ) { req := & pb . Request { } reader := bufio . NewReader ( s ) decoder := protobufCodec . Multicodec ( nil ) . Decoder ( reader ) if err := decoder . Decode ( req ) ; err != nil { log . Warn ( err ) return } log . WithFields ( log . Fields { " " : req . GetPeerId ( ) , " " : req . GetRequestId ( ) , " " : req . GetMethod ( ) , } ) . Info ( " " ) }
remote peer request handler (received request from peer)
remote peer request handler ( received request from peer )