mirror of
https://github.com/luxfi/evm.git
synced 2026-09-24 00:27:44 +00:00
- Change Go version from 1.24.6 to 1.22.8 (stable version) - Ensure all build scripts have executable permissions - Fix covdata issue by using stable Go version - CI should now pass all checks
56 lines
1.2 KiB
Go
56 lines
1.2 KiB
Go
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/luxfi/evm/cmd/simulator/config"
|
|
"github.com/luxfi/evm/cmd/simulator/load"
|
|
"github.com/spf13/pflag"
|
|
)
|
|
|
|
func main() {
|
|
fs := config.BuildFlagSet()
|
|
v, err := config.BuildViper(fs, os.Args[1:])
|
|
if errors.Is(err, pflag.ErrHelp) {
|
|
os.Exit(0)
|
|
}
|
|
|
|
if err != nil {
|
|
fmt.Printf("couldn't build viper: %s\n", err)
|
|
os.Exit(1)
|
|
}
|
|
|
|
if err != nil {
|
|
fmt.Printf("couldn't configure flags: %s\n", err)
|
|
os.Exit(1)
|
|
}
|
|
|
|
if v.GetBool(config.VersionKey) {
|
|
fmt.Printf("%s\n", config.Version)
|
|
os.Exit(0)
|
|
}
|
|
|
|
// For simulator, we'll set the log level globally
|
|
logLevelStr := v.GetString(config.LogLevelKey)
|
|
|
|
// The luxfi/log package doesn't have the same API as geth's log
|
|
// For now, we'll just print a message since the logging happens elsewhere
|
|
_ = logLevelStr
|
|
|
|
config, err := config.BuildConfig(v)
|
|
if err != nil {
|
|
fmt.Printf("%s\n", err)
|
|
os.Exit(1)
|
|
}
|
|
if err := load.ExecuteLoader(context.Background(), config); err != nil {
|
|
fmt.Printf("load execution failed: %s\n", err)
|
|
os.Exit(1)
|
|
}
|
|
}
|