def define_peers(peer_names, peer_hosts, organisation, domain=None):
    """Define peers as connection objects.

        Args:
            peer_names (Iterable): List of peer names.
            peer_hosts (Iterable): List of peer hosts.
            organisation (str): What organisation the peers belong to
            domain (str): Domain used. Defaults to none.

        Returns:
            tuple: A tuple of dictionaries with Peer Options and Peer Connections.
    """
    peer_options = {}
    peer_connections = {}
    for name, host in zip(peer_names, peer_hosts):
        if domain:
            key = f'{name}.{organisation}.{domain}'
        else:
            key = name
        peer_options[key] = {'chaincodeQuery': True, 'endorsingPeer': True,
            'eventSource': True, 'ledgerQuery': True}
        peer_connections[key] = {'url': 'grpc://' + host + ':7051',
            'eventUrl': 'grpc://' + host + ':7053'}
    return peer_options, peer_connections
