Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: redesign layout #138

Merged
merged 1 commit into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions env.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,6 @@ func getSlotTipRef(g *localstatequery.GenesisConfigResult) uint64 {
return byronSlots + ((currentTimeSec - byronEndTime) / uint64(g.SlotLength/1000000))
}

// Calculate KES expiration from node metrics
func kesExpiration(
g *localstatequery.GenesisConfigResult,
p *PromMetrics,
) time.Time {
currentTimeSec := uint64(time.Now().Unix() - 1)
expirationTimeSec := currentTimeSec - (uint64(g.SlotLength/1000000) * (getSlotTipRef(g) % uint64(g.SlotsPerKESPeriod))) + (uint64(g.SlotLength/1000000) + uint64(g.SlotsPerKESPeriod)*p.RemainingKesPeriods)
return time.Unix(int64(expirationTimeSec), 0)
}

// Calculate expected interval between blocks
func slotInterval(g *localstatequery.GenesisConfigResult) uint64 {
// g.SlotLength is nanoseconds
Expand Down
4 changes: 4 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type Config struct {
type AppConfig struct {
NodeName string `yaml:"nodeName" envconfig:"NODE_NAME"`
Network string `yaml:"network" envconfig:"NETWORK"`
Refresh uint32 `yaml:"refresh" envconfig:"REFRESH"`
Retries uint32 `yaml:"retries" envconfig:"RETRIES"`
}

Expand All @@ -49,6 +50,7 @@ type NodeConfig struct {
type PrometheusConfig struct {
Host string `yaml:"host" envconfig:"PROM_HOST"`
Port uint32 `yaml:"port" envconfig:"PROM_PORT"`
Refresh uint32 `yaml:"refresh" envconfig:"PROM_REFRESH"`
Timeout uint32 `yaml:"timeout" envconfig:"PROM_TIMEOUT"`
}

Expand All @@ -64,6 +66,7 @@ var globalConfig = &Config{
App: AppConfig{
NodeName: "Cardano Node",
Network: "",
Refresh: 1,
Retries: 3,
},
Node: NodeConfig{
Expand All @@ -76,6 +79,7 @@ var globalConfig = &Config{
Prometheus: PrometheusConfig{
Host: "127.0.0.1",
Port: 12798,
Refresh: 3,
Timeout: 3,
},
}
Expand Down
Loading
Loading