-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into feat/debug-pkg
# Conflicts: # .github/workflows/test-integration.yml # examples/health-monitor/go.sum # explorer/go.mod # explorer/go.sum # explorer/integration/gex_test.go # hermes/go.mod # hermes/go.sum # integration/explorer/gex_test.go # integration/go.sum # marketplace/cmd/info.go # marketplace/cmd/list.go # marketplace/pkg/apps/details.go # marketplace/pkg/apps/search.go # marketplace/pkg/tree/tree_test.go # test/debug/go.mod # test/debug/go.sum # test/debug/tools.go # test/integration/explorer/gex_test.go
- Loading branch information
Showing
63 changed files
with
7,583 additions
and
1,614 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
.vscode | ||
*.test | ||
*.ign | ||
go.work | ||
go.work.sum |
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,26 @@ | ||
version: 1 | ||
apps: | ||
explorer: | ||
description: Easy to use terminal chain explorer for testing your Ignite blockchains | ||
path: ./explorer | ||
hermes: | ||
description: A wrapper around the hermes IBC relayer | ||
path: ./hermes | ||
marketplace: | ||
description: Explore the world of Ignite applications and more! | ||
path: ./marketplace | ||
chain-info: | ||
description: A simple chain information application | ||
path: ./examples/chain-info | ||
flags: | ||
description: A simple flags usage application | ||
path: ./examples/flags | ||
health-monitor: | ||
description: A simple health monitor application | ||
path: ./examples/health-monitor | ||
hello-world: | ||
description: A simple hello world application | ||
path: ./examples/hello-world | ||
hooks: | ||
description: A simple hooks application | ||
path: ./examples/hooks |
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,52 @@ | ||
package cmd | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"os" | ||
"path" | ||
|
||
"github.com/ignite/cli/v28/ignite/pkg/cache" | ||
"github.com/ignite/cli/v28/ignite/services/chain" | ||
"github.com/ignite/cli/v28/ignite/services/plugin" | ||
"github.com/spf13/pflag" | ||
) | ||
|
||
// ExecuteBuild executes the build subcommand. | ||
func ExecuteBuild(ctx context.Context, cmd *plugin.ExecutedCommand, c *chain.Chain) error { | ||
flags, err := cmd.NewFlags() | ||
if err != nil { | ||
return err | ||
} | ||
output, err := getOutputFlag(flags) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
tempDir, err := os.MkdirTemp(os.TempDir(), "buildcache-*") | ||
if err != nil { | ||
return fmt.Errorf("could not create a temp dir: %w", err) | ||
} | ||
cacheStorage, err := cache.NewStorage(path.Join(tempDir, "cacheStorage.db")) | ||
if err != nil { | ||
return fmt.Errorf("could not prepare a cache storage for building chain: %w", err) | ||
} | ||
binaryName, err := c.Build(ctx, cacheStorage, nil, output, false, true) | ||
if err != nil { | ||
return fmt.Errorf("building chain failed with error: %w", err) | ||
} | ||
fmt.Printf("Chain built successfully at %s\n", binaryName) | ||
return nil | ||
} | ||
|
||
func getOutputFlag(flags *pflag.FlagSet) (string, error) { | ||
out, err := flags.GetString("output") | ||
if err != nil { | ||
return "", fmt.Errorf("could not get --output flag: %w", err) | ||
} | ||
|
||
if out == "" { | ||
return ".", nil | ||
} | ||
return out, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package cmd | ||
|
||
import "github.com/ignite/cli/v28/ignite/services/plugin" | ||
|
||
// GetCommands returns the list of chain-info app commands. | ||
func GetCommands() []*plugin.Command { | ||
return []*plugin.Command{ | ||
{ | ||
Use: "chain-info", | ||
Short: "chain-info is a simple application that demonstrates how to get information or manipulate the chains", | ||
Commands: []*plugin.Command{ | ||
{ | ||
Use: "info", | ||
Short: "Prints out some basic informations about the chain in the current directory", | ||
}, | ||
{ | ||
Use: "build", | ||
Short: "Builds the chain app in the current directory with help of ignite helper functions", | ||
Flags: []*plugin.Flag{ | ||
{ | ||
Name: "output", | ||
Shorthand: "o", | ||
Usage: "The path to output binary file", | ||
DefaultValue: ".", | ||
Type: plugin.FlagTypeString, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
} |
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,36 @@ | ||
package cmd | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"os" | ||
"text/tabwriter" | ||
|
||
"github.com/ignite/cli/v28/ignite/services/chain" | ||
"github.com/ignite/cli/v28/ignite/services/plugin" | ||
) | ||
|
||
// ExecuteInfo executes the info subcommand. | ||
func ExecuteInfo(ctx context.Context, cmd *plugin.ExecutedCommand, c *chain.Chain) error { | ||
w := tabwriter.NewWriter(os.Stdout, 0, 8, 0, '\t', 0) | ||
write := func(s string, v interface{}) { | ||
fmt.Fprintf(w, "%s:\t%v\n", s, v) | ||
} | ||
|
||
write("Version", c.Version) | ||
write("App Path", c.AppPath()) | ||
write("Config Path", c.ConfigPath()) | ||
init, err := c.IsInitialized() | ||
if err != nil { | ||
return fmt.Errorf("could not find out if the chain is initialized: %w", err) | ||
} | ||
write("Is Initialized", init) | ||
bin, err := c.Binary() | ||
if err != nil { | ||
return fmt.Errorf("could not find out chain's binary file name: %w", err) | ||
} | ||
write("Binary File", bin) | ||
w.Flush() | ||
|
||
return nil | ||
} |
Oops, something went wrong.