Skip to content

Commit

Permalink
Merge pull request #647 from 0chain/akhilesh/storageV2
Browse files Browse the repository at this point in the history
updated: added storage version and managing tags
  • Loading branch information
Jayashsatolia403 authored Oct 30, 2024
2 parents 6f376ed + a0309f4 commit cbc1629
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
11 changes: 11 additions & 0 deletions cmd/newallocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,14 @@ var newallocationCmd = &cobra.Command{
fileOptionParams.ForbidRename.Value = forbidRename
}

var storageVersion int64
if flags.Changed("storage_version") {
storageVersion, err = flags.GetInt64("storage_version")
if err != nil {
log.Fatal("invalid forbid_upload: ", err)
}
}

var allocationID string
if len(owner) == 0 {
options := sdk.CreateAllocationOptions{
Expand All @@ -258,6 +266,7 @@ var newallocationCmd = &cobra.Command{
ThirdPartyExtendable: thirdPartyExtendable,
Force: force,
IsEnterprise: isEnterprise,
StorageVersion: storageVersion,

Check failure on line 269 in cmd/newallocation.go

View workflow job for this annotation

GitHub Actions / unit-test

cannot use storageVersion (variable of type int64) as int value in struct literal
}
allocationID, _, _, err = sdk.CreateAllocationWith(options)
if err != nil {
Expand Down Expand Up @@ -355,6 +364,8 @@ func init() {
newallocationCmd.Flags().Bool("forbid_move", false, "(default false) specify if the users cannot move objects from this allocation")
newallocationCmd.Flags().Bool("forbid_copy", false, "(default false) specify if the users cannot copy object from this allocation")
newallocationCmd.Flags().Bool("forbid_rename", false, "(default false) specify if the users cannot rename objects in this allocation")

newallocationCmd.Flags().Int64("storage_version", 0, "storaage version of allocation")
}

func storeAllocation(allocationID string) {
Expand Down
11 changes: 10 additions & 1 deletion cmd/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,15 @@ var blobberUpdateCmd = &cobra.Command{
stakePoolSettingChanged = true
}

if flags.Changed("delegate_Wallet") {
var dw string
if dw, err = flags.GetString("delegate_wallet"); err != nil {
log.Fatal(err)
}
stakePoolSettings.DelegateWallet = &dw
stakePoolSettingChanged = true
}

if flags.Changed("service_charge") {
var sc float64
if sc, err = flags.GetFloat64("service_charge"); err != nil {
Expand Down Expand Up @@ -395,7 +404,7 @@ func init() {
buf := blobberUpdateCmd.Flags()
buf.String("blobber_id", "", "blobber ID, required")
buf.String("delegate_wallet", "", "delegate wallet, optional")
buf.Int("storage_version", 0, "update storage version, optional")
buf.Int64("storage_version", 0, "update storage version, optional")
buf.Int64("capacity", 0, "update blobber capacity bid, optional")
buf.Float64("read_price", 0.0, "update read_price, optional")
buf.Float64("write_price", 0.0, "update write_price, optional")
Expand Down

0 comments on commit cbc1629

Please sign in to comment.