This Django project is an API implementation for comparing the performance analytics of public cloud storage and IPFS using various parameters. The project is created for a blockchain class to explore the differences in performance between centralized cloud storage providers and decentralized IPFS storage.
A special thanks to the following people who have contributed to this project:
Feel free to add your name to the list if you have contributed to the project. To do so, edit this file and submit a pull request.
- Upload files to Azure Blob Storage or IPFS using Pinata
- Download files from Azure Blob Storage or IPFS
- Delete files from Azure Blob Storage or IPFS
- Compare performance analytics for public cloud storage and IPFS
Follow the steps below to set up the project on your local machine.
- Python 3.6 or higher
- pip
- virtualenv
- Clone the repository:
git clone https://github.com/srikar58/Blockchain_storage_analytics.git
cd django-storage-api-comparison
- Create a virtual environment and activate it:
python -m venv .venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
3.Install the required packages:
pip install -r requirements.txt
4.Create a .env file in the root directory of your Django project and add your Azure Blob Storage and Pinata API keys:
AZURE_STORAGE_CONNECTION_STRING=your-azure-storage-connection-string
PINATA_API_KEY=your-pinata-api-key
PINATA_SECRET_API_KEY=your-pinata-secret-api-key
Replace the placeholders with your actual Azure and Pinata credentials.
5.Start the development server:
python manage.py runserver
Now, you can access the API endpoints at http://localhost:8000/api/.
- URL:
/api/upload/
- Method:
POST
- Form Data:
file
: The file to be uploaded.storage_type
: The storage type where the file will be uploaded, eitherazure
oripfs
.
- URL:
/api/download/
- Method:
POST
- Form Data:
file_identifier
: The name of the file(hash key or name) to be downloaded.storage_type
: The storage type from where the file will be downloaded, eitherazure
oripfs
.
- URL:
/api/delete/
- Method:
POST
- Form Data:
file_identifier
: The identifier of the file(hash key or name) to be deleted.storage_type
: The storage type where the file will be deleted or unpinned, eitherazure
oripfs
.