infra/op-signer/cmd/main.go
Sam Stokes 75b02dff3d
op-signer: add to this repo (#51)
* op-signer: add to this repo

* circleci: add op-signer jobs/workflows

* ops: update tag service to include op-signer

* readme: add op-signer one sentence description

* ci: add op-signer option to github action

* ops: add op-signer min version
2024-09-10 15:01:09 -04:00

52 lines
1.1 KiB
Go

package main
import (
"fmt"
"os"
"github.com/urfave/cli/v2"
"github.com/ethereum/go-ethereum/log"
signer "github.com/ethereum-optimism/infra/op-signer"
"github.com/ethereum-optimism/optimism/op-service/cliapp"
oplog "github.com/ethereum-optimism/optimism/op-service/log"
)
var (
Version = ""
GitCommit = ""
GitDate = ""
)
func main() {
oplog.SetupDefaults()
app := cli.NewApp()
app.Flags = cliapp.ProtectFlags(signer.CLIFlags("OP_SIGNER"))
app.Version = fmt.Sprintf("%s-%s-%s", Version, GitCommit, GitDate)
app.Name = "op-signer"
app.Usage = "OP Signing Service"
app.Description = ""
app.Commands = []*cli.Command{
{
Name: "client",
Usage: "test client for signer service",
Subcommands: []*cli.Command{
{
Name: "sign",
Usage: "sign a transaction",
Action: signer.ClientSign(Version),
Flags: cliapp.ProtectFlags(signer.ClientSignCLIFlags("SIGNER")),
},
},
},
}
app.Action = cliapp.LifecycleCmd(signer.MainAppAction(Version))
err := app.Run(os.Args)
if err != nil {
log.Crit("Application failed", "message", err)
}
}