-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.go
More file actions
33 lines (29 loc) · 769 Bytes
/
plugin.go
File metadata and controls
33 lines (29 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package cevm
import (
"os"
"path/filepath"
)
// PluginPath returns the absolute path to the cevm VM plugin binary.
// Used by lux CLI and universe Makefiles to locate the built plugin.
func PluginPath() string {
home, err := os.UserHomeDir()
if err != nil {
return ""
}
return filepath.Join(home, "work", "luxcpp", "evm", "build", "bin", "cevm")
}
// PluginExists reports whether the cevm plugin binary is present on disk.
func PluginExists() bool {
p := PluginPath()
if p == "" {
return false
}
info, err := os.Stat(p)
return err == nil && !info.IsDir()
}
// VMID returns the VM ID for the cevm plugin.
// This is the identifier used by Lux subnet configuration to reference
// this VM in the plugin directory.
func VMID() string {
return "cevm"
}