Retrieve Data
Learn how to retrieve data for the Filecoin network with different approaches as well as incentivize data retrievability.
Retrieve data using retrieval clients
To retrieve data stored on the Filecoin network, the basic process involves making retrieval requests to Service Providers (SPs) who initially stored the data, using either the Content ID (CID) or the storage deal ID.
A programmatic option is to utilize Filecoin retrieval clients, which handle the intricate retrieval process behind the scenes. By simply providing a Content ID (CID), retrieval clients can efficiently return your data either via the command-line interface (CLI) or through the programmable method.
Ingredients
With a given CID, you can use any of the following retrieval clients to retrieve content.
Saturn: a Web3 CDN in Filecoin’s retrieval market.
Instructions
retrieving content with Lassie
Lassie is designed to fetch content in the content-addressed archive (CAR) form. In most cases, you will require additional tooling, such as the go-car library, to work with CAR files effectively.
The Lassie command line interface (CLI) provides the simplest method for retrieving content from the Filecoin/IPFS network. By using the lassie fetch
command and passing the CID as an argument, you can easily retrieve the desired content.
For example,
Lassie can also serve as a go library within your Golang application when programmatically retrieving content from the network. To utilize Lassie in your code, you need to install the dependency and import it into your program following the instructions here.
The following example demonstrates how to use the Lassie library to fetch a CID.
retrieving content with Saturn
Saturn Javascript Client is still a work in progress and not recommended for use in production yet.
The following code example demonstrates how to use the Saturn in the Javascript program to fetch a CID.
For quick retrieval of existing datasets with the methods above, check out the Filecoin Dataset Explorer.
Last updated