From 97eb6c9f7eec63ff6a1720e89857d8509ffa6b27 Mon Sep 17 00:00:00 2001 From: Jayash Date: Tue, 8 Oct 2024 01:48:19 +0530 Subject: [PATCH 1/9] Update blobber new fields --- cmd/storage.go | 26 ++++++++++++++--- go.mod | 14 ++++++---- go.sum | 75 ++++++++++++++++++++++++++++++++++++++------------ 3 files changed, 88 insertions(+), 27 deletions(-) diff --git a/cmd/storage.go b/cmd/storage.go index 7da2cf4a..2186816c 100644 --- a/cmd/storage.go +++ b/cmd/storage.go @@ -187,6 +187,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") { @@ -290,10 +306,10 @@ var blobberUpdateCmd = &cobra.Command{ } var resetBlobberStatsCmd = &cobra.Command{ - Use: "reset-blobber-stats", - Short: "Reset blobber stats", - Long: `Reset blobber stats`, - Args: cobra.MinimumNArgs(0), + Use: "reset-blobber-stats", + Short: "Reset blobber stats", + Long: `Reset blobber stats`, + Args: cobra.MinimumNArgs(0), Hidden: true, Run: func(cmd *cobra.Command, args []string) { var ( @@ -378,6 +394,8 @@ 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("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") diff --git a/go.mod b/go.mod index 44fdd382..98d17e49 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21 require ( github.com/0chain/errors v1.0.3 - github.com/0chain/gosdk v1.17.3 + github.com/0chain/gosdk v1.17.10-0.20241007201651-616a0bd61e84 github.com/icza/bitio v1.1.0 github.com/olekukonko/tablewriter v0.0.5 github.com/spf13/cobra v1.6.0 @@ -14,7 +14,7 @@ require ( ) require ( - github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565 // indirect + github.com/0chain/common v1.13.1-0.20240926135437-61b88d39bbbd // 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 @@ -25,6 +25,7 @@ require ( github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect github.com/ethereum/go-ethereum v1.10.26 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-stack/stack v1.8.1 // indirect github.com/google/uuid v1.3.0 // indirect @@ -36,7 +37,7 @@ require ( github.com/hashicorp/golang-lru/v2 v2.0.1 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/herumi/bls-go-binary v1.31.0 // indirect - github.com/hitenjain14/fasthttp v0.0.0-20240527123209-06019e79bff9 // indirect + github.com/hitenjain14/fasthttp v0.0.0-20240916135632-f9303a91736c // indirect github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/klauspost/compress v1.17.0 // indirect github.com/klauspost/cpuid/v2 v2.2.4 // indirect @@ -65,15 +66,16 @@ require ( github.com/tyler-smith/go-bip39 v1.1.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasthttp v1.51.0 // indirect + github.com/x448/float16 v0.8.4 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect go.dedis.ch/fixbuf v1.0.3 // indirect go.dedis.ch/kyber/v3 v3.1.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.9.0 // indirect go.uber.org/zap v1.24.0 // indirect - golang.org/x/crypto v0.17.0 // indirect - golang.org/x/sync v0.5.0 // indirect - golang.org/x/sys v0.15.0 // indirect + golang.org/x/crypto v0.21.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect diff --git a/go.sum b/go.sum index 8d53024a..45db5a1f 100644 --- a/go.sum +++ b/go.sum @@ -36,14 +36,16 @@ 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 v0.0.6-0.20230127095721-8df4d1d72565 h1:z+DtCR8mBsjPnEsT2XtRu4X7GfBiMnz9dYvWYs9V0B4= -github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565/go.mod h1:UyDC8Qyl5z9lGkCnf9RHJPMektnFX8XtCJZHXCCVj8E= +github.com/0chain/common v1.13.1-0.20240926135437-61b88d39bbbd h1:PDnzyJJA4rF2LBW+0OQJ5y9vIwsPYYjbbFwImvgiDdY= +github.com/0chain/common v1.13.1-0.20240926135437-61b88d39bbbd/go.mod h1:vHK9Q0/nz28PxmKsLSMLzEs5iK6QVgl1LxdDQdR7y6s= 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.17.3 h1:nL6x1saSwTku1UFDYoX/uKJO57VQTgowp6id+7UHb7g= -github.com/0chain/gosdk v1.17.3/go.mod h1:y7Ucdmv40VltqulZnncMNjNQ4piX5Dta5ujNmPmXnxg= +github.com/0chain/gosdk v1.17.10-0.20241007201651-616a0bd61e84 h1:0FGS+o8QCEsibCA2bqdjAOSZTiLnEV5LkvyQxKAEomQ= +github.com/0chain/gosdk v1.17.10-0.20241007201651-616a0bd61e84/go.mod h1:mr7LcQicFFrSzFujItjkLP1LvXz9S0j73i7KDEpMXLo= 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= +github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/Luzifer/go-openssl/v3 v3.1.0 h1:QqKqo6kYXGGUsvtUoCpRZm8lHw+jDfhbzr36gVj+/gw= github.com/Luzifer/go-openssl/v3 v3.1.0/go.mod h1:liy3FXuuS8hfDlYh1T+l78AwQ/NjZflJz0NDvjKhwDs= github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o= @@ -53,6 +55,8 @@ github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/ github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M= github.com/btcsuite/btcd v0.23.0/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= @@ -90,6 +94,18 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -124,8 +140,12 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= +github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= +github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -133,6 +153,8 @@ github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -160,6 +182,8 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -219,8 +243,8 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/herumi/bls-go-binary v1.31.0 h1:L1goQ2tMtGgpXCg5AwHAdJQpLs/pfnWWEc3Wog6OhmI= github.com/herumi/bls-go-binary v1.31.0/go.mod h1:O4Vp1AfR4raRGwFeQpr9X/PQtncEicMoOe6BQt1oX0Y= -github.com/hitenjain14/fasthttp v0.0.0-20240527123209-06019e79bff9 h1:Z6Mu2JCsW2hbqx91L0HNPRPQ10RyAFvPocQHlrRo1Jk= -github.com/hitenjain14/fasthttp v0.0.0-20240527123209-06019e79bff9/go.mod h1:RZMcXy7u4S+E97IXYTe7WHZ3+mCYOh4vys8PkIGZeXk= +github.com/hitenjain14/fasthttp v0.0.0-20240916135632-f9303a91736c h1:lDSIbcLu5TdT+uwb4wPzZgo1pQvKjP/tArL5QKjDJdI= +github.com/hitenjain14/fasthttp v0.0.0-20240916135632-f9303a91736c/go.mod h1:RZMcXy7u4S+E97IXYTe7WHZ3+mCYOh4vys8PkIGZeXk= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c h1:DZfsyhDK1hnSS5lH8l+JggqzEleHteTYfutAiVlSUM8= @@ -274,6 +298,8 @@ github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -304,7 +330,15 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v1.12.0 h1:C+UIj/QWtmqY13Arb8kwMt5j34/0Z2iKamrJ+ryC0Gg= +github.com/prometheus/client_golang v1.12.0/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a h1:CmF68hwI0XsOQ5UwlBopMi2Ow4Pbg32akc4KIVCOm+Y= +github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/remeh/sizedwaitgroup v1.0.0 h1:VNGGFwNo/R5+MJBf6yrsr110p0m4/OX4S3DCy7Kyl5E= @@ -315,8 +349,8 @@ github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUc github.com/rjeczalik/notify v0.9.1 h1:CLCKso/QK1snAlnhNR/CNvNiFU2saUtjV0bx3EwNeCE= github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= @@ -341,8 +375,9 @@ github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobt github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -351,8 +386,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= @@ -371,6 +406,8 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.51.0 h1:8b30A5JlZ6C7AS81RsWjYMQmrZG6feChmgAolCl1SqA= github.com/valyala/fasthttp v1.51.0/go.mod h1:oI2XroL+lI7vdXyYoQk03bXBThfFl2cVdIA3Xl7cH8g= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -415,8 +452,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -427,6 +464,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME= +golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -504,8 +543,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190124100055-b90733256f2e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -551,8 +590,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -708,6 +747,8 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From f997e82cca62bf79ec9186c0a4c60e523bc26f8d Mon Sep 17 00:00:00 2001 From: Akhilesh Mahajan Date: Thu, 10 Oct 2024 23:36:47 +0530 Subject: [PATCH 2/9] updated: added storage version and managing tags --- cmd/newallocation.go | 22 ++++++++++++++++++++++ cmd/storage.go | 29 +++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/cmd/newallocation.go b/cmd/newallocation.go index 460fdadd..3e1faa00 100755 --- a/cmd/newallocation.go +++ b/cmd/newallocation.go @@ -237,6 +237,22 @@ 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 managingWallet string + if flags.Changed("managing_wallet") { + managingWallet, err = flags.GetString("managing_wallet") + if err != nil { + log.Fatal("invalid managing wallet: ", err) + } + } + var allocationID string if len(owner) == 0 { options := sdk.CreateAllocationOptions{ @@ -258,6 +274,8 @@ var newallocationCmd = &cobra.Command{ ThirdPartyExtendable: thirdPartyExtendable, Force: force, IsEnterprise: isEnterprise, + StorageVersion: storageVersion, + ManagingWallet: managingWallet, } allocationID, _, _, err = sdk.CreateAllocationWith(options) if err != nil { @@ -355,6 +373,10 @@ 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().String("storage_version", "", "storage version of the blobber") + newallocationCmd.Flags().String("managing_wallet", "", "managing wallet of the blobber") + } func storeAllocation(allocationID string) { diff --git a/cmd/storage.go b/cmd/storage.go index 7da2cf4a..c7db7d8f 100644 --- a/cmd/storage.go +++ b/cmd/storage.go @@ -234,6 +234,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 { @@ -274,6 +283,22 @@ var blobberUpdateCmd = &cobra.Command{ updateBlobber.IsRestricted = &ia } + var storageVersion int64 + if flags.Changed("storage_version"){ + if storageVersion, err = flags.GetInt64("storage_version"); err != nil{ + log.Fatal(err) + } + updateBlobber.StorageVersion = &storageVersion + } + + var managingWallet string + if flags.Changed("managing_wallet"){ + if managingWallet, err = flags.GetString("managing_wallet"); err != nil{ + log.Fatal(err) + } + updateBlobber.ManagingWallet = &managingWallet + } + if termsChanged { updateBlobber.Terms = terms } @@ -389,6 +414,10 @@ func init() { buf.Bool("not_available", true, "(default false) set blobber's availability for new allocations") buf.Bool("is_restricted", true, "(default false) set is_restricted") buf.String("url", "", "update the url of the blobber, optional") + buf.Int64("storage_version", 2, "storage version of the blobber, optional") + buf.String("delegate_wallet", "", "delegate wallet of the blobber, optional") + buf.String("managing_wallet", "", "managing wallet of the blobber, optional") + blobberUpdateCmd.MarkFlagRequired("blobber_id") resetBlobberStatsCmd.Flags().String("blobber_id", "", "blobber_id is required") From f02957a08145b1b6c31ad6a187bdc3461acb32ec Mon Sep 17 00:00:00 2001 From: Akhilesh Mahajan Date: Fri, 11 Oct 2024 00:53:46 +0530 Subject: [PATCH 3/9] updated: resolved comments --- cmd/newallocation.go | 11 ----------- cmd/storage.go | 8 -------- 2 files changed, 19 deletions(-) diff --git a/cmd/newallocation.go b/cmd/newallocation.go index 3e1faa00..cdcf119c 100755 --- a/cmd/newallocation.go +++ b/cmd/newallocation.go @@ -245,14 +245,6 @@ var newallocationCmd = &cobra.Command{ } } - var managingWallet string - if flags.Changed("managing_wallet") { - managingWallet, err = flags.GetString("managing_wallet") - if err != nil { - log.Fatal("invalid managing wallet: ", err) - } - } - var allocationID string if len(owner) == 0 { options := sdk.CreateAllocationOptions{ @@ -275,7 +267,6 @@ var newallocationCmd = &cobra.Command{ Force: force, IsEnterprise: isEnterprise, StorageVersion: storageVersion, - ManagingWallet: managingWallet, } allocationID, _, _, err = sdk.CreateAllocationWith(options) if err != nil { @@ -375,8 +366,6 @@ func init() { newallocationCmd.Flags().Bool("forbid_rename", false, "(default false) specify if the users cannot rename objects in this allocation") newallocationCmd.Flags().String("storage_version", "", "storage version of the blobber") - newallocationCmd.Flags().String("managing_wallet", "", "managing wallet of the blobber") - } func storeAllocation(allocationID string) { diff --git a/cmd/storage.go b/cmd/storage.go index c7db7d8f..595618c4 100644 --- a/cmd/storage.go +++ b/cmd/storage.go @@ -291,13 +291,6 @@ var blobberUpdateCmd = &cobra.Command{ updateBlobber.StorageVersion = &storageVersion } - var managingWallet string - if flags.Changed("managing_wallet"){ - if managingWallet, err = flags.GetString("managing_wallet"); err != nil{ - log.Fatal(err) - } - updateBlobber.ManagingWallet = &managingWallet - } if termsChanged { updateBlobber.Terms = terms @@ -416,7 +409,6 @@ func init() { buf.String("url", "", "update the url of the blobber, optional") buf.Int64("storage_version", 2, "storage version of the blobber, optional") buf.String("delegate_wallet", "", "delegate wallet of the blobber, optional") - buf.String("managing_wallet", "", "managing wallet of the blobber, optional") blobberUpdateCmd.MarkFlagRequired("blobber_id") From 518c6734b0df6bf2308ef30d3437c26c5227e6f7 Mon Sep 17 00:00:00 2001 From: Akhilesh Mahajan Date: Fri, 11 Oct 2024 00:56:38 +0530 Subject: [PATCH 4/9] updated: resolved coments --- cmd/storage.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/cmd/storage.go b/cmd/storage.go index b6d5dc84..75eec50b 100644 --- a/cmd/storage.go +++ b/cmd/storage.go @@ -299,15 +299,6 @@ var blobberUpdateCmd = &cobra.Command{ updateBlobber.IsRestricted = &ia } - var storageVersion int64 - if flags.Changed("storage_version"){ - if storageVersion, err = flags.GetInt64("storage_version"); err != nil{ - log.Fatal(err) - } - updateBlobber.StorageVersion = &storageVersion - } - - if termsChanged { updateBlobber.Terms = terms } From 61d7976ff7f6b8039b7d7bde1415b870e243b42b Mon Sep 17 00:00:00 2001 From: Akhilesh Mahajan Date: Fri, 11 Oct 2024 09:37:24 +0530 Subject: [PATCH 5/9] updated: removed duplicated cmds --- cmd/storage.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cmd/storage.go b/cmd/storage.go index 75eec50b..6049d5db 100644 --- a/cmd/storage.go +++ b/cmd/storage.go @@ -404,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") @@ -416,9 +416,6 @@ func init() { buf.Bool("not_available", true, "(default false) set blobber's availability for new allocations") buf.Bool("is_restricted", true, "(default false) set is_restricted") buf.String("url", "", "update the url of the blobber, optional") - buf.Int64("storage_version", 2, "storage version of the blobber, optional") - buf.String("delegate_wallet", "", "delegate wallet of the blobber, optional") - blobberUpdateCmd.MarkFlagRequired("blobber_id") resetBlobberStatsCmd.Flags().String("blobber_id", "", "blobber_id is required") From d90ab6b54a3ac26092321f1a80501542b38603e2 Mon Sep 17 00:00:00 2001 From: Akhilesh Mahajan Date: Fri, 11 Oct 2024 09:42:05 +0530 Subject: [PATCH 6/9] updated: type changed for storage version --- cmd/newallocation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/newallocation.go b/cmd/newallocation.go index cdcf119c..ba0a5969 100755 --- a/cmd/newallocation.go +++ b/cmd/newallocation.go @@ -365,7 +365,7 @@ func init() { 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().String("storage_version", "", "storage version of the blobber") + newallocationCmd.Flags().Int64("storage_version", 0, "storaage version of allocation") } func storeAllocation(allocationID string) { From 6f376edbafcc321262e80ff063cf4ae6388d5025 Mon Sep 17 00:00:00 2001 From: Jayash Satolia Date: Wed, 30 Oct 2024 15:14:31 +0530 Subject: [PATCH 7/9] Update zbox build --- .github/workflows/build-zbox.yaml | 6 +++--- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/distribute-zboxcli-apt.yml | 6 +++--- .github/workflows/release-zboxcli.yml | 6 +++--- .github/workflows/release.yml | 6 +++--- .github/workflows/tests.yml | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-zbox.yaml b/.github/workflows/build-zbox.yaml index 794bf13c..b6019c4e 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: | @@ -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 @@ -115,7 +115,7 @@ jobs: go-version: '1.21' - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install run: make install 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..b60d1a68 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: | @@ -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 @@ -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 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..f68076d3 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: | From 33295fb6f7bcf12d0cff302799b80e3bfa8b912f Mon Sep 17 00:00:00 2001 From: Jayash Satolia Date: Wed, 30 Oct 2024 15:16:00 +0530 Subject: [PATCH 8/9] Update zbox build --- .github/workflows/build-zbox.yaml | 6 +++--- .github/workflows/release-zboxcli.yml | 6 +++--- .github/workflows/tests.yml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-zbox.yaml b/.github/workflows/build-zbox.yaml index b6019c4e..3e0e792c 100644 --- a/.github/workflows/build-zbox.yaml +++ b/.github/workflows/build-zbox.yaml @@ -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 @@ -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 @@ -121,7 +121,7 @@ jobs: 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/release-zboxcli.yml b/.github/workflows/release-zboxcli.yml index b60d1a68..e5badc50 100644 --- a/.github/workflows/release-zboxcli.yml +++ b/.github/workflows/release-zboxcli.yml @@ -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 @@ -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 @@ -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/tests.yml b/.github/workflows/tests.yml index f68076d3..71e06f68 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 From 34313986bc3cde8452d6f8d53bc5c0207af18b33 Mon Sep 17 00:00:00 2001 From: Jayash Satolia Date: Wed, 30 Oct 2024 15:18:51 +0530 Subject: [PATCH 9/9] Fix build --- cmd/newallocation.go | 2 +- cmd/storage.go | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cmd/newallocation.go b/cmd/newallocation.go index ba0a5969..8bcdf2a5 100755 --- a/cmd/newallocation.go +++ b/cmd/newallocation.go @@ -266,7 +266,7 @@ var newallocationCmd = &cobra.Command{ ThirdPartyExtendable: thirdPartyExtendable, Force: force, IsEnterprise: isEnterprise, - StorageVersion: storageVersion, + StorageVersion: int(storageVersion), } allocationID, _, _, err = sdk.CreateAllocationWith(options) if err != nil { diff --git a/cmd/storage.go b/cmd/storage.go index 9efedbfc..4eafcf31 100644 --- a/cmd/storage.go +++ b/cmd/storage.go @@ -2,6 +2,7 @@ package cmd import ( "fmt" + "github.com/0chain/gosdk/core/transaction" "log" "time" @@ -23,7 +24,7 @@ var scConfig = &cobra.Command{ Run: func(cmd *cobra.Command, args []string) { doJSON, _ := cmd.Flags().GetBool("json") - var conf, err = sdk.GetStorageSCConfig() + var conf, err = transaction.GetConfig("storage_sc_config") if err != nil { log.Fatalf("Failed to get storage SC configurations: %v", err) } @@ -315,10 +316,10 @@ var blobberUpdateCmd = &cobra.Command{ } var resetBlobberStatsCmd = &cobra.Command{ - Use: "reset-blobber-stats", - Short: "Reset blobber stats", - Long: `Reset blobber stats`, - Args: cobra.MinimumNArgs(0), + Use: "reset-blobber-stats", + Short: "Reset blobber stats", + Long: `Reset blobber stats`, + Args: cobra.MinimumNArgs(0), Hidden: true, Run: func(cmd *cobra.Command, args []string) { var (