diff --git a/changelog.md b/changelog.md index 0334a1f848..5c9714bacf 100644 --- a/changelog.md +++ b/changelog.md @@ -10,6 +10,8 @@ ### Changes - [#4569](https://github.com/ignite/cli/pull/4569) Add flags to set coin type on commands. Add getters for bech32 prefix and coin type. +- [#4586](https://github.com/ignite/cli/pull/4586) Remove network as default plugin. +- [#4589](https://github.com/ignite/cli/pull/4589) Fix broken links - [#4589](https://github.com/ignite/cli/pull/4589) Resolve broken links. - [#4596](https://github.com/ignite/cli/pull/4596) Add default `openapi.yml` when skipping proto gen. diff --git a/ignite/cmd/plugin_default.go b/ignite/cmd/plugin_default.go index 65d25ab2a3..5c3412370a 100644 --- a/ignite/cmd/plugin_default.go +++ b/ignite/cmd/plugin_default.go @@ -16,8 +16,6 @@ type defaultPlugin struct { } const ( - PluginNetworkVersion = "v0.2.2" - PluginNetworkPath = "github.com/ignite/cli-plugin-network@" + PluginNetworkVersion PluginRelayerVersion = "hermes/v0.2.8" PluginRelayerPath = "github.com/ignite/apps/hermes@" + PluginRelayerVersion ) @@ -26,12 +24,6 @@ const ( // a command will added if the plugin is not already installed. // When the user executes that command, the plugin is automatically installed. var defaultPlugins = []defaultPlugin{ - { - use: "network", - short: "Launch a blockchain in production", - aliases: []string{"n"}, - path: PluginNetworkPath, - }, { use: "relayer", short: "Connect blockchains with an IBC relayer", diff --git a/ignite/cmd/plugin_default_test.go b/ignite/cmd/plugin_default_test.go index c86aa03c3b..239f2cbf49 100644 --- a/ignite/cmd/plugin_default_test.go +++ b/ignite/cmd/plugin_default_test.go @@ -24,7 +24,7 @@ func TestEnsureDefaultPlugins(t *testing.T) { name: "should not add because already present in config", cfg: &pluginsconfig.Config{ Apps: []pluginsconfig.Plugin{{ - Path: "github.com/ignite/cli-plugin-network@v42", + Path: PluginRelayerPath, }}, }, expectAddedInCommand: false, @@ -36,7 +36,7 @@ func TestEnsureDefaultPlugins(t *testing.T) { ensureDefaultPlugins(cmd, tt.cfg) - expectedCmd := findCommandByPath(cmd, "ignite network") + expectedCmd := findCommandByPath(cmd, "ignite relayer") if tt.expectAddedInCommand { assert.NotNil(t, expectedCmd) } else { diff --git a/ignite/internal/tools/gen-cli-docs/main.go b/ignite/internal/tools/gen-cli-docs/main.go index 03382fe466..3749af264f 100644 --- a/ignite/internal/tools/gen-cli-docs/main.go +++ b/ignite/internal/tools/gen-cli-docs/main.go @@ -58,10 +58,6 @@ func run() error { if err != nil { return err } - cfg.Apps = append(cfg.Apps, pluginsconfig.Plugin{ - // Add network plugin - Path: ignitecmd.PluginNetworkPath, - }) if err := cfg.Save(); err != nil { return err } diff --git a/integration/network/genesis.json b/integration/network/genesis.json deleted file mode 100644 index 09b0c6938a..0000000000 --- a/integration/network/genesis.json +++ /dev/null @@ -1,227 +0,0 @@ -{ - "genesis_time": "0001-01-01T00:00:00Z", - "chain_id": "example-1", - "initial_height": "1", - "consensus_params": { - "block": { - "max_bytes": "22020096", - "max_gas": "-1", - "time_iota_ms": "1000" - }, - "evidence": { - "max_age_num_blocks": "100000", - "max_age_duration": "172800000000000", - "max_bytes": "1048576" - }, - "validator": { - "pub_key_types": [ - "ed25519" - ] - }, - "version": {} - }, - "app_hash": "", - "app_state": { - "auth": { - "params": { - "max_memo_characters": "256", - "tx_sig_limit": "7", - "tx_size_cost_per_byte": "10", - "sig_verify_cost_ed25519": "590", - "sig_verify_cost_secp256k1": "1000" - }, - "accounts": [] - }, - "authz": { - "authorization": [] - }, - "bank": { - "params": { - "send_enabled": [], - "default_send_enabled": true - }, - "balances": [], - "supply": [], - "denom_metadata": [] - }, - "capability": { - "index": "1", - "owners": [] - }, - "crisis": { - "constant_fee": { - "denom": "stake", - "amount": "1000" - } - }, - "distribution": { - "params": { - "community_tax": "0.020000000000000000", - "base_proposer_reward": "0.010000000000000000", - "bonus_proposer_reward": "0.040000000000000000", - "withdraw_addr_enabled": true - }, - "fee_pool": { - "community_pool": [] - }, - "delegator_withdraw_infos": [], - "previous_proposer": "", - "outstanding_rewards": [], - "validator_accumulated_commissions": [], - "validator_historical_rewards": [], - "validator_current_rewards": [], - "delegator_starting_infos": [], - "validator_slash_events": [] - }, - "evidence": { - "evidence": [] - }, - "example": { - "params": {} - }, - "feegrant": { - "allowances": [] - }, - "genutil": { - "gen_txs": [] - }, - "gov": { - "starting_proposal_id": "1", - "deposits": [], - "votes": [], - "proposals": [], - "deposit_params": { - "min_deposit": [ - { - "denom": "stake", - "amount": "10000000" - } - ], - "max_deposit_period": "172800s" - }, - "voting_params": { - "voting_period": "172800s" - }, - "tally_params": { - "quorum": "0.334000000000000000", - "threshold": "0.500000000000000000", - "veto_threshold": "0.334000000000000000" - } - }, - "group": { - "group_seq": "0", - "groups": [], - "group_members": [], - "group_policy_seq": "0", - "group_policies": [], - "proposal_seq": "0", - "proposals": [], - "votes": [] - }, - "ibc": { - "client_genesis": { - "clients": [], - "clients_consensus": [], - "clients_metadata": [], - "params": { - "allowed_clients": [ - "06-solomachine", - "07-tendermint" - ] - }, - "create_localhost": false, - "next_client_sequence": "0" - }, - "connection_genesis": { - "connections": [], - "client_connection_paths": [], - "next_connection_sequence": "0", - "params": { - "max_expected_time_per_block": "30000000000" - } - }, - "channel_genesis": { - "channels": [], - "acknowledgements": [], - "commitments": [], - "receipts": [], - "send_sequences": [], - "recv_sequences": [], - "ack_sequences": [], - "next_channel_sequence": "0" - } - }, - "interchainaccounts": { - "controller_genesis_state": { - "active_channels": [], - "interchain_accounts": [], - "ports": [], - "params": { - "controller_enabled": true - } - }, - "host_genesis_state": { - "active_channels": [], - "interchain_accounts": [], - "port": "icahost", - "params": { - "host_enabled": true, - "allow_messages": [] - } - } - }, - "mint": { - "minter": { - "inflation": "0.130000000000000000", - "annual_provisions": "0.000000000000000000" - }, - "params": { - "mint_denom": "bar", - "inflation_rate_change": "0.130000000000000000", - "inflation_max": "0.200000000000000000", - "inflation_min": "0.070000000000000000", - "goal_bonded": "0.670000000000000000", - "blocks_per_year": "6311520" - } - }, - "params": null, - "slashing": { - "params": { - "signed_blocks_window": "100", - "min_signed_per_window": "0.500000000000000000", - "downtime_jail_duration": "600s", - "slash_fraction_double_sign": "0.050000000000000000", - "slash_fraction_downtime": "0.010000000000000000" - }, - "signing_infos": [], - "missed_blocks": [] - }, - "staking": { - "params": { - "unbonding_time": "1814400s", - "max_validators": 100, - "max_entries": 7, - "historical_entries": 10000, - "bond_denom": "stake", - "min_commission_rate": "0.000000000000000000" - }, - "last_total_power": "0", - "last_validator_powers": [], - "validators": [], - "delegations": [], - "unbonding_delegations": [], - "redelegations": [], - "exported": false - }, - "transfer": { - "port_id": "transfer", - "denom_traces": [], - "params": { - "send_enabled": true, - "receive_enabled": true - } - }, - "upgrade": {}, - "vesting": {} - } -} \ No newline at end of file diff --git a/integration/network/network_test.go b/integration/network/network_test.go deleted file mode 100644 index b2f87aa972..0000000000 --- a/integration/network/network_test.go +++ /dev/null @@ -1,235 +0,0 @@ -//nolint:unused -package network_test - -import ( - "bytes" - "context" - "os" - "path/filepath" - "strings" - "testing" - - "github.com/blang/semver/v4" - "github.com/go-git/go-git/v5" - "github.com/go-git/go-git/v5/plumbing" - "github.com/stretchr/testify/require" - - ignitecmd "github.com/ignite/cli/v29/ignite/cmd" - chainconfig "github.com/ignite/cli/v29/ignite/config/chain" - "github.com/ignite/cli/v29/ignite/pkg/cmdrunner/step" - "github.com/ignite/cli/v29/ignite/pkg/gomodule" - "github.com/ignite/cli/v29/ignite/pkg/xgit" - envtest "github.com/ignite/cli/v29/integration" -) - -const ( - spnModule = "github.com/tendermint/spn" - spnRepoURL = "https://" + spnModule - spnConfigFile = "config_2.yml" - pluginNetworkRepoURL = "https://" + ignitecmd.PluginNetworkPath -) - -// setupSPN executes the following tasks: -// - clone cli-plugin-network to get the SPN version from go.mod -// - add the cloned cli-plugin-network as a global plugin -// - clone SPN to the expected version -// - returns the path of the cloned SPN. -func setupSPN(env envtest.Env) string { - var ( - t = env.T() - require = require.New(t) - path = t.TempDir() - pluginPath = filepath.Join(path, "cli-plugin-network") - spnPath = filepath.Join(path, "spn") - spnVersion string - ) - // Clone the cli-plugin-network with the expected version - err := xgit.Clone(context.Background(), pluginNetworkRepoURL, pluginPath) - require.NoError(err) - t.Logf("Checkout cli-plugin-revision to ref %q", ignitecmd.PluginNetworkPath) - // Add plugin to config - env.Must(env.Exec("add plugin network", - step.NewSteps(step.New( - // NOTE(tb): to test cli-plugin-network locally (can happen during dev) - // comment the first line below and uncomment the second, with the - // correct path to the plugin. - step.Exec(envtest.IgniteApp, "plugin", "add", "-g", pluginPath), - // step.Exec(envtest.IgniteApp, "plugin", "add", "-g", "/home/tom/src/ignite/cli-plugin-network"), - )), - )) - - // Read spn version from plugin's go.mod - gm, err := gomodule.ParseAt(pluginPath) - require.NoError(err) - for _, r := range gm.Require { - if r.Mod.Path == spnModule { - spnVersion = r.Mod.Version - break - } - } - if spnVersion == "" { - t.Fatal("unable to read spn version from go.mod") - } - t.Logf("spn version found %q", spnVersion) - - // Check if spnVersion is a tag or a pseudo-version - v, err := semver.ParseTolerant(spnVersion) - require.NoError(err) - if n := len(v.Pre); n > 0 { - // pseudo version, need to extract hash - spnVersion = strings.Split(v.Pre[n-1].VersionStr, "-")[1] - } - - // Clone spn - spnRepo, err := git.PlainClone(spnPath, false, &git.CloneOptions{ - URL: spnRepoURL, - }) - require.NoError(err) - // Checkout expected version - rev, err := spnRepo.ResolveRevision(plumbing.Revision(spnVersion)) - require.NoError(err, spnVersion) - w, err := spnRepo.Worktree() - require.NoError(err) - err = w.Checkout(&git.CheckoutOptions{ - Hash: *rev, - }) - require.NoError(err, rev) - t.Logf("Checkout spn to ref %q", rev) - - return spnPath -} - -func migrateSPNConfig(t *testing.T, spnPath string) { - t.Helper() - configPath := filepath.Join(spnPath, spnConfigFile) - rawCfg, err := os.ReadFile(configPath) - require.NoError(t, err) - - version, err := chainconfig.ReadConfigVersion(bytes.NewReader(rawCfg)) - require.NoError(t, err) - if version != chainconfig.LatestVersion { - t.Logf("migrating spn config from v%d to v%d", version, chainconfig.LatestVersion) - - file, err := os.OpenFile(configPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o755) - require.NoError(t, err) - - defer file.Close() - - err = chainconfig.MigrateLatest(bytes.NewReader(rawCfg), file) - require.NoError(t, err) - } -} - -func TestNetworkPublish(t *testing.T) { - t.Skip("Skipped until SPN app is migrated to V2") - - // var ( - // env = envtest.New(t) - // spnPath = setupSPN(env) - // spn = env.App( - // spnPath, - // envtest.AppHomePath(t.TempDir()), - // envtest.AppConfigPath(path.Join(spnPath, spnConfigFile)), - // ) - // ) - // - // var ( - // ctx, cancel = context.WithTimeout(env.Ctx(), envtest.ServeTimeout) - // isBackendAliveErr error - // ) - // - // // Make sure that the SPN config file is at the latest version - // migrateSPNConfig(t, spnPath) - // - // validator := spn.Config().Validators[0] - // servers, err := validator.GetServers() - // require.NoError(t, err) - // - // go func() { - // defer cancel() - // - // if isBackendAliveErr = env.IsAppServed(ctx, servers.API.Address); isBackendAliveErr != nil { - // return - // } - // var b bytes.Buffer - // env.Exec("publish planet chain to spn", - // step.NewSteps(step.New( - // step.Exec( - // envtest.IgniteApp, - // "network", "chain", "publish", - // "https://github.com/ignite/example", - // "--local", - // // The hash is used to be sure the test uses the right config - // // version. Hash value must be updated to the latest when the - // // config version in the repository is updated to a new version. - // "--hash", "b8b2cc2876c982dd4a049ed16b9a6099eca000aa", - // ), - // step.Stdout(&b), - // )), - // ) - // require.False(t, env.HasFailed(), b.String()) - // t.Log(b.String()) - // }() - // - // env.Must(spn.Serve("serve spn chain", envtest.ExecCtx(ctx))) - // - // require.NoError(t, isBackendAliveErr, "spn cannot get online in time") -} - -func TestNetworkPublishGenesisConfig(t *testing.T) { - t.Skip("Skipped until SPN app is migrated to V2") - - // var ( - // env = envtest.New(t) - // spnPath = setupSPN(env) - // spn = env.App( - // spnPath, - // envtest.AppHomePath(t.TempDir()), - // envtest.AppConfigPath(path.Join(spnPath, spnConfigFile)), - // ) - // ) - // - // var ( - // ctx, cancel = context.WithTimeout(env.Ctx(), envtest.ServeTimeout) - // isBackendAliveErr error - // ) - // - // // Make sure that the SPN config file is at the latest version - // migrateSPNConfig(t, spnPath) - // - // validator := spn.Config().Validators[0] - // servers, err := validator.GetServers() - // require.NoError(t, err) - // - // go func() { - // defer cancel() - // - // if isBackendAliveErr = env.IsAppServed(ctx, servers.API.Address); isBackendAliveErr != nil { - // return - // } - // var b bytes.Buffer - // env.Exec("publish test chain to spn", - // step.NewSteps(step.New( - // step.Exec( - // envtest.IgniteApp, - // "network", "chain", "publish", - // "https://github.com/aljo242/test", - // "--local", - // // The hash is used to be sure the test uses the right config - // // version. Hash value must be updated to the latest when the - // // config version in the repository is updated to a new version. - // "--hash", "23761c53ea364c7b046043f8c551eef992b99d22", - // // custom config genesis - // "--genesis-config", "gen.yml", - // ), - // step.Stdout(&b), - // )), - // ) - // require.False(t, env.HasFailed(), b.String()) - // t.Log(b.String()) - // }() - // - // env.Must(spn.Serve("serve spn chain", envtest.ExecCtx(ctx))) - // - // require.NoError(t, isBackendAliveErr, "spn cannot get online in time") -} diff --git a/integration/network/request_test.go b/integration/network/request_test.go deleted file mode 100644 index 4073cfa610..0000000000 --- a/integration/network/request_test.go +++ /dev/null @@ -1,80 +0,0 @@ -package network_test - -import ( - "testing" -) - -func TestNetworkRequestParam(t *testing.T) { - t.Skip("Skipped until SPN app is migrated to V2") - - // var ( - // env = envtest.New(t) - // spnPath = setupSPN(env) - // spn = env.App( - // spnPath, - // envtest.AppHomePath(t.TempDir()), - // envtest.AppConfigPath(path.Join(spnPath, spnConfigFile)), - // ) - // ) - // - // var ( - // ctx, cancel = context.WithTimeout(env.Ctx(), envtest.ServeTimeout) - // isBackendAliveErr error - // ) - // - // // Make sure that the SPN config file is at the latest version - // migrateSPNConfig(t, spnPath) - // - // validator := spn.Config().Validators[0] - // servers, err := validator.GetServers() - // require.NoError(t, err) - // - // go func() { - // defer cancel() - // - // if isBackendAliveErr = env.IsAppServed(ctx, servers.API.Address); isBackendAliveErr != nil { - // return - // } - // var b bytes.Buffer - // env.Exec("publish planet chain to spn", - // step.NewSteps(step.New( - // step.Exec( - // envtest.IgniteApp, - // "network", "chain", "publish", - // "https://github.com/ignite/example", - // "--local", - // // The hash is used to be sure the test uses the right config - // // version. Hash value must be updated to the latest when the - // // config version in the repository is updated to a new version. - // "--hash", "b8b2cc2876c982dd4a049ed16b9a6099eca000aa", - // ), - // step.Stdout(&b), - // ), - // step.New( - // step.Exec( - // envtest.IgniteApp, - // "network", "request", "change-param", - // "1", "mint", "mint_denom", "\"bar\"", - // "--local", - // ), - // step.Stdout(&b), - // ), - // step.New( - // step.Exec( - // envtest.IgniteApp, - // "network", "chain", "show", "genesis", - // "1", - // "--local", - // ), - // step.Stdout(&b), - // ), - // ), - // ) - // require.False(t, env.HasFailed(), b.String()) - // t.Log(b.String()) - // }() - // - // env.Must(spn.Serve("serve spn chain", envtest.ExecCtx(ctx))) - // - // require.NoError(t, isBackendAliveErr, "spn cannot get online in time") -}