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: docs/quickstart/publish.md
+11-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ Pinning a file to IPFS is how content is published to IPFS. Any given file repre
16
16
:::callout
17
17
Data pinned to the IPFS network is public by default and retrievable by anyone. Make sure to avoid publishing private data or take the necessary measures to adequately encrypt it before publishing.
18
18
:::
19
+
19
20
## Prerequisites
20
21
21
22
- A free [web3.storage](https://web3.storage/) account.
@@ -55,7 +56,7 @@ Let's unpack what just happened, by looking at CIDs, and how they fits into the
55
56
56
57
In IPFS, every file and directory is identified with a Content Identifier ([CID](../concepts/content-addressing.md)). The CID serves as the **permanent address** of the file and can be used by anyone to find it on the IPFS network.
57
58
58
-
When a file is published to IPFS (like the image used in this guide), it's first transformed into a content-addressable representation by which the file is split into smaller chunks (if above ~1MB) which are linked, and hashed to produce the CID.
59
+
When a file is published to IPFS (like the image used in this guide), it's first transformed into a content-addressable representation by which the file is split into smaller chunks (if above ~1MB) which are linked and hashed to produce the CID.
59
60
60
61
The CID for the uploaded image is:
61
62
@@ -71,16 +72,18 @@ You can now share the CID and anyone should be able to fetch it.
71
72
72
73
To understand what happens when you pin a file, it's helpful to understand the lifecycle of data in IPFS, which can be summarised as follows:
73
74
74
-
1.**Content-addressable representation**: The file is transformed into a content-addressable representation with a CID. For this guide, the full details are not important. The basic idea is that this representation makes files and directories **content-addressable** via CIDs by chunking files into smaller blocks**, calculating their hashes, and constructing a [Merkle DAG](../concepts/merkle-dag.md).
75
+
1.**Content-addressable representation**: The file is transformed into a content-addressable representation with a CID. For this guide, the full details are not important. The basic idea is that this representation makes files and directories **content-addressable** via CIDs by chunking files into smaller blocks\*\*, calculating their hashes, and constructing a [Merkle DAG](../concepts/merkle-dag.md).
75
76
2.**Pinning:** refers to the stage where the blocks of the CID are saved on an IPFS node (or multiple nodes), in this case, web3.storage. Since saving is not enough for the CID to be retrievable, pinning typically refers to two things:
76
-
-**Advertising:** Making it discoverable to the IPFS network by advertising a record linking between the CID and the server's IP address to the network. This advertising stage is a continuous process that repeats.
77
+
-**Advertising:** Making it discoverable to the IPFS network by advertising a record linking between the CID and the server's IP address to <VueCustomTooltiplabel="Distributed Hash Table: a decentralized data store that maps data based on key-value pairs."underlinedmultilineis-left>the DHT</VueCustomTooltip>. This advertising stage is a continuous process that repeats typically every 12 hours.
77
78
-**Providing:** The content-addressable representation of the CID is persisted on one of web3.storage's IPFS nodes (servers running an IPFS node) and made publicly available to the IPFS network.
78
-
3.**Retrieval:** refers to when an IPFS node fetches the blocks of the CID and constructs the Merkle DAG. This achieves several things:
79
-
-**File access:**once the Merkle DAG is constructed, the file is essentially replicated and can be accessed.
80
-
-**Verifying**that the blocks received are the correct ones by hashing them. This allows blocks to come from any node in the network. This type of retrieval is *trustless*.
81
-
<!-- - **Replication:** when another IPFS node fetches the CID, it increases the replication factor of the CID, thereby increasing its resilience. -->
79
+
3.**Retrieval:** refers to when an IPFS node fetches the blocks of the CID and constructs the Merkle DAG. This usually involves several steps:
80
+
-**Block fetching:**An IPFS node fetches the blocks of the Merkle DAG (of the file or folder) from providers.
81
+
-**Verifying** the IPFS node verifies the blocks fetched by hashing them and ensuring the resulting hash is correct. Note that blocks can come from any node in the network and this type of retrieval is _trustless_.
82
+
-**File access:**once all the blocks are present, the Merkle DAG can be constructed making the CID successfully replicated and accessible.
82
83
4.**Deleting:** refers to the deletion of a CID from a node. Deletion is always a local operation. If a CID has been replicated by other nodes, it will continue to be available on the IPFS network.
83
84
85
+
Note that once the CID is replicated, it is typically advertised by default, even if it isn't explicitly pinned.
86
+
84
87
## Fetching your published file
85
88
86
89
Now that the file is published and you have a CID, you will learn how it can be fetched from the IPFS network.
@@ -94,7 +97,7 @@ The first option allows you to speak the native IPFS protocol. The latter serves
0 commit comments