mirror of
https://github.com/luxfi/evm.git
synced 2026-09-24 00:27:44 +00:00
Major refactoring to reduce EVM's dependency on node: External packages now used: - github.com/luxfi/p2p v1.0.2 (network/p2p, gossip, lp118) - github.com/luxfi/upgrade v1.0.0 (upgrade configs) - github.com/luxfi/vms v0.1.0 (VM interfaces) - github.com/luxfi/codec (codec utilities) - github.com/luxfi/units (unit constants) - github.com/luxfi/constants (network constants) - github.com/luxfi/utils (wrappers, json codec) Remaining node dependencies (minimal, for plugin model): - node/vms/rpcchainvm (RPC plugin server) - node/api (API utilities) - node/utils/rpc (RPC utilities) - node/version (version info) This follows the principle: ONE canonical package for each concern.
34 lines
733 B
Go
34 lines
733 B
Go
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package runner
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/luxfi/log"
|
|
"github.com/luxfi/node/vms/rpcchainvm"
|
|
"github.com/luxfi/utils/ulimit"
|
|
|
|
"github.com/luxfi/evm/plugin/evm"
|
|
)
|
|
|
|
func Run(versionStr string) {
|
|
printVersion, err := PrintVersion()
|
|
if err != nil {
|
|
fmt.Printf("couldn't get config: %s", err)
|
|
os.Exit(1)
|
|
}
|
|
if printVersion && versionStr != "" {
|
|
fmt.Println(versionStr)
|
|
os.Exit(0)
|
|
}
|
|
if err := ulimit.Set(ulimit.DefaultFDLimit, log.Root()); err != nil {
|
|
fmt.Printf("failed to set fd limit correctly due to: %s", err)
|
|
os.Exit(1)
|
|
}
|
|
rpcchainvm.Serve(context.Background(), &evm.VM{})
|
|
}
|