func StartNS(ctx context.Context) (*NS, string) {
	ns := &NS{
		upCh:    make(chan *ttnpb.UplinkMessage, 1),
		txAckCh: make(chan *ttnpb.GatewayTxAcknowledgment, 1),
	}
	srv := rpcserver.New(ctx)
	ttnpb.RegisterGsNsServer(srv.Server, ns)
	lis, err := net.Listen("tcp", ":0")
	if err != nil {
		panic(err)
	}
	go srv.Serve(lis)
	return ns, lis.Addr().String()
}
StartNS starts the mock NS.
package mock
import (
	"context"
	"net"
	types "github.com/gogo/protobuf/types"
	"go.thethings.network/lorawan-stack/v3/pkg/rpcserver"
	"go.thethings.network/lorawan-stack/v3/pkg/ttnpb"
)
type NS struct {
	upCh    chan *ttnpb.UplinkMessage
	txAckCh chan *ttnpb.GatewayTxAcknowledgment
}