@@ -10,6 +10,7 @@ import (
10
10
"github.com/NethermindEth/juno/core/felt"
11
11
"github.com/NethermindEth/juno/db"
12
12
"github.com/NethermindEth/juno/db/pebble"
13
+ "github.com/NethermindEth/juno/migration"
13
14
"github.com/NethermindEth/juno/utils"
14
15
"github.com/olekukonko/tablewriter"
15
16
"github.com/spf13/cobra"
@@ -21,6 +22,7 @@ const (
21
22
22
23
type DBInfo struct {
23
24
Network string `json:"network"`
25
+ SchemaVersion uint64 `json:"schema_version"`
24
26
ChainHeight uint64 `json:"chain_height"`
25
27
LatestBlockHash * felt.Felt `json:"latest_block_hash"`
26
28
LatestStateRoot * felt.Felt `json:"latest_state_root"`
@@ -84,7 +86,7 @@ func dbInfo(cmd *cobra.Command, args []string) error {
84
86
defer database .Close ()
85
87
86
88
chain := blockchain .New (database , nil )
87
- info := DBInfo {}
89
+ var info DBInfo
88
90
89
91
// Get the latest block information
90
92
headBlock , err := chain .Head ()
@@ -97,6 +99,12 @@ func dbInfo(cmd *cobra.Command, args []string) error {
97
99
return fmt .Errorf ("failed to get the state update: %v" , err )
98
100
}
99
101
102
+ schemaMeta , err := migration .SchemaMetadata (database )
103
+ if err != nil {
104
+ return fmt .Errorf ("failed to get schema metadata: %v" , err )
105
+ }
106
+
107
+ info .SchemaVersion = schemaMeta .Version
100
108
info .Network = getNetwork (headBlock , stateUpdate .StateDiff )
101
109
info .ChainHeight = headBlock .Number
102
110
info .LatestBlockHash = headBlock .Hash
0 commit comments