Allocations
Contract between the client and Züs System about storing their data
Introduction
Allocation Structure
type StorageAllocation struct {
// ID is unique allocation ID that is equal to hash of transaction with
// which the allocation has created.
ID string `json:"id"`
// Tx keeps hash with which the allocation has created or updated.
Tx string `json:"tx"`
DataShards int `json:"data_shards"`
ParityShards int `json:"parity_shards"`
Size int64 `json:"size"`
Expiration common.Timestamp `json:"expiration_date"`
Owner string `json:"owner_id"`
OwnerPublicKey string `json:"owner_public_key"`
Stats *StorageAllocationStats `json:"stats"`
DiverseBlobbers bool `json:"diverse_blobbers"`
PreferredBlobbers []string `json:"preferred_blobbers"`
// Blobbers not to be used anywhere except /allocation and /allocations table
// if Blobbers are getting used in any smart-contract, we should avoid.
BlobberAllocs []*BlobberAllocation `json:"blobber_details"`
BlobberAllocsMap map[string]*BlobberAllocation `json:"-" msg:"-"`
// Flag to determine if anyone can extend this allocation, meaning increase its size
ThirdPartyExtendable bool `json:"third_party_extendable"`
// FileOptions to define file restrictions on an allocation for third-parties
// default 00000000 for all crud operations suggesting only owner has the below listed abilities.
// enabling option/s allows any third party to perform certain ops
// 00000001 - 1 - upload
// 00000010 - 2 - delete
// 00000100 - 4 - update
// 00001000 - 8 - move
// 00010000 - 16 - copy
// 00100000 - 32 - rename
FileOptions uint16 `json:"file_options"`
WritePool currency.Coin `json:"write_pool"`
// Requested ranges.
ReadPriceRange PriceRange `json:"read_price_range"`
WritePriceRange PriceRange `json:"write_price_range"`
// StartTime is time when the allocation has been created. We will
// use it to check blobber's MaxOfferTime extending the allocation.
StartTime common.Timestamp `json:"start_time"`
// Finalized is true where allocation has been finalized.
Finalized bool `json:"finalized,omitempty"`
// Canceled set to true where allocation finalized by cancel_allocation
// transaction.
Canceled bool `json:"canceled,omitempty"`
// MovedToChallenge is number of tokens moved to challenge pool.
MovedToChallenge currency.Coin `json:"moved_to_challenge,omitempty"`
// MovedBack is number of tokens moved from challenge pool to
// related write pool (the Back) if a data has deleted.
MovedBack currency.Coin `json:"moved_back,omitempty"`
// MovedToValidators is total number of tokens moved to validators
// of the allocation.
MovedToValidators currency.Coin `json:"moved_to_validators,omitempty"`
// TimeUnit configured in Storage SC when the allocation created. It can't
// be changed for this allocation anymore. Even using expire allocation.
TimeUnit time.Duration `json:"time_unit"`
}
Allocation flow in Züs System

Allocation tokenomics
Allocation cost
Cancelation Charge
Operations on allocations
Creating an allocation
Listing user's allocations
Updating an allocation
Finalizing an allocation
Canceling an allocation
Transfer an allocation to another account
Last updated