Initial commit of stand alone consensus engine work.

This commit is contained in:
philip-morlier
2023-06-12 09:52:46 -07:00
parent 9badeb2b93
commit 7434ccb8c8
7 changed files with 548 additions and 1 deletions
+2 -1
View File
@@ -355,8 +355,9 @@ func geth(ctx *cli.Context) error {
defer stack.Close()
defer pluginsOnShutdown()
stack.RegisterAPIs(pluginGetAPIs(stack, wrapperBackend))
//end PluGeth code injection
startNode(ctx, stack, backend, false)
pluginHookTester()
//end PluGeth code injection
stack.Wait()
return nil
}
+18
View File
@@ -102,3 +102,21 @@ func pluginsOnShutdown() {
}
OnShutdown(plugins.DefaultPluginLoader)
}
func HookTester(pl *plugins.PluginLoader) {
fnList := pl.Lookup("HookTester", func(item interface{}) bool {
_, ok := item.(func())
return ok
})
for _, fni := range fnList {
fni.(func())()
}
}
func pluginHookTester() {
if plugins.DefaultPluginLoader == nil {
log.Warn("Attempting HookTester, but default PluginLoader has not been initialized")
return
}
HookTester(plugins.DefaultPluginLoader)
}