Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Feb 1, 2025
1 parent 1b23018 commit c7b3064
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 5 deletions.
2 changes: 1 addition & 1 deletion connect/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

## [`v0.1.0`](https://github.com/ignite/apps/releases/tag/connect/v0.1.0)

* First release of the Connect app compatible with Ignite >= v28.3.0
* First release of the Connect app compatible with Ignite >= v28.x.y
40 changes: 39 additions & 1 deletion connect/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
# Connect

This Ignite App is aimed to extend [Ignite CLI](https://github.com/ignite/cli) and let a user interact with any Cosmos SDK based chain.
This Ignite App extends [Ignite CLI](https://github.com/ignite/cli) to let a user interact with any Cosmos SDK based chain.

## Installation

```shell
ignite app install -g github.com/ignite/apps/connect
```

### Usage

* Discover available chains

```shell
ignite connect discover
```

* Add a chain to interact with

```shell
ignite connect add atomone
```

* (Or) Add a local chain to interact with

```shell
ignite connect add simapp localhost:9090
```

* List all connected chains

```shell
ignite connect
```

* Remove a connected chain

```shell
ignite connect rm atomone
```
6 changes: 5 additions & 1 deletion connect/cmd/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/ignite/cli/v28/ignite/services/plugin"
)

func AppHandler(ctx context.Context, cmd *plugin.ExecutedCommand, name string, cfg *chains.ChainConfig) (*cobra.Command, error) {
func AppHandler(ctx context.Context, cmd *plugin.ExecutedCommand, name string, cfg *chains.ChainConfig, args ...string) (*cobra.Command, error) {
chainCmd := &cobra.Command{
Use: name,
Short: fmt.Sprintf("Commands for %s chain", name),
Expand Down Expand Up @@ -70,6 +70,10 @@ func AppHandler(ctx context.Context, cmd *plugin.ExecutedCommand, name string, c
return nil, err
}

if len(args) > 0 {
chainCmd.SetArgs(args)
}

return chainCmd, nil
}

Expand Down
2 changes: 1 addition & 1 deletion connect/cmd/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ func RemoveHandler(ctx context.Context, cmd *plugin.ExecutedCommand) error {
_ = os.Remove(path.Join(configDir, fmt.Sprintf("%s.fds", chainName)))
_ = os.Remove(path.Join(configDir, fmt.Sprintf("%s.autocli", chainName)))

fmt.Printf("Chain %s successfully removed from Connect\n", chainName)
fmt.Printf("Chain %s successfully removed!\n", chainName)
return nil
}
2 changes: 1 addition & 1 deletion connect/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (app) Execute(ctx context.Context, c *plugin.ExecutedCommand, _ plugin.Clie
return cmd.VersionHandler(ctx, c)
default:
if slices.Contains(availableChains, args[0]) {
appCmd, err := cmd.AppHandler(ctx, c, args[0], cfg.Chains[args[0]])
appCmd, err := cmd.AppHandler(ctx, c, args[0], cfg.Chains[args[0]], args[1:]...)
if err != nil {
return err
}
Expand Down

0 comments on commit c7b3064

Please sign in to comment.