(path: str)
Fetch CDXJ file content from IPFS by hash.
Fetch CDXJ file content from IPFS by hash.
Fetch CDXJ file content from IPFS by hash .
def fetch_ipfs_index(path: str) -> Optional[str]:
    """Fetch CDXJ file content from IPFS by hash."""
    ipfs_hash = format_ipfs_cid(path)

    if ipfs_hash is None:
        return None

    try:
        with ipfshttpclient.connect(util.IPFSAPI_MUTLIADDRESS) as client:
            return client.cat(path).decode('utf-8')

    except ipfshttpclient.exceptions.StatusError as err:
        raise BackendError(backend_name='ipfs') from err
def fetch_ipfs_index ( path : str ) -> Optional [ str ] : ipfs_hash = format_ipfs_cid ( path ) if ipfs_hash is None : return None try : with ipfshttpclient . connect ( util . IPFSAPI_MUTLIADDRESS ) as client : return client . cat ( path ) . decode ( 'utf-8' ) except ipfshttpclient . exceptions . StatusError as err : raise BackendError ( backend_name = 'ipfs' ) from err