Simulate the creation process of the NFT market to create your own decentralized art gallery
IPFSCN中文社区
2021-04-08 06:46
本文约3096字,阅读全文需要约12分钟
Truffle Suite launches NFT development template with Filecoin Box

Recently, as the market enthusiasm continues to rise, NFT has begun to enter people's field of vision and continues to ferment. According to statistics, the global market value of NFT has reached 21.479 billion US dollars, becoming one of the most popular asset classes in this round of bull market. But there are pros and cons. Due to fundamental design flaws, people often hear that NFTs are "always on the blockchain". Because of the cost and space constraints of storing data on the blockchain, NFTs usually only store ownership records. Without the actual content of the NFT.

The digital artwork corresponding to NFT is not stored on the blockchain, but stored elsewhere on the network. If the server where the file is stored is shut down due to poor company operations, natural disasters, policies and regulations, etc., then the NFT assets will not find the corresponding target and lose their value. Therefore, under the NFT boom, the issue of safe storage of NFT assets is worthy of our calm thinking.

However, the emergence of IPFS effectively solves these problems. NFT stored on IPFS allows people to mint and trade NFT assets like Ethereum, and can natively support NFT. At the same time, the content addressing pioneered by IPFS can perfectly fit with the uniqueness of NFT, and calculate the hash value of the content. If no one destroys the file, users can find the closest copy according to this hash value.

With the popularity of NFTs, now is a good time to revisit best practices for linking and storing NFT data on IPFS. And all of this is exactly the Filecoin Box that needs to contain the NFT development template.

Recently, Truffle Suite officially announced that it will launch an NFT development template with Filecoin Box, and Filecoin Box can be used in Truffle! Developers can use the Filecoin Box to get started and start building a decentralized art gallery.


first level title


1. Noun analysis

Truffle Suite: is an Ethereum development environment, testing framework and asset pipeline, Truffle Suite manages and monitors the health of blockchain-enabled applications, built for open source and enterprises.
Filecoin Box: is a template for building, deploying and trading NFTs using the Filecoin Ganache and Ethereum Ganache simulators. With Filecoin Box, Truffle creates NFT storage solutions for developers and continues to bridge Ethereum. At the same time, IPFS and Filecoin ecosystem provide a solid foundation for NFT development.

Ganachefirst level title


2. What can be done with Filecoin Box

Using Filecoin Box, users can complete most of the development tasks of building a Filecoin application:

  • Launched personal IPFS node to store and retrieve files

  • Create a storage transaction and view its progress in different states

  • Test how the application handles expiry of storage transactions

  • Transfer Filecoin's token FIL between accounts

  • Interact with various Filecoin wallets

The advantages of Filecoin Box allow users to enter the Filecoin ecosystem and use Filecoin's powerful distributed storage, which in turn brings benefits to users' DApps. Not only that, but Filecoin Box enables developers to build decentralized art galleries, which include Lotus and IPFS nodes in addition to Ethereum nodes for deploying ERC-721-based NFTs.


first level title


text

1. Requirements for Filecoin Box

l Node.js 12.x or later.
l NPM 5.2 or later

l Windows, Linux or MacOS


2. Install

3. Settings

Open Filecoin Ganache, after the installation is complete, you can run Filecoin Ganache with the following command.

This step will create 10 accounts, each account will load 100 FIL, and display its account address and related private key at the same time.

It also starts the Lotus and IPFS processes running on: http and IPFS respectively.

4. Optionally run the Filecoin Ganache GUI
Another way to run Filecoin Ganache through the CLI is to use the Filecoin Ganche UI. As shown in the screenshot below, it displays all the core elements of the Filecoin protocol in the form of tabs, which is especially useful for users who are just starting to use Filecoin Ganache.

5. Run the Filecoin web browser
Note that these steps below will vary (including merging branches into master/main, webpack, truffle plugins, etc.).

Assuming your program is working properly, you can open the Filecoin web browser. The URL is: http://localhost:3000.

6. Run Ethereum Ganache

7. Create storage transaction
A storage transaction is an agreement between a client and a storage miner to store some data in the network for a certain period of time. It should be noted that in the Filecoin main network, a transaction must be reached with the miners before storing data, while in Filecoin Ganache, the transaction is automatically concluded.
8. Via the Filecoin web browser
The easiest way to store data, open Filecoin Network Explorer, navigate to"market"Label. From here, you can click",then click",then click"Upload to the Filecoin network"to select a file.
9. Saving via Truffle
Truffle now has a command that can be accessed directly from the Truffle CLI"save"document. It's currently experimental though, so only appears on specific branches.
After the installation is complete, you can save your assets with the following command. But need to include objects pointing to the respective nodes in your object (although these are already pre-configured out of the box)

10. Mint an NFT
At this point, we have made up the three assets of our NFT (metadata, thumbnail, and original asset) and created a transaction. The following are their corresponding CID addresses.
  • metadata (QmS4t7rFPxaaNriXvCmALr5GYRAtya5urrDaZgkfHutdCG)

  • thumbnail  (QmbAAMaGWpiSgmMWYTRtGsru382j6qTVQ4FDKX2cRTRso6)

  • asset  (QmUWFZQrJHfCVNHXVjjb2zeowVvH7dC6rKpbdHsTdnAgvP)

Assuming the local Ethereum Ganache node is running, we can open the console and follow the steps below to mint a new NFT. Since the base URL is set to the URL of the IPFS gateway, we only need to pass the CID into the asset metadata


11. Transfer of ownership

In the end, we just need to pass in ownership and the transaction experience is complete.


Under the leadership of the NFT wave, more and more users pay attention to and participate in the production. If you have not experienced how to create your own NFT and start a simulated transaction, create a decentralized art gallery of your own. Please pay attention to the official account [IPFS lover], you can get the official link tutorial address, and experience in depth how to use Filecoin Box on Truffle Suite to create a wonderful world about NFT.

IPFSCN中文社区
作者文库