Filecoin 백서

Filecoin

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 52쪽 중 24쪽

`$AGENT_ID` in the [Verify Registration](#verify-registration) step below. **Alternative:** You can also look up the transaction on [BaseScan (Base Sepolia)](https://sepolia.basescan.org/) → **Logs** tab → **Transfer** or **Registered** event, and read the `tokenId` / `agentId` from the event (e.g. [example transaction](https://sepolia.basescan.org/tx/0x0edda2928ec45aaa4091a2fa2cc863f249e78b86931aed31e2c5365d3b99175c) shows token ID 398). ### Verify Registration Confirm your agent is registered correctly using the agent ID from the previous step (use `$AGENT_ID` if you extracted it with `cast`, or the value you read from BaseScan): ```bash cast call $IDENTITY_REGISTRY \ "tokenURI(uint256)" \ $AGENT_ID \ --rpc-url $BASE_SEPOLIA_RPC ``` You will get ABI-encoded output similar to: ```bash 0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000059697066733a2f2f626166796265696868616c35686c62796c6b69626e696967366a37327764726d376c72346e66367a34376e61746c6568326a6b796f7372673764692f6769746875622d6167656e742d636172642e6a736f6e00000000000000 ``` The output is ABI-encoded. Decode it: ```bash cast --abi-decode "f()(string)" <OUTPUT_FROM_ABOVE> ``` You should see your Token URI returned: `ipfs://<ROOT_CID>/github-agent-card.json`: ```bash cast --abi-decode "f()(string)" 0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000059697066733a2f2f626166796265696868616c35686c62796c6b69626e696967366a37327764726d376c72346e66367a34376e61746c6568326a6b796f7372673764692f6769746875622d6167656e742d636172642e6a736f6e00000000000000 "ipfs://bafybeihhal5hlbylkibniig6j72wdrm7lr4nf6z47natleh2jkyosrg7di/github-agent-card.json" ``` ### View on Block Explorer Visit your agent on the Base Sepolia block explorer: ``` https://sepolia.basescan.org/nft/0x8004a818bfb912233c491871b3d84c89a494bd9e/<AGENT_ID_DECIMAL> ``` Replace `<AGENT_ID_DECIMAL>` with your agent's ID (e.g., `398`). <figure><img src="https://3376433986-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxNWFG7bQkjLkl5BBGjbD%2Fuploads%2Fgit-blob-07f698e6c7069c77d1dbf99500d44a1dc985ae4d%2Feip8004-base-explorer-nft.png?alt=media" alt=""><figcaption><p>Base Sepolia block explorer, showing NFT minted</p></figcaption></figure> *** ## Step 4: Check On-chain Storage Proofs Finally, let's verify that your agent card is persistently stored with cryptographic proofs. ### Check PDP Proof Status Use the Dataset ID from Step 2: ```bash filecoin-pin data-set show 11653 # Replace with your Dataset ID ``` You'll see output like: ```bash filecoin-pin data-set show 11653 ┌ Filecoin Onchain Cloud Data Set Details for #11653 │ ◇ ━━━ Data Set ━━━ │ │ Network: calibration │ Client address: 0x44896a716F7b5Ed343C6962b3D56FaA5377Cd052 │ │ #11653 │ Status: live │ CDN add-on: disabled │ │ Provider │ ID: 11 │ Address: 0x682467D59F5679cB0BF13115d4C94550b8218CF2 │ Name: pspsps-calibnet │ Description: herding cats │ Service URL: https://calibnet.pspsps.io │ Active: yes │ Location: C=DE;ST=Bavaria;L=Nuremberg │ │ Metadata │ source: "filecoin-pin" │ withIPFSIndexing: "" │ │ Payment │ PDP rail ID: 12908 │ Payer: 0x44896a716F7b5Ed343C6962b3D56FaA5377Cd052 │ Payee: 0x682467D59F5679cB0BF13115d4C94550b8218CF2 │ │ Pieces │ Total pieces: 1 │ Total size: 1.5 KiB │ Unique PieceCIDs: 1 │ Unique IPFS Root CIDs: 1 │ │ #0 (active) │ PieceCID: bafkzcibdricannieziik7jobrwqia4qfq6g7cwxfspsppv5aa76uev4u6ek7awz5 │ Size: 1.5 KiB │ Metadata │ ipfsRootCID: "bafybeihhal5hlbylkibniig6j72wdrm7lr4nf6z47natleh2jkyosrg7di" │ │ └ Data set inspection complete ``` > **💡 Note**: PDP proofs may take up to 24 hours to begin after initial upload. This is normal. ### Summary ✅ Your agent is now: * 🔒 **Persistently stored** on Filecoin with cryptographic PDP proofs * 🌐 **Registered on-chain** as an ERC-8004 NFT on Base Sepolia * 🔍 **Discoverable** via the Identity Registry by any third party * ✅ **Verifiable** - anyone can check storage proofs and on-chain data * 🚀 **Ready to use** by other agents and applications *** ## Step 5: Deploy on Mainnet Ready to move to production? This step covers deploying your agent on Filecoin mainnet and Base mainnet. ### Required Tokens (Mainnet) You'll need real tokens on **two networks**: #### Filecoin Mainnet * **FIL** - For gas fees on Filecoin * **USDFC** - For storage payments Get FIL and USDFC via the [USDFC Bridge](https://app.usdfc.net/#/bridge) - bridge from any token on any network to FIL and USDFC on Filecoin mainnet. You can also use [Sushi](https://www.sushi.com/filecoin/swap?token0=NATIVE\&token1=0x80b98d3aa09ffff255c3ba4a241111ff1262f045) to swap FIL for USDFC. #### Base Mainnet * **ETH** - For NFT minting and registration on Base ### ERC-8004 Registry Address (Base Mainnet) ``` 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432 ``` View on explorer: [Base Mainnet Registry](https://basescan.org/address/0x8004A169FB4a3325136EB29fA0ceB6D2e539a432) ### Upload to Filecoin Mainnet Filecoin Pin defaults to Mainnet, so no extra flags are needed for mainnet operations. #### Setup Payment System (Mainnet) ```bash export PRIVATE_KEY="0x..." # Your wallet private key filecoin-pin payments setup --auto ``` #### Upload Your Agent Card (Mainnet) ```bash filecoin-pin add --auto-fund github-agent-card.json ``` Save the **Root CID** and **Dataset ID** from the output. ### Register on Base Mainnet #### Set Environment Variables ```bash export PRIVATE_KEY="0x..." # Your wallet private key export TOKEN_URI="ipfs://<ROOT_CID>/github-agent-card.json" # From previous step export IDENTITY_REGISTRY="0x8004A169FB4a3325136EB29fA0ceB6D2e539a432" export BASE_MAINNET_RPC="https://mainnet.base.org" ``` #### Register the Agent ```bash cast send $IDENTITY_REGISTRY \ "register(string)" \ "$TOKEN_URI" \ --rpc-url $BASE_MAINNET_RPC \ --private-key $PRIVATE_KEY ``` #### Verify Registration ```bash export TX_HASH="0x..." # from your cast send output # Extract agent ID (token ID) from the Transfer event in the receipt logs AGENT_ID=$(cast receipt $TX_HASH --rpc-url $BASE_MAINNET_RPC --json \ | jq -r '.logs[] | select(.topics[0] == "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef") | .topics[3]' \ | head -1 \ | xargs cast --to-dec) echo "Agent ID: $AGENT_ID" ``` ### Check Mainnet Storage Proofs ```bash filecoin-pin data-set show <YOUR_DATASET_ID> ``` *** ## Troubleshooting ### Issue: `filecoin-pin: command not found` **Solution**: Install the Filecoin Pin CLI: ```bash npm install -g filecoin-pin@latest ``` ### Issue: `Insufficient USDFC` **Solution**: Request more test USDFC at [Filecoin Calibnet USDFC Faucet](https://forest-explorer.chainsafe.dev/faucet/calibnet_usdfc) ### Issue: `Transaction reverted` on Base Sepolia **Solution**: Check your Base Sepolia ETH balance: ```bash cast balance <YOUR_ADDRESS> --rpc-url https://sepolia.base.org --ether ``` Get more from the [faucet](https://www.alchemy.com/faucets/base-sepolia) if needed. ### Issue: IPFS retrieval is slow or fails **Solution**: IPFS propagation can take a few minutes. Try different gateways: ```bash curl -s "https://ipfs.io/ipfs/<CID>/github-agent-card.json" | jq . curl -s "https://gateway.pinata.cloud/ipfs/<CID>/github-agent-card.json" | jq . curl -s "https://dweb.link/ipfs/<CID>/github-agent-card.json" | jq . ``` ### Issue: PDP proofs not showing **Solution**: PDP proofs can take up to 24 hours to begin after upload. This is normal - your data is still stored, proofs just take time to generate. Check back later with: ```bash filecoin-pin data-set show <YOUR_DATASET_ID> ``` ### Issue: Token URI doesn't include filename **Solution**: The Token URI must include the full path including filename. Correct format: ``` ipfs://<CID>/github-agent-card.json ``` If you registered with the wrong format, you'll need to register a new agent with the corrected Token URI. *** ## What's Next? Now that your agent is registered with verifiable persistent storage, you can: ### Build Your Own Agent 1. **Create custom agent cards** for your services 2. **Deploy your own MCP server** and reference it in the agent card 3. **Register multiple agents** for different capabilities 4. **Update agent cards** by uploading new versions (CID changes) and updating on-chain ### Explore ERC-8004 Features * **Reputation Registry** - Build reputation for your agents * **Validation Registry** - Add validators to verify agent behavior * **Multi-agent coordination** - Discover and compose multiple agents ### Join the Community * **Filecoin Builders**: [on telegram](https://t.me/+Xj6_zTPfcUA4MGQ1); [on Slack](https://filecoinproject.slack.com/archives/CRK2LKYHW) * **ERC-8004 Discussion**: [GitHub Discussions](https://github.com/ethereum/EIPs/issues/8004) * **Filecoin Pin**: [Documentation](/build-on-filecoin/cookbook/filecoin-pin) * **Builder Channels**: Join ERC-8004 builder communities ### Sponsored Storage for ERC-8004 Builders Coming soon, stay tuned! *** ## Additional Resources * [**ERC-8004 Specification**](https://eips.ethereum.org/EIPS/eip-8004) * [**Reference Implementation**](https://github.com/ChaosChain/trustless-agents-erc-ri) * [**Filecoin Pin Getting Started**](/build-on-filecoin/cookbook/filecoin-pin/getting-started) * [**Base Sepolia Explorer**](https://sepolia.basescan.org) * [**GitHub MCP Server**](https://github.com/github/github-mcp-server) *** **Happy building!** 🚀 # FAQ ## What is Filecoin Pin? Filecoin Pin stores IPFS content on the Filecoin Network of decentralized Storage Providers. It enables developers to programmatically pay for storage and retrieval with Filecoin Pay. When SPs prove storage, they are paid from the developers' Filecoin Pay Account. *** ### How can I use Filecoin Pin today? Three paths are available: * **CLI:** Upload files from your terminal on Filecoin Mainnet. Fund storage from your own wallet. [Get started here](/build-on-filecoin/cookbook/filecoin-pin/getting-started). * **GitHub Action:** Automate pinning of websites or build artifacts in your CI/CD pipeline. * **Website (demo):** Upload files in your browser using a pre-funded test wallet on Calibration testnet. *** ### What do I need to get started? * You can find different links related to Filecoin Pin here: [Filecoin Pin documentation](/build-on-filecoin/cookbook/filecoin-pin) *** ### How do payments and approvals work? * **Website (demo):** The demo wallet handles payments. It has been prefunded with testnet USDFC and FIL. Users don't need to connect their own wallet. * **CLI / GitHub Action:** Your wallet handles payments on Mainnet. You approve and deposit USDFC funds through Filecoin Pay once, then the CLI manages payments automatically. {% hint style="info" %} Storage providers receive payment after cryptographically proving data possession. {% endhint %} *** ### How does auto-funding work? Use `--auto-fund` when uploading. The CLI calculates storage costs automatically. It deposits the right amount of USDFC to your payment rail. {% hint style="info" %} No manual deposit calculations needed. The system handles it. {% endhint %} *** ### How long is my data stored? On **Mainnet** (the default), data persists as long as you maintain deposits in Filecoin Pay. Storage providers must prove they hold your data daily or they stop receiving payment. The CLI supports auto-funding to keep your runway healthy. On **Calibration testnet** (the demo website), data has no persistence guarantees. Treat it as a demo environment only. *** ### What is a Data Set? A Data Set groups your uploads together. Each upload becomes a "piece" within the Data Set. Multiple files you upload share the same payment rail. Check your Data Set with `filecoin-pin data-set show <id>`. *** ### How do I retrieve my data? Three methods: 1. **IPFS Gateways:** Use public gateways with your root CID: `https://gateway.example.com/ipfs/<root-cid>` 2. **Direct from Storage Provider:** Get the direct download URL from `filecoin-pin data-set show <id>` 3. **IPFS Tools:** Use Kubo, Helia, IPFS Desktop with your root CID. *** ### What is a piece CID vs root CID? **Root CID** (bafybei...) is your IPFS content identifier. Use this to retrieve your data. **Piece CID** (bafkzci...) is the Filecoin commitment. Storage Providers prove they store this piece. {% hint style="info" %} Both are linked cryptographically on-chain. {% endhint %} *** ### How do I verify my data is actually stored? Two ways to verify: 1. **CLI:** Run `filecoin-pin data-set show <id>` to see on-chain verification. Check proof status and piece details. 2. **PDP Explorer:** Visit `https://pdp.vxb.ai/calibration/dataset/{datasetID}` to view proofs in your browser. {% hint style="info" %} Both methods show CommP and proof state directly from blockchain state. {% endhint %} *** ### How do I access the code for the dApp and CLI? See the repos as reference implementations and to fork for my own project? * **Website**: <https://github.com/filecoin-project/filecoin-pin-website> * **CLI:** <https://github.com/filecoin-project/filecoin-pin> *** ## References * Filecoin Pin CLI Docs: [Filecoin Pin documentation](/build-on-filecoin/cookbook/filecoin-pin) * Filecoin Pin dApp Repo: <https://github.com/filecoin-project/filecoin-pin-website> * Synapse SDK: <https://github.com/FilOzone/synapse-sdk> * USDFC documentation: <https://docs.secured.finance/usdfc-stablecoin/getting-started> # Plan your Filecoin storage provider business This page will help you understand how to plan a profitable business, design a suitable storage provider architecture, and make the right hardware investments. The Filecoin network provides decentralized data storage and makes sure data is verified, always available, and immutable. Storage providers in the Filecoin network are in charge of storing, providing content and issuing new blocks. To become a storage provider in the Filecoin network you need a range of technical, financial and business skills. We will explain all the key concepts you need to understand in order to design a suitable architecture, make the right hardware investments, and run a profitable storage provider business. In a hurry? The [storage provider agent quickstart](/provide-storage/agent-quickstart) takes you from zero to running Storage Service, Consensus Mining, or both, on a single page. There are two ways to participate in Filecoin: * **Serve Storage Service on Filecoin** * **Warm Storage (Recommended):** backed by PDP proofs, FWSS, and Filecoin Pay. No GPU required; a single-machine Docker stack is enough to start. Some data is provided by the network for you to store. * **Cold Storage:** the Filecoin Cold Storage Service (FCSS), sealed with PoRep, for archives of 1 TiB and up. * **Consensus Mining (PoRep):** the classic Filecoin sealing path: seal sectors, prove them over time, and take FIL collateral. GPU-heavy hardware and a larger operational footprint. You manage your own data business relationships. * **Both:** run Consensus Mining and Storage Service on one Curio cluster. See [Path C](/provide-storage/agent-quickstart#path-c). Planning to become a storage provider? Tell us about your setup in the [storage provider interest form](https://docs.google.com/forms/d/e/1FAIpQLSdTd7Znz5uJeF8f98LccjZ-q7dq9Nh861t_rFkH_kcNO6HCtw/viewform). ## Storage Service (PDP) FOC lets you sell warm storage from your own hardware without a PoRep sealing pipeline. One Docker Compose command brings up Forest, Yugabyte, and Curio-PDP, and a web guide on `http://127.0.0.1:4701` walks you through wallet, storage, domain, and FOC registration. Downloads aside, setup takes about five minutes. ```bash git clone https://github.com/filecoin-project/curio.git cd curio/docker/skiff # Mainnet SKIFF_IMAGE=filecoin/curio-pdp:latest docker compose -f docker-compose.yaml up -d # Calibration test network (free test funds) SKIFF_IMAGE=filecoin/curio-pdp:calibnet docker compose -f docker-compose.yaml -f docker-compose.calibnet.yaml up -d ``` Keep the `SKIFF_IMAGE=` prefix on any later `docker compose up`, or the stack falls back to building the `:dev` image. Full walkthrough — what’s in the box, hardware, the PDP Guide steps, and what you earn: [**Run a PDP provider**](/provide-storage/pdp/install-and-run-pdp). Deeper operator docs (custom disks, external chain nodes, troubleshooting): [**Curio-PDP**](https://docs.curiostorage.org/getting-started/curio-pdp) on [docs.curiostorage.org](https://docs.curiostorage.org/). ### Choose your operation profile Storage providers run at three broad sizes. The sizes below are for Storage Service (PDP), and each starts from the per-node hardware floor in [Path A of the agent quickstart](/provide-storage/agent-quickstart#path-a). Consensus Mining needs a sealing and proving cluster instead: see [Path B](/provide-storage/agent-quickstart#path-b). | Profile | What it looks like | | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- | | **Solo** | One machine at the hardware floor. Start with 10 TiB+ of HDD and add disks as you fill. Today's endorsed providers declare between 60 and 500 TiB. | | **Renting (colocation/DC operator)** | A bare-metal storage server from a large host, 40 to 175 TiB raw per box before RAID. | | **Enterprise Data Center Operator** | 1 PiB and up: the hardware floor per head node, with JBOD shelves for piece data. | Protocol background: [About PDP](/provide-storage/pdp/about). The sections below cover the **Consensus Mining** path. ## Consensus Mining (PoRep) PoRep is the classic Filecoin storage-provider business: seal sectors, prove them over time, take FIL collateral, and (optionally) make storage deals. The sections below cover architecture, hardware, and how to run that operation profitably. Follow these steps: 1. Understand Filecoin economics 2. Plan your business 3. Build the right core competencies 4. Build the right infrastructure 5. Get to know the ecosystem 6. Understand ROI and collateral 7. Choose your provider software stack 8. Set up a local development environment 9. Become a storage provider 10. Configure PoRep deal-making and retrieval services 11. Explore verified deals and ecosystem tools ## Understand Filecoin economics To understand how you can run a profitable business as a Filecoin storage provider, it is important to make sure you understand the economics of Filecoin. Once you understand all core concepts, you can build out a strategy for your desired ROI. Storage providers can also add additional value to clients when they offer certain certifications. These can enable a storage provider to charge customers additional fees for storing data in compliance with those standards, for example, HIPAA, SOC2, PCI, GDPR and others. [Filecoin economics ->](/provide-storage/filecoin-economics/storage-proving) ## Plan your business <a href="#plan-your-business" id="plan-your-business"></a> The hardware and other requirements for running a Filecoin storage provider business are significantly higher than regular blockchain mining operations. The mechanisms are designed this way because, in contrast to some other blockchain solutions, where you can simply configure one or more nodes to "mine" tokens, the Filecoin network's primary goal is to provide decentralized storage for humanity's most valuable data. You need to understand the various earning mechanisms in the Filecoin network. [Filecoin deals ->](/provide-storage/filecoin-deals/storage-deals) ### Daily fees and startup readiness (FIP-0100) With the activation of [FIP-0100](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0100.md) in network version 25, all new sectors — and any sectors that are extended or updated — incur a dai
프로젝트로 돌아가기