celestiaorg / celestiaorg/celestia-node

Refinement of CLI tool argument handling

Open
#4,625 5 comments 2 reactions 0 assignees View on GitHub
external needs:triage
Dominant language
Go
Stars
996
Forks
1.1k
Avg merge
1d 6h
Merged PRs (30d)
34

Description

## 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/cobra@v1.9.1/command.go:1000 +0x7ec
github.com/spf13/cobra.(*Command).ExecuteC(0x10983a0e0)
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.9.1/command.go:1148 +0x384
github.com/spf13/cobra.(*Command).Execute(...)
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.9.1/command.go:1071
github.com/spf13/cobra.(*Command).ExecuteContext(...)
/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.9.1/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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.