From 125f155cf8744dca2580a968e0e8b9d19e904bd1 Mon Sep 17 00:00:00 2001 From: Arcyx <66889150+thearcyx@users.noreply.github.com> Date: Thu, 5 Jun 2025 14:20:54 +0300 Subject: [PATCH] Clarify TxConfig initialization in golang-client-tutorial.md Improved the explanation of TxConfig creation using `NewTxConfig` with default gas price settings. --- tutorials/golang-client-tutorial.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tutorials/golang-client-tutorial.md b/tutorials/golang-client-tutorial.md index fc3df7b6bb1..d3b8d1e6a7b 100644 --- a/tutorials/golang-client-tutorial.md +++ b/tutorials/golang-client-tutorial.md @@ -57,6 +57,7 @@ import ( client "github.com/celestiaorg/celestia-node/api/rpc/client" "github.com/celestiaorg/celestia-node/blob" share "github.com/celestiaorg/go-square/v2/share" + "github.com/celestiaorg/celestia-node/state" ) // SubmitBlob submits a blob containing "Hello, World!" to the 0xDEADBEEF namespace. It uses the default signer on the running node. @@ -79,8 +80,12 @@ func SubmitBlob(ctx context.Context, url string, token string) error { return err } + // Use a default TxConfig instead of passing nil, + // to ensure safe defaults for gas pricing and transaction behavior. + options := state.NewTxConfig() + // submit the blob to the network - height, err := client.Blob.Submit(ctx, []*blob.Blob{helloWorldBlob}, nil) + height, err := client.Blob.Submit(ctx, []*blob.Blob{helloWorldBlob}, options) if err != nil { return err } @@ -305,7 +310,8 @@ func SubmitBlob(ctx context.Context, url string, token string) error { fmt.Println("Submitting blob to the network...") - // Create basic TxConfig instead of passing nil + // Use a default TxConfig instead of passing nil, + // to ensure safe defaults for gas pricing and transaction behavior. options := state.NewTxConfig() // Submit the blob to the network with the options