forked from taikoxyz/taiko-mono
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartup.go
49 lines (43 loc) · 1.32 KB
/
startup.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package guardianproverhealthcheck
import (
"context"
"net/http"
"time"
"github.com/morkid/paginate"
)
// Startup represents an individual startup from a guardian prover, every time
// one boots up, we should receive a startup and save it in the database.
type Startup struct {
GuardianProverID uint64 `json:"guardianProverID"`
GuardianProverAddress string `json:"guardianProverAddress"`
L1NodeVersion string `json:"l1NodeVersion"`
L2NodeVersion string `json:"l2NodeVersion"`
Revision string `json:"revision"`
GuardianVersion string `json:"guardianVersion"`
CreatedAt time.Time `json:"createdAt"`
}
type SaveStartupOpts struct {
GuardianProverID uint64
GuardianProverAddress string
Revision string
GuardianVersion string
L1NodeVersion string `json:"l1NodeVersion"`
L2NodeVersion string `json:"l2NodeVersion"`
}
type NodeInfo struct {
Startup
LatestL1BlockNumber uint64 `json:"latestL1BlockNumber"`
LatestL2BlockNumber uint64 `json:"latestL2BlockNumber"`
}
type StartupRepository interface {
GetByGuardianProverID(
ctx context.Context,
req *http.Request,
id int,
) (paginate.Page, error)
GetMostRecentByGuardianProverID(
ctx context.Context,
id int,
) (*Startup, error)
Save(opts SaveStartupOpts) error
}