OSDN Git Service

feat: add node discovery and status check (#374)
[bytom/vapor.git] / toolbar / precognitive / database / orm / node_liveness.go
diff --git a/toolbar/precognitive/database/orm/node_liveness.go b/toolbar/precognitive/database/orm/node_liveness.go
new file mode 100644 (file)
index 0000000..307f8ba
--- /dev/null
@@ -0,0 +1,17 @@
+package orm
+
+import (
+       "time"
+)
+
+type NodeLiveness struct {
+       ID         uint64 `gorm:"primary_key"`
+       NodeID     uint16
+       PingTimes  uint64
+       PongTimes  uint64
+       BestHeight uint64
+       CreatedAt  time.Time
+       UpdatedAt  time.Time
+
+       Node *Node `gorm:"foreignkey:NodeID"`
+}