Skip to content
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

feat: add network plugin #19

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
# Project variables.
PROJECT_NAME = 'ignite apps'

## mocks: generate mocks
mocks:
@echo Generating mocks
@go install github.com/vektra/mockery/v2@latest
@for dir in $$(find $$(pwd -P) -mindepth 1 -maxdepth 4 -type d); do \
if [ -e "$$dir/go.mod" ]; then \
echo "Running go generate in $$dir"; \
cd "$$dir" && mockery; \
fi \
done


## goget: Run go get for all apps.
goget:
@echo Running go get $(REPO)...
Expand Down
3 changes: 3 additions & 0 deletions app.ignite.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
version: 1
apps:
network:
description: Launch new Cosmos blockchains by interacting with the Ignite Chain to coordinate with validators
path: ./spaceship
spaceship:
description: Deploy your chain into a remote server in minutes
path: ./spaceship
Expand Down
3 changes: 2 additions & 1 deletion go.work.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ use (
./examples/health-monitor
./examples/hello-world
./examples/hooks
./appregistry
./explorer
./hermes
./appregistry
./network
./rollkit
./spaceship
./wasm
Expand Down
2 changes: 1 addition & 1 deletion hermes/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (app) Manifest(context.Context) (*plugin.Manifest, error) {
}

func (app) Execute(ctx context.Context, c *plugin.ExecutedCommand, _ plugin.ClientAPI) error {
// Remove the three two elements "ignite", "relayer" and "hermes" from OsArgs.
// Remove the three elements "ignite", "relayer" and "hermes" from OsArgs.
args := c.OsArgs[3:]
switch args[0] {
case "configure":
Expand Down
25 changes: 25 additions & 0 deletions network/.mockery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
all: False
quiet: False
log-level: debug
recursive: True
with-expecter: True
outpkg: "mocks"
dir: "network/mocks"
mockname: "{{.InterfaceName}}"
filename: "{{.InterfaceNameSnake}}.go"
packages:
github.com/ignite/apps/network/network:
interfaces:
Chain:
CosmosClient:
github.com/ignite/apps/network/network/testutil:
interfaces:
ProjectClient:
ProfileClient:
LaunchClient:
BankClient:
RewardClient:
StakingClient:
MonitoringcClient:
MonitoringpClient:
AccountInfo:
5 changes: 5 additions & 0 deletions network/CHANGELOG.md
Pantani marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Spaceship App Changelog

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

* First release of the Ignite Network app compatible with Ignite >= v28.x.y
20 changes: 20 additions & 0 deletions network/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Network App

`network` is a app developed for [Ignite CLI](https://github.com/ignite/cli).

The plugin adds `ignite network` commands that allow launching new Cosmos blockchains by interacting with the Ignite Chain to coordinate with validators.

The plugin is integrated into Ignite CLI by default.

[**Check out our documentation for launching chains with the commands**](https://docs.ignite.com/nightly/network/introduction)

## Developer instruction

- clone this repo locally
- Run `ignite plugin add -g /absolute/path/to/apps/network` to add the plugin to global config
- `ignite network` command is now available with the local version of the plugin.

Then repeat the following loop:

- Hack on the plugin code
- Rerun `ignite network` to recompile the plugin and test
15 changes: 15 additions & 0 deletions network/cmd/debug/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package main

import (
"fmt"
"os"

"github.com/ignite/apps/network/cmd"
)

func main() {
if err := cmd.NewNetwork().Execute(); err != nil {
_, _ = fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
Loading
Loading