Filecoin 백서

Filecoin

원문

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

ss, `f1vuc4...`, returned from the previous command: ```shell curl -X POST '127.0.0.1:1234/rpc/v0' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBbGxvdyI6WyJyZWFkIiwid3JpdGUiLCJzaWduIiwiYWRtaW4iXX0.um-LqY7g-SDOsMheDRbQ9JIaFzus_Pan0J88VQ6ZLVE' \ --data '{"jsonrpc":"2.0","id":1,"method":"Filecoin.WalletSetDefault","params":["f1vuc4eu2wgsdnce2ngygyzuxky3aqijqe7gj5qqa"]}' \ | jq ``` This will output something like: ```plaintext { "id": 1, "jsonrpc": "2.0", "result": null } ``` ## Next steps You should now have a local lite-node connected to a remote full-node with an admin API key! You can use this setup to continue playing around with the JSON-RPC, or start building your applications on Filecoin! [Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/nodes/lite-nodes/spin-up-a-lite-node) # Full-nodes This section contain information on how to spin up a full Filecoin node using Lotus, and options for using remote nodes. ## Table of contents * [Pre-requisites](/provide-storage/nodes/full-nodes/pre-requisites) * [Basic setup](/provide-storage/nodes/full-nodes/basic-setup) * [Node providers](/provide-storage/nodes/full-nodes/node-providers) [Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/nodes/full-nodes) # Pre-requisites This page provide details on Lotus installation prerequisites and supported platforms. Before installing Lotus on your computer, you will need to meet the following prerequisites: * **Operating system**: Lotus is compatible with Windows, macOS, and various Linux distributions. Ensure that your operating system is compatible with the version of Lotus you intend to install. * **CPU architecture**: Lotus is compatible with 64-bit CPU architectures. Ensure that your computer has a 64-bit CPU. * **Memory**: Lotus requires at least 8GB of RAM to run efficiently. * **Storage**: Lotus requires several GB of free disk space for the blockchain data, as well as additional space for the Lotus binaries and other files. * **Internet connection**: Lotus requires a stable and high-speed internet connection to synchronize with the Filecoin network and communicate with other nodes. * **Firewall and port forwarding**: Ensure that your firewall settings and port forwarding rules allow incoming and outgoing traffic on the ports used by Lotus. * **Command-line interface**: Lotus is primarily operated through the command line interface. Ensure that you have a basic understanding of command-line usage and are comfortable working in a terminal environment. ## Lotus documentation To get more information, check out the official [Lotus documentation](https://lotus.filecoin.io/lotus/install/prerequisites/). [Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/nodes/full-nodes/pre-requisites) # Basic setup This page gives a very basic overview of how to install Lotus on your computer. To install Lotus on your computer, follow these steps: 1. First, you need to download the appropriate binary file for your operating system. Go to the [official Lotus GitHub repository](https://github.com/filecoin-project/lotus) and select the latest release that is compatible with your system. You can choose from Windows, macOS, and Linux distributions. 2. Once you have downloaded the binary file, extract the contents to a directory of your choice. For example, if you are using Linux, you can extract the contents to the `/usr/local/bin directory` by running the command: ```sh sudo tar -C /usr/local/bin -xzf lotus-1.34.1-linux-amd64.tar.gz ``` 3. After extracting the contents, navigate to the `lotus` directory in your terminal. For example, if you extracted the contents to `/usr/local/bin`, you can navigate to the lotus directory by running the command: ```sh cd /usr/local/bin/lotus-1.34.1 ``` 4. Run the `lotus` binary file to start the Lotus daemon. You can do this by running the command: ```sh ./lotus daemon ``` 5. This will start the Lotus daemon, which will connect to the Filecoin network and start synchronizing with other nodes on the network. 6. Optionally, you can also run the lotus-miner binary file if you want to participate in the Filecoin mining process. You can do this by running the command: ```sh ./lotus-miner run ``` 7. This will start the Lotus miner, which will use your computer’s computing power to mine new blocks on the Filecoin network. [Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/nodes/full-nodes/basic-setup) # Node providers A node providers, sometimes specifically called a remote node providers, are services that offers access to remote nodes on the Filecoin network. Nodes are essential components of the Filecoin network. They maintain copies of the blockchain’s entire transaction history and verify the validity of new transactions and blocks. Running a node requires significant computational resources and storage capacity, which can be demanding for individual developers or teams. ### Benefits Remote node providers address this challenge by hosting and maintaining Filecoin nodes on behalf of their clients. By utilizing a remote node provider, developers can access blockchain data, submit transactions, and query the network without the need to synchronize the entire blockchain or manage the infrastructure themselves. This offers convenience and scalability, particularly for applications or services that require frequent and real-time access to blockchain data. Remote node providers typically offer APIs or other communication protocols to facilitate seamless integration with their hosted nodes. These APIs allow developers to interact with the Filecoin network, retrieve data, and execute transactions programmatically. ### Potential drawbacks It’s important to note that when using a remote node provider, developers are relying on the provider’s infrastructure and trustworthiness. You should carefully choose a reliable and secure provider to ensure the integrity and privacy of their interactions with the blockchain network. Node providers often limit the specifications of the nodes that they offer. Some developers may need particularly speedy nodes or nodes that contain the entire history of the blockchain (which can be incredibly expensive to store). ### Node providers There are multiple node providers for the Filecoin mainnet and each of the testnets. Check out the [Mainnet RPCs page](/networks-and-tools/networks/mainnet/rpcs) for details on current public node providers. [Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/nodes/full-nodes/node-providers) # Architecture Software components, sealing processes, and system design for storage provider operations. This section covers the software stack, sealing pipeline, and operational tooling that storage providers use to run their systems. ## Table of contents * [Software components](/provide-storage/architecture/lotus-components) — the major Lotus components in a storage provider setup * [Storage provider automation](/provide-storage/architecture/lotus-automation) — one-click deployment tools for the Lotus and Boost stack * [Sealing pipeline](/provide-storage/architecture/sealing-pipeline) — the step-by-step process of preparing sectors for storage * [Sealing rate](/provide-storage/architecture/sealing-rate) — factors that determine how fast a provider can seal new sectors * [Sealing as a service](/provide-storage/architecture/sealing-as-a-service) — outsourcing sector sealing to third-party providers * [Network indexer](/provide-storage/architecture/network-indexer) — how the IPNI maps content identifiers to storage providers [Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/storage-providers/architecture) # Software components Understanding the components of Lotus is necessary in understanding subsequent sections on sealing, and what it means to build well-balanced storage provider architecture. The diagram below shows the major components of Lotus: <figure><img src="https://3376433986-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxNWFG7bQkjLkl5BBGjbD%2Fuploads%2Fgit-blob-89d64ac6cd61a6acdc439352f156c77992a7ea4b%2Fstorage-provider-architecture-software-components-components.png?alt=media" alt=""><figcaption></figcaption></figure> The following components are the most important to understand: * Lotus daemon * Lotus miner * Lotus worker * Boost [Click here](https://boost.filecoin.io/getting-started) for a compatibility matrix of the different components and the required Golang version. ### Lotus daemon <a href="#lotus-daemon" id="lotus-daemon"></a> The daemon is a key Lotus component that does the following: * Syncs the chain * Holds the wallets of the storage provider The machine running the Lotus daemon must be connected to the public internet for the storage provider to function. See the [Lotus documentation](https://lotus.filecoin.io/storage-providers/setup/initialize/#connectivity-to-the-storage-provider) for more in-depth information on connectivity requirements. #### Syncing the chain <a href="#syncing-the-chain" id="syncing-the-chain"></a> Syncing the chain is a key role of the daemon. It communicates with the other nodes on the network by sending messages, which are, in turn, collected into [blocks](/reference/general/glossary#block). These blocks are then collected into [tipsets](/reference/general/glossary#tipset). Your Lotus daemon receives the messages on-chain, enabling you to maintain consensus about the state of the Filecoin network with all the other participants. Due to the growth in the size of the chain since its genesis, it is not advised for storage providers to sync the entire history of the network. Instead, providers should use the available [lightweight snapshots](https://forest-archive.chainsafe.dev/list) to import the most recent messages. One exception in which a provider would need to sync the entire chain would be to run a blockchain explorer. Synced chain data should be stored on an SSD; however, faster NVMe drives are strongly recommended. A slow chain sync can lead to delays in critical messages being sent on-chain from your Lotus miner, resulting in the faulting of sectors and the slashing of collateral. Another important consideration is the size of the file system and available free space. Because the Filecoin chain grows as much as 50GB a day, any available space will eventually fill up. It is up to storage providers to manage the size of the chain on disk and prune it as needed. Solutions like [SplitStore](https://lotus.filecoin.io/lotus/configure/splitstore/) (enabled by default) and [compacting](https://lotus.filecoin.io/lotus/manage/chain-management/#compacting-the-chain-data) reduce the storage space used by the chain. Compacting involves replacing the built-up chain data with a recent lightweight snapshot. #### Holding wallets <a href="#holding-wallets" id="holding-wallets"></a> Another key role of the Lotus daemon is to host the Filecoin wallets that are required to run a storage provider (SP). As an SP, you will need a minimum of 2 wallets: an *owner wallet* and a *worker wallet*. A third wallet called the *control* wallet) is required to scale your operations in a production environment. To keep wallets safe, providers should consider physical access, network access, software security, and secure backups. As with any cryptocurrency wallet, access to the private key means access to your funds. Lotus supports [Ledger hardware wallets](https://lotus.filecoin.io/lotus/manage/ledger/), the use of which is recommended, or remote wallets with `lotus-wallet` on a remote machine (see [remote lotus wallet](https://lotus.filecoin.io/tutorials/lotus/remote-lotus-wallet/) for instructions). The worker and control wallets can not be kept on a hardware device because Lotus requires frequent access to those types of wallets. For instance, Lotus may require access to a worker or control wallet to send WindowPoSt proofs on-chain. **Control wallets** Control wallets are required to scale your operations in a production environment. In production, only using the general worker wallet increases the risk of message congestion, which can result in delayed message delivery on-chain and potential sector faulting, slashing, or lost block rewards. It is recommended that providers create wallets for each subprocess. There are five different types of control wallets a storage provider can create: * PoSt wallet * PreCommit wallet * Commit wallet * Publish storage deals wallet * Terminate wallet The `lotus-miner` also gets an address to which funds can/should be sent. This address can be used to pay any fees and collateral. Withdrawal from this address is **only** possible with the *owner wallet* private key. ### Lotus miner <a href="#lotus-miner" id="lotus-miner"></a> The Lotus miner, often referred to using the daemon naming syntax `lotus-miner`, is the process that coordinates most of the storage provider activities. It has 3 main responsibilities: * Storing sectors and data * Scheduling jobs * Proving the stored data #### Storing sectors and data <a href="#storing-sectors-and-data" id="storing-sectors-and-data"></a> Storage Providers on the Filecoin network store sectors. There are two types of sectors that a provider may store: * Sealed sectors: these sectors may or may not actually contain data, but they provide capacity to the network, for which the provider is rewarded. * Unsealed sectors: used when storing data deals, as retrievals happen from unsealed sectors. Originally, `lotus-miner` was the component with storage access. This resulted in `lotus-miner` hardware using internal disks, directly attached storage shelves like [JBODs](https://en.wikipedia.org/wiki/Non-RAID_drive_architectures#JBOD), Network-Attached-Storage (NAS), or a storage cluster. However, this design introduced a bottleneck on the Lotus miner. More recently, Lotus has added a more scalable storage access solution in which workers can also be assigned storage access. This removes the bottleneck from the Lotus miner. Low-latency storage access is critical because of the impact on storage-proving processes. Keeping a backup of your sealed sectors, the cache directory, and any unsealed sectors is crucial. Additionally, you should keep a backup of the `sectorstore.json` file that lives under your storage path. The `sectorestore.json` file is required to restore your system in the event of a failure. You can read more about the `sectorstore.json` file in the [lotus docs](https://lotus.filecoin.io/storage-providers/seal-workers/seal-workers/#sector-storage-groups). It is also imperative to have at least a daily backup of your `lotus-miner` state. Backups can be made with: ``` lotus-miner backup ``` The `sectorstore.json` file, which lives under your storage path, is also required for restoration in the event of a failure. You can read more about the file in the [Lotus docs](https://lotus.filecoin.io/storage-providers/seal-workers/seal-workers/#sector-storage-groups). ### Scheduling jobs <a href="#scheduling-jobs" id="scheduling-jobs"></a> Another key responsibility of the Lotus Miner is the scheduling of jobs for the sealing pipeline and storage proving. #### Storage proving <a href="#storage-proving" id="storage-proving"></a> One of the most important roles of `lotus-miner` is the Storage proving. Both [WindowPoSt](/reference/general/glossary#window-proof-of-spacetime-windowpost) and [WinningPoSt](/reference/general/glossary#winning-proof-of-spacetime-winningpost) processes are usually handled by the `lotus-miner` process. For scalability and reliability purposes it is now also possible to run these proving processes on dedicated servers (proving workers) instead of using the Lotus miner. The proving processes require low-latency access to sealed sectors. The proving challenge requires a GPU to run on. The resulting `zkProof` will be sent to the chain in a message. Messages must arrive within 30 minutes for WindowPoSt, and 30 seconds for WinningPoSt. It is extremely important that providers properly size and configure the proving workers, whether they are using just the Lotus miner or separate workers. Additionally, dedicated wallets, described in Control wallets, should be set up for these processes. Always check if there are upcoming proving deadlines before halting any services for maintenance. For detailed instructions, refer to the [Lotus maintenance guide](https://lotus.filecoin.io/storage-providers/operate/maintenance/). ### Lotus worker <a href="#lotus-worker" id="lotus-worker"></a> The Lotus worker is another important component of the Lotus architecture. There can be - and most likely will be - multiple workers in a single storage provider setup. Assigning specific roles to each worker enables higher throughput, sealing rate, and improved redundancy. As mentioned above, proving tasks can be assigned to dedicated workers, and workers can also get storage access. The remaining worker tasks encompass running a sealing pipeline, which is discussed in the next section. ### Boost <a href="#boost" id="boost"></a> [Boost](https://boost.filecoin.io/) is the market component for storage providers to interact with clients. Boost is made of several components (such as boostd, boostd-data, yugabytedb, booster-http etc.). It works as a deal-taking engine (from deals made by clients or other tools), and serves data retrievals to clients who request a copy of the data over graphsync, bitswap or http. Boost has become a critical component in the software stack of a storage provider and it is therefore necessary to read the Boost documentation carefully. Boost requires YugabyteDB as of version 2.0. Plan your deployment so that you understand the concepts of Yugabyte well enough. See the [Boost](https://boost.filecoin.io/) documentation for more details. ### Helpful commands <a href="#helpful-commands" id="helpful-commands"></a> The following commands can help storage providers with their setup. #### Backup Lotus miner state <a href="#backup-lotus-miner-state" id="backup-lotus-miner-state"></a> It is imperative to have at least one daily backup of your Lotus miner state. Backups can be made using the following command: ``` lotus-miner backup ``` #### View wallets and funds <a href="#view-wallets-and-funds" id="view-wallets-and-funds"></a> You can use the following command to view wallets and their funds: ``` lotus wallet list ``` #### Check storage configuration <a href="#check-storage-configuration" id="check-storage-configuration"></a> Run the following command to check the storage configuration for your Lotus miner instance: ``` lotus-miner storage list ``` This command return information on your *sealed space* and your *scratch space*, otherwise known as a cache. These spaces are only available if you have properly configured your Lotus miner by following the steps described in the [Lotus documentation](https://lotus.filecoin.io/storage-providers/operate/custom-storage-layout/). In some cases it might be useful to check if the system has access to the storage paths to a certain sector. To check the storage paths to sector 1 for instance, use: ``` lotus-miner storage find 1 ``` #### View scheduled jobs <a href="#view-scheduled-jobs" id="view-scheduled-jobs"></a> To view the scheduled sealing jobs, run the following: ``` lotus-miner sealing
프로젝트로 돌아가기