-
Notifications
You must be signed in to change notification settings - Fork 73
feat(cli): use either Repository or JSON-RPC API to read data #738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next/2.0
Are you sure you want to change the base?
Changes from all commits
db19aff
f2c3dc5
2bf59ea
8737787
505c197
d9ccb60
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,7 +13,6 @@ import ( | |||||||||||||||||||
|
|
||||||||||||||||||||
| "github.com/ethereum/go-ethereum/common/hexutil" | ||||||||||||||||||||
| "github.com/spf13/cobra" | ||||||||||||||||||||
| "github.com/spf13/viper" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| "github.com/cartesi/rollups-node/internal/config" | ||||||||||||||||||||
| "github.com/cartesi/rollups-node/pkg/inspectclient" | ||||||||||||||||||||
|
|
@@ -50,7 +49,6 @@ func init() { | |||||||||||||||||||
|
|
||||||||||||||||||||
| Cmd.Flags().StringVar(&inspectEndpoint, "inspect-endpoint", "http://localhost:10012/", | ||||||||||||||||||||
| "address used to connect to the inspect api") | ||||||||||||||||||||
| cobra.CheckErr(viper.BindPFlag(config.INSPECT_ADDRESS, Cmd.Flags().Lookup("inspect-endpoint"))) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| origHelpFunc := Cmd.HelpFunc() | ||||||||||||||||||||
| Cmd.SetHelpFunc(func(command *cobra.Command, strings []string) { | ||||||||||||||||||||
|
|
@@ -96,10 +94,7 @@ func run(cmd *cobra.Command, args []string) { | |||||||||||||||||||
| nameOrAddress, err := config.ToApplicationNameOrAddressFromString(args[0]) | ||||||||||||||||||||
| cobra.CheckErr(err) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| endpoint, err := config.GetInspectAddress() | ||||||||||||||||||||
| cobra.CheckErr(err) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| client, err := inspectclient.NewClient(endpoint) | ||||||||||||||||||||
| client, err := inspectclient.NewClient(inspectEndpoint) | ||||||||||||||||||||
|
||||||||||||||||||||
| client, err := inspectclient.NewClient(inspectEndpoint) | |
| endpoint := inspectEndpoint | |
| if !cmd.Flags().Changed("inspect-endpoint") { | |
| if cfgEndpoint, cfgErr := config.GetInspectAddress(); cfgErr == nil && cfgEndpoint != "" { | |
| endpoint = cfgEndpoint | |
| } | |
| } | |
| client, err := inspectclient.NewClient(endpoint) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This removes the previous viper/config binding (
config.GetInspectAddress()), which likely changes behavior for users relying on environment/config-based configuration. If that's unintended, consider restoring config/env resolution (e.g., defaultinginspectEndpointfrom config/env, or keeping the priorGetInspectAddress()behavior with the flag overriding it).