Browse Source

:art: Expose NodeID in /api/summary

Ettore Di Giacinto 3 năm trước cách đây
mục cha
commit
9ffe0f7445
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      api/api.go

+ 3 - 1
api/api.go

@@ -69,12 +69,14 @@ func API(ctx context.Context, l string, defaultInterval, timeout time.Duration,
 		services := len(ledger.CurrentData()[protocol.ServicesLedgerKey])
 		onChainNodes := len(e.HubRoom.Topic.ListPeers())
 		p2pPeers := len(e.Host().Network().Peerstore().Peers())
+		nodeID := e.Host().ID().String()
 
 		blockchain := ledger.Index()
 
 		return c.JSON(http.StatusOK, struct {
 			Files, Machines, Users, Services, BlockChain, OnChainNodes, Peers int
-		}{files, machines, users, services, blockchain, onChainNodes, p2pPeers})
+			NodeID                                                            string
+		}{files, machines, users, services, blockchain, onChainNodes, p2pPeers, nodeID})
 	})
 
 	ec.GET("/api/machines", func(c echo.Context) error {