Files
sonr/cmd/hway/main.go
T

38 lines
686 B
Go
Raw Normal View History

package main
import (
_ "embed"
"fmt"
2024-12-05 20:36:58 -05:00
"os"
2024-12-16 15:29:54 -05:00
config "github.com/onsonr/sonr/internal/config/hway"
)
2024-12-05 20:36:58 -05:00
// main is the entry point for the application
func main() {
cmd := rootCmd()
if err := cmd.Execute(); err != nil {
fmt.Println(err)
2024-12-05 20:36:58 -05:00
os.Exit(1)
}
os.Exit(0)
}
func loadEnvImplFromArgs(args []string) (config.Hway, error) {
cmd := rootCmd()
if err := cmd.ParseFlags(args); err != nil {
return nil, err
}
env := &config.HwayImpl{
ServePort: servePort,
ChainId: chainID,
IpfsGatewayUrl: ipfsGatewayURL,
SonrApiUrl: sonrAPIURL,
SonrGrpcUrl: sonrGrpcURL,
SonrRpcUrl: sonrRPCURL,
PsqlDSN: formatPsqlDSN(),
}
return env, nil
}