feat: Add node uptime rpc / output in info command

This commit is contained in:
Łukasz Magiera
2022-10-11 10:11:09 +02:00
parent e74838f024
commit 2c11f9d265
17 changed files with 119 additions and 0 deletions
+7
View File
@@ -2,6 +2,7 @@ package common
import (
"context"
"time"
"github.com/gbrlsnchs/jwt/v3"
"github.com/google/uuid"
@@ -26,6 +27,8 @@ type CommonAPI struct {
Alerting *alerting.Alerting
APISecret *dtypes.APIAlg
ShutdownChan dtypes.ShutdownChan
Start dtypes.NodeStartTime
}
type jwtPayload struct {
@@ -91,3 +94,7 @@ func (a *CommonAPI) Session(ctx context.Context) (uuid.UUID, error) {
func (a *CommonAPI) Closing(ctx context.Context) (<-chan struct{}, error) {
return make(chan struct{}), nil // relies on jsonrpc closing
}
func (a *CommonAPI) StartTime(context.Context) (time.Time, error) {
return time.Time(a.Start), nil
}