Closed Bexanderthebex closed 2 years ago
Hey there! The initial goal of this project was to store everything from the genesis in the database.
For the tasks we are solving with this project we don't need to delete the old data.
If you need something like that I can suggest to fork the Indexer for Explorer and implement the described feature for yourself.
@Bexanderthebex As @khorolets stated, given the name (near-indexer-for-explorer) this project is intended to be used by NEAR Explorer, which needs the whole history, so the proposed feature does not fit our needs. Feel free to fork the project and/or submit a PR. If the PR would look reasonable, we might merge it, but realistically, I feel that would create a maintenance burden on our side, which is not helping us, so I would recommend you go with a fork.
P.S. it is not as simple as just deleting old blocks since accounts
and access_keys
(and some other tables) have references to the receipts that created or deleted those accounts/keys, and thus you would need to take a closer look into those relations and drop the foreign key constraint.
@frol I agree with what @khorolets said. I think I'll just create a fork or we will just configure a non-archival node that will store the last 7 days worth of transactions.
Currently, we can define where to start indexing (block_height) but it would be awesome if we can also define how long the data can stay in the database so that it won't grow and we can run our database to a considerable size only. Probably something based on the block_timestamp