Automatically configuring and enabling plugins after installing with ark plugin:install
#4591
-
It seems counterintuitive that you can install a plugin via I see references to |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
In order to use installed plugin it has to be included in the app.json. We cannot automatically load the plugin based on its manifest file, because we cannot determine which processes will use it (e.g. In order to use plugin in the app.jso it has to export ServiceProvider class. You can look into core-manager plugin for reference (ServiceProvider, export). To avoid manual configuration your plugin can also export CLI commands. You can implement custom command like To sum it up you can implement the If you are using only one network configuration CLI plugins are loaded automatically. When you are using multiple network configurations (devnet, testnet, mainnet) then provide desired network via References: |
Beta Was this translation helpful? Give feedback.
ark plugin:install
will install plugin under the selected network data path (for example: /ark-core/devnet /plugins/).In order to use installed plugin it has to be included in the app.json. We cannot automatically load the plugin based on its manifest file, because we cannot determine which processes will use it (e.g.
core
,relay
). The order of the plugin is also important, because plugins are loaded sequentially as they are listed in app.json. If you use dependencies to other packages that often means that it has to be loaded just after the dependent plugin and we cannot simplify it to be loaded after the other packages. For example if you want to decorate logger which is the first plug…