Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
KonradStaniec committed Nov 21, 2024
1 parent 6cafc58 commit e8624d5
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 20 deletions.
3 changes: 0 additions & 3 deletions covenant-signer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
2 changes: 1 addition & 1 deletion covenant-signer/cmd/dumpDefaultCfgCmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
21 changes: 5 additions & 16 deletions covenant-signer/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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\<username>\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\<username>\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.
Expand All @@ -40,11 +36,4 @@ func init() {
dafaultConfigPath,
"path to the configuration file",
)

rootCmd.PersistentFlags().StringVar(
&globalParamPath,
globalParamKey,
defaultGlobalParamsPath,
"path to the global params file",
)
}
41 changes: 41 additions & 0 deletions covenant-signer/example/config.toml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e8624d5

Please sign in to comment.