-
Notifications
You must be signed in to change notification settings - Fork 13
Add supported-chains cmd & Improve Error Messages #330
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: main
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -42,3 +42,5 @@ encrypted.secrets.json | |
|
|
||
| # Output produced by e2e Anvil tests | ||
| test/test.yaml | ||
|
|
||
| .claude | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -155,7 +155,18 @@ func (h *handler) ResolveInputs(v *viper.Viper, creSettings *settings.Settings) | |
| totalClients += len(fc) | ||
| } | ||
| if totalClients == 0 { | ||
| return Inputs{}, fmt.Errorf("no RPC URLs found for supported or experimental chains") | ||
| target, _ := settings.GetTarget(v) | ||
| if target == "" { | ||
| target = "(none)" | ||
| } | ||
| return Inputs{}, fmt.Errorf( | ||
| "no RPC URLs found for target %q\n\n"+ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't we have a generalised rpc check in the root of the cmd package?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not quite. cmd/root.go has |
||
| "To fix:\n"+ | ||
| " • Check that your project.yaml has an 'rpcs' section under the target %q\n"+ | ||
| " • Ensure chain names are valid (run 'cre workflow supported-chains' to see all supported names)\n"+ | ||
| " • Verify the correct target is selected via --target or CRE_TARGET", | ||
| target, target, | ||
| ) | ||
| } | ||
|
|
||
| broadcast := v.GetBool("broadcast") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| package supported_chains | ||
|
|
||
| import ( | ||
| "fmt" | ||
|
|
||
| "github.com/spf13/cobra" | ||
|
|
||
| "github.com/smartcontractkit/cre-cli/cmd/workflow/simulate/chain/evm" | ||
| ) | ||
|
|
||
| func New() *cobra.Command { | ||
| return &cobra.Command{ | ||
| Use: "supported-chains", | ||
| Short: "List all supported chain names", | ||
| Args: cobra.NoArgs, | ||
| RunE: func(cmd *cobra.Command, args []string) error { | ||
| names := evm.SupportedChainNames() | ||
| fmt.Println("Supported chain names:") | ||
| for _, name := range names { | ||
| fmt.Printf(" %s\n", name) | ||
| } | ||
| return nil | ||
| }, | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| ## cre workflow supported-chains | ||
|
|
||
| List all supported chain names | ||
|
|
||
| ``` | ||
| cre workflow supported-chains [optional flags] | ||
| ``` | ||
|
|
||
| ### Options | ||
|
|
||
| ``` | ||
| -h, --help help for supported-chains | ||
| ``` | ||
|
|
||
| ### Options inherited from parent commands | ||
|
|
||
| ``` | ||
| -e, --env string Path to .env file which contains sensitive info | ||
| -R, --project-root string Path to the project root | ||
| -E, --public-env string Path to .env.public file which contains shared, non-sensitive build config | ||
| -T, --target string Use target settings from YAML config | ||
| -v, --verbose Run command in VERBOSE mode | ||
| ``` | ||
|
|
||
| ### SEE ALSO | ||
|
|
||
| * [cre workflow](cre_workflow.md) - Manages workflows | ||
|
|
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.
We're missing
cre workflow listduring merge conflict resolution