main.go 1.16 KB
Newer Older
1 2 3 4 5
package main

import (
	"os"

6
	opservice "github.com/ethereum-optimism/optimism/op-service"
7
	"github.com/urfave/cli/v2"
8 9

	"github.com/ethereum-optimism/optimism/op-proposer/flags"
Sabnock01's avatar
Sabnock01 committed
10
	"github.com/ethereum-optimism/optimism/op-proposer/metrics"
11
	"github.com/ethereum-optimism/optimism/op-proposer/proposer"
12
	"github.com/ethereum-optimism/optimism/op-service/cliapp"
13
	oplog "github.com/ethereum-optimism/optimism/op-service/log"
14
	"github.com/ethereum-optimism/optimism/op-service/metrics/doc"
15
	"github.com/ethereum/go-ethereum/log"
16 17 18
)

var (
19
	Version   = "v0.10.14"
20 21 22 23 24
	GitCommit = ""
	GitDate   = ""
)

func main() {
25
	oplog.SetupDefaults()
26 27

	app := cli.NewApp()
28
	app.Flags = cliapp.ProtectFlags(flags.Flags)
29
	app.Version = opservice.FormatVersion(Version, GitCommit, GitDate, "")
30
	app.Name = "op-proposer"
31 32
	app.Usage = "L2 Output Submitter"
	app.Description = "Service for generating and proposing L2 Outputs"
33
	app.Action = cliapp.LifecycleCmd(proposer.Main(Version))
34
	app.Commands = []*cli.Command{
35 36
		{
			Name:        "doc",
Sabnock01's avatar
Sabnock01 committed
37
			Subcommands: doc.NewSubcommands(metrics.NewMetrics("default")),
38 39 40
		},
	}

41 42 43 44 45
	err := app.Run(os.Args)
	if err != nil {
		log.Crit("Application failed", "message", err)
	}
}