diff --git a/app/dashboard/utils.py b/app/dashboard/utils.py index c76258232a4..da1c27314bb 100644 --- a/app/dashboard/utils.py +++ b/app/dashboard/utils.py @@ -24,7 +24,7 @@ from django.conf import settings -import ipfsapi +import ipfshttpclient import requests from app.utils import sync_profile from dashboard.helpers import UnsupportedSchemaException, normalize_url, process_bounty_changes, process_bounty_details @@ -32,7 +32,7 @@ from eth_utils import to_checksum_address from gas.utils import conf_time_spread, eth_usd_conv_rate, gas_advisories, recommend_min_gas_price_to_confirm_in_time from hexbytes import HexBytes -from ipfsapi.exceptions import CommunicationError +from ipfshttpclient.exceptions import CommunicationError from web3 import HTTPProvider, Web3, WebsocketProvider from web3.exceptions import BadFunctionCallOutput from web3.middleware import geth_poa_middleware @@ -196,14 +196,14 @@ def get_ipfs(host=None, port=settings.IPFS_API_PORT): communication error with IPFS. Returns: - ipfsapi.client.Client: The IPFS connection client. + ipfshttpclient.client.Client: The IPFS connection client. """ if host is None: host = f'https://{settings.IPFS_HOST}' try: - return ipfsapi.connect(host, port) + return ipfshttpclient.connect(host, port) except CommunicationError as e: logger.exception(e) raise IPFSCantConnectException('Failed while attempt to connect to IPFS') diff --git a/app/kudos/utils.py b/app/kudos/utils.py index 87dc2392c99..f240221a903 100644 --- a/app/kudos/utils.py +++ b/app/kudos/utils.py @@ -25,7 +25,7 @@ from django.conf import settings -import ipfsapi +import ipfshttpclient from dashboard.utils import get_web3 from eth_utils import to_checksum_address from git.utils import get_emails_master @@ -161,7 +161,7 @@ def __init__(self, network='localhost', sockets=False): self._w3 = get_web3(self.network, sockets=sockets) host = f'{settings.IPFS_API_SCHEME}://{settings.IPFS_HOST}' - self._ipfs = ipfsapi.connect(host=host, port=settings.IPFS_API_PORT) + self._ipfs = ipfshttpclient.connect(host=host, port=settings.IPFS_API_PORT) self._contract = self._get_contract() self.address = self._get_contract_address() diff --git a/requirements/base.txt b/requirements/base.txt index 0c6523c6851..d5242c94e94 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -37,7 +37,7 @@ cytoolz==0.9.0 boto==2.49.0 google-api-python-client django-environ==0.4.5 -ipfsapi +ipfshttpclient eth-utils==1.4.1 jsondiff==1.1.1 social-auth-app-django==2.1.0