Retrieving from Filecoin

Data can be fetched directly from Filecoin using CIDs and regular Filecoin tooling. To do so, you will need the CID of the Solana object to fetch—this may be found using the slot-to-cid or the tx-to-cid indexes; see Looking up CIDs.

Once you have the CID, use lassie to download the data. Lassie can be installed using the standard go toolchain:

$ go install github.com/filecoin-project/lassie/cmd/lassie@latest

To fetch the data, simply

$ lassie fetch [-o <output file>] [-t <timeout>] <CID>[/path/to/content]

This will download the data as a CAR file.

To extract the CAR file contents, use go-car tool --

$ go install github.com/ipld/go-car/cmd/car@latest
$ car extract -f </path/to/car/file>

Last updated