-
Notifications
You must be signed in to change notification settings - Fork 552
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
refactor: move network command into a plugin #3306
Conversation
and couple of other changes to accomodate plugin network code.
Declare cli-plugin-network as a default plugin.
fixed |
should be OK after my last commit I hope, this was introduced by the merge. |
I'm not sure how long you are supposed to wait but it seems like I'm stuck when running the command
EDIT: The command fails with an error after some time Also, I have no prompt and stuck when not running a final command (example: just
|
Can you detail the error please, on my side the command works well.
I can reproduce, that's a regression, I'm on it. |
@lubtd Please recompile |
I get
but I realize I had unstable connectivity, let me retry How long does it take to you to get the plugin built? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works now @tbruyelle 👍
Plugin build process takes several minutes though, is it normal?
On my machine it only takes a few seconds, that might be related to If you |
Yes, if I remove and rebuild, its significantly faster! |
OK, so that's the reason. I can reproduce the long build by running the following commands :
Unfortunately |
@jeronimoalbi do you think you could review/approve? |
* wip: remove network cmd declaration and couple of other changes to accomodate plugin network code. * fix: allow plugin.Use to have more than one word * fix missing feed OSArg * remove appd start-with-http-tunneling command * comment * chore: remove spn dependency from cli * attempt to add legacy plugin command * fix after rebase * feat: add plugin proxy command for default plugins Declare cli-plugin-network as a default plugin. * test: add case for ensureDefaultPlugins * test: add for Config.HasPlugin * chore: add comment * add CL * fix linter * fix: plugin add doesn't kill the plugin on stop * docs: move CL entry to changes * fix network integration tests The network integration tests used to fetch the SPN version from CLI go.mod, but this is no longer possible since the dependency has been removed. To fix that, the SPN version is now read from the cli-plugin-network's go.mod which is cloned from the declared version in defaultPlugins. A fix has also been added to support persistant flags. Finally pluginsconfig.HasPlugin has been updated so it can return true if a local plugin with a module name equals to the given path exists. This permits to use `ignite` with a local cli-plugin-network. * fix lint * set networl plugin version after merge * add network plugin command to gen-cli-docs TODO: need to handle hidden commands * fix linter * fix test * fix: pass events.Bus to plugin.Load Co-authored-by: Alex Johnson <[email protected]> Co-authored-by: Danilo Pantani <[email protected]>
Resolve #3144
The PR removes completely the network code and thanks to a couple other removals, removes the
tendermint/spn
dependency from the CLI.The network code has been moved into a plugin, see related PR ignite/cli-plugin-network#1
In order to make the change as smooth as possible for the user, unlike other plugins, the
ignite network
orignite n
command is still present in the available commands. I added a concept of "default plugins", which is a list of trusted plugins for which we want to have the related command available, even if the user hasn't fetched and installed the plugin yet.So the "network" command has been added in this "default plugins" list (more can be added afterward, it should work the same), and as a result, when
ignite
is run without args, thenetwork
sub-command is listed.Now the cool part of this is when the user runs
ignite network
(orignite n chain
or whatever sub commands), the attached command will act as a proxy that will add the plugin to the global config, fetch and compile it, and then run it immediately. The only difference for the user is these preliminary steps, which by the way happen only the first time the user runs theignite network
command. Once the plugin is installed, it's as fast as before.From now, everything related to network commands can be tested, like the usual demo, it should be a good way to ensure nothing is broken. Just compile
ignite
from this branch and play with it.