diff --git a/.github/workflows/build-zbox.yaml b/.github/workflows/build-zbox.yaml index 794bf13c..3e0e792c 100644 --- a/.github/workflows/build-zbox.yaml +++ b/.github/workflows/build-zbox.yaml @@ -21,7 +21,7 @@ jobs: sudo apt -y install build-essential nghttp2 libnghttp2-dev libssl-dev containerd docker.io - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup gopath and gocache run: | @@ -40,7 +40,7 @@ jobs: make install - name: 'Upload Artifact' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: zbox-linux path: zbox @@ -79,7 +79,7 @@ jobs: go env -w "CC=/mingw64/bin/clang.exe" - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install run: make install @@ -93,7 +93,7 @@ jobs: zip zbox-windows.zip zbox.exe libgcc_s_seh-1.dll libstdc++-6.dll libwinpthread-1.dll - name: 'Upload Artifact' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: zbox-windows.zip path: zbox-windows.zip @@ -115,13 +115,13 @@ jobs: go-version: '1.21' - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install run: make install - name: 'Upload Artifact' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: zbox-macos path: zbox diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index c50188e1..eef52f5e 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -34,7 +34,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/distribute-zboxcli-apt.yml b/.github/workflows/distribute-zboxcli-apt.yml index eb5a170b..6cc9bc9d 100644 --- a/.github/workflows/distribute-zboxcli-apt.yml +++ b/.github/workflows/distribute-zboxcli-apt.yml @@ -49,7 +49,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: ${{ env.SRC_DIR }} @@ -140,7 +140,7 @@ jobs: DEB_DIR: ${{ github.workspace }}/deb-files steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: ${{ env.SRC_DIR }} @@ -263,7 +263,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: ${{ env.SRC_DIR }} diff --git a/.github/workflows/release-zboxcli.yml b/.github/workflows/release-zboxcli.yml index 4f206580..e5badc50 100644 --- a/.github/workflows/release-zboxcli.yml +++ b/.github/workflows/release-zboxcli.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install deps run: | @@ -87,7 +87,7 @@ jobs: tag_schema: semantic - name: 'Upload Artifact' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: zbox-linux path: zbox @@ -126,7 +126,7 @@ jobs: go env -w "CC=/mingw64/bin/clang.exe" - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install run: make install @@ -140,7 +140,7 @@ jobs: zip zbox-windows.zip zbox.exe libgcc_s_seh-1.dll libstdc++-6.dll libwinpthread-1.dll - name: 'Upload Artifact' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: zbox-windows.zip path: zbox-windows.zip @@ -162,7 +162,7 @@ jobs: go-version: '1.20' # The Go version to download (if necessary) and use. - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install run: make install @@ -171,7 +171,7 @@ jobs: run: tar -czvf zbox-macos.tar.gz ./zbox - name: 'Upload Artifact' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: zbox-macos path: zbox diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2a3a3c37..38dd201a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,7 +51,7 @@ jobs: OUTPUT_DIR: ${{ github.workspace }}/output steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: ${{ env.SRC_DIR }} @@ -154,7 +154,7 @@ jobs: OUTPUT_DIR: ${{ github.workspace }}/output steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: ${{ env.SRC_DIR }} @@ -230,7 +230,7 @@ jobs: OUTPUT_DIR: ${{ github.workspace }}\output steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: ${{ env.SRC_DIR }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 87c1865a..71e06f68 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,7 +19,7 @@ jobs: go-version: '1.21' - name: Clone Zbox - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Packages run: | @@ -40,7 +40,7 @@ jobs: go-version: '1.21' - name: Clone 0Box - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: check software run: | @@ -52,7 +52,7 @@ jobs: run: make install - name: 'Upload Artifact' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: zbox-linux path: zbox diff --git a/cmd/newallocation.go b/cmd/newallocation.go index 460fdadd..8bcdf2a5 100755 --- a/cmd/newallocation.go +++ b/cmd/newallocation.go @@ -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{ @@ -258,6 +266,7 @@ var newallocationCmd = &cobra.Command{ ThirdPartyExtendable: thirdPartyExtendable, Force: force, IsEnterprise: isEnterprise, + StorageVersion: int(storageVersion), } allocationID, _, _, err = sdk.CreateAllocationWith(options) if err != nil { @@ -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) { diff --git a/cmd/storage.go b/cmd/storage.go index bc6d41a0..4eafcf31 100644 --- a/cmd/storage.go +++ b/cmd/storage.go @@ -188,6 +188,22 @@ var blobberUpdateCmd = &cobra.Command{ updateBlobber.Capacity = &changedCapacity } + var delegateWallet string + if flags.Changed("delegate_wallet") { + if delegateWallet, err = flags.GetString("delegate_wallet"); err != nil { + log.Fatal(err) + } + updateBlobber.DelegateWallet = &delegateWallet + } + + var storageVersion int + if flags.Changed("storage_version") { + if storageVersion, err = flags.GetInt("storage_version"); err != nil { + log.Fatal(err) + } + updateBlobber.StorageVersion = &storageVersion + } + terms := &sdk.UpdateTerms{} var termsChanged bool if flags.Changed("read_price") { @@ -235,6 +251,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 { @@ -379,7 +404,9 @@ func init() { buf := blobberUpdateCmd.Flags() buf.String("blobber_id", "", "blobber ID, required") - buf.Int64("capacity", 0, " update blobber capacity bid, optional") + buf.String("delegate_wallet", "", "delegate wallet, 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") buf.Duration("max_offer_duration", 0*time.Second, "update max_offer_duration, optional")