EmerisHQ / tracelistener

UNIX named pipes-based real-time state listener for Cosmos SDK blockchains
GNU Affero General Public License v3.0
33 stars 8 forks source link

feat(resetchain): introduce new command #68

Closed Pitasi closed 2 years ago

Pitasi commented 2 years ago

resetchain is a tool that clears CockroachDB data for a specific chain.

It follows CockroachDB best practices for deleting data: https://www.cockroachlabs.com/docs/stable/bulk-delete-data.html. It can be summarised as: do deletes in chunks, use a "cursor" or some discriminator to select a chunk that certainly doesn't contain rows from the chunk you previously deleted (in our case, id column).

Closes https://github.com/EmerisHQ/demeris-backend/issues/564

Pitasi commented 2 years ago

I changed resetter_test.go to use a single cockroachdb instance across all tests, this should speed them up a lot. On my pc, the testserver takes almost 10s to start.