Add --pluginsdir flag. (#1)

Add a new flag, `--pluginsdir`, for setting the directory where plugins are stored.  The default remains `$datadir/plugins`.

Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Reviewed-on: cerc-io/plugeth#1
This commit is contained in:
2023-07-19 14:01:46 +08:00
committed by roysc
co-authored by telackey
parent 366f480bc1
commit 1d8f2a28e8
3 changed files with 22 additions and 3 deletions
+2 -1
View File
@@ -8,7 +8,7 @@ import (
"plugin"
"reflect"
"strings"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
"github.com/openrelayxyz/plugeth-utils/core"
@@ -58,6 +58,7 @@ func Lookup(name string, validate func(interface{}) bool) []interface{} {
var DefaultPluginLoader *PluginLoader
func NewPluginLoader(target string) (*PluginLoader, error) {
log.Info("Loading plugins from directory", "path", target)
pl := &PluginLoader{
Plugins: []pluginDetails{},
Subcommands: make(map[string]Subcommand),