Get the name as it was at a particular height.
    Returns the name record states at this block height on success (an array)
    Returns {'error': ...} on error

def get_name_at(name, block_id, include_expired=False, hostport=None, proxy=None):
    """
    Get the name as it was at a particular height.
    Returns the name record states at this block height on success (an array)
    Returns {'error': ...} on error
    """
    assert hostport or proxy, 'Need hostport or proxy'
    if proxy is None:
        proxy = connect_hostport(hostport)

    namerec_schema = {
        'type': 'object',
        'properties': NAMEOP_SCHEMA_PROPERTIES,
        'required': NAMEOP_SCHEMA_REQUIRED
    }

    namerec_list_schema = {
        'type': 'object',
        'properties': {
            'records': {
                'anyOf': [
                    {
                        'type': 'array',
                        'items': namerec_schema
                    },
                    {
                        'type': 'null',
                    },
                ],
            },
        },
        'required': [
            'records'
        ],
    }

    resp_schema = json_response_schema( namerec_list_schema )
    resp = {}
    try:
        if include_expired:
            resp = proxy.get_historic_name_at(name, block_id)
        if not include_expired or 'KeyError' in resp.get('error', ''):
            resp = proxy.get_name_at(name, block_id)

        assert resp, "No such name {} at block {}".format(name, block_id)

        resp = json_validate(resp_schema, resp)
        if json_is_error(resp):
            return resp

    except ValidationError as e:
        if BLOCKSTACK_DEBUG:
            log.exception(e)

        resp = {'error': 'Server response did not match expected schema.  You are likely communicating with an out-of-date Blockstack node.', 'http_status': 502}
        return resp

    except socket.timeout:
        log.error("Connection timed out")
        resp = {'error': 'Connection to remote host timed out.', 'http_status': 503}
        return resp

    except socket.error as se:
        log.error("Connection error {}".format(se.errno))
        resp = {'error': 'Connection to remote host failed.', 'http_status': 502}
        return resp

    except Exception as ee:
        if BLOCKSTACK_DEBUG:
            log.exception(ee)

        log.error("Caught exception while connecting to Blockstack node: {}".format(ee))
        resp = {'error': 'Failed to contact Blockstack node.  Try again with `--debug`.', 'http_status': 500}
        return resp

    return resp['records']