Filecoin 백서

Filecoin

원문

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

%2FxNWFG7bQkjLkl5BBGjbD%2Fuploads%2Fgit-blob-d103c6873e5cfb87e6d132e7688b561e1ee362c2%2Fbasics-how-retrieval-works-basic-retrieval-lassie-library.webp?alt=media) #### Retrieve using Lassie Make sure that you have [Go](https://go.dev/) installed and that your `GOPATH` is set up. By default, your `GOPATH` will be set to `~/go`.\\ **Install Lassie** 1. Download the [Lassie Binary from the latest release](https://github.com/filecoin-project/lassie/releases/latest) based on your system architecture. Or download and install Lassie using the Go package manager: ```sh go install github.com/filecoin-project/lassie/cmd/lassie@latest ``` 2. Download the [go-car binary from the latest release](https://github.com/ipld/go-car/releases/latest) based on your system architecture or install the [go-car](https://github.com/ipld/go-car) package using the Go package manager. The go-car package makes it easier to work with content-addressed archive (CAR) files: ```sh go install github.com/ipld/go-car/cmd/car@latest ``` You now have everything you need to retrieve a file with Lassie and extract the contents with `go-car`. **Retrieve** To retrieve data from Filecoin using Lassie, all you need is the CID of the content you want to download. The video below demonstrates how Lassie can be used to render content directly from Filecoin and IPFS. Lassie and `go-car` can work together to retrieve and extract data from Filecoin. All you need is the CID of the content to download. ```shell lassie fetch -o - <CID> | car extract - ``` This command uses a `|` to chain two commands together. This will work on Linux or macOS. Windows users may need to use PowerShell to use this form. Alternatively, you can use the commands separately, as explained later on this page. An example of fetching and extracting a single file, identified by its CID: ```shell lassie fetch -o - bafykbzaceatihez66rzmzuvfx5nqqik73hlphem3dvagmixmay3arvqd66ng6 | car extract - > lidar-data.tar ``` Basic progress information, similar to the output shown below, is displayed: ```plaintext Fetching bafykbzaceatihez66rzmzuvfx5nqqik73hlphem3dvagmixmay3arvqd66ng6................................................................................................................................................ Fetched [bafykbzaceatihez66rzmzuvfx5nqqik73hlphem3dvagmixmay3arvqd66ng6] from [12D3KooWPNbkEgjdBNeaCGpsgCrPRETe4uBZf1ShFXStobdN18ys]: Duration: 42.259908785s Blocks: 144 Bytes: 143 MiB extracted 1 file(s) ``` The resulting file is a tar archive: ```shell ls -l # total 143M # -rw-rw-r-- 1 user user 143M Feb 16 11:21 lidar-data.tar ``` **Lassie CLI usage** Lassie's usage for retrieving data is as follows: ```shell lassie fetch -p -o <OUTFILE_FILE_NAME> <CID>/path/to/content ``` * `-p` is an optional flag that tells Lassie that you would like to see detailed progress information as it fetches your data. For example: ```plaintext Fetching bafykbzaceatihez66rzmzuvfx5nqqik73hlphem3dvagmixmay3arvqd66ng6 Querying indexer for bafykbzaceatihez66rzmzuvfx5nqqik73hlphem3dvagmixmay3arvqd66ng6... Found 4 storage providers candidates from the indexer, querying all of them: 12D3KooWPNbkEgjdBNeaCGpsgCrPRETe4uBZf1ShFXStobdN18ys 12D3KooWNHwmwNRkMEP6VqDCpjSZkqripoJgN7eWruvXXqC2kG9f 12D3KooWKGCcFVSAUXxe7YP62wiwsBvpCmMomnNauJCA67XbmHYj 12D3KooWLDf6KCzeMv16qPRaJsTLKJ5fR523h65iaYSRNfrQy7eU Querying [12D3KooWLDf6KCzeMv16qPRaJsTLKJ5fR523h65iaYSRNfrQy7eU] (started)... Querying [12D3KooWKGCcFVSAUXxe7YP62wiwsBvpCmMomnNauJCA67XbmHYj] (started)... ... ``` * `-o` is an optional flag that tells Lassie where to write the output to. If you don’t specify a file, it will append `.car` to your CID and use that as the output file name. Use `-o -` to write the CAR stream to `stdout` so it can be piped to another command, such as `go-car`, or redirected to a file. * `<CID>/path/to/content` is the CID of the content you want to retrieve and an optional path to a specific file within that content. Example: ``` lassie fetch -o - bafybeiaysi4s6lnjev27ln5icwm6tueaw2vdykrtjkwiphwekaywqhcjze/wiki/Cryptographic_hash_function | car extract - | less ``` A CID is always necessary, and if you don’t specify a path, Lassie will attempt to download the entire content. If you specify a path, Lassie will only download that specific file or, if it is a directory, the entire directory and its contents. **go-car CLI usage** The `car extract` command can be used to extract files and directories from a CAR: ```shell car extract -f <INPUT_FILE>[/path/to/file/or/directory] [<OUTPUT_DIR>] ``` * `-f` is an optional flag that tells `go-car` where to read the input from. If omitted, it will read from `stdin`, as in our example above where we piped `lassie fetch -o -` output to `car extract`. * `/path/to/file/or/directory` is an optional path to a specific file or directory within the CAR. If omitted, it will attempt to extract the entire CAR. * `<OUTPUT_DIR>` is an optional argument that tells `go-car` where to write the output to. If omitted, it will be written to the current directory. If you supply `-p`, `car extract` writes extracted file bytes directly to `stdout`. This only works when extracting a single file. In the example above, where we fetched a file named `lidar-data.tar`, the `>` operator was used to redirect the output of `car extract` to a named file. This is because the content we fetched was raw file data that did not have a name encoded. In this case, if we didn’t use `-` and `> filename`, `go-car` would write to a file named `unknown`. In this instance, `go-car` was used to reconstitute the file from the raw blocks contained within Lassie’s CAR output. `go-car` has other useful commands. The first is `car ls`, which can be used to list the contents of a CAR. The second is `car inspect`, which can be used to inspect the contents of the CAR and optionally verify the integrity of a CAR. Lassie and go-car are the recommended command-line tools for retrieving and inspecting Filecoin data by CID. #### Lassie HTTP daemon The Lassie HTTP daemon is an HTTP interface for retrieving IPLD data from IPFS and Filecoin peers. It fetches content from peers known to have it and provides the resulting data in CAR format. ```http GET /ipfs/{cid}[/path][?params] ``` A `GET` query against a Lassie HTTP daemon allows retrieval from peers that have the content identified by the given root CID, streaming the DAG in the response in [CAR (v1)](https://ipld.io/specs/transport/car/carv1/) format. You can read more about the HTTP request and response to the daemon in [Lassie’s HTTP spec](https://github.com/filecoin-project/lassie/blob/main/docs/HTTP_SPEC.md). Lassie’s HTTP interface can be a very powerful tool for web applications that require fetching data from Filecoin and IPFS. #### Lassie’s CAR format Lassie only returns data in CAR format, specifically, [CARv1](https://ipld.io/specs/transport/car/carv1/) format. [Lassie’s car spec](https://github.com/filecoin-project/lassie/blob/main/docs/CAR.md) describes the nature of the CAR data returned by Lassie and the various options available to the client for manipulating the output. [Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/getting-started/how-retrieval-works/basic-retrieval) # Serving retrievals In this article, we will discuss the functions of storage providers in the Filecoin network, the role of the indexer, and the retrieval process for publicly available data. ### The indexer When data should be publicly discoverable, the storage provider publishes an advertisement to the InterPlanetary Network Indexer (IPNI). IPNI maps content identifiers to storage providers and retrieval metadata so clients can discover where content is available. IPNI can also include the retrieval protocols or endpoints a provider advertises for specific CIDs. Filecoin storage providers may serve retrievals over HTTP, Bitswap, Graphsync, or service-specific endpoints depending on their software and configuration. ### Retrieval process If a client wants to retrieve publicly available data from the Filecoin network, then they generally follow this process. #### Query the IPNI Before the client can retrieve from a storage provider, they first need to find which providers hold the data. To do this, the client sends a query to the InterPlanetary Network Indexer. #### Select a provider Assuming IPNI returns more than one storage provider, the client can select which provider to retrieve from. Here, they will also get additional details based on the retrieval path they want to use. #### Initiate retrieval The client then retrieves the data from the storage provider over one of the advertised paths. HTTP retrieval is the common path for whole-piece `/piece/{pieceCid}` retrieval. Providers that index and advertise IPFS CIDs can also expose `/ipfs/{cid}` style retrieval. #### Finalize the retrieval Once the client has received the last chunk of data, the connection is closed. ### Implementation paths Different retrieval workflows use different tools: | Workflow | Maintained path | | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Serving PDP retrievals as a storage provider | Use [Curio](https://curiostorage.org/) for PDP retrievals. | | Serving PoRep retrievals as a storage provider | Use [Boost](https://boost.filecoin.io/) to serve retrievals. Boost supports Graphsync retrievals by default, and storage providers can run [`booster-http`](https://boost.filecoin.io/http-retrieval) for HTTP retrievals when configured. | | Retrieving data as a client | Use [Lassie](https://github.com/filecoin-project/lassie) to fetch CID-addressed content from Filecoin and IPFS using the best available retrieval path. For whole-piece retrieval, use provider or service `/piece` endpoints. | | Retrieving application data with Filecoin Onchain Cloud | See the [Filecoin Onchain Cloud retrieval docs](https://docs.filecoin.cloud/core-concepts/retrieval/) for maintained Synapse SDK retrieval flows. | [Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/getting-started/how-retrieval-works/serving-retrievals) # Interplanetary consensus InterPlanetary Consensus (IPC) powers planetary-scale decentralized applications (dApps) through horizontal scalability of Filecoin, Ethereum and more. ## What is IPC? [Interplanetary Consensus (IPC)](https://www.ipc.space/) is a framework that enables on-demand horizontal scalability of networks, by deploying "subnets" running different consensus algorithms depending on the application's requirements. ### What is horizontal scalability and why is it important for dApps? [Horizontal scalability](https://en.wikipedia.org/wiki/Scalability#Horizontal_or_scale_out) generally refers to the addition of nodes to a system, to increase its performance. For example, adding more nodes to a compute network helps distribute the effort needed to run a single compute task. This reduces cost per task and decreases latency, while improving overall throughput. In web3, horizontal scalability refers to *scaling* blockchains, for *desired* performance. More specifically, *scaling* the ability of a blockchain to process transactions and achieve consensus, across an increasing number of users, at *desired* latencies and throughput. IPC is one such scaling solution, alongside other popular layer 2 solutions, like [sidechains](https://ethereum.org/en/developers/docs/scaling/sidechains/) and [rollups](https://ethereum.org/en/developers/docs/scaling/#rollups). For decentralized applications (dApps), there are several key motivations to adopt scaling - performance, decentralization, security. The challenge is that these factors are known to be conflicting goals. ### How does IPC achieve horizontal scalability? IPC is a scaling solution intentionally designed to achieve considerable performance, decentralization and security for dApps. It achieves scaling through the permissionless spawning of new blockchain sub-systems, which are composed of [subnets](https://docs.ipc.space/concepts/subnets). Subnets are organized in a hierarchy, with one parent subnet being able to spawn infinite child subnets. Within a hierarchical subsystem, subnets can seamlessly communicate with each other, reducing the need for cross-chain bridges. Subnets also have their own specific consensus algorithms, whilst leveraging security features from parent subnets. This allows dApps to use subnets for hosting sets of applications or to [shard](https://en.wikipedia.org/wiki/Shard_\(database_architecture\)) a single application, according to its various cost or performance needs. ### How is IPC unique as a scaling solution? Earlier, we talked about the challenge of scaling solutions to balance performance, security and decentralization. IPC is a standout framework that strikes a considerable balance between these factors, to achieve breakthroughs in scaling. * **Highly customizable without compromising security.** Most L2 scaling solutions today either inherit the L1's security features but don't have their own consensus algorithms (e.g. rollups), or do the reverse (e.g. sidechains). They are also deployed in isolation and require custom bridges or protocols to transfer assets and state between L2s that share a common L1, which are vulnerable to attacks. In contrast, IPC subnets have their own consensus algorithms, inherit security features from the parent subnet and have native cross-net communication, eliminating the need for bridges. * **Multi-chain interoperability.** IPC uses the [Filecoin Virtual Machine (FVM)](/core-concepts/filecoin-virtual-machine) as its transaction execution layer. The FVM is a WASM-based polyglot execution environment for IPLD data and is designed to support smart contracts written in any programming language, compiled to WASM. It currently supports Filecoin and Ethereum. Today, IPC is fully compatible with Filecoin and Ethereum and can use either as a rootnet. IPC will eventually allow any chain to be taken as rootnet. * **Tight storage integration with Filecoin.** IPC was designed from the data-centric L1, [Filecoin](/getting-started/what-is-filecoin), which is the largest decentralized storage network. IPC can leverage its storage primitives, like IPLD data integration, to deliver enhanced solutions for data availability and more. ## Applications of IPC Here are some practical examples of how IPC improves the performance of dApps: * **Distributed Computation**: Spawn ephemeral subnets to run distributed computation jobs. * **Coordination**: Assemble into smaller subnets for decentralized orchestration with high throughput and low fees. * **Localization**: Leverage proximity to improve performance and operate with very low latency in geographically constrained settings. * **Partition tolerance**: Deploy blockchain substrates in mobile settings or other environments with limited connectivity. With better performance, lower fees and faster transactions, IPC can rapidly improve horizontal and vertical markets with decentralized technology: * **Artificial Intelligence:** IPC is fully compatible with [Filecoin](/getting-started/what-is-filecoin), the world’s largest decentralized data storage. Leveraging Filecoin, IPC can enable distributed computation to power hundreds of innovative AI models. * **Decentralized Finance (DeFi):** Enabling truly high-frequency trading and traditional backends with verifiability and privacy. * **Big Data and Data Science:** Multiple teams are creating global-scale distributed compute networks to enable Data Science analysis on Exabytes of decentralized stored data. * **Metaverse/Gaming:** Enabling real-time tracking of player interactions in virtual worlds. * **DAOs:** Assemble into smaller subnets for decentralized orchestration with high throughput and low fees. Partition tolerance: Deploy blockchain substrates in mobile settings or other environments with limited connectivity. ### Get involved * Visit the [website](https://www.ipc.space/) * Read the [docs](https://docs.ipc.space/) * Check out the [repository](https://github.com/consensus-shipyard/ipc) * Connect with the community on [Discord](https://discord.gg/QtNbXf75) [Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/getting-started/interplanetary-consensus) # Community Learn about the Filecoin project, connect with the community, and find ways to contribute. The Filecoin community includes developers, storage providers, researchers, and users working together to build a decentralized storage network. This section covers how to get involved, where to find help, and how the project is organized. ## Table of contents * [Forums and FIPs](/getting-started/community/forums-and-fips) — discussion channels, governance proposals, and community calls * [Filecoin compared to](/getting-started/community/filecoin-compared-to) — how Filecoin differs from other storage solutions * [Filecoin FAQs](/getting-started/community/filecoin-faqs) — common questions about storage costs, hardware, and economics * [FAQs](/getting-started/community/faqs) — frequently asked questions about FVM and building on Filecoin * [Related projects](/getting-started/community/related-projects) — protocols and tools in the Filecoin ecosystem * [Social media](/getting-started/community/social-media) — official Filecoin channels and online presence * [The Filecoin project](/getting-started/community/the-filecoin-project) — roadmap, research, and ongoing development * [Ways to contribute](/getting-started/community/ways-to-contribute) — how to participate in code, docs, and community efforts [Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/getting-started/community) # Forums and FIPs Connect with the Filecoin community in discussion forums or on IRC. The Filecoin community is active and here to answer your questions in your channel of choice. ### Discussion Forums For shorter-lived discussions, our community chat open to all on both Slack and Discord: * [Slack](https://filecoinproject.slack.com/ssb/redirect) * [Discord](https://discord.com/invite/filecoin) For long-lived discussions and for support, please use the [discussion tab on GitHub](https://github.com/filecoin-project/community#forums) instead of Slack. It’s easy for complex discussions to get lost in a sea of new messages on those chat platforms, and posting longer discussions and support requests on the forums helps future visitors, too. ### Filecoin improvement proposals Filecoin improvement proposals (FIPs) are design documents that propose changes and improvements to the Filecoin network, giving detailed specifications and their rational, and allowing the community to document their consensus or dissent. All technical FIPs that are accepted are later reflected in the [Filecoin Spec](https://spec.filecoin.io/). There are three types of FIPs: * Technical FIPs (FTP): protocol changes, standards, API changes. They can include core (consensus-related changes, networking (network protocol improvements, interface (API/RPC or language-level updates), or can be informational (updates to general guidelines or documentation). * Organizational FIPs (FOP): changes to processes, tools, or governance. * Recovery FIPs (FRP): emergency fixes requiring state changes (e.g., major bugs). Typically, the FIP lifecycle looks something like this: \[ WIP ] -> \[ DRAFT ] -> \[ LAST CALL ] -> \[ ACCEPTED ] ->
프로젝트로 돌아가기