code: func (s *Service) RegisterChaincodeEvent(ccID, eventFilter string) (fab.Registration, <-chan *fab.CCEvent, error) {
  	if ccID == "" {
  		return nil, nil, errors.New("chaincode ID is required")
  	}
  	if eventFilter == "" {
  		return nil, nil, errors.New("event filter is required")
  	}
  
  	eventch := make(chan *fab.CCEvent, s.eventConsumerBufferSize)
  	regch := make(chan fab.Registration)
  	errch := make(chan error)
  
  	if err := s.Submit(dispatcher.NewRegisterChaincodeEvent(ccID, eventFilter, eventch, regch, errch)); err != nil {
  		return nil, nil, errors.WithMessage(err, "error registering for chaincode events")
  	}
  
  	select {
  	case response := <-regch:
  		return response, eventch, nil
  	case err := <-errch:
  		return nil, nil, err
  	}
  }
docs: // RegisterChaincodeEvent registers for chaincode events. If the client is not authorized to receive
  // chaincode events then an error is returned.
  // - ccID is the chaincode ID for which events are to be received
  // - eventFilter is the chaincode event name for which events are to be received