Skip to content

Commit

Permalink
Merge branch 'sprint-1.18' of https://github.com/0chain/zboxcli into …
Browse files Browse the repository at this point in the history
…feat/session-key
  • Loading branch information
Hitenjain14 committed Nov 2, 2024
2 parents 508438e + 575d8ed commit f34e79c
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 29 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build-zbox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/distribute-zboxcli-apt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: ${{ env.SRC_DIR }}

Expand Down Expand Up @@ -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 }}

Expand Down Expand Up @@ -263,7 +263,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: ${{ env.SRC_DIR }}

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release-zboxcli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install deps
run: |
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down Expand Up @@ -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 }}

Expand Down Expand Up @@ -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 }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
go-version: '1.21'

- name: Clone Zbox
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Packages
run: |
Expand All @@ -40,7 +40,7 @@ jobs:
go-version: '1.21'

- name: Clone 0Box
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: check software
run: |
Expand All @@ -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
Expand Down
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: int(storageVersion),
}
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
29 changes: 28 additions & 1 deletion cmd/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions 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.0-RC8.0.20241028155703-82a3092d4a0c
github.com/0chain/gosdk v1.18.0-RC9
github.com/icza/bitio v1.1.0
github.com/olekukonko/tablewriter v0.0.5
github.com/spf13/cobra v1.6.0
Expand All @@ -15,7 +15,7 @@ require (
)

require (
github.com/0chain/common v1.18.1 // indirect
github.com/0chain/common v1.18.2 // indirect
github.com/Luzifer/go-openssl/v3 v3.1.0 // indirect
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/btcsuite/btcd v0.23.4 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/0chain/common v1.18.1 h1:QKXdEjK6SB3SqzDS/XbK74jy20d3tc+6PA8J8dFpuGw=
github.com/0chain/common v1.18.1/go.mod h1:Lapu2Tj7z5Sm4r+X141e7vsz4NDODTEypeElYAP3iSw=
github.com/0chain/common v1.18.2 h1:VGWfd3Xqio9xbmebPFnUbuk5QN0pK0xzvifaUggJF5g=
github.com/0chain/common v1.18.2/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.0-RC8.0.20241028155703-82a3092d4a0c h1:t3AOpN6pZYGO/AT8LC5ZNpdM8GQJrd9kOIKZuTa9Ddk=
github.com/0chain/gosdk v1.18.0-RC8.0.20241028155703-82a3092d4a0c/go.mod h1:fw3TUzF7HWNBuksA2WZzLcHlMz+A1XA9as5i3KUBqXg=
github.com/0chain/gosdk v1.18.0-RC9 h1:vGkdZnt7uS+1OmgS1Qv/6wFPlZqUoJvqWuenf0tMffs=
github.com/0chain/gosdk v1.18.0-RC9/go.mod h1:q/zFTOMHU2hFGjFzIxCOZLonsmrSzYVP3ExCHHOmL6w=
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

0 comments on commit f34e79c

Please sign in to comment.