From bf33ecfa3d12b5c369bbb1eeedbf3e06069ad7f8 Mon Sep 17 00:00:00 2001
From: Philip Offtermatt
Date: Tue, 12 Sep 2023 15:09:08 +0200
Subject: [PATCH 1/2] Add version command
---
cometmock/main.go | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/cometmock/main.go b/cometmock/main.go
index 6030f39..278f927 100644
--- a/cometmock/main.go
+++ b/cometmock/main.go
@@ -18,6 +18,8 @@ import (
"github.com/urfave/cli/v2"
)
+const version = "v0.37.x"
+
// GetMockPVsFromNodeHomes returns a list of MockPVs, created with the priv_validator_key's from the specified node homes
// We use MockPV because they do not do sanity checks that would e.g. prevent double signing
func GetMockPVsFromNodeHomes(nodeHomes []string) []types.PrivValidator {
@@ -43,6 +45,16 @@ func main() {
app := &cli.App{
Name: "cometmock",
HideHelpCommand: true,
+ Commands: []*cli.Command{
+ {
+ Name: "version",
+ Usage: "Print the version of cometmock",
+ Action: func(c *cli.Context) error {
+ fmt.Printf("%s\n", version)
+ return nil
+ },
+ },
+ },
Flags: []cli.Flag{
&cli.Int64Flag{
Name: "block-time",
From 891dfecb069cf72c0759d8e0aa47165bf2d6827e Mon Sep 17 00:00:00 2001
From: Philip Offtermatt
Date: Tue, 12 Sep 2023 15:09:48 +0200
Subject: [PATCH 2/2] Add makefile with install target
---
Makefile | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 Makefile
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..4c85cff
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,2 @@
+install:
+ go install ./cometmock
\ No newline at end of file