Documentation ¶
Index ¶
- Variables
- type DB
- type DBConnectionOpts
- type GetSignedBlocksByStartingBlockIDOpts
- type GuardianProver
- type HealthCheck
- type HealthCheckRepository
- type NodeInfo
- type SaveHealthCheckOpts
- type SaveSignedBlockOpts
- type SaveStartupOpts
- type SignedBlock
- type SignedBlockRepository
- type Startup
- type StartupRepository
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoDB = errors.Validation.NewWithKeyAndDetail("ERR_NO_DB", "DB is required")
)
View Source
var (
EventsProcessed = promauto.NewCounter(prometheus.CounterOpts{
Name: "events_processed_ops_total",
Help: "The total number of processed events",
})
)
Functions ¶
This section is empty.
Types ¶
type DBConnectionOpts ¶
type GetSignedBlocksByStartingBlockIDOpts ¶
type GetSignedBlocksByStartingBlockIDOpts struct {
StartingBlockID uint64
}
type GuardianProver ¶
type GuardianProver struct { Address common.Address ID *big.Int HealthCheckCounter prometheus.Counter SignedBlockCounter prometheus.Counter }
func SignatureToGuardianProver ¶
func SignatureToGuardianProver( msg []byte, b64EncodedSig string, guardianProvers []GuardianProver, ) (*GuardianProver, error)
type HealthCheck ¶
type HealthCheck struct { ID int `json:"id"` GuardianProverID uint64 `json:"guardianProverId"` Alive bool `json:"alive"` ExpectedAddress string `json:"expectedAddress"` RecoveredAddress string `json:"recoveredAddress"` SignedResponse string `json:"signedResponse"` LatestL1Block uint64 `json:"latestL1Block"` LatestL2Block uint64 `json:"latestL2Block"` CreatedAt time.Time `json:"createdAt"` }
type HealthCheckRepository ¶
type HealthCheckRepository interface { Get( ctx context.Context, req *http.Request, ) (paginate.Page, error) GetByGuardianProverID( ctx context.Context, req *http.Request, id int, ) (paginate.Page, error) GetMostRecentByGuardianProverID( ctx context.Context, req *http.Request, id int, ) (*HealthCheck, error) Save(opts SaveHealthCheckOpts) error GetUptimeByGuardianProverID(ctx context.Context, id int) (float64, int, error) }
type SaveHealthCheckOpts ¶
type SaveSignedBlockOpts ¶
type SaveStartupOpts ¶
type SignedBlock ¶
type SignedBlockRepository ¶
type SignedBlockRepository interface { Save(opts SaveSignedBlockOpts) error GetByStartingBlockID(opts GetSignedBlocksByStartingBlockIDOpts) ([]*SignedBlock, error) GetMostRecentByGuardianProverID(id int) (*SignedBlock, error) }
SignedBlockRepository defines database interaction methods to create and get signed blocks submitted by guardian provers.
type Startup ¶
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"` }
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.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.