Browse Source

:notebook: Add API call for ledger

Ettore Di Giacinto 3 years ago
parent
commit
3f68ec157f
1 changed files with 4 additions and 0 deletions
  1. 4 0
      api/api.go

+ 4 - 0
api/api.go

@@ -88,6 +88,10 @@ func API(l string, ledger *blockchain.Ledger) error {
 		return c.JSON(http.StatusOK, ledger.BlockChain())
 	})
 
+	ec.GET("/api/ledger", func(c echo.Context) error {
+		return c.JSON(http.StatusOK, ledger.CurrentData())
+	})
+
 	ec.GET("/api/ledger/:bucket/:key", func(c echo.Context) error {
 		bucket := c.Param("bucket")
 		key := c.Param("key")