You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: build/cookbook/filecoin-pin/getting-started.md
+15-8Lines changed: 15 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ Before starting, make sure you have:
33
33
Install the CLI globally with npm:
34
34
35
35
```sh
36
-
npm install -g filecoin-pin
36
+
npm install -g filecoin-pin@latest
37
37
```
38
38
39
39
Verify the installation:
@@ -71,22 +71,29 @@ In MetaMask:
71
71
72
72
The private key is a 64-character hex string, with or without an `0x` prefix.
73
73
74
-
### 2️⃣ Save the private key to a `.env` file
74
+
### 2️⃣ Save or export the private key
75
+
76
+
The Filecoin Pin CLI does not store your key, but a `.env` file is still a local file on disk. Use a private working directory, keep `.env` out of git, and delete the file when you no longer need it.
75
77
76
78
Create a file named `.env` in your working directory containing:
77
79
78
-
```
80
+
```sh
79
81
export PRIVATE_KEY="0xYOUR_PRIVATE_KEY_HERE"
80
82
```
81
83
82
84
Then secure it and load it into your shell:
83
85
84
86
```sh
87
+
printf'.env\n'>> .gitignore
85
88
chmod 600 .env
86
89
source .env
87
90
```
88
91
89
-
Add `.env` to your `.gitignore` if you're inside a git repository.
92
+
For a one-off shell session, you can avoid writing the key to disk and export it directly instead:
93
+
94
+
```sh
95
+
export PRIVATE_KEY="0xYOUR_PRIVATE_KEY_HERE"
96
+
```
90
97
91
98
***
92
99
@@ -223,13 +230,13 @@ filecoin-pin add my-data/
223
230
224
231
Your file is now retrievable via standard IPFS tooling using its Root CID. For example:
225
232
226
-
```
233
+
```text
227
234
https://<YOUR_ROOT_CID>.ipfs.inbrowser.link
228
235
```
229
236
230
237
Or via the dweb.link gateway:
231
238
232
-
```
239
+
```text
233
240
https://dweb.link/ipfs/<YOUR_ROOT_CID>
234
241
```
235
242
@@ -246,13 +253,13 @@ Filecoin storage providers must cryptographically prove daily that they continue
246
253
List the data sets associated with your wallet:
247
254
248
255
```sh
249
-
filecoin-pin data-set --ls
256
+
filecoin-pin data-set list
250
257
```
251
258
252
259
Then get the full on-chain detail for a specific data set:
253
260
254
261
```sh
255
-
filecoin-pin data-set <DATASET_ID>
262
+
filecoin-pin data-set show <DATASET_ID>
256
263
```
257
264
258
265
This queries the smart contracts directly, so the values are live blockchain state.
Copy file name to clipboardExpand all lines: build/cookbook/retrieve-data.md
+25-58Lines changed: 25 additions & 58 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,83 +8,50 @@ description: >-
8
8
9
9
### <markstyle="color:blue;">Retrieve data using retrieval clients</mark>
10
10
11
-
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.
11
+
To retrieve data stored on the Filecoin network, the basic process involves making retrieval requests to storage providers or IPFS peers using the root Content ID (CID) for the data.
12
12
13
-
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.
13
+
Filecoin retrieval clientshandle provider discovery and transport selection behind the scenes. Provide the root CID, and the client returns the data through a command-line interface or a library integration.
14
14
15
15
#### **Ingredients**
16
16
17
-
With a given CID, you can use any of the following retrieval clients to retrieve content.
17
+
With a given CID, you can use the following maintained retrieval tooling:
18
18
19
-
*[Lassie](https://github.com/filecoin-project/lassie): optimizes for most efficient available retrieval protocols.
20
-
*[go-car](https://github.com/ipld/go-car): a content addressable archive utility.
19
+
*[Lassie](https://github.com/filecoin-project/lassie): retrieves IPFS and Filecoin content over the best available protocols.
20
+
*[go-car](https://github.com/ipld/go-car): reads, lists, and extracts content-addressed archive (CAR) files.
21
21
22
22
#### **Instructions**
23
23
24
24
**Retrieving content with Lassie**
25
25
26
-
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.
26
+
Install the current Lassie and go-car command-line tools. Make sure [Go](https://go.dev/doc/install) is installed and that your Go binary directory is on your `PATH`, or download the latest binaries from the [Lassie releases](https://github.com/filecoin-project/lassie/releases/latest) and [go-car releases](https://github.com/ipld/go-car/releases/latest):
27
27
28
-
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.
29
-
30
-
<preclass="language-jsx"><codeclass="lang-jsx"><strong>lassie fetch -o - <CID> | car extract
31
-
</strong></code></pre>
28
+
```sh
29
+
go install github.com/filecoin-project/lassie/cmd/lassie@latest
30
+
go install github.com/ipld/go-car/cmd/car@latest
31
+
```
32
32
33
-
For example,
33
+
Lassie fetches content in CAR form. Stream the CAR to go-car when you want to extract the UnixFS files immediately:
34
34
35
+
```sh
36
+
lassie fetch -o - <CID>| car extract -
35
37
```
36
-
lassie fetch -p bafybeic56z3yccnla3cutmvqsn5zy3g24muupcsjtoyp3pu5pm5amurjx4 | car extract
38
+
39
+
To save the CAR for later inspection or extraction:
40
+
41
+
```sh
42
+
lassie fetch -p -o <CID>.car <CID>
43
+
car ls -f <CID>.car
44
+
car extract -f <CID>.car
37
45
```
38
46
39
-
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](https://github.com/filecoin-project/lassie?tab=readme-ov-file#golang-library).
40
-
41
-
The following example demonstrates how to use the Lassie library to fetch a CID.
fmt.Printf("Fetched %d blocks in %d bytes\n", stats.Blocks, stats.Size)
84
-
}
47
+
For example:
85
48
49
+
```sh
50
+
lassie fetch -o - bafybeic56z3yccnla3cutmvqsn5zy3g24muupcsjtoyp3pu5pm5amurjx4 | car extract -
86
51
```
87
52
53
+
For library integrations, use the current [Lassie Go library documentation](https://github.com/filecoin-project/lassie?tab=readme-ov-file#golang-library) instead of copying an example from this reference page.
54
+
88
55
For quick retrieval of existing datasets with the methods above, check out the [Filecoin Dataset Explorer](https://datasets.filecoin.io/).
Copy file name to clipboardExpand all lines: getting-started/how-retrieval-works/basic-retrieval.md
+27-27Lines changed: 27 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,15 +30,15 @@ Make sure that you have [Go](https://go.dev/) installed and that your `GOPATH` i
30
30
31
31
Or download and install Lassie using the Go package manager:
32
32
33
-
```
34
-
go install github.com/filecoin-project/lassie/cmd/lassie@latest
35
-
```
33
+
```sh
34
+
go install github.com/filecoin-project/lassie/cmd/lassie@latest
35
+
```
36
36
37
37
2. Download the [go-car binary from the latest release](https://github.com/ipld/go-car/releases/latest) based on your system architecture or install the [go-car](https://github.com/ipld/go-car) package using the Go package manager. The go-car package makes it easier to work with content-addressed archive (CAR) files:
38
38
39
-
```
40
-
go install github.com/ipld/go-car/cmd/car@latest
41
-
```
39
+
```sh
40
+
go install github.com/ipld/go-car/cmd/car@latest
41
+
```
42
42
43
43
You now have everything you need to retrieve a file with Lassie and extract the contents with `go-car`.
44
44
@@ -51,7 +51,7 @@ The video below demonstrates how Lassie can be used to render content directly f
51
51
Lassie and `go-car` can work together to retrieve and extract data from Filecoin. All you need is the CID of the content to download.
52
52
53
53
```shell
54
-
lassie fetch -o - <CID>| car extract
54
+
lassie fetch -o - <CID>| car extract -
55
55
```
56
56
57
57
This command uses a `|` to chain two commands together. This will work on Linux or macOS. Windows users may need to use PowerShell to use this form. Alternatively, you can use the commands separately, as explained later on this page.
* `-o` is an optional flag that tells Lassie where to write the output to. If you don’t specify a file, it will append `.car` to your CID and use that as the output file name.
109
110
110
-
If you specify`-p`, the output will be written to `stdout` so it can be piped to another command, such as `go-car`, or redirected to a file.
111
+
Use `-o -` to write the CAR stream to `stdout` so it can be piped to another command, such as `go-car`, or redirected to a file.
111
112
112
113
* `<CID>/path/to/content` is the CID of the content you want to retrieve and an optional path to a specific file within that content. Example:
113
-
*```shell
114
-
lassie fetch -o - bafybeiaysi4s6lnjev27ln5icwm6tueaw2vdykrtjkwiphwekaywqhcjze/wiki/Cryptographic_hash_function | car extract - | less
115
-
```
114
+
115
+
lassie fetch -o - bafybeiaysi4s6lnjev27ln5icwm6tueaw2vdykrtjkwiphwekaywqhcjze/wiki/Cryptographic_hash_function | car extract - | less
116
116
117
117
A CID is always necessary, and if you don’t specify a path, Lassie will attempt to download the entire content. If you specify a path, Lassie will only download that specific file or, if it is a directory, the entire directory and its contents.
118
118
@@ -128,19 +128,19 @@ car extract -f <INPUT_FILE>[/path/to/file/or/directory] [<OUTPUT_DIR>]
128
128
* `/path/to/file/or/directory` is an optional path to a specific file or directory within the CAR. If omitted, it will attempt to extract the entire CAR.
129
129
* `<OUTPUT_DIR>` is an optional argument that tells `go-car` where to write the output to. If omitted, it will be written to the current directory.
130
130
131
-
If you supply `-p`, as in the above example, it will attempt to extract the content directly to `stdout`. This will only work if we are extracting a single file.
131
+
If you supply `-p`, `car extract` writes extracted file bytes directly to `stdout`. This only works when extracting a single file.
132
132
133
133
In the example above, where we fetched a file named `lidar-data.tar`, the `>` operator was used to redirect the output of `car extract` to a named file. This is because the content we fetched was raw file data that did not have a name encoded. In this case, if we didn’t use `-` and `> filename`, `go-car` would write to a file named `unknown`. In this instance, `go-car` was used to reconstitute the file from the raw blocks contained within Lassie’s CAR output.
134
134
135
135
`go-car` has other useful commands. The first is `car ls`, which can be used to list the contents of a CAR. The second is `car inspect`, which can be used to inspect the contents of the CAR and optionally verify the integrity of a CAR.
136
136
137
-
And there we have it! Downloading and managing data from Filecoin is super simple when you use Lassie and Go-car!
137
+
Lassie and go-car are the recommended command-line tools for retrieving and inspecting Filecoin data by CID.
138
138
139
139
#### Lassie HTTP daemon
140
140
141
141
The Lassie HTTP daemon is an HTTP interface for retrieving IPLD data from IPFS and Filecoin peers. It fetches content from peers known to have it and provides the resulting data in CAR format.
Copy file name to clipboardExpand all lines: getting-started/how-storage-works/storage-onramps.md
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,13 +8,16 @@ description: >-
8
8
9
9
Developers use web UIs, APIs, or libraries to send data to storage onramps. Behind the scenes, storage onramps receive the data and handle the underlying processes to store it in a reliable way, making deals with Filecoin storage providers.
10
10
11
-
The available storage onramps are:
11
+
Examples of maintained storage onramps include:
12
12
13
-
*[Lighthouse](https://lighthouse.storage/) "offers permanent, decentralized storage powered by Filecoin. Secure, scalable, and ideal for individuals, developers, and enterprises."
14
-
*[Akave](https://www.akave.ai/) is "revolutionizing data management with a decentralized, modular solution that combines the robust storage of Filecoin with cutting-edge encryption and easy-to-use interfaces."
15
-
*[Storacha](https://storacha.network/) is an open hot storage network scales IPFS and Filecoin. Upload any data and Storacha will ensure it ends up on a decentralized set of IPFS and Filecoin storage providers. There Storacha [docs](https://docs.storacha.network/) detail the JavaScript and Go API libraries, and there is a no-code web uploader available as well.
16
-
*[Singularity](https://data-programs.gitbook.io/singularity) "facilitates onboarding of large quantities of data (PB-scale) to the Filecoin network in an efficient, secure, and flexible way."
17
-
*[CID Gravity](https://www.cidgravity.com/) is a "seamless gateway to the decentralized web", allowing you to drag and drop files through an easy-to-use UI that uploads files to Filecoin and IPFS.
13
+
*[Filecoin Onchain Cloud](../../build/advanced/filecoin-onchain-cloud.md) is a programmable, on-chain storage platform with verifiable storage proofs (PDP) and automatic payments (Filecoin Pay), accessed through the Synapse SDK.
14
+
*[Filecoin Pin](../../build/cookbook/filecoin-pin/getting-started.md) is a CLI and API path for pinning IPFS-compatible content to Filecoin-backed storage with Filecoin Pay.
15
+
*[fil.one](https://fil.one/) is S3-compatible object storage backed by Filecoin, with flat per-terabyte pricing and no egress fees. Point any S3 SDK or tool at its endpoint to store data with cryptographic integrity proofs. See the [fil.one docs](https://docs.fil.one/).
16
+
*[Lighthouse](https://lighthouse.storage/) offers permanent, decentralized storage powered by Filecoin.
17
+
*[Akave](https://www.akave.ai/) provides a decentralized data-lake and object-storage layer backed by Filecoin.
18
+
*[Pinata](https://pinata.cloud/) is an IPFS pinning service for storing and serving files, media, and app data over IPFS. See the [Pinata docs](https://docs.pinata.cloud/).
19
+
*[Singularity](https://data-programs.gitbook.io/singularity) facilitates onboarding large quantities of data to the Filecoin network.
20
+
*[CID Gravity](https://www.cidgravity.com/) provides a web UI for uploading files to Filecoin and IPFS.
18
21
*[Ramo](https://use.ramo.computer/) provides Filecoin-based, S3-compatible storage for data on Filecoin.
19
22
20
23
[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill\_Page+URL=https://docs.filecoin.io/getting-started/how-storage-works/storage-onramps)
0 commit comments