1. Home
  2. FluxDrive
  3. How to utilize FluxDrive Pro

How to utilize FluxDrive Pro

Flux launched FluxDrive Pro, featuring a highly sought-after decentralized storage solution: API-based IPFS. This new product of the Flux ecosystem will provide decentralized, scalable, and resilient storage at competitive prices. The addition of API-based IPFS makes it simpler for Web3 developers to run their dApps on the Flux network and will enable further growth of the Flux ecosystem.


Getting Started

Major storage providers such as Filecoin, Storj, and Infura rely on API infrastructure for their IPFS services, offering developers a seamless experience for bulk uploading and user-friendly operations. In response to this industry trend, Flux has complemented the current FluxDrive offering by introducing API access.

Initially, FluxDrive Pro is available to exclusive partners only. Working in a closed environment with partners will enable us to test and improve FluxDrive Pro before launching it to the general public. The ease of use and utility of FluxDrive Pro is critical, and Flux is committed to building the best possible product by engaging with talented teams in the Web3 development community.

To gain access to FluxDrive Pro, please use this following form to get in touch with us!

You’ll need the Zelcore wallet to access ZelID, which is essential for us to provide you with an API key. Once you’ve completed the form, we will promptly reach out to you to assist with the setup process.


How to Use FluxDrive Pro

Utilizing FluxDrive Pro involves the use of a coding program, such as VSCode or similar tools. This enables you to operate an Ubuntu terminal and execute necessary commands. The API is accessible via the link https://api.fluxdrive.runonflux.io

Supported API calls on FluxDrive Pro include:

/api/v0/status
/api/v0/ls
/api/v0/put
/api/v0/putfolder
/api/v0/cat
/api/v0/get
/api/v0/rm
/api/v0/thumb

Let’s examine each of these API calls individually, providing the exact command, an example, and the anticipated results for each.

1. /api/v0/status

Command: curl “https://api.fluxdrive.runonflux.io/api/v0/status” -X POST -u “<ZELID>:<API_KEY_SECRET>”

Example: curl “https://api.fluxdrive.runonflux.io/api/v0/status” -X POST -u “1XcNTEsgVND4eb4bsVa2bjktnZZSruVct:95c36537910f4f3baf92e42a7dccb39b4c40e7b469bac78e7b1ad12b99b41184”

Result: {“status”:”success”,”result”:{“storage_used”:2412017}}

2. /api/v0/ls

Command: curl “https://api.fluxdrive.runonflux.io/api/v0/ls” -X POST -u “<ZELID>:<API_KEY_SECRET>”

Example: curl “https://api.fluxdrive.runonflux.io/api/v0/ls” -X POST -u “1XcNTEsgVND4eb4bsVa2bjktnZZSruVct:95c36537910f4f3baf92e42a7dccb39b4c40e7b469bac78e7b1ad12b99b41184”

Result: {“status”:”success”,”files”:[{“hash”:”QmdMfrUsh8tvAj5MuWEFxYR7VjpmXvihxSZZZWoJYE3LMR”,”added_date”:”2023–11–08T15:32:53.592Z”,”added_time”:1699457573,”hash_abbr”:”QmdMfr..YE3LMR”,”height”:200,”icon”:”filetype-png”,”mimetype”:”image/png”,”name”:”21045.png”,”name_abbr”:”21045.png”,”owner”:”1XcNTEsgVND4eb4bsVa2bjktnZZSruVct”,”size”:37161,”thumbnail”:”QmP4su8pghrCkJqDQxRssXsr5mSggNBXGQ6ojh7xWDvsnA”,”timestamp”:1699457573592,”type”:”png”,”width”:200}]}

3. /api/v0/put

Multiple files can be uploaded by specifying multiple ‘-F file=@”<file>”’ arguments to curl. Returns an array of file objects.

Command: curl “https://api.fluxdrive.runonflux.io/api/v0/put” -X POST -u “<ZELID>:<API_KEY_SECRET>” -H “Content-Type: multipart/form-data” -F file=@”” -F file=@”” -F file=@””

Example: curl “https://api.fluxdrive.runonflux.io/api/v0/put” -X POST -u “1XcNTEsgVND4eb4bsVa2bjktnZZSruVct:95c36537910f4f3baf92e42a7dccb39b4c40e7b469bac78e7b1ad12b99b41184” -H “Content-Type: multipart/form-data” -F file=@”21045.png”

Result: {“status”:”success”,”files”:[{“owner”:”1XcNTEsgVND4eb4bsVa2bjktnZZSruVct”,”name”:”21045.png”,”name_abbr”:”21045.png”,”size”:37161,”width”:200,”height”:200,”hash”:”QmdMfrUsh8tvAj5MuWEFxYR7VjpmXvihxSZZZWoJYE3LMR”,”hash_abbr”:”QmdMfr..YE3LMR”,”type”:”png”,”icon”:”filetype-png”,”mimetype”:”image/png”,”timestamp”:1699457573592,”added_time”:1699457573,”added_date”:”2023–11–08T15:32:53.592Z”,”thumbnail”:”QmP4su8pghrCkJqDQxRssXsr5mSggNBXGQ6ojh7xWDvsnA”}]}

4. /api/v0/putfolder

Multiple files can be uploaded by specifying multiple ‘-F file=@”<file>”’ arguments to curl. Returns an array of file objects and a folder hash.

Command: curl “https://api.fluxdrive.runonflux.io/api/v0/putfolder” -X POST -u “<ZELID>:<API_KEY_SECRET>” -H “Content-Type: multipart/form-data” -F file=@”” -F file=@””

Example: curl “https://api.fluxdrive.runonflux.io/api/v0/putfolder” -X POST -u “1XcNTEsgVND4eb4bsVa2bjktnZZSruVct:95c36537910f4f3baf92e42a7dccb39b4c40e7b469bac78e7b1ad12b99b41184” -H “Content-Type: multipart/form-data” -F file=@”image.png” -F file=@”metadata.json”

Result: 

{“status”:”success”,”files”:[{“owner”:”1XcNTEsgVND4eb4bsVa2bjktnZZSruVct”,”name”:”test2.png”,”name_abbr”:”test2.png”,”size”:1927441,”width”:1600,”height”:900,”hash”:”QmQjnA6vPkhCCMrz2VJJxsSiB7tS8oYjVB6ExLYXhShP62″,”hash_abbr”:”QmQjnA..hShP62″,”type”:”png”,”icon”:”filetype-png”,”mimetype”:”image/png”,”timestamp”:1699554843974,”added_time”:1699554843,”added_date”:”2023–11–09T18:34:03.974Z”,”path”:[“QmNaS1f8RDbQ9jz5FGkZWvzG5VA6jp4JJBEwQ2DLzhWN8V”],”thumbnail”:”QmfSMTmdsaddaavbJwPDwHuwUD2Ufmnfrc9nitAEhR5Eck”},{“owner”:”1XcNTEsgVND4eb4bsVa2bjktnZZSruVct”,”name”:”testipfs.png”,”name_abbr”:”testipfs.png”,”size”:37161,”width”:200,”height”:200,”hash”:”QmdMfrUsh8tvAj5MuWEFxYR7VjpmXvihxSZZZWoJYE3LMR”,”hash_abbr”:”QmdMfr..YE3LMR”,”type”:”png”,”icon”:”filetype-png”,”mimetype”:”image/png”,”timestamp”:1699554844537,”added_time”:1699554844,”added_date”:”2023–11–09T18:34:04.537Z”,”path”:[“QmNaS1f8RDbQ9jz5FGkZWvzG5VA6jp4JJBEwQ2DLzhWN8V”],”thumbnail”:”QmP4su8pghrCkJqDQxRssXsr5mSggNBXGQ6ojh7xWDvsnA”}],”folder”:{“hash”:”QmNaS1f8RDbQ9jz5FGkZWvzG5VA6jp4JJBEwQ2DLzhWN8V”,”size”:”1965233″}}

5. /api/v0/cat

Command: curl “https://api.fluxdrive.runonflux.io/api/v0/cat?arg=<HASH>” -X POST -u “<ZELID>:<API_KEY_SECRET>”

Argument: 

  • arg [string] (Required)– The hash of the IPFS object to be outputted. 

Example: curl “https://api.fluxdrive.runonflux.io/api/v0/cat?arg=QmfZEkeQmfq8kDPW7dWXo4LXbcwHWEUTDBT8nK36FBkZA2” -X POST -u “1XcNTEsgVND4eb4bsVa2bjktnZZSruVct:95c36537910f4f3baf92e42a7dccb39b4c40e7b469bac78e7b1ad12b99b41184”

Result: 

Continued:

curl “https://api.fluxdrive.runonflux.io/api/v0/cat?arg=QmdMfrUsh8tvAj5MuWEFxYR7VjpmXvihxSZZZWoJYE3LMR” -X POST -u “1XcNTEsgVND4eb4bsVa2bjktnZZSruVct:95c36537910f4f3baf92e42a7dccb39b4c40e7b469bac78e7b1ad12b99b41184” — output testipfs.png

6. /api/v0/get

Command: curl “https://api.fluxdrive.runonflux.io/api/v0/get?arg=<HASH>&archive=true&compress=true&compression-level=9” -X POST -u “<ZELID>:<API_KEY_SECRET>”

Arguments:

  • arg [string] (Required): The hash of the IPFS object to be outputted.
  • archive [bool]: Output a TAR archive.
  • compress [bool]: Compress the output with GZIP compression. 
  • compression-level [int]: The level of compression (1–9). 

Example: curl “https://api.fluxdrive.runonflux.io/api/v0/get?arg=QmfZEkeQmfq8kDPW7dWXo4LXbcwHWEUTDBT8nK36FBkZA2&archive=true&compress=true&compression-level=9” -X POST -u “1XcNTEsgVND4eb4bsVa2bjktnZZSruVct:95c36537910f4f3baf92e42a7dccb39b4c40e7b469bac78e7b1ad12b99b41184”

Result:

Continued:

curl “https://api.fluxdrive.runonflux.io/api/v0/get?arg=QmdMfrUsh8tvAj5MuWEFxYR7VjpmXvihxSZZZWoJYE3LMR&archive=true&compress=true&compression-level=9” -X POST -u “1XcNTEsgVND4eb4bsVa2bjktnZZSruVct:8eea027c07a0fc92d6612933ebc511cd0fa905b5730f4adac36cc3da25a69242” — output testtest.png

7. /api/v0/rm 

Command: curl “https://api.fluxdrive.runonflux.io/api/v0/rm?arg=<HASH>” -X POST -u “<ZELID>:<API_KEY_SECRET>”

Argument:

  • arg [string] (Required): The hash of the IPFS object to be deleted.

Example: curl “https://api.fluxdrive.runonflux.io/api/v0/rm?arg=QmdMfrUsh8tvAj5MuWEFxYR7VjpmXvihxSZZZWoJYE3LMR” -X POST -u “1XcNTEsgVND4eb4bsVa2bjktnZZSruVct:95c36537910f4f3baf92e42a7dccb39b4c40e7b469bac78e7b1ad12b99b41184”

Result: {“status”:”success”,”data”:{“Pins”:[“QmdMfrUsh8tvAj5MuWEFxYR7VjpmXvihxSZZZWoJYE3LMR”]}}

8. /api/v0/thumb

Command: curl “https://api.fluxdrive.runonflux.io/api/v0/thumb?arg=<HASH>” -X POST -u “<ZELID>:<API_KEY_SECRET>”

Argument:

  • arg [string] (Required): The hash of the thumbnail IPFS object to be outputted.

Example: curl “https://api.fluxdrive.runonflux.io/api/v0/thumb?arg=QmdMfrUsh8tvAj5MuWEFxYR7VjpmXvihxSZZZWoJYE3LMR” -X POST -u “1XcNTEsgVND4eb4bsVa2bjktnZZSruVct:95c36537910f4f3baf92e42a7dccb39b4c40e7b469bac78e7b1ad12b99b41184”

Result:

Continued:

curl “https://api.fluxdrive.runonflux.io/api/v0/cat?arg=QmdMfrUsh8tvAj5MuWEFxYR7VjpmXvihxSZZZWoJYE3LMR” -X POST -u “1XcNTEsgVND4eb4bsVa2bjktnZZSruVct:895c36537910f4f3baf92e42a7dccb39b4c40e7b469bac78e7b1ad12b99b41184” — output testipfs.png


Want to know more?

Please visit the official Flux website hosted on the Flux decentralized network. Learn about the ecosystem and see what Flux has to offer. Check out the Flux products to see how you can leverage cost-effective decentralized infrastructure.

You can also stay updated by following the official Flux Twitter @RunOnFlux for news and announcements.

Finally, you can meet the Flux community on the Flux discord. On Discord, you can chat with the Flux team and discuss all things Flux; we’re always looking for new community members, developers, or potential partners.

Updated on June 26, 2024