What is IPFS?#
IPFS is a peer-to-peer hypermedia protocol that makes the web faster, safer, and more open. To put it simply, it is a decentralized internet. Technically, it is a distributed file system based on a distributed hash table (DHT) for content addressing, a Git model for version management, Merkle object associations, peer-to-peer technology, a global naming system (IPNS), and various other technologies.
In layman's terms, you can think of it as a shared cloud drive. You can try downloading IPFS - Desktop (for systems with a graphical interface) or kubo - ipfs (for CLI). Then start IPFS, and your device will become a node in the IPFS network.
What can you do with IPFS?#
Once you connect to the IPFS network, IPFS will automatically treat your device as a local IPFS node and look for other IPFS nodes. You will be able to help other users connect and provide files. At the same time, you can upload your files to your IPFS node, waiting for distribution so that other users on the network can access your files. In the IPFS network, accessing files is done through the IPFS gateway, such as: https://ipfs.io/ipfs/
+ CID (file hash)
. For example: https://ipfs.crossbell.io/ipfs/bafybeifbn36zmdb37ov6id3toy6bve47264hjk2yob6rm4bhw7ooawncf4
(Here, the ipfs.crossbell.io
IPFS gateway hosted by CrossBell is used to bypass the GFW ban.)
Is this technology really that ideal?#
This technology is indeed quite ideal, but practical applications encounter the following issues:
- Files uploaded through the local IPFS node cannot be accessed via the IPFS gateway + CID for a long time.
- Too few discovered nodes.
- It may consume a lot of your bandwidth.
Most of these problems are due to the network being too large, while the weight of a single IPFS node is very low. Although IPFS distribution can generally be completed within a few hours, for individuals, we should look for service providers to help us meet these needs. They often have greater weight in the IPFS network, higher efficiency in file updates, and also provide some extended services, such as automated Git deployment. The service used in this article is Fleek.
About Fleek#
You can simply understand it as having a high weight, with many IPFS nodes. Files uploaded to the IPFS network via Fleek can be broadcasted within seconds and support connecting Git repositories to deploy projects and bind your domain name.
Is Fleek trustworthy?#
I have only been using this service for 2 days. I observed that Fleek provides three types of access methods after successfully deploying a website:
xxx-xxx.fleek.app
: This domain uses Cloudflare CDN, and the actual number of resolved IPs is 2, not recommended for use.
: This method is the native IPFS access method. Access is done through the IPFS gateway + CID. However, since the CID is a hash value, it will change when your website changes.
3. Binding a custom domain for access, which will use Amazon's CDN and automatically map the CID, with the actual number of resolved IPs exceeding 30, and the speed is very fast.
Warning
Note that any IPFS-like technology using the HTTP protocol requires a centralized server to proxy access to the IPFS network. Only when the visitor connects to the IPFS network will a decentralized connection method be used.)
- Although it shows the IPFS file browsing interface, this page is actually achieved by making HTTP requests to Amazon CDN to proxy the IPFS network, and it is still a centralized network.
- Once your device is connected to the IPFS network, all traffic will use P2P (decentralized), so the access address you see is actually the local address.
To summarize, what can we do with Fleek?#
Let Fleek connect to your Git repository, build a static website through build commands, and publish it to IPFS, while also being compatible with HTTP access.
Getting Started#
- Go to fleek.xyz and log in with MetaMask.
- Connect your Git repository and enter build commands and other relevant information.
- Deploy the website.
- Bind the domain name.
- Final access.
Effect picture:
Expanding, what else can we do with IPFS technology? (😭 Currently deprecated)#
-
Create a huge image hosting service, already in use, see: https://pic.onani.cn (Principle: Request https://ipfs-pic.onani.cn, get the image list, randomly select and display using JS.)
-
No need to self-host any images anymore, already in use, all images on this blog are stored using IPFS.
-
Theoretically, you can upload any storage-consuming service to IPFS, achieving separation of storage and computation.