From 29e2d712f4a207f0b965fb32cc18678c96456c1f Mon Sep 17 00:00:00 2001 From: Ekaterina Pavlova Date: Sat, 2 Nov 2024 21:56:06 +0300 Subject: [PATCH] cli: add flag `max-retries` for `upload-bin` Signed-off-by: Ekaterina Pavlova --- cli/util/convert.go | 13 +++++++++++- cli/util/upload_bin.go | 41 +++++++++++++++++++------------------- docs/neofs-blockstorage.md | 3 ++- 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/cli/util/convert.go b/cli/util/convert.go index 586513305d..5c5a7e7079 100644 --- a/cli/util/convert.go +++ b/cli/util/convert.go @@ -90,6 +90,17 @@ func NewCommands() []*cli.Command { Name: "skip-blocks-uploading", Usage: "Skip blocks uploading and upload only index files", }, + &cli.UintFlag{ + Name: "retries", + Usage: "Maximum number of Neo/NeoFS node request retries", + Value: 5, + Action: func(context *cli.Context, u uint) error { + if u < 1 { + return cli.Exit("retries should be greater than 0", 1) + } + return nil + }, + }, }, options.RPC...) uploadBinFlags = append(uploadBinFlags, options.Wallet...) return []*cli.Command{ @@ -172,7 +183,7 @@ func NewCommands() []*cli.Command { { Name: "upload-bin", Usage: "Fetch blocks from RPC node and upload them to the NeoFS container", - UsageText: "neo-go util upload-bin --fs-rpc-endpoint [,[...]] --container --block-attribute block --index-attribute index --rpc-endpoint [--timeout