Refinement of CLI tool argument handling
Feature Request
Summary
Ergonomics of some commands took a bit to figure out --
❯ celestia blob submit 0x00 0x00 --url https://example.com
Error: cant access the auth token: token/node-store flag was not specified: no opened Node Store found (no node is running)
Needs a token, even if RPC node doesn't. And any random string works.
Following requires a blob and namespace... even though it doesn't use them?
❮ celestia blob submit --url https://example.com --token null --input-file ./input.json
panic: runtime error: index out of range [0] with length 0
goroutine 1 [running]:
github.com/celestiaorg/celestia-node/nodebuilder/blob/cmd.init.func6(0x10983aea0?, {0x1400179e660?, 0x0?, 0x105457806?})
/home/runner/work/celestia-node/celestia-node/nodebuilder/blob/cmd/blob.go:138 +0x148
github.com/spf13/cobra.(*Command).execute(0x10983aea0, {0x1400179e600, 0x6, 0x6})
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1000 +0x7ec
github.com/spf13/cobra.(*Command).ExecuteC(0x10983a0e0)
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1148 +0x384
github.com/spf13/cobra.(*Command).Execute(...)
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1071
github.com/spf13/cobra.(*Command).ExecuteContext(...)
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1064
main.run()
/home/runner/work/celestia-node/celestia-node/cmd/celestia/main.go:48 +0x58
main.main()
/home/runner/work/celestia-node/celestia-node/cmd/celestia/main.go:41 +0x1c
For large blobs it'd be nice to support stdin or pipe with a defined namespace.
Problem Definition
Being forced to include irrelevant arguments is odd ergonomics.
❯ celestia blob submit 0x00 0x00 --url https://example.com Error: cant access the auth token: token/node-store flag was not specified: no opened Node Store found (no node is running)Needs a token, even if RPC node doesn't. And any random string works.
when you refer to RPC node you mean the light node correct? you need to start the node with --rpc.skip-auth to skip auth and when you do you can provide --token null where null is any string to send the requests
Following requires a blob and namespace... even though it doesn't use them?
agreed this is weird UX and this ticket should focus on that @celestiaorg/celestia-node
when you refer to RPC node you mean the light node correct
Yes. The URL provided has skip auth -- I'm just speaking to the ergonomics of the CLI tool and expected behavior. If I have disabled auth on my node, it's weird to then be forced to provide an auth string, or suggested to use "null" when "abc123" would work.