API Usage

Some usage example of the Mantle Gateway:

Upload data to S3 Distributed Storage

This operation upload a file through Mantle SDS. When the shards of the file have been computed, the shards are then uploaded to several S3 buckets.

This is where we make sure that you data is always ready. If at least 3/4 of these S3 buckets are available the data will be totally accessible.

cURL example

curl -L -X POST https://develop.sds.mantle.technology/files -H 'x-api-key:{{API_KEY}}' -F 'file=@{{PATH_TO_FILE}}'

Response:

This is a Receipts from Mantle Gateway, with some abstractions.

{
  "id":"000000000000000000000000",
  "pointer":"string",
  "fileName":"string",
  "creationDate":"2022-12-12T14:09:22.406Z",
  "queryParams":{
    "app": "sds"
  }
}

Download a File

This operation correspond to posting data on a network, the reponse is a Receipt that contains the pointer to the data posted.

cURL example

curl -L -X GET 'http://develop.sds.mantle.technology/files/{fileId}' -H 'x-api-key:{{API_KEY}}'

Response:

The Mantle SDS will return a stream of byte that will be cryptographically identical as the one uploaded

Get Information on a File

This operation correspond to posting data on a network, the reponse is a Receipt that contains the pointer to the data posted.

cURL example

curl -L -X GET 'http://develop.sds.mantle.technology/files/info/{fileId}' -H 'x-api-key: {{API_KEY}}'

Response:
Mantle SDS will return the map of the file.

{
    "FileName": "string",
    "FileIds": [
        "string",
        "string",
        "string",
        "string",
        "string",
        "string",
        "string",
        "string"
    ],
    "Hash": "file_hash",
    "Size": Concat_Shards_size,
    "UnencryptedSize": file_size
}

The FileIds field is the name of the files in each of the S3 servers where the shards have been uploaded.

The hash of the file is computed using the BLAKE2B-256 hash function. Since the map in stored in a blockchain, the hash in the map can be trusted as a source of validation when downloading the file at a later time.

The Size field correspond to the total size of the shards added.

Get All Files

This operation correspond to posting data on a network, the reponse is a Receipt that contains the pointer to the data posted.

cURL example

curl -L -X GET 'http://develop.sds.mantle.technology/files/' -H 'x-api-key:{{API_KEY}}'

Response:
Mantle SDS will return the map of the file. Which is list of Receipts with again some abstractions

[
  {
  "id":"000000000000000000000000",
  "pointer":"string",
  "fileName":"string",
  "creationDate":"2022-12-12T14:09:22.406Z",
  "queryParams":{
    "app": "sds"
 		}
	}
]