From c6504537de96c5e52c65391b7d9e7a65a9bef26f Mon Sep 17 00:00:00 2001 From: Viacheslav Date: Fri, 8 Sep 2023 16:17:59 +0300 Subject: [PATCH] feat(cmd/blob): add fee and gasLimit flags (#2669) --- cmd/celestia/blob.go | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/cmd/celestia/blob.go b/cmd/celestia/blob.go index 0d09268257..6d397525f5 100644 --- a/cmd/celestia/blob.go +++ b/cmd/celestia/blob.go @@ -14,7 +14,12 @@ import ( "github.com/celestiaorg/celestia-node/share" ) -var base64Flag bool +var ( + base64Flag bool + + fee int64 + gasLimit uint64 +) func init() { blobCmd.AddCommand(getCmd, getAllCmd, submitCmd, getProofCmd) @@ -31,6 +36,20 @@ func init() { false, "printed blob's data as a base64 string", ) + + submitCmd.PersistentFlags().Int64Var( + &fee, + "fee", + -1, + "specifies fee for blob submission", + ) + + submitCmd.PersistentFlags().Uint64Var( + &gasLimit, + "gas.limit", + 0, + "specifies max gas for the blob submission", + ) } var blobCmd = &cobra.Command{ @@ -118,7 +137,11 @@ var submitCmd = &cobra.Command{ return fmt.Errorf("error creating a blob:%v", err) } - height, err := client.Blob.Submit(cmd.Context(), []*blob.Blob{parsedBlob}, nil) + height, err := client.Blob.Submit( + cmd.Context(), + []*blob.Blob{parsedBlob}, + &blob.SubmitOptions{Fee: fee, GasLimit: gasLimit}, + ) response := struct { Height uint64 `json:"height"`