Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ Available Commands:
download download file from blobbers
feed download segment files from remote live feed, and upload
get-diff Get difference of local and allocation root
get-download-cost Get downloading cost
get-mpt Directly view blockchain data
get-upload-cost Get uploading cost
getallocation Gets the allocation info
Expand Down Expand Up @@ -1995,33 +1994,6 @@ An expired write pool, associated with an allocation, can be locked until alloca
./zbox wp-unlock
```

#### Download cost

`get-download-cost` determines the cost for downloading the remote file from dStorage. The client must be an
owner, collaborator, or using an auth ticket to determine the download cost of the file.

| Parameter | Required | Description | default | Valid values |
| ---------- | -------- | ----------------------------------------- | ------- | ------------ |
| allocation | yes | allocation id | | string |
| authticket | no | auth ticket to use if not the owner | | string |
| lookuphash | no | hash of remote file, use with auth ticket | | string |
| remotepath | no | file of which to get stats, use if owner | | string |

<details>
<summary>get-download-cost</summary>

![image](https://user-images.githubusercontent.com/6240686/124497750-41ef0500-ddb3-11eb-99ea-115a4e234eda.png)

</details>
Command:
```
./zbox get-download-cost --allocation <allocation_id> --remotepath /path/file.ext
```
Response:
```
0.0000107434 tokens for 10 64KB blocks (24 B) of <remote_path_of_file> .
```

#### Upload cost

`get-upload-cost` determines the cost for uploading a local file on dStorage.
Expand Down
2 changes: 0 additions & 2 deletions cmd/getallocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (

"github.com/0chain/gosdk/core/common"
"github.com/0chain/gosdk/zboxcore/blockchain"
"github.com/0chain/gosdk/zboxcore/fileref"
"github.com/0chain/gosdk/zboxcore/logger"
"github.com/0chain/gosdk/zboxcore/sdk"
"github.com/0chain/zboxcli/util"
Expand Down Expand Up @@ -112,7 +111,6 @@ var getallocationCmd = &cobra.Command{

fmt.Println(" price:")
fmt.Println(" time_unit: ", alloc.TimeUnit)
fmt.Println(" read_price: ", calculateDownloadCost(alloc, GB, (GB+fileref.CHUNK_SIZE-1)/fileref.CHUNK_SIZE), "/ GB (by 64KB)")
fmt.Println(" write_price:", uploadCostFor1GB(alloc), fmt.Sprintf("/ GB / %s", alloc.TimeUnit))
},
}
Expand Down