Storage S.C.

This page is under progressive development.

new_allocation_request

Create a new allocation and lock tokens in the client's write pool, given the following inputs:

type newAllocationRequest struct {
	Name                 string     `json:"name"`
	DataShards           int        `json:"data_shards"`
	ParityShards         int        `json:"parity_shards"`
	Size                 int64      `json:"size"`
	Owner                string     `json:"owner_id"`
	OwnerPublicKey       string     `json:"owner_public_key"`
	Blobbers             []string   `json:"blobbers"`
	BlobberAuthTickets   []string   `json:"blobber_auth_tickets"`
	ReadPriceRange       PriceRange `json:"read_price_range"`
	WritePriceRange      PriceRange `json:"write_price_range"`
	ThirdPartyExtendable bool       `json:"third_party_extendable"`
	FileOptionsChanged   bool       `json:"file_options_changed"`
	FileOptions          uint16     `json:"file_options"`
}

update_allocation_request

Updates the parameters of an existing allocation given the following parameters:​

type updateAllocationRequest struct {
	ID                      string `json:"id"`               // allocation id
	Name                    string `json:"name"`             // allocation name
	OwnerID                 string `json:"owner_id"`         // Owner of the allocation
	OwnerPublicKey          string `json:"owner_public_key"` // Owner Public Key of the allocation
	Size                    int64  `json:"size"`             // difference
	Extend                  bool   `json:"extend"`
	AddBlobberId            string `json:"add_blobber_id"`
	AddBlobberAuthTicket    string `json:"add_blobber_auth_ticket"`
	RemoveBlobberId         string `json:"remove_blobber_id"`
	SetThirdPartyExtendable bool   `json:"set_third_party_extendable"`
	FileOptionsChanged      bool   `json:"file_options_changed"`
	FileOptions             uint16 `json:"file_options"`
}

finalize_allocation

Finalize an expired allocation by allocation owner or one of blobbers of the allocation. It moves all tokens have to be moved between pools and empties write pool moving left tokens to the client. It requires the following input parameters:

AllocationID string `json:"allocation_id"`

cancel_allocation

Cancel the allocation before its expiry date. It moves all tokens have to be moved between pools and empties write pool moving left tokens to the client, it also deducts a cancelation fee mentioned in the Allocations page. It required the following input parameters:

AllocationID string `json:"allocation_id"`

Last updated