Browsers3000 is a five-week hackathon hosted by ProtocolLabs focused on building decentralized solutions for the Web3 future.
As web browsers gradually adopt Web3 technology, the need for decentralized storage becomes more and more obvious. However, browser plugins and using distributed storage protocols such as IPFS face increasing limitations. Standard web browsers don't always take advantage of IPFS technology natively. Therefore, there is a need for an intermediary role to provide assistance to developers who intend to use such storage system applications to develop applications.
Estuary is the solution that many Web3 developers are looking for. Its essence is an IPFS node that integrates a minimal Filecoin library. Getting Filecoin and IPFS to work together is not difficult, but finding the right steps can take a bit of skill.
In this example, Textile is using an intermediary service set up to allow developers to pin content to the IPFS network using standard APIs. Before understanding their cooperation mechanism, you need to understand their respective principles.
IPFS and Filecoin: A Match Made in Heaven in the Blockchain World
Filecoin is a decentralized network that allows people to access data anywhere. Users can rent out their available storage space as nodes in the network, and users can also earn Filecoin through the data access services provided on these nodes.
Another link in this combination is IPFS, which is a Web3 file system that allows developers to access data on the network. The most similar service that can be found in the non-blockchain field is cloud computing, but IPFS is not controlled by large companies.
Old-school programmers may remember working with pointers in C. IPFS uses a similar concept, the content identifier (CID), through which data can be accessed on available nodes.
When accessing files, you can refer to the CID identifier on the IPFS storage service instead of using the file address on the local hard disk. However, since browsers don't understand IPFS natively, they need a way to treat these CIDs as files. This is what the Textile tool does.
Textile: A Sustainable IPFS Data Warehouse
The problem browsers have with IPFS files is that they are not persistent. Textile provides an easy build-as-a-service solution that developers can add to any website or app. Although the IPFS protocol is not natively supported in mainstream browsers, Textile can use"Buckets"As a way to organize indexing and pinning IPFS data to meet the needs of developers.
The steps to set up a bucket are very easy. It is nothing more than creating a local secret file to store the secret key needed to access the TextileHub account. When you sign up for a TextileHub account and develop an app, you get a pair of public and private keys. This key pair needs to be inserted into a text file in the following format:
TEXTILE_HUB_KEY=XXXX
TEXTILE_HUB_SECRET=XXXX
IPFS_GATEWAY=https://ipfs.io
This link may be the most technical operation. Textile's command-line CLI tool should be able to provide the value of the public-private key pair, allowing the system to access the bucket. When developers have completed this step, they should be able to easily use buckets to develop applications. You can learn more about this example using NextJS and TextileBuckets to quickly start a project template. .
Textile's integration solution supports development in any language or framework. Some developers may want to use React or Vue frameworks in production, but Angular or other JS implementations are actually fine. Public-private key pairs provide a way to securely store data. They also support operations that generate a libp2p identity.
When users of your application set up a libp2p key, they can use the bucket infrastructure set up by Textile to pin data to the IPFS network. Depending on server traffic and the quality of your internet connection, there may be a short wait for these files to become publicly accessible.
The more popular a particular piece of data is on the IPFS network, the faster it will be retrieved. If the data your users are storing requires verifiable proof of long-term storage, TextileBucket also supports a Filecoin API that allows you to make storage transaction proposals with storage providers you are already familiar with in the Filecoin network. But what if you don't even know a single storage provider? Estuary provides an easier solution that allows you to store data on the Filecoin network.
dual storage system
When data is added to a bucket through Textile, the data will be pinned to IPFS and can be accessed by others, but this does not mean that it must be on the Filecoin chain. Data accessed through Textile's IPFS gateway needs to reach a storage transaction proposal with a storage service provider before it can be added to the Filecoin blockchain. To pin data onto the Filecoin network, you need an intermediary service like Estuary or Textile'sBidbot.
Through Estuary, uploaded data can enter more than 100 nodes. But the question is, is your data really on the chain? There are a few easy ways to do the verification, allowing you to obtain the relevant file, CID identification number and information about the service provider that is storing the data.
Uploading files to Estuary is very simple, there are several ways:
1. Users can use Estuary's API in their applications
2. Use the command line
3. After logging in, drag and drop files in the browser
Estuary also supports listing data associated with a specific account. This list provides the files and CID identification information that the user has access to, including the storage service provider information on the Filecoin network that saves these data. Estuary provides a simple ReactJS integration method, developers can directly copy the reference. Of course, developers also need to add their own API keys, but in most cases, referring to the code snippets from the Estuary manual can meet the development needs.
A New Paradigm for Web Storage
IPFS and Filecoin are complementary systems, and the ecosystem has also developed tools such as Textile and Estuary to help the two collaborate. With the limited use of plug-ins, these tools are the best solution for developing Web3 applications in current browsers. In the future, when IPFS becomes more and more popular, browsers will support native integration solutions. As browser integration continues to evolve, Textile and Estuary also provide simple workarounds that allow these systems to work well in parallel.
——End——
Editor: Interstellar Vision IPFSNEWS Eric
