Filecoin 백서

Filecoin

원문

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

let There are multiple ways to create a new wallet. The simplest way is to use the Lotus CLI directly: 1. Open a new terminal window. 2. Move into the `~/lotus-devnet` directory:\\ ```shell cd ~/lotus-devnet ``` 3. Export the devnet-specific variables again to make sure we don’t interfere with any existing Lotus installations on your system:\\ ```shell export LOTUS_PATH=~/.lotus-local-net export LOTUS_MINER_PATH=~/.lotus-miner-local-net export LOTUS_SKIP_GENESIS_CHECK=_yes_ export CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__" export CGO_CFLAGS="-D__BLST_PORTABLE__" ``` 4. Create a new wallet with `lotus wallet new`:\\ ```shell ./lotus wallet new ``` \ This will output something like:\\ ```plaintext t1snly7vh4mjtjznwze56ihrdhzfwvbajywwmrenq ``` 5. View the wallets available on this node with `lotus wallet list`:\\ ```shell ./lotus wallet list ``` \ This will output something like:\\ ```plaintext Address Balance Nonce Default t1snly7vh4mjtjznwze56ihrdhzfwvbajywwmrenq 0 FIL 0 t3q4o7gkwe7p7xokhgws4rwntj7yqfhpj5pm6cqc7dycl7cwk4uvgh2odwdvge5re7ne5gcc6xluifss5uu5cq 49999999.999763880085417692 FIL 2 X ``` 6. You can now close this terminal window, or you can keep it open for the next section. #### Send funds We can now send FIL from the pre-mined `t3q4o7g...` account to our new `t1snly7...` account with `lotus send`: 1. If you closed the terminal windows from the last section, open a new terminal window, move into the `~/lotus-devnet` directory, and export the devnnet-specific variables again with:\\ ```shell cd ~/lotus-devnet export LOTUS_PATH=~/.lotus-local-net export LOTUS_MINER_PATH=~/.lotus-miner-local-net export LOTUS_SKIP_GENESIS_CHECK=_yes_ export CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__" export CGO_CFLAGS="-D__BLST_PORTABLE__" ``` 2. View the wallets available on this node with `lotus wallet list`:\\ ```shell ./lotus wallet list ``` \ This will output something like:\\ ```plaintext Address Balance Nonce Default t1snly7vh4mjtjznwze56ihrdhzfwvbajywwmrenq 0 FIL 0 t3q4o7gkwe7p7xokhgws4rwntj7yqfhpj5pm6cqc7dycl7cwk4uvgh2odwdvge5re7ne5gcc6xluifss5uu5cq 49999999.999763880085417692 FIL 2 X ``` \ In the above example, the `t3q4o...` address is the *pre-mined* address we created in an earlier step. This has a very large balance of FIL. We want to send FIL from this pre-mined address to our new `t1snl...` address. 3. Create the send request with `lotus send`, supplying the pre-mined `t3q4o...` address as the `--from` address, the new `t1snl...` address as the receiving address, and the amount of FIL we want to send:\\ ```shell ./lotus send --from <PRE-MINED ADDRESS> <TO ADDRESS> <VALUE> ``` \ For example:\\ ```shell ./lotus send --from t3q4o7gkwe7p7xokhgws4rwntj7yqfhpj5pm6cqc7dycl7cwk4uvgh2odwdvge5re7ne5gcc6xluifss5uu5cq t1snly7vh4mjtjznwze56ihrdhzfwvbajywwmrenq 2000 # bafy2bzaceaqzbgiazwvtpago6wpkxl42puxfkvwv5cwjpime2irqatamji2bq ``` 4. Check the balance of your new `t1snl...` address with `lotus wallet balance`:\\ ```shell ./lotus wallet balance <ADDRESS> ``` \ For example:\\ ```shell ./lotus wallet balance t1snly7vh4mjtjznwze56ihrdhzfwvbajywwmrenq # 2000 FIL ``` 5. You can now close this terminal window, or you can keep it open for the next section. ### Stop and restart You’ll eventually want to stop your local devnet from running or may need to restart it. Follow these steps. #### Stop the devnet 1. Open the storage provider terminal window. 2. Press `CTRL` + `c` to stop the node. The node will print `Graceful shutdown successful` once it has fully stopped:\\ ```plaintext # CTRL + c ``` \ This will output something like:\\ ```shell ... 2023-02-14T10:54:42.030-0400 DEBUG advmgr sealer/sched_worker.go:603 worker 1fa5f6b1-eb4d-4d92-98b1-6114a0d7695d dropped 2023-02-14T10:54:42.056-0400 INFO builder node/shutdown.go:44 miner shut down successfully 2023-02-14T10:54:42.056-0400 WARN builder node/shutdown.go:47 Graceful shutdown successful ``` 3. You can now close the storage provider terminal window. 4. Open the client terminal window. 5. Press `CTRL` + `c` to stop the node. The node will print `Graceful shutdown successful` once it has fully stopped:\\ ```plaintext ... 2023-02-14T10:55:42.475-0400 INFO badgerbs v2@v2.2007.3/db.go:554 Force compaction on level 0 done 2023-02-14T10:55:42.502-0400 INFO builder node/shutdown.go:44 node shut down successfully 2023-02-14T10:55:42.502-0400 WARN builder node/shutdown.go:47 Graceful shutdown successful ``` 6. You can now close the client terminal window. #### Restart the devnet 1. Open a new terminal window, move into the `~/lotus-devnet` directory, and export the devnnet-specific variables again with:\\ ```shell cd ~/lotus-devnet export LOTUS_PATH=~/.lotus-local-net export LOTUS_MINER_PATH=~/.lotus-miner-local-net export LOTUS_SKIP_GENESIS_CHECK=_yes_ export CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__" export CGO_CFLAGS="-D__BLST_PORTABLE__" ``` 2. Start the client node with `lotus daemon`:\\ ```shell ./lotus daemon --lotus-make-genesis=devgen.car --genesis-template=localnet.json --bootstrap=false ``` \ This will output something like:\\ ```plaintext 2023-01-31T10:57:41.022-0400 INFO main lotus/daemon.go:218 lotus repo: /home/johnny/.lotus 2023-01-31T10:57:41.022-0400 INFO repo repo/fsrepo.go:265 Initializing repo at '/home/johnny/.lotus' 2023-01-31T10:57:41.022-0400 INFO paramfetch go-paramfetch@v0.0.4/paramfetch.go:209 Parameter file /var/tmp/filecoin-proof-parameters/v28-stacked-proof-of-replication-merkletree-poseidon_hasher-8-0-0-sha256_hasher-ecd683648512ab1765faa2a5f14bab48f676e633467f0aa8aad4b55dcb0652bb.vk is ok ``` \ This command will continue to run. Leave this window open. 3. For the storage provider node, open a new terminal window, move into the `~/lotus-devnet` directory, and export the devnnet-specific variables again with:\\ ```shell cd ~/lotus-devnet export LOTUS_PATH=~/.lotus-local-net export LOTUS_MINER_PATH=~/.lotus-miner-local-net export LOTUS_SKIP_GENESIS_CHECK=_yes_ export CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__" export CGO_CFLAGS="-D__BLST_PORTABLE__" ``` 4. Restart the storage provider node with `lotus-miner run`:\\ ```shell ./lotus-miner run --nosync ``` \ This will output something like:\\ ```plaintext 2023-01-31T12:54:12.009-0400 INFO main lotus-miner/run.go:98 Checking full node sync status 2023-01-31T12:54:12.013-0400 INFO modules modules/core.go:64 memory limits initialized {"max_mem_heap": 0, "total_system_mem": 16444395520, "effective_mem_limit": 16444395520} 2023-01-31T12:54:12.013-0400 WARN modules modules/core.go:124 failed to initialize cgroup-driven watchdog; err: failed to load cgroup for process: cgroups: cgroup mountpoint does not exist ``` 5. This command will continue to run. Leave this window open. 6. You must run all further commands from a new terminal window. ### Next steps To summarize, you’ve started a local devnet, funded a new address, and exported that address to a file! You’ve got all the pieces ready to start developing applications on Filecoin! ### Troubleshooting Running into issues? Check out these troubleshooting steps to figure out what’s going on. #### Could not get API info for FullNode You may encounter the following error message: ```plaintext ERROR: could not get API info for FullNode: could not get api endpoint: API not running (no endpoint ``` If you receive this error when trying to call your Lotus daemon, either your `lotus daemon` isn’t running (see [Restart the devnet](#stop-and-restart)) or you haven’t re-exported the necessary variables (see the [Build section](#build)). [Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/networks-and-tools/networks/local-testnet) # Get test tokens Test funds are available to developer so that they can test their smart contracts and applications within the confines of a test network. This page covers how to get test funds from a local testnet. Before we begin, you must have a local testnet running. Follow the [Run a local network guide](/networks-and-tools/networks/local-testnet) if you haven’t got a local testnet set up yet. 1. Change directory to where you created the `lotus` and `lotus-miner` binaries. If you followed the [Run a local network guide](/networks-and-tools/networks/local-testnet) these binaries will be in `~/lotus-devnet`:\\ ```shell cd ~/lotus-devnet ``` 2. View the wallets available on this node with `lotus wallet list`:\\ ```shell ./lotus wallet list ``` \ This command will output something like:\\ ```plaintext Address Balance Nonce Default t1snly7vh4mjtjznwze56ihrdhzfwvbajywwmrenq 0 FIL 0 t3q4o7gkwe7p7xokhgws4rwntj7yqfhpj5pm6cqc7dycl7cwk4uvgh2odwdvge5re7ne5gcc6xluifss5uu5cq 49999999.999763880085417692 FIL 2 X ``` 3. Create the send request with `lotus send`, supplying the pre-mined `t3q4o...` address as the `--from` address, the new `t1snl...` address as the receiving address, and the amount of FIL we want to send:\\ ```shell ./lotus send --from <PRE-MINED ADDRESS> <TO ADDRESS> <VALUE> ``` \ For example:\\ ```shell ./lotus send --from t3q4o7gkwe7p7xokhgws4rwntj7yqfhpj5pm6cqc7dycl7cwk4uvgh2odwdvge5re7ne5gcc6xluifss5uu5cq t1snly7vh4mjtjznwze56ihrdhzfwvbajywwmrenq 2000 ``` \ This command will output something like:\\ ```plaintext bafy2bzaceaqzbgiazwvtpago6wpkxl42puxfkvwv5cwjpime2irqatamji2bq ``` 4. Check the balance of your new `t1snl...` address with `lotus wallet balance`:\\ ```shell ./lotus wallet balance <ADDRESS> ``` \ For example:\\ ```shell ./lotus wallet balance t1snly7vh4mjtjznwze56ihrdhzfwvbajywwmrenq ``` \ This command will output something like:\\ ```plaintext 2000 FIL ``` If you want to manage your local testnet tokens in MetaMask you will need to create a `t4` address. You can create a `t4` address using `lotus wallet new delegated`. Once you have a `t4` address you can connect MetaMask to your local testnet to see the new balance within the MetaMask extension. [Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/networks-and-tools/networks/local-testnet/get-test-tokens) # Legacy networks {% hint style="danger" %} **LEGACY — DO NOT USE** These networks are no longer active and may be unavailable. For testing and development, use the [Calibration testnet](/networks-and-tools/networks/calibration) or a [local testnet](/networks-and-tools/networks/local-testnet). {% endhint %} The following networks are no longer operational: ## Nerpanet The Nerpa test network, often called *Nerpanet*, was designed with tiny sector sizes. This network was for application developers to test the very basic functionality of their applications before moving over to the calibration test network. It was retired on 2021-08-16. ## Spacenet The Spacenet test network was created for the Interplanetary Consensus (IPC) project. This network was retired on 2023-09-11. ## Wallaby The Wallaby test network, often just called *Wallaby*, was designed for internal Filecoin developers to test new features before rolling them out to the Hyperspace testnet, and then onto Mainnet. Wallaby was designed to be reset every week. It was retired on 2023-02-07. [Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/networks-and-tools/networks/legacy-networks) # Assets Manage FIL tokens, set up wallets, and transfer assets on the Filecoin network. This section covers how to acquire, store, and transfer FIL tokens on the Filecoin network. ## Table of contents * [The FIL token](/networks-and-tools/assets/the-fil-token) — the native cryptocurrency that powers the Filecoin network * [Wallets](/networks-and-tools/assets/wallets) — wallet options for securely holding and managing FIL * [Metamask setup](/networks-and-tools/assets/metamask-setup) — configure MetaMask to work with Filecoin * [Get FIL](/networks-and-tools/assets/get-fil) — how to purchase FIL through exchanges * [Transfer FIL](/networks-and-tools/assets/transfer-fil) — send FIL between different address types [Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/networks-and-tools/assets) # The FIL token FIL is the cryptocurrency that powers the Filecoin network. This page explains what FIL is, how it can be used, and its denominations. ## Uses FIL plays a vital role in incentivizing users to participate in the Filecoin network and ensuring its smooth operation. Here are some ways in which FIL is used on the Filecoin network: ### Network payments When a user wants to store data on the Filecoin network, they pay in FIL to the storage providers who offer their storage space. The payment is made in advance, for a certain amount of time that the data will be stored on the network. In addition, storage providers choose their own terms and payment mechanisms for providing storage and retrieval services so other options (such as fiat payments) can be available. ### Blockchain rewards Storage providers are also rewarded with FIL for providing their storage space and performing other useful tasks on the network. FIL is used to reward storage providers who validate and add new blocks to the Filecoin blockchain. Providers receive a block reward in FIL for each new block they add to the blockchain and also earn transaction fees in FIL for processing storage and retrieval transactions. ### Governance As members of the Filecoin community, FIL holders are encouraged to participate in the Filecoin governance process. They can do so by proposing, deliberating, designing, and/or contributing to consensus for network changes, alongside other stakeholders in the Filecoin community- including implementers, Core Devs, storage providers, and other ecosystem partners. Learn more about the [Filecoin Governance process](https://fil.org/governance). ## Denominations FIL, NanoFIL, and PicoFIL are all denominated in the same cryptocurrency unit, but they represent different levels of precision and granularity. For most users, FIL is the main unit of measurement and is used for most transactions and payments on the Filecoin network. Much like how a US penny represents a fraction of a US dollar, there are many ways to represent value using Filecoin. This is because some actions on the Filecoin network require substantially less value than one whole `FIL`. The different denominations of `FIL` you may see referenced across the ecosystem are: | Name | Decimal | | -------- | ------------------------- | | FIL | 1 | | milliFIL | 1,000 | | microFIL | 1,000,000 | | nanoFIL | 1,000,000,000 | | picoFIL | 1,000,000,000,000 | | femtoFIL | 1,000,000,000,000,000 | | attoFIL | 1,000,000,000,000,000,000 | [Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.filecoin.io/networks-and-tools/assets/the-fil-token) # Wallets Wallets provide a way to securely store Filecoin, along with other digital assets. These wallets consist of a public and private key, which work similarly to a bank account number and password. When someone sends cryptocurrency to your wallet address, the transaction is recorded on the blockchain network, and the funds are added to your wallet balance. Similarly, when you send cryptocurrency from your wallet to someone else’s wallet, the transaction is recorded on the blockchain network, and the funds are deducted from your wallet balance. There are various types of cryptocurrency wallets, including desktop, mobile, hardware, and web-based wallets, each with its own unique features and levels of security. It’s important to choose a reputable and secure wallet to ensure the safety of your digital assets. ## Compatible wallets We do not provide technical support for any of these wallets. Please use caution when researching and using the wallets listed below. Wallets that have conducted third-party audits of their open-source code by a reputable security auditor are marked *recommended* below. If you are already running your own lotus node, you can also [manage FIL wallets from the command line](https://lotus.filecoin.io/lotus/manage/manage-fil/). | Name | Description | Audited | | ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ------- | | [Ledger](https://support.ledger.com/article/4402721277329-zd) | A multi-currency hardware wallet. *Recommended.* | Yes | | [Glif web wallet](https://www.glif.io/en?txtype=send) | Supports sending & receiving FIL. Can be integrated with a Ledger hardware device. *Recommended.* | Yes | | [Filecoin MetaMask Wallet](https://snaps.metamask.io/snap/npm/filsnap/) | MetaMask has extensions called [Snaps](https://metamask.io/snaps/) installable from the right menu in MetaMask. | Yes | | [FoxWallet](https://foxwallet.com/) | A multi-currency mobile wallet by [Filfox](https://filfox.info/en). | Yes | | [Brave Wallet](https://brave.com/wallet/) | A multi-currency software wallet built-in to the Brave browser. | Yes | | [Trust wallet](https://trustwallet.com/) | A multi-currency wallet, the official wallet of Binance. | Unknown | | [ImToken](https://token.im/) | A multi-currency wallet. | Unknown | | [MathWallet](https://mathwallet.org/en-us/) | A multi-currency wallet. | Unknown | | [FoxWallet](https://foxwallet.com/) | A multi-currency mobile wallet by [Filfox](https://filfox.info/en). | Yes | | [FilSnap MetaMask Snap](https://snaps.metamask.io/snap/npm/filsnap/) | MetaMask has an extension system called [Snaps](https://metamask.io/snaps/). | Yes | | [D'CENT Wallet](https://www.dcentwallet.com/en) | A hardware and mobile wallet supporting Filecoin mainnet transactions, with f1 and f4 address support. | Yes | ### Hot versus cold A hot wallet refers to any wallet that is permanently connected to the internet. They can be mobile, desktop, or browser-based. Hot wallets make it faster and easier to access digital assets but could be vulnerable to online attacks. Therefore, it is recommended to keep large balances in cold wallets and only use hot wallets to hold funds that need to be accessed frequently. Cold wallets most commonly refer to hardware wallet devices shaped like a USB stick. They are typically offline and only connected to the internet for transactions. Accessing a cold wallet requires physical possession of the device plus knowledge of the private key, which makes them more resistant to theft. Cold wallets can be less convenient and are most useful for storing larger balances securely. ### Security Wallets that have gone through an audit have had their codebase checked by a recognized security firm for security vulnerabilities and potential leaks. However, just because a wallet has had an audit does not mean that it’s 100% bug-proof. Be incredibly cautious when using unaudited wallets. Never share your seed phrase, password, or private keys. Bad actors will often use social engineering tactics such as phishing emails or posing as customer service or tech support to lure users into handing over their private key or seed phrase. ### Add a wallet to our list If you know of a wallet that supports Filecoin, you can submit a pull request to this page and add it! * Create an issue in [`filecoin-project/filecoin-docs`](https://github.com/filecoin-project/filecoin-docs) with the name of the wallet and its features. * If the wallet is a mobile wallet, it must be available on both Android and iOS. * The wallet must have been audited. The results of this audit must be public. [Was this page helpful?](https://airtable.com/apppq4inOe4gmSSlk/pagoZHC2i1iqgphgl/form?prefill_Page+URL=https://docs.
프로젝트로 돌아가기