-
Notifications
You must be signed in to change notification settings - Fork 551
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: release v0.21.1
- Loading branch information
Showing
45 changed files
with
1,089 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package ignitecmd | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// NewNetworkClient creates a new client command that holds some other | ||
// sub commands related to connect client to the network. | ||
func NewNetworkClient() *cobra.Command { | ||
c := &cobra.Command{ | ||
Use: "client", | ||
Short: "Connect your network with SPN", | ||
} | ||
|
||
c.AddCommand( | ||
NewNetworkClientCreate(), | ||
) | ||
|
||
return c | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package ignitecmd | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
|
||
"github.com/ignite-hq/cli/ignite/pkg/cliui" | ||
"github.com/ignite-hq/cli/ignite/pkg/cliui/icons" | ||
"github.com/ignite-hq/cli/ignite/pkg/cosmosclient" | ||
"github.com/ignite-hq/cli/ignite/services/network" | ||
) | ||
|
||
// NewNetworkClientCreate connects the monitoring modules of launched chains with SPN | ||
func NewNetworkClientCreate() *cobra.Command { | ||
c := &cobra.Command{ | ||
Use: "create [launch-id] [node-api-url]", | ||
Short: "Connect the monitoring modules of launched chains with SPN", | ||
Args: cobra.ExactArgs(2), | ||
RunE: networkClientCreateHandler, | ||
} | ||
c.Flags().AddFlagSet(flagNetworkFrom()) | ||
c.Flags().AddFlagSet(flagSetKeyringBackend()) | ||
return c | ||
} | ||
|
||
func networkClientCreateHandler(cmd *cobra.Command, args []string) error { | ||
session := cliui.New() | ||
defer session.Cleanup() | ||
|
||
launchID, err := network.ParseID(args[0]) | ||
if err != nil { | ||
return err | ||
} | ||
nodeAPI := args[1] | ||
|
||
nb, err := newNetworkBuilder(cmd) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
nodeClient, err := cosmosclient.New(cmd.Context(), cosmosclient.WithNodeAddress(nodeAPI)) | ||
if err != nil { | ||
return err | ||
} | ||
node, err := network.NewNodeClient(nodeClient) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
ibcInfo, err := node.IBCInfo(cmd.Context()) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
n, err := nb.Network() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
clientID, err := n.CreateClient(launchID, ibcInfo) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
session.StopSpinner() | ||
session.Printf("%s Client created: %s\n", icons.Info, clientID) | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.