Renter Storage Upload

API Endpoint

http://localhost:5001/api/v1/storage/upload

Input Parameters

Argument

Input Values

Type

Description

Required?

arg

Hash of file uploaded to BTFS node.

string

Add hash of file to upload.

Y

leaf-hash

"True" or "False"

boolean

Flag to specify given hash(es) is leaf hash(es). Default: "false".

N

price

Price in μBTT

int64

Max price Per GB per day of storage in μBTT.

N

replication-factor

int

Replication factor for the file with erasure coding built-in. Default: "3".

N

host-select-mode

score

string

Based on mode to select the host and upload automatically. Default: "score".

N

host-selection

string

Use only these selected hosts in order on 'custom' mode. Use ',' as delimiter.

N

host-search-local

bool

Enable host search under all domains 0.0.0.0 (useful for local test).

N

storage-length

Number of days

int

Store file for certain length in days. Default: "30".

N

Usage

// Storage upload a file with BTFS hash QmdBX8seLx4TGHwr8Tu9L2QSByaJ9bbFUpxFvKAYyxCf7b, price of 750000 μBTT, and contract length 35 days:

curl -X POST "http://localhost:5001/api/v1/storage/upload?arg=QmdBX8seLx4TGHwr8Tu9L2QSByaJ9bbFUpxFvKAYyxCf7b&price=750000&storage-length=35"

Response

// Outputs Session ID

{"ID":"4a99a8a0-21a1-4e26-861f-9d725eb06012"}