This directory contains samples for Swan MultiChain Storage System. Swan MultiChain Storage is the Web3 cloud computing solution for storage bucket creation, deployment and management. User can create and manage buckets through samples under this directory. For more information checkout Swan MCS Developer Docs.
To use the swan-sdk
Multi-Chain Storage (MCS) service, an MCS API key is required. To get an MCS API Key: visit MultiChain Storage.
This sample (and Swan SDK) requires you to have API Key from MCS.
Steps to get a MCS API Key:
- Go to Multi Chain Storage. Make sure you're under the Mainnet environment.
- Login through MetaMask.
- Click the gear icon on the top right and select 'Setting'.
- Click 'Create API Key'
- Store your API Key safely, do not share with others.
- Clone the python-sdk-docs-samples.
$ git clone https://github.com/swanchain/python-sdk-docs-samples.git
- Install and updgrade pip and virtualenv if you do not already have them.
- Create virtualenv compatible with Python 3.7+
$ python3 -m venv venv
$ source venv/bin/activate
- Install the dependencies from the requirements file
$ pip install -r requirements.txt
- Create a new .env file
- Store your MCS API key in .env file:
MCS_API_KEY = <your_storage_api_key>
Create and delete a bucket.
$ python storage/create_delete_bucket.py
Retrieve information for a single bucket but also for all buckets.
$ python storage/info_bucket.py
Detailed breakdown of how to create folders and upload MCS and IPFS folders.
$ python storage/folders_bucket.py
Detailed breakdown of how to upload, download, and delete a file in a Bucket.
$ python storage/file_bucket.py
Retrieve information on a particular file or all files in a Bucket.
$ python storage/file_info_bucket.py