Skip to content
Merged
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
12 changes: 11 additions & 1 deletion cmd/newallocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,14 @@ var newallocationCmd = &cobra.Command{
}
}

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

var allocationID string
if len(owner) == 0 {
options := sdk.CreateAllocationOptions{
Expand All @@ -267,6 +275,7 @@ var newallocationCmd = &cobra.Command{
Force: force,
IsEnterprise: isEnterprise,
StorageVersion: int(storageVersion),
AuthRoundExpiry: authRoundExpiry,
}
allocationID, _, _, err = sdk.CreateAllocationWith(options)
if err != nil {
Expand All @@ -284,7 +293,7 @@ var newallocationCmd = &cobra.Command{
}

allocationID, _, _, err = sdk.CreateAllocationForOwner(owner, ownerPublicKey, *datashards, *parityshards,
*size, readPrice, writePrice, lock, preferred_blobbers, blobber_auth_tickets, thirdPartyExtendable, isEnterprise, force, &fileOptionParams)
*size, readPrice, writePrice, lock, preferred_blobbers, blobber_auth_tickets, thirdPartyExtendable, isEnterprise, force, &fileOptionParams, authRoundExpiry)
if err != nil {
log.Fatal("Error creating allocation: ", err)
}
Expand Down Expand Up @@ -366,6 +375,7 @@ func init() {
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")
newallocationCmd.Flags().Int64("auth_round_expiry", 0, "storaage version of allocation")
}

func storeAllocation(allocationID string) {
Expand Down
11 changes: 11 additions & 0 deletions cmd/updateallocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ var updateAllocationCmd = &cobra.Command{
fileOptionParams.ForbidRename.Value = forbidRename
}

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

if addBlobberId != "" {
allocationObj, err := sdk.GetAllocation(allocID)
if err != nil {
Expand All @@ -131,6 +139,7 @@ var updateAllocationCmd = &cobra.Command{
allocUnderRepair = true
if txnHash, err := allocationObj.UpdateWithRepair(
size,
authRoundExpiry,
extend,
lock,
addBlobberId,
Expand All @@ -154,6 +163,7 @@ var updateAllocationCmd = &cobra.Command{
} else {
txnHash, _, err := sdk.UpdateAllocation(
size,
authRoundExpiry,
extend,
allocID,
lock,
Expand Down Expand Up @@ -203,4 +213,5 @@ func init() {
updateAllocationCmd.Flags().Bool("forbid_copy", false, "(default false) specify if the users cannot copy object from this allocation")
updateAllocationCmd.Flags().Bool("forbid_rename", false, "(default false) specify if the users cannot rename objects in this allocation")

updateAllocationCmd.Flags().Int64("auth_round_expiry", 0, "auth round expiry in seconds")
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ toolchain go1.22.5

require (
github.com/0chain/errors v1.0.3
github.com/0chain/gosdk v1.18.20
github.com/0chain/gosdk v1.19.0-RC2.0.20250117164514-4933fa5602a5
github.com/icza/bitio v1.1.0
github.com/olekukonko/tablewriter v0.0.5
github.com/spf13/cobra v1.6.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ github.com/0chain/common v1.18.3 h1:42dYOv2KyMTSanuS67iDtfv+ErbSRqR8NJ3MG72MwaI=
github.com/0chain/common v1.18.3/go.mod h1:Lapu2Tj7z5Sm4r+X141e7vsz4NDODTEypeElYAP3iSw=
github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM=
github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc=
github.com/0chain/gosdk v1.18.20 h1:6j6ySKJj+gcA/IL401cUiEcJq+TlCNf24MupsJfo+Ao=
github.com/0chain/gosdk v1.18.20/go.mod h1:8unFy9Dx2YyPKMYPDGR3MFhUEymbAfQcRDm9bobVLGw=
github.com/0chain/gosdk v1.19.0-RC2.0.20250117164514-4933fa5602a5 h1:A8Ig1uLfMIaGtP4/m2X7/KZC9+thbsOJNBaMY/ZsycY=
github.com/0chain/gosdk v1.19.0-RC2.0.20250117164514-4933fa5602a5/go.mod h1:8unFy9Dx2YyPKMYPDGR3MFhUEymbAfQcRDm9bobVLGw=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ=
Expand Down
Loading