Skip to content

Commit

Permalink
move cmds to nodebuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
vgonkivs committed Sep 18, 2023
1 parent cb51000 commit 57b3d6f
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package rpc

import (
"encoding/base64"
"encoding/hex"
"fmt"
"reflect"
"strconv"
Expand Down Expand Up @@ -112,7 +113,9 @@ var getAllCmd = &cobra.Command{
}

blobs, err := internal.RPCClient.Blob.GetAll(cmd.Context(), height, []share.Namespace{namespace})

fmt.Println(hex.EncodeToString(blobs[0].Namespace().ID()))
fmt.Println(blobs[0].Namespace().ID())
fmt.Println(blobs[0].Namespace())
formatter := formatData
if base64Flag || err != nil {
formatter = nil
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package rpc

import (
"encoding/hex"
"fmt"
"strconv"

Expand Down Expand Up @@ -121,13 +122,15 @@ var submitTxCmd = &cobra.Command{
Short: "Submits the given transaction/message to the Celestia network and blocks until the tx is included in a block.",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
rawTx, err := internal.DecodeToBytes(args[0])
decoded, err := hex.DecodeString(args[0])
if err != nil {
return fmt.Errorf("failed to decode tx: %v", err)
}

fmt.Println(args[0])
txResponse, err := internal.RPCClient.State.SubmitTx(
cmd.Context(),
rawTx,
decoded,
)
return internal.PrintOutput(txResponse, err, nil)
},
Expand Down

0 comments on commit 57b3d6f

Please sign in to comment.