diff --git a/covenant-signer/Dockerfile b/covenant-signer/Dockerfile index 54c9f28..8fc3e2f 100644 --- a/covenant-signer/Dockerfile +++ b/covenant-signer/Dockerfile @@ -1,8 +1,5 @@ FROM golang:1.23.1-alpine as builder -# Version to build. Default is the Git HEAD. -ARG VERSION="HEAD" - # Use muslc for static libs ARG BUILD_TAGS="muslc" diff --git a/covenant-signer/cmd/dumpDefaultCfgCmd.go b/covenant-signer/cmd/dumpDefaultCfgCmd.go index d29d442..1134d80 100644 --- a/covenant-signer/cmd/dumpDefaultCfgCmd.go +++ b/covenant-signer/cmd/dumpDefaultCfgCmd.go @@ -13,7 +13,7 @@ func init() { var dumpCfgCmd = &cobra.Command{ Use: "dump-cfg", - Short: "dumps default confiiguration file", + Short: "dumps default configuration file", RunE: func(cmd *cobra.Command, args []string) error { path, err := cmd.Flags().GetString(configPathKey) if err != nil { diff --git a/covenant-signer/cmd/root.go b/covenant-signer/cmd/root.go index 11c3d2d..3762f64 100644 --- a/covenant-signer/cmd/root.go +++ b/covenant-signer/cmd/root.go @@ -12,20 +12,16 @@ var ( configPath string configPathKey = "config" - globalParamPath string - globalParamKey = "params" - rootCmd = &cobra.Command{ Use: "covenant-signer", Short: "remote signing serivce to perform covenant duties", } - // C:\Users\\AppData\Local\tools on Windows - // ~/.tools on Linux - // ~/Library/Application Support/tools on MacOS - dafaultConfigDir = btcutil.AppDataDir("signer", false) - dafaultConfigPath = filepath.Join(dafaultConfigDir, "config.toml") - defaultGlobalParamsPath = filepath.Join(dafaultConfigDir, "global-params.json") + // C:\Users\\AppData\Local\signer on Windows + // ~/.signer on Linux + // ~/Library/Application Support/signer on MacOS + dafaultConfigDir = btcutil.AppDataDir("signer", false) + dafaultConfigPath = filepath.Join(dafaultConfigDir, "config.toml") ) // Execute executes the root command. @@ -40,11 +36,4 @@ func init() { dafaultConfigPath, "path to the configuration file", ) - - rootCmd.PersistentFlags().StringVar( - &globalParamPath, - globalParamKey, - defaultGlobalParamsPath, - "path to the global params file", - ) } diff --git a/covenant-signer/example/config.toml b/covenant-signer/example/config.toml new file mode 100644 index 0000000..660b67d --- /dev/null +++ b/covenant-signer/example/config.toml @@ -0,0 +1,41 @@ +# This is a TOML config file. +# For more information, see https://github.com/toml-lang/toml + +[keystore] +# The type of the key store +keystore-type = "cosmos" + +[keystore.cosmos] +# The directory to store the keys in +key-directory = "" +# The keyring backend to use +keyring-backend = "" +# The name of the key to use +key-name = "" +# Passphrase +passphrase = "" + +[server-config] +# The address to listen on +host = "127.0.0.1" + +# The port to listen on +port = 9791 + +# Read timeout in seconds +read-timeout = 15 + +# Write timeout in seconds +write-timeout = 15 + +# Idle timeout in seconds +idle-timeout = 120 + +# Max content length in bytes +max-content-length = 8192 + +[metrics] +# The prometheus server host +host = "127.0.0.1" +# The prometheus server port +port = 2112