Skip to content

Commit

Permalink
cli: add upload-bin
Browse files Browse the repository at this point in the history
This command is used for keeping container with blocks for
blockfetcher updated.

Close #3578

Signed-off-by: Ekaterina Pavlova <[email protected]>
  • Loading branch information
AliceInHunterland committed Oct 1, 2024
1 parent 9a38360 commit e5601ee
Show file tree
Hide file tree
Showing 2 changed files with 387 additions and 0 deletions.
35 changes: 35 additions & 0 deletions cli/util/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,34 @@ func NewCommands() []*cli.Command {
txctx.AwaitFlag,
}, options.RPC...)
txCancelFlags = append(txCancelFlags, options.Wallet...)
putFlags := append([]cli.Flag{
&cli.StringFlag{
Name: "fs-rpc-endpoint",
Aliases: []string{"fsr"},
Usage: "NeoFS storage node RPC address",
Required: true,
},
&cli.StringFlag{
Name: "container",
Aliases: []string{"cid"},
Usage: "NeoFS container ID to upload blocks to",
Required: true,
},
&cli.StringFlag{
Name: "block-attribute",
Usage: "Attribute key of the block object",
Required: true,
},
&cli.StringFlag{
Name: "index-attribute",
Usage: "Attribute key of the index file object",
Required: true,
},
&flags.AddressFlag{
Name: "address",
Usage: "Address to use for signing the uploading and searching transactions in NeoFS. If not specified, the first account from the wallet is used.",
},
}, options.RPC...)
return []*cli.Command{
{
Name: "util",
Expand Down Expand Up @@ -109,6 +137,13 @@ func NewCommands() []*cli.Command {
},
},
},
{
Name: "upload-bin",
Usage: "Fetch blocks from RPC node and upload it to the NeoFS container",
UsageText: "neo-go db upload-bin --fs-rpc-endpoint address --container cid --block-attribute string --index-attribute string --rpc-endpoint address --wallet wallet [--wallet-config config] [--address address]",
Action: uploadBin,
Flags: append(putFlags, options.Wallet...),
},
},
},
}
Expand Down
Loading

0 comments on commit e5601ee

Please sign in to comment.