-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into hotfix-stakingoputputidx
- Loading branch information
Showing
15 changed files
with
692 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Changelog | ||
|
||
## [Unreleased](https://github.com/babylonchain/covenant-emulator/tree/HEAD) | ||
|
||
[Full Changelog](https://github.com/babylonchain/covenant-emulator/compare/v0.1.0...HEAD) | ||
|
||
**Merged pull requests:** | ||
|
||
- chore: Bump Babylon v0.8.0 [\#17](https://github.com/babylonchain/covenant-emulator/pull/17) ([gitferry](https://github.com/gitferry)) | ||
- Bumps babylon to latest version [\#16](https://github.com/babylonchain/covenant-emulator/pull/16) ([KonradStaniec](https://github.com/KonradStaniec)) | ||
- feat: Allow the covenant emulator to submit signatures in batches [\#15](https://github.com/babylonchain/covenant-emulator/pull/15) ([vitsalis](https://github.com/vitsalis)) | ||
- CI: Remove redundant SSH key logic [\#14](https://github.com/babylonchain/covenant-emulator/pull/14) ([filippos47](https://github.com/filippos47)) | ||
- chore: Remove dependency on finality-provider [\#13](https://github.com/babylonchain/covenant-emulator/pull/13) ([gitferry](https://github.com/gitferry)) | ||
- chore: Remove private repo thingy [\#11](https://github.com/babylonchain/covenant-emulator/pull/11) ([gitferry](https://github.com/gitferry)) | ||
|
||
## [v0.1.0](https://github.com/babylonchain/covenant-emulator/tree/v0.1.0) (2024-02-08) | ||
|
||
[Full Changelog](https://github.com/babylonchain/covenant-emulator/compare/v0.1.0-rc.0...v0.1.0) | ||
|
||
**Implemented enhancements:** | ||
|
||
- Cycle dependency with finality-provider [\#9](https://github.com/babylonchain/covenant-emulator/issues/9) | ||
|
||
## [v0.1.0-rc.0](https://github.com/babylonchain/covenant-emulator/tree/v0.1.0-rc.0) (2024-01-22) | ||
|
||
[Full Changelog](https://github.com/babylonchain/covenant-emulator/compare/5187e721981f61e36012e183af9171068d9b2544...v0.1.0-rc.0) | ||
|
||
**Closed issues:** | ||
|
||
- Log directory won't be created automatically if not existing [\#3](https://github.com/babylonchain/covenant-emulator/issues/3) | ||
|
||
**Merged pull requests:** | ||
|
||
- chore: Upgrade bbn to 0.8.0-rc.0 [\#12](https://github.com/babylonchain/covenant-emulator/pull/12) ([vitsalis](https://github.com/vitsalis)) | ||
- chore: Prepare public release [\#7](https://github.com/babylonchain/covenant-emulator/pull/7) ([gitferry](https://github.com/gitferry)) | ||
- chore: Bump babylon with checking of slashing time lock [\#6](https://github.com/babylonchain/covenant-emulator/pull/6) ([gitferry](https://github.com/gitferry)) | ||
- doc: Add initial documentation of covenant emulator [\#5](https://github.com/babylonchain/covenant-emulator/pull/5) ([gitferry](https://github.com/gitferry)) | ||
- chore: Fix directory permission when `init` [\#4](https://github.com/babylonchain/covenant-emulator/pull/4) ([gitferry](https://github.com/gitferry)) | ||
- chore: display the error when failing to load docs [\#2](https://github.com/babylonchain/covenant-emulator/pull/2) ([vitsalis](https://github.com/vitsalis)) | ||
- Init covenant emulator [\#1](https://github.com/babylonchain/covenant-emulator/pull/1) ([gitferry](https://github.com/gitferry)) | ||
|
||
|
||
|
||
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package config | ||
|
||
import ( | ||
"fmt" | ||
"net" | ||
"time" | ||
) | ||
|
||
const ( | ||
defaultMetricsPort = 2112 | ||
defaultMetricsHost = "127.0.0.1" | ||
defaultMetricsUpdateInterval = 100 * time.Millisecond | ||
) | ||
|
||
// MetricsConfig defines the server's basic configuration | ||
type MetricsConfig struct { | ||
Host string `long:"host" description:"IP of the Prometheus server"` | ||
Port int `long:"port" description:"Port of the Prometheus server"` | ||
UpdateInterval time.Duration `long:"updateinterval" description:"The interval of Prometheus metrics updated"` | ||
} | ||
|
||
func (cfg *MetricsConfig) Validate() error { | ||
if cfg.Port < 0 || cfg.Port > 65535 { | ||
return fmt.Errorf("invalid port: %d", cfg.Port) | ||
} | ||
|
||
ip := net.ParseIP(cfg.Host) | ||
if ip == nil { | ||
return fmt.Errorf("invalid host: %v", cfg.Host) | ||
} | ||
|
||
return nil | ||
} | ||
|
||
func (cfg *MetricsConfig) Address() (string, error) { | ||
if err := cfg.Validate(); err != nil { | ||
return "", err | ||
} | ||
return fmt.Sprintf("%s:%d", cfg.Host, cfg.Port), nil | ||
} | ||
|
||
func DefaultMetricsConfig() MetricsConfig { | ||
return MetricsConfig{ | ||
Port: defaultMetricsPort, | ||
Host: defaultMetricsHost, | ||
UpdateInterval: defaultMetricsUpdateInterval, | ||
} | ||
} |
Oops, something went wrong.