Skip to content

Commit

Permalink
feat(cmd/blob): add fee and gasLimit flags (celestiaorg#2669)
Browse files Browse the repository at this point in the history
  • Loading branch information
vgonkivs committed Sep 8, 2023
1 parent 4f047c2 commit c650453
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions cmd/celestia/blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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{
Expand Down Expand Up @@ -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"`
Expand Down

0 comments on commit c650453

Please sign in to comment.