Skip to content

Commit

Permalink
added more logs to state dump script
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Jul 16, 2024
1 parent fb7fb21 commit 4c52baa
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions state-dump/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,16 @@ func main() {
iter := store.Iterator(nil, nil)

// Dump all keys as write operations.
count := 0
exported := 0
processed := 0
for ; iter.Valid(); iter.Next() {
key := iter.Key()

processed++
if processed%100000 == 0 {
fmt.Printf("Processed %d keys\n", processed)
}

// Make sure key is for the given address. Different stores have the address
// in a different position.
if len(addressesBech32Data) > 0 {
Expand Down Expand Up @@ -156,11 +162,14 @@ func main() {
panic(err)
}

count++
if count%5000 == 0 {
fmt.Println("Exported", count, "keys")
exported++
if exported == 1 {
fmt.Println("Exported first key")
}
if exported%5000 == 0 {
fmt.Println("Exported", exported, "keys")
}
}

fmt.Println("Exported", count, "keys")
fmt.Println("Exported", exported, "keys")
}

0 comments on commit 4c52baa

Please sign in to comment.