|
@@ -45,7 +45,7 @@ func API(l string, ledger *blockchain.Ledger) error {
|
|
|
machines := len(ledger.CurrentData()[edgevpn.MachinesLedgerKey])
|
|
|
users := len(ledger.CurrentData()[edgevpn.UsersLedgerKey])
|
|
|
services := len(ledger.CurrentData()[edgevpn.ServicesLedgerKey])
|
|
|
- blockchain := len(ledger.BlockChain())
|
|
|
+ blockchain := ledger.Index()
|
|
|
|
|
|
return c.JSON(http.StatusOK, struct {
|
|
|
Files, Machines, Users, Services, BlockChain int
|
|
@@ -84,9 +84,9 @@ func API(l string, ledger *blockchain.Ledger) error {
|
|
|
|
|
|
ec.GET("/*", echo.WrapHandler(http.StripPrefix("/", assetHandler)))
|
|
|
|
|
|
- ec.GET("/api/blockchain", func(c echo.Context) error {
|
|
|
- return c.JSON(http.StatusOK, ledger.BlockChain())
|
|
|
- })
|
|
|
+ // ec.GET("/api/blockchain", func(c echo.Context) error {
|
|
|
+ // return c.JSON(http.StatusOK, ledger.BlockChain())
|
|
|
+ // })
|
|
|
|
|
|
ec.GET("/api/ledger", func(c echo.Context) error {
|
|
|
return c.JSON(http.StatusOK, ledger.CurrentData())
|