bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 52쪽 중 33쪽
jobs
```
#### View available workers <a href="#view-available-workers" id="view-available-workers"></a>
To see the workers on which the miner can schedule jobs, run:
```
lotus-miner sealing workers
```
#### View proving deadlines <a href="#view-proving-deadlines" id="view-proving-deadlines"></a>
To check if there are upcoming proving deadlines, run the following:
```
lotus-miner proving deadlines
```
[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/architecture/lotus-components)
# Storage provider automation
1-click deployment automation for the storage provider stack allows new storage providers to quickly learn and deploy Lotus and Boost.
{% hint style="info" %}
[Find the automation code here!](https://github.com/filecoin-project/sp-automation)
{% endhint %}
## Why this automation?
It can be rather overwhelming for new storage providers to learn everything about Filecoin and the various software components. In order to help with the learning process, we provide a fully automated installation of the Lotus and Boost stack. This automation should allow anyone to go on mainnet or the Calibration testnet in no time.
## What are we automating?
This automation is still evolving and will receive more features and capabilities over time. In its current state, it lets you:
* Install and configure Lotus Daemon to interact with the blockchain.
* Initialize and configure Lotus Miner to join the network as a storage provider.
* Install and configure Boost to accept storage deals from clients.
* Install and configure Booster-HTTP to provide HTTP-based retrievals to clients.
## Sealing configuration
The initial use case of this automation is to use sealing-as-a-service instead of doing your own sealing. As such, there is no Lotus Worker configured for the setup. It is possible to extend the setup with a remote worker. However, this Lotus Worker will require dedicated and custom hardware.
## Composable deployment
One of the next features coming to this automation is a composable deployment method. Today Lotus Daemon, Lotus Miner, and Boost are all installed on a single machine. Many production setups, however, will split out those services into their own dedicated hardware. A composable deployment will allow you to deploy singular components on separate servers.
## Prerequisites
Read the `README` carefully on the [GitHub repo](https://github.com/filecoin-project/sp-automation) to make sure you have all the required prerequisites in place.
[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/architecture/lotus-automation)
# Sealing pipeline
The process of sealing sectors is called the sealing pipeline. It is important for storage providers to understand the steps of the process.
Each step in the sealing process has different performance considerations, and fine-tuning is required to align the different steps optimally. For example, storage providers that don’t understand the process expected throughput may end up overloading the sealing pipeline by trying to seal too many sectors at once or taking on a dataset that is too large for available infrastructure. This can lead to a slower *sealing rate*, which is discussed in greater detail in [Sealing Rate](/provide-storage/architecture/sealing-rate).
## Overview
The sealing pipeline can be broken into the following steps:
<figure><img src="https://3376433986-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxNWFG7bQkjLkl5BBGjbD%2Fuploads%2Fgit-blob-793d48b8a4dc504d42c14b1a294f1bc8781f5eea%2Fstorage-provider-architecture-sealing-pipeline-tasks.png?alt=media" alt=""><figcaption></figcaption></figure>
### AddPiece
The sealing pipeline begins with *AddPiece* (AP), where the pipeline takes a *Piece* and prepares it into the sealing scratch space for the *PreCommit 1* task (PC1) to take over. In Filecoin, a *Piece* is data in CAR-file format produced by an [IPLD DAG](https://ipld.io) with a corresponding `PayloadCID` and `PieceCID`. The maximum Piece size is equal to the sector size, which is either 32 GiB or 64 GiB. If the content is larger than the sector size, it must be split into more than one `PieceCID` during data preparation.
The AddPiece process is only uses some CPU cores; it doesn’t require the use of a GPU. It does write a lot of data on the sealing volume though. Therefore it is recommended to limit the concurrent AP processes to 1 or 2 via the environment variable `AP_32G_MAX_CONCURRENT=1`.
It is typically co-located on a server with other worker processes from the sealing pipeline. As PC1 is the next process in the sealing pipeline, running AddPiece on the same server as the PC1 process is a logical architecture configuration.
Consider limiting the AP process to a few cores by using the [`taskset` command](https://man7.org/linux/man-pages/man1/taskset.1.html), where `<xx-xx>` is the range on which cores the process needs to run on:
```shell
taskset -c <xx-xx> lotus-worker run ...
```
### PreCommit 1
PreCommit 1 (PC1) is the most CPU intensive process of the entire sealing pipeline. PC1 is the step in which a sector, regardless of whether it contains data or not, is cryptographically secured. The worker process loads cryptographic parameters from a cache location, which should be stored on enterprise NVMe for latency reduction. These parameters are then used to run Proof-of-Replication (PoRep) SDR encoding against the sector that was put into the sealing scratch space. This task is single-threaded and very CPU intensive, so it requires a CPU with SHA256 extensions. Typical CPUs that meet this requirement include the AMD Epyc Milan/Rome or an Intel Xeon Ice Lake with 32 cores or more.
Using the scratch space, the PC1 task will create 11 layers of the sector. Storage providers must host scratch space for this on enterprise NVMe. This means that:
* Every sector consumes memory equal to 1+11 times its size on the scratch volume.
* For a 32 GiB sector, PC1 requires 384 GiB on the scratch volume
* For a 64 GiB sector, PC1 requires 768 GiB.
In order to seal at a decent rate and to make use of all the sealing capacity in a PC1 server, you will maximize the concurrent PC1 jobs on a system. Set the `PC1_32G_MAX_CONCURRENT=` environment variable for the PC1 worker. You can learn more about this in the chapter on [Sealing Rate](/provide-storage/architecture/sealing-rate). Sealing several sectors multiplies the requirements on CPU cores, RAM, and scratch space by the number of sectors being sealed in parallel.
The process of sealing a single 32 GiB sector takes roughly **3 hours** but that time depends largely on your hardware and what other jobs are running on that hardware.
### PreCommit 2
When PC1 has completed on a given sector, the entire scratch space for that sector is moved over to the *PreCommit 2 (PC2)* task. This task is typically executed on a different server than the PC1 server because it behaves differently. In short, PC2 validates PC1 using the Poseidon hashing algorithm over the Merkle Tree DAG that was created in PC1. As mentioned in the previous section, the entire scratch space is either 384 GiB or 768 GiB, depending on the sector size.
Where PC1 is CPU-intensive, PC2 is executed on GPU. This task is also notably shorter in duration than PC1, typically 10 to 20 minutes on a capable GPU. This requires a GPU with at least 10 GiB of memory and 3500+ CUDA cores or shading units, in the case of Nvidia. Storage providers can use slower GPUs, but this may create a bottleneck in the sealing pipeline.
For best performance, compile Lotus with CUDA support instead of OpenCL. For further information, see the Lotus [CUDA Setup](https://lotus.filecoin.io/tutorials/lotus-miner/cuda/).
In the case of a [Snap Deal](/provide-storage/filecoin-deals/snap-deals), an existing committed capacity sector is filled with data. When this happens, the entire PC1 task does not run again; however, the snapping process employs PC1’s `replica-update` and `prove-replica-update` to add the data to the sector. This can run on the PC2 worker or on a separate worker depending on your sealing pipeline capacity.
When PC2 has completed for a sector, a *precommit* message is posted on-chain. If batching is configured, Lotus will batch these messages to avoid sending messages to the chain for every single sector. In addition, there is a configurable timeout interval, after which the message will be sent on-chain. This timeout is set to 24 hours by default. These configuration parameters are found in the `.lotusminer/config.toml` file.
If you want to force the pre-commit message on-chain for testing purposes, run:
```shell
lotus-miner sectors batching precommit --publish-now
```
The sealed sector and its 11 layers are kept on the scratch volume until Commit 2 (C2) is complete.
### WaitSeed
WaitSeed is not an actual task that is executed, but it is a step in the pipeline in which the blockchain forces the pipeline to wait for 150 epochs as a built-in security mechanism. With Filecoin’s 30 second epochs, this means 75 minutes must elapse between PC2 and the next task, Commit 1 (C1).
### Commit 1
The Commit 1 (C1) phase is an intermediate phase that performs the preparation necessary to generate a proof. It is CPU-bound and typically completes in seconds. It is recommended that storage providers run this process on the server where C2 is running.
### Commit 2
The last and final step in the sealing pipeline is Commit 2 (C2). This step involves the creation of zk-SNARK proof. Like PC2, this task is GPU-bound and is, therefore, best co-located with the PC2 task.
Finally, the proof is committed on-chain in a message. As with the pre-commit messages, the commit messages are batched and held for 24 hours by default before committing on-chain to avoid sending messages for each and every sector. You can again avoid batching by running:
```shell
lotus-miner sectors batching commit --publish-now
```
Finally, the sealed sector is stored in the miner’s long-term storage space, along with unsealed sectors, which are required for retrievals if configured to do so.
[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/architecture/sealing-pipeline)
# Sealing rate
The rate at which storage providers complete the sealing pipeline process is called the sealing rate sealing capacity. This page describes considerations and advice in regards to sealing rate.
## Cost
When setting up their business, storage providers must determine how fast they should seal and, thus, how much sealing hardware they should buy. In other words, the cost is an important factor in determining a storage provider’s sealing rate. For example, suppose you have an initial storage capacity of 100 TiB, which would account for 1 PiB [QAP](/reference/general/glossary#quality-adjusted-storage-power) if all the sectors contain Filecoin Plus verified deals. If your sealing capacity is 2.5 TiB per day, you will seal your full 100 TiB in 40 days. Is it worth investing in double the sealing capacity to fill your storage in just 20 days? It might be if you are planning to grow way beyond 100 TiB. This is an example of the sort of cost considerations storage providers must factor in when tuning the sealing rate.
## Customer expectations
A common reason that a storage provider may want or need a faster sealing rate is customer expectations. When you take on a customer deal, there are often requirements to seal a dataset of a certain size within a certain time window. If you are a new storage provider with 2.5 TiB per day in sealing capacity, you cannot take on a deal of 2 PiB that needs to be on-chain in 1 month; at the very least, you could not take the deal using your own sealing infrastructure. Instead, you can use a [Sealing-as-a-service provider](/provide-storage/architecture/sealing-as-a-service), which can help you scale your sealing capabilities.
## Balancing the sealing pipeline
When designing their sealing pipeline, storage providers should consider bottlenecks, the grouping of similar tasks, and scaling out.
### Bottlenecks
The art of building a well-balanced sealing pipeline means having the bottlenecks where you expect them to be; any non-trivial piece of infrastructure always contains some kind of bottleneck. Ideally, you should design your systems so that the PC1 process is the bottleneck. By doing this, all other components are matched to the capacity required to perform PC1. With PC1 being the most resource-intensive task in the pipeline, it makes the most sense to architect a solution around this bottleneck. Knowing exactly how much sealing capacity you can get from your PC1 servers is vital so you can match the rest of your infrastructure to this throughput.
Assuming you obtain maximum hardware utilization from your PC1 server to seal 15 sectors in parallel, and PC1 takes 3 hours on your infrastructure, that would mean a sealing rate of 3.75 TiB per day. The calculation is described below:
```plaintext
15 sectors x 32 GiB / 3 hours PC1 runtime x 24 hours / 1024 = 3.75 TiB /day
```
### Grouping similar tasks
While a Lotus worker can run all of the various tasks in the sealing pipeline, different storage provider configurations may split tasks between workers. Because some tasks are similar in behavior and others are insignificant in terms of resource consumption, it makes sense to group like-tasks together on the same worker.
A common grouping is *AddPiece (AP)* and PreCommit1 (PC1) because AP essentially prepares the data for the PC1 task. If you have dedicated hardware for PreCommit2 (PC2), your scratch content will move to that other server. If you are grouping PC1 and PC2 on the same server, you won’t have the sealing scratch copied, but you will need a larger NVMe volume. Eventually, you may run out of sealing scratch space and not be able to start sealing additional sectors. Consider a very large bandwidth (40Gb or even 100Gb) between the servers that copy over the sealing space.
As PC1 is CPU-bound and PC2 is GPU-bound, this is another good reason to separate those tasks into dedicated hardware, especially if you are planning to scale. Because PC2 is GPU-bound, it makes sense to have PC2, C1, and C2 collocated on the same worker.
Another rule of thumb is to have two PC2 workers for every PC1 worker in your setup. The *WaitSeed* phase occurs after PC2, which locks the scratch space for a sector until C1 and C2. In order to keep sealing sectors in PC1, PC2 must have sufficient capacity. You can easily host multiple PC2 workers on a single server though, ideally with separate GPU's.
{% hint style="info" %}
You can run multiple lotus-workers on the same GPU by splitting out their`tmp`folders. Give the environment variable `TMPDIR=<folder>`to the lotus-worker.
{% endhint %}
### Scaling out
A storage provider’s sealing capacity scales linearly with the hardware you add to it. For example, if your current setup allows for a sealing rate of 3 TiB per day, doubling the number of workers could bring you to 6 TiB per day. This requires that all components of your infrastructure are able to handle this additional throughput. Using [Sealing-as-a-Service providers](/provide-storage/architecture/sealing-as-a-service) allows you to scale your sealing capacity without adding more hardware.
[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/architecture/sealing-rate)
# Sealing-as-a-service
This page describes how sealing-as-a-service works, and the benefits to storage providers.
Storage providers with hardware cost or availability constraints can use *Sealing-as-a-service*, in which another provider performs sector sealing on the storage providers behalf. This page describes how sealing-as-a-service works, and the benefits to storage providers.
### Overview
In a traditional setup, a storage provider needs high-end hardware to build out a [sealing pipeline](/provide-storage/architecture/sealing-pipeline). Storage providers with hardware cost or availability constraints can use *Sealing-as-a-Service* providers, where another provider performs sector sealing on the storage provider’s behalf. In this model, the following occurs:
1. The storage provider provides the data to the sealer
2. The sealer seals the data into sectors.
3. The sealer returns the sealed sectors in exchange for a service cost.
### Benefits
Sealing-as-a-service provides multiple benefits for storage providers:
* Available storage can be filled faster, thereby maximizing block rewards, without investing in a complex, expensive sealing pipeline.
* Bigger deals can be onboarded, as Sealing-as-a-Service essentially offers a burst capability in your sealing capacity. Thus, storage providers can take on larger deals without worrying about sealing time and not meeting client expectations.
* Storage capacity on the Filecoin network can be expanded without investing in a larger sealing pipeline.
Other solutions are possible where the sealing partner seals committed capacity (CC) sectors for you, which you in turn [snap up](/provide-storage/filecoin-deals/snap-deals) to data sectors.
See the following video from [Aligned](https://aligned.co/sealing-as-a-service) about their offering of Sealing-as-a-Service:
{% embed url="<https://www.youtube.com/watch?v=v4l1lGsUXvs>" %}
[Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/architecture/sealing-as-a-service)
# Network indexer
InterPlanetary Network Indexer (IPNI) enables users to search for content-addressable data available from storage providers. This page discusses the implications of IPNI for storage providers.
A *network indexer*, also referred to as an *indexer node* or *indexer*, is a node that maps content identifiers (CIDs) to records of who has the data and how to retrieve that data. These records are called *provider data records*. Indexers are built to scale in environments with massive amounts of data, like the Filecoin network, and are also used by the IPFS network to locate data. Because the Filecoin network stores so much data, clients can’t perform efficient retrieval without proper indexing. Indexer nodes work like a specialized key-value store for efficient retrieval of content-addressed data.
There are two groups of users within the network indexer process:
* *Storage providers* advertise their available content by storing data in the indexer. This process is handled by the indexer’s *ingest* logic.
* *Retrieval clients* query the indexer to determine which storage providers have the content and what protocol to use, such as Graphsync, Bitswap, etc. This process is handled by the indexer’s *find* logic.
## How the indexer works
This diagram summarizes the different *actors* in the indexer ecosystem and how they interact with each other. In this context, these actors are not the same as [smart-contract actors](/core-concepts/filecoin-evm-runtime/actor-types).
<figure><img src="https://3376433986-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxNWFG7bQkjLkl5BBGjbD%2Fuploads%2Fgit-blob-ef38f81d11b84334c7fd3d190e0e97eea36c56c1%2Fstorage-providers-architecture-network-indexer-indexer.png?alt=media" alt=""><figcaption><p>For more info on how the indexer works, read the <a href="https://filecoin.io/blog/how-does-the-network-indexer-work/">Filecoin blog post</a>.</p></figcaption></figure>
## IPNI and storage providers
Storage providers publish data to indexers so that clients can find that data using the CID or multihash of the content. When a clie프로젝트로 돌아가기