Open Jim8y opened 2 years ago
mode delete
Cannot delete a directory which is not empty.
save as an existing mode name
There is no warning and the original mode configs will be overwritten.
The logic of mode save
is a little strange for me.
If I want to save a mode, firstly I need to start neo-cli with some specified mode in ./Mode/
folder or with default mode mainnet
, and corresponding config files will be generated in ./
folder. Then I modify or replace the config files in ./
folder , use mode save <modeName>
cmd to copy the config files to ./Mode/
folder. Why don't I directly create a new mode in ./Mode/
folder?:joy:
The logic of
mode save
is a little strange for me. If I want to save a mode, firstly I need to start neo-cli with some specified mode in./Mode/
folder or with default modemainnet
, and corresponding config files will be generated in./
folder. Then I modify or replace the config files in./
folder , usemode save <modeName>
cmd to copy the config files to./Mode/
folder. Why don't I directly create a new mode in./Mode/
folder?😂
Cause config.json
are spread everywhere, with save mode
we can collect config
file from the node
and Plugins
. If user directly creates mode under Modes
folder, how could they deal with Plugins
.
@nicolegys May you please test this?
After I install a new plugin, neo-cli will remind me to restart it. But if I restart it immediately without saving this mode, in this pr, the new installed plugin will be removed. Need to add some words in this warning to remind users saving mode before restarting neo-cli.
After I install a new plugin, neo-cli will remind me to restart it. But if I restart it immediately without saving this mode, in this pr, the new installed plugin will be removed. Need to add some words in this warning to remind users saving mode before restarting neo-cli.
This issue should have been solved in my last commit. The reason of that issue is the plugin folder name is kinda different from the plugin name.
Need to remind users to restart/resync neo-cli if new plugins are auto-installed.
exception.
Need to remind users to restart/resync neo-cli if new plugins are auto-installed.
Well, actually, it is supposed to be loaded automatically....will check this logic.
async issue still exists.
@Liaojinghui Can we move on? I think it's useful.
If plugins are auto-installed/auto-uninstalled when starting neo-cli
, type exit
and neo-cli
will throw an exception.
reinstall plugin
will replace this plugin's config file in mode\xxx
by the default config file.
e.g. Both ApplicationLogs
and RpcServer
are not installed but in \mode\testnet
, now I start neo-cli
with testnet
mode, I could find that RpcServer
's config file in \mode\testnet
be replaced by the default one. Because RpcServer
is installed as a dependency of ApplicationLogs
.
- If plugins are auto-installed/auto-uninstalled when starting
neo-cli
, typeexit
andneo-cli
will throw an exception.reinstall plugin
will replace this plugin's config file inmode\xxx
by the default config file.- e.g. Both
ApplicationLogs
andRpcServer
are not installed but in\mode\testnet
, now I startneo-cli
withtestnet
mode, I could find thatRpcServer
's config file in\mode\testnet
be replaced by the default one. BecauseRpcServer
is installed as a dependency ofApplicationLogs
.
2. ...
hasn't been fixed.
If use lower case to install plugins, it can't find folders like Plugins/applicationlogs
.
Doesn' the GetActualPath
work?
This issue still exists. neo-project/neo#3000
Threw an exception when reinstalling StateService, but not always.
- If plugins are auto-installed/auto-uninstalled when starting
neo-cli
, typeexit
andneo-cli
will throw an exception.reinstall plugin
will replace this plugin's config file inmode\xxx
by the default config file.- e.g. Both
ApplicationLogs
andRpcServer
are not installed but in\mode\testnet
, now I startneo-cli
withtestnet
mode, I could find thatRpcServer
's config file in\mode\testnet
be replaced by the default one. BecauseRpcServer
is installed as a dependency ofApplicationLogs
.
ApplicationLogs
is before RpcServer
in .PLUGINS
file, and both of them are not installed.
2.Start neo-cli.Threw an exception when reinstalling StateService, but not always.
This is an issue in neo core
, and has being addressed in https://github.com/neo-project/neo/pull/2569 . This pr can not and should not handle that.
No more issues,need review.
@Liaojinghui Please fix format.
It uses an error plugin path when starting neo-cli in the different directory with neo-cli.dll
.
It uses an error plugin path when starting neo-cli in the different directory with
neo-cli.dll
.
The path issue is not a problem should be addressed in this pr. it is a nature feature of C# on windows platform.
Relative path will always be relative to the executing folder, unless you publish it in a self-contain mode.
It uses an error plugin path when starting neo-cli in the different directory with
neo-cli.dll
.The path issue is not a problem should be addressed in this pr. it is a nature feature of C# on windows platform.
Relative path will always be relative to the executing folder, unless you publish it in a self-contain mode.
It was published in the self-contain mode.
Actually, this issue is because method PluginExists
uses the wrong path to find the specified plugin.
In addtion, as you said, relative path is an old issue that also exists in master branch, and it happens not only in the places I mentioned in this pr. I'll create annother issue if needed.
In addtion, as you said, relative path is an old issue that also exists in master branch, and it happens not only in the places I mentioned in this pr. I'll create annother issue if needed.
You dont have to, cause this issue does not exist in the official publish package as it is published in the self-contain mode.
In addtion, as you said, relative path is an old issue that also exists in master branch, and it happens not only in the places I mentioned in this pr. I'll create annother issue if needed.
You dont have to, cause this issue does not exist in the official publish package as it is published in the self-contain mode.
I have said that this issue also exists when it is published in the self-contain mode. I've tested it both on v3.4.0 and master branch, both on windows and linux. The cause of this issue is, in our code, files are read or generated based on the current execution directory, not the relative directory. And this issue was not raised before because of few usage scenarios, so it's not a high priority. Please be more careful.
@shargon Could you review again?
@Liaojinghui Please solve conflicts
@Liaojinghui Please solve conflicts
Resolved
updated to work under https://github.com/neo-project/neo-modules/pull/709
This pr implements neo-project/neo-node#863 Mode system is intended to help developers to save and load neo node configurations.
mainnet
mainnet
mode:testnet
mode:privatenet
mode:when user load into the privatenet mode, a single node blockchain network will be setup with the default primary account NbVj8GhwToNv4WF2gVaoco6hbkMQ8hrHWP. Please note that the secret key of this account is publicly available to everyone,
do not send any asset to this account in main net
you will lose your token and we will not be responsible for that.
Create your own mode You can config your own network by modifying the
config.json
andconfig.fs.json
in the root directory, as well as theconfig.json
of Plugins. Then runmode save [mode name]
to save your configuration as a mode. If the name you assigned is an existing mode, existing mode will be updated.