code: func (s *StanServer) replicateSub(sr *pb.SubscriptionRequest, ackInbox string, subID uint64) (*subState, error) {
  	op := &spb.RaftOperation{
  		OpType: spb.RaftOperation_Subscribe,
  		Sub: &spb.AddSubscription{
  			Request:  sr,
  			AckInbox: ackInbox,
  			ID:       subID,
  		},
  	}
  	data, err := op.Marshal()
  	if err != nil {
  		panic(err)
  	}
  	// Replicate operation and wait on result.
  	future := s.raft.Apply(data, 0)
  	if err := future.Error(); err != nil {
  		return nil, err
  	}
  	rs := future.Response().(*replicatedSub)
  	return rs.sub, rs.err
  }
docs: // replicateSub replicates the SubscriptionRequest to nodes in the cluster via
  // Raft.