filecoin-project / lotus

Reference implementation of the Filecoin protocol, written in Go
https://lotus.filecoin.io/
Other
2.81k stars 1.25k forks source link

add command to delete retrievals #8414

Closed coryschwartz closed 1 week ago

coryschwartz commented 2 years ago

Checklist

Lotus component

What is the motivation behind this feature request? Is your feature request related to a problem? Please describe.

Filecoin retrievals have no in-band method for removing retrievals.

filecoin retrievals end up in the repo under retrievals/, nodes that make a lot of deals can have a lot of data stored there without an obvious way to clear up the disk space. There ought to be a way to delete retrieved content other than just removing the car files found there.

Describe the solution you'd like

Add a new command and API endpoint to remove retireved content

probably something like this.

ClientRemoveRetrieval(ctx context.Context, deal retrievalmarket.DealID) error
// remove referenece from the retrieval store

and a cli could be something like this

lotus client rm <id>

Describe alternatives you've considered

Cleaning up using OS utilities works. But it probably isn't obvious that you can do this, and it isn't as easy to administer.

Additional context

Nodes that make a lot of retrieval deals can have a couple of TB stored per week, the storage requirement can be higher than the chain. API clients, for example, dealbot, have no way to clean up this storage through API calls.

coryschwartz commented 2 years ago

You can assign this to me to implement

rjan90 commented 1 week ago

Closing this ticket as the Legacy Lotus/Lotus-Miner Markets sub-system, which reached EOL at the end of the 31st January 2023, and has been completely removed from the code: