Delete most docs. Update about page with links to docs.filecoin.io

This commit is contained in:
Hector Sanjuan 2020-09-17 20:35:19 +02:00
parent 6849d18b03
commit a4fd356fcb
30 changed files with 14 additions and 6451 deletions

View File

@ -1,146 +1 @@
{
"bellman": {
"title": "Bellman",
"value": "Bellman is a rust crate for building zk-SNARK circuits. It provides circuit traits and primitive structures, as well as basic gadget implementations such as booleans and number abstractions."
},
"nvme": {
"title": "NVMe",
"value": "(non-volatile memory express) is a host controller interface and storage protocol created to accelerate the transfer of data between enterprise and client systems and solid-state drives (SSDs) over a computer's high-speed Peripheral Component Interconnect Express (PCIe) bus."
},
"multiaddr": {
"title": "Multiaddr",
"value": "Multiaddr is a format for encoding addresses from various well-established network protocols. It is useful to write applications that future-proof their use of addresses, and allow multiple transport protocols and addresses to coexist."
},
"attofil": {
"title": "attoFIL",
"value": "AttoFIL is a word used to describe 10^-18 FIL. The word atto comes from the Norwegian and Danish term: atten eighteen."
},
"fil": {
"title": "FIL",
"value": "A ticker symbol is an abbreviation used to uniquely identify Filecoin when it is used in a wallet exchange or a cryptocurrency exchange."
},
"epost": {
"title": "Election Proof-of-Spacetime",
"value": "Election Proof-of-Spacetime couples the Proof-of-Spacetime process with block production, meaning that in order to produce a block, the miner must produce a valid Proof-of-Spacetime proof (snark output)."
},
"jwt": {
"title": "JWT",
"value": "JSON Web Tokens are an open, industry standard RFC 7519 method for representing claims securely between two parties."
},
"json-rpc": {
"title": "JSON-RPC",
"value": "JSON-RPC is a remote procedure call protocol encoded in JSON. It is a very simple protocol (and very similar to XML-RPC), defining only a few data types and commands."
},
"bls-address": {
"title": "BLS Signature (Address)",
"value": "A BonehLynnShacham (BLS) signature is a digital signature scheme that allows a user to determine the authenticity of a signer, and is a commonly used signature scheme in the Filecoin Distributed Storage Network."
},
"faucet": {
"title": "Filecoin Test Faucet",
"value": "A webpage where you can get free test Filecoin to participate in the Testnet."
},
"chain": {
"title": "Chain",
"value": "The Filecoin Blockchain is a distributed virtual machine that achieves consensus, processes messages, accounts for storage, and maintains security in the Filecoin Protocol. It is the main interface linking various actors in the Filecoin system."
},
"miner-power": {
"title": "Miner Power",
"value": "Miner storage in relation to network storage, tracked in the power table."
},
"sector": {
"title": "Sector",
"value": "A fixed-size block of data of SECTOR_SIZE bytes which generally contains client's data."
},
"sealing": {
"title": "Sealing",
"value": "A slow encoding process that returns commitments and proofs for data being stored in a sector."
},
"seal": {
"title": "Seal",
"value": "A slow encoding process that returns commitments and proofs for data being stored in a sector."
},
"posts": {
"title": "Proof-of-Spacetime(s)",
"value": "Filecoin is a protocol token whose blockchain runs on a novel proof, called Proof-of-Spacetime, where blocks are created by miners that are storing data."
},
"filecoin-testnet": {
"title": "Filecoin Testnet",
"value": "Until we launch, we are making lots of changes to Lotus. The Testnet is expected to bring a few significant fixes/improvements. During Testnet, you can retrieve test filecoin from our network faucet to use as collateral to start mining. Test filecoin do not have any value the official filecoin tokens will not be released until Mainnet launch."
},
"filecoin-decentralized-storage-market": {
"title": "Filecoin Decentralized Storage Market",
"value": "Storage Market subsystem is the data entry point into the network. Miners only earn power from data stored in a storage deal and all deals live on the Filecoin network."
},
"filecoin-proof-parameters": {
"title": "Filecoin Proof Parameters",
"value": "The proving algorithms rely on a large binary parameter file."
},
"lotus-devnet": {
"title": "DevNet",
"value": "On the DevNets, you can store data as a storage client and also try how Filecoin mining works. The devnets are an important development tool for those who anticipate building applications on top of the Filecoin protocol or storing data on the decentralized storage market. "
},
"filecoin-distributed-storage-network": {
"title": "Filecoin Distributed Storage Network",
"value": "Filecoin is a distributed storage network based on a blockchain mechanism. Filecoin miners can elect to provide storage capacity for the network, and thereby earn units of the Filecoin cryptocurrency (FIL) by periodically producing cryptographic proofs that certify that they are providing the capacity specified."
},
"lotus-node": {
"title": "Lotus Node",
"value": "The Lotus Node is full of capabilities. It runs the Blockchain system, makes retrieval deals, does data transfer, supports block producer logic, and syncs and validates the chain."
},
"block-rewards": {
"title": "Block Reward",
"value": "Over the entire lifetime of the protocol, 1,400,000,000 FIL (TotalIssuance) will be given out to miners. The rate at which the funds are given out is set to halve every six years, smoothly (not a fixed jump like in Bitcoin)."
},
"block-producer-miner": {
"title": "Miner (Block Producer)",
"value": "The Block Producer Miner's logic. It currently shares an interface and process with the Lotus Node. A Block Producer chooses which messages to include in a block and is rewarded according to each messages gas price and consumption, forming a market."
},
"lotus-miner": {
"title": "Miner (lotus-miner)",
"value": "The Miner's logic. It has its own dedicated process. Contributes to the network through Sector commitments and Proofs of Spacetime to prove that it is storing the sectors it has commited to."
},
"swarm-port": {
"title": "Swarm Port (Libp2p)",
"value": "The LibP2P Swarm manages groups of connections to peers, handles incoming and outgoing streams, and is part of the miners implementation. The port value is part of the Host interface."
},
"daemon": {
"title": "Lotus Daemon",
"value": "A Daemon is a program that runs as a background process. A Daemon in the context of the Filecoin Distributed Storage Network may enable applications to communicate with peers, handle protocols, participate in pubsub, and interact with a distributed hash table (DHT)."
},
"storage-deal": {
"title": "Storage deal",
"value": "One of the two types of deals in Filecoin markets. Storage deals are recorded on the blockchain and enforced by the protocol."
},
"retrieval-deal": {
"title": "Retrieval deal",
"value": "One of the two types of deals in Filecoin markets. Retrieval deals are off chain and enabled by micropayment channel by transacting parties."
},
"deal-cid": {
"title": "Deal CID",
"value": "CID is a format for referencing content in distributed information systems, it is a way to store information so it can be retrieved based on its content, not its location. DealCID specifically is used in storage deals."
},
"data-cid": {
"title": "Data CID",
"value": "CID is a format for referencing content in distributed information systems, it is a way to store information so it can be retrieved based on its content, not its location. DataCID specifically is used to represent the file that is stored in the Filecoin Distributed Storage Network."
},
"cid": {
"title": "CID",
"value": "A CID is a self-describing content-addressed identifier. It uses cryptographic hashes to achieve content addressing. It uses several multiformats to achieve flexible self-description, namely multihash for hashes, multicodec for data content types, and multibase to encode the CID itself into strings."
},
"total-network-power": {
"title": "Total Network Power",
"value": "A reference to all the Power Tables for every subchain, accounting for each Lotus Miner on chain."
},
"chain-block-height": {
"title": "Chain Block Height",
"value": "Chain block height is defined as the number of blocks in the chain between any given block and the very first block in the blockchain."
},
"block-height": {
"title": "Block Height",
"value": "Height of the Merkle Tree of a sector. A sector is a contiguous array of bytes that a miner puts together, seals, and performs Proofs of Spacetime on."
},
"blocktime": {
"title": "Blocktime",
"value": "The time it takes for a Block to propagate to the whole network."
}
}
{}

View File

@ -2,194 +2,11 @@
"posts": [
{
"title": "About Lotus",
"slug": "en+lotus",
"slug": "",
"github": "en/about.md",
"value": null,
"posts": []
},
{
"title": "Installation",
"slug": "en+install",
"github": "en/installation/installation.md",
"value": null,
"posts": [
{
"title": "Linux installation",
"slug": "en+install-linux",
"github": "en/installation/install-linux.md",
"value": null
},
{
"title": "MacOS installation",
"slug": "en+install-macos",
"github": "en/installation/install-macos.md",
"value": null
},
{
"title": "Updating Lotus",
"slug": "en+update",
"github": "en/installation/update.md",
"value": null
}
]
},
{
"title": "Getting started",
"slug": "en+getting-started",
"github": "en/getting-started/getting-started.md",
"value": null,
"posts": [
{
"title": "Setting up Lotus",
"slug": "en+setup",
"github": "en/getting-started/setup.md",
"value": null
},
{
"title": "Obtaining and sending FIL",
"slug": "en+wallet",
"github": "en/getting-started/wallet.md",
"value": null
},
{
"title": "Setup troubleshooting",
"slug": "en+setup-troubleshooting",
"github": "en/getting-started/setup-troubleshooting.md",
"value": null
}
]
},
{
"title": "Storing and retrieving data",
"slug": "en+store",
"github": "en/store/store.md",
"value": null,
"posts": [
{
"title": "Making storage deals",
"slug": "en+making-deals",
"github": "en/store/making-deals.md",
"value": null
},
{
"title": "Adding data from IPFS",
"slug": "en+adding-from-ipfs",
"github": "en/store/adding-from-ipfs.md",
"value": null
},
{
"title": "Retrieving data",
"slug": "en+retriving",
"github": "en/store/retrieve.md",
"value": null
},
{
"title": "Storage Troubleshooting",
"slug": "en+storage-troubleshooting",
"github": "en/store/storage-troubleshooting.md",
"value": null
}
]
},
{
"title": "Storage mining",
"slug": "en+mining",
"github": "en/mining/mining.md",
"value": null,
"posts": [
{
"title": "Miner setup",
"slug": "en+miner-setup",
"github": "en/mining/miner-setup.md",
"value": null
},
{
"title": "Managing deals",
"slug": "en+managing-deals",
"github": "en/mining/managing-deals.md",
"value": null
},
{
"title": "Lotus Worker",
"slug": "en+lotus-worker",
"github": "en/mining/lotus-seal-worker.md",
"value": null
},
{
"title": "Benchmarking GPUs",
"slug": "en+gpus",
"github": "en/mining/gpus.md",
"value": null
},
{
"title": "Mining Troubleshooting",
"slug": "en+mining-troubleshooting",
"github": "en/mining/mining-troubleshooting.md",
"value": null
}
]
},
{
"title": "Building",
"slug": "en+building",
"github": "en/building/building.md",
"value": null,
"posts": [
{
"title": "Setting up remote API access",
"slug": "en+remote-api",
"github": "en/building/remote-api.md",
"value": null,
"posts": []
},
{
"title": "API endpoints and methods",
"slug": "en+api",
"github": "en/building/api.md",
"value": null,
"posts": []
},
{
"title": "API Reference",
"slug": "en+api-methods",
"github": "en/building/api-methods.md",
"value": null,
"posts": []
},
{
"title": "Payment Channels",
"slug": "en+payment-channels",
"github": "en/building/payment-channels.md",
"value": null,
"posts": []
},
{
"title": "Running a local devnet",
"slug": "en+local-devnet",
"github": "en/building/local-devnet.md",
"value": null,
"posts": []
},
{
"title": "Jaeger Tracing",
"slug": "en+jaeger-tracing",
"github": "en/building/jaeger-tracing.md",
"value": null,
"posts": []
},
{
"title": "API Troubleshooting",
"slug": "en+api-troubleshooting",
"github": "en/building/api-troubleshooting.md",
"value": null,
"posts": []
}
]
},
{
"title": "Lotus Architecture (WIP)",
"slug": "en+arch",
@ -203,23 +20,6 @@
"value": null
}
]
},
{
"title": "FAQs",
"slug": "en+faqs",
"github": "en/faqs.md",
"value": null,
"posts": []
},
{
"title": "Glossary",
"slug": "en+glossary",
"github": "en/.glossary.json",
"value": null,
"custom": {
"glossary": true
},
"posts": []
}
]
}

View File

@ -2,13 +2,18 @@
Lotus is an implementation of the **Filecoin Distributed Storage Network**.
The **Lotus Node** (and the mining applications) can be built to join any of the [Filecoin networks](https://docs.filecoin.io/how-to/networks/).
It is written in Go and provides a suite of command-line applications:
For more details about Filecoin, check out the [Filecoin Docs](https://docs.filecoin.io) and [Filecoin Spec](https://filecoin-project.github.io/specs/).
- Lotus Node (`lotus`): a Filecoin Node: validates network transactions, manages a FIL wallet, can perform storage and retrieval deals.
- Lotus Miner (`lotus-miner`): a Filecoin miner. See the the respective Lotus Miner section in the Mine documentation.
- Lotus Worker (`lotus-worker`): a worker that assists miners to perform mining-related tasks. See its respective guide for more information.
## What can I learn here?
The [Lotus user documentation](https://docs.filecoin.io/get-started/lotus) is part of the [Filecoin documentation site](https://docs.filecoin.io):
* To install and get started with Lotus, visit the [Get Started section](https://docs.filecoin.io/get-started/lotus).
* Information about how to perform deals on the Filecoin network using Lotus can be found in the [Store section](https://docs.filecoin.io/store/lotus).
* Miners looking to provide storage to the Network can find the latest guides in the [Mine section](https://docs.filecoin.io/mine/lotus).
* Developers and integrators that wish to use the Lotus APIs can start in the [Build section](https://docs.filecoin.io/mine/lotus).
For more details about Filecoin, check out the [Filecoin Docs](https://docs.filecoin.io) and [Filecoin Spec](https://spec.filecoin.io/).
* How to [install](en+installation) and [setup](en+setup) the Lotus software
* How to [store data on the Filecoin network](en+store)
* How to [setup a high performance FIL miner](en+miner-setup)
* How to [configure and access Lotus APIs](en+remote-api)

File diff suppressed because it is too large Load Diff

View File

@ -1,36 +0,0 @@
# API Troubleshooting
## Types: params
`params` must be an array. If there are no `params` you should still pass an empty array.
## Types: TipSet
For methods such as `Filecoin.StateMinerPower`, where the method accepts the argument of the type `TipSet`, you can pass `null` to use the current chain head.
```sh
curl -X POST \
-H "Content-Type: application/json" \
--data '{ "jsonrpc": "2.0", "method": "Filecoin.StateMinerPower", "params": ["t0101", null], "id": 3 }' \
'http://127.0.0.1:1234/rpc/v0'
```
## Types: Sending a CID
If you do not serialize the CID as a [JSON IPLD link](https://did-ipid.github.io/ipid-did-method/#txref), you will receive an error. Here is an example of a broken CURL request:
```sh
curl -X POST \
-H "Content-Type: application/json" \
--data '{ "jsonrpc": "2.0", "method":"Filecoin.ClientGetDealInfo", "params": ["bafyreiaxl446wlnu6t6dpq4ivrjf4gda4gvsoi4rr6mpxau7z25xvk5pl4"], "id": 0 }' \
'http://127.0.0.1:1234/rpc/v0'
```
To fix it, change the `params` property to:
```sh
curl -X POST \
-H "Content-Type: application/json" \
--data '{ "jsonrpc": "2.0", "method":"Filecoin.ClientGetDealInfo", "params": [{"/": "bafyreiaxl446wlnu6t6dpq4ivrjf4gda4gvsoi4rr6mpxau7z25xvk5pl4"}], "id": 0 }' \
'http://127.0.0.1:1234/rpc/v0'
```

View File

@ -1,38 +0,0 @@
# API endpoints and methods
The API can be accessed on:
- `http://[api:port]/rpc/v0` - HTTP RPC-API endpoint
- `ws://[api:port]/rpc/v0` - Websocket RPC-API endpoint
- `PUT http://[api:port]/rest/v0/import` - REST endpoint for file import (multipart upload). It requires write permissions.
The RPC methods can be found in the [Reference](en+api-methods) and directly in the source code:
- [Both Lotus node + miner APIs](https://github.com/filecoin-project/lotus/blob/master/api/api_common.go)
- [Lotus node API](https://github.com/filecoin-project/lotus/blob/master/api/api_full.go)
- [Lotus miner API](https://github.com/filecoin-project/lotus/blob/master/api/api_storage.go)
## JSON-RPC client
Lotus uses its own Go library implementation of [JSON-RPC](https://github.com/filecoin-project/go-jsonrpc).
## cURL example
To demonstrate making an API request, we will take the method `ChainHead` from [api/api_full.go](https://github.com/filecoin-project/lotus/blob/master/api/api_full.go).
```go
ChainHead(context.Context) (*types.TipSet, error)
```
And create a CURL command. In this command, `ChainHead` is included as `{ "method": "Filecoin.ChainHead" }`:
```sh
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $(cat ~/.lotusminer/token)" \
--data '{ "jsonrpc": "2.0", "method": "Filecoin.ChainHead", "params": [], "id": 3 }' \
'http://127.0.0.1:1234/rpc/v0'
```
(See [this section](en+remote-api) to learn how to generate authorization tokens).

View File

@ -1,5 +0,0 @@
# Building with Lotus
Lotus applications provide HTTP (JSON-RPC) APIs that allow developers to control Lotus programatically.
This section dives into how to setup and use these APIs, additionally providing information on advanced Lotus features and workflows, like Payment Channels or how to setup a fully local Lotus development network.

View File

@ -1,26 +0,0 @@
# Jaeger Tracing
Lotus has tracing built into many of its internals. To view the traces, first download [Jaeger](https://www.jaegertracing.io/download/) (Choose the 'all-in-one' binary). Then run it somewhere, start up the lotus daemon, and open up localhost:16686 in your browser.
## Open Census
Lotus uses [OpenCensus](https://opencensus.io/) for tracing application flow. This generates spans through the execution of annotated code paths.
Currently it is set up to use Jaeger, though other tracing backends should be fairly easy to swap in.
## Running Locally
To easily run and view tracing locally, first, install jaeger. The easiest way to do this is to [download the binaries](https://www.jaegertracing.io/download/) and then run the `jaeger-all-in-one` binary. This will start up jaeger, listen for spans on `localhost:6831`, and expose a web UI for viewing traces on `http://localhost:16686/`.
Now, to start sending traces from Lotus to Jaeger, set the environment variable `LOTUS_JAEGER` to `localhost:6831`, and start the `lotus daemon`.
Now, to view any generated traces, open up `http://localhost:16686/` in your browser.
## Adding Spans
To annotate a new codepath with spans, add the following lines to the top of the function you wish to trace:
```go
ctx, span := trace.StartSpan(ctx, "put function name here")
defer span.End()
```

View File

@ -1,54 +0,0 @@
# Setup Local Devnet
Build the Lotus Binaries in debug mode, This enables the use of 2048 byte sectors.
```sh
make 2k
```
Set the `LOTUS_SKIP_GENESIS_CHECK` environment variable to `_yes_`. This tells your
Lotus node that it's okay if the genesis being used doesn't match any baked-in
genesis.
```sh
export LOTUS_SKIP_GENESIS_CHECK=_yes_
```
Download the 2048 byte parameters:
```sh
./lotus fetch-params 2048
```
Pre-seal some sectors:
```sh
./lotus-seed pre-seal --sector-size 2KiB --num-sectors 2
```
Create the genesis block and start up the first node:
```sh
./lotus-seed genesis new localnet.json
./lotus-seed genesis add-miner localnet.json ~/.genesis-sectors/pre-seal-t01000.json
./lotus daemon --lotus-make-genesis=devgen.car --genesis-template=localnet.json --bootstrap=false
```
Then, in another console, import the genesis miner key:
```sh
./lotus wallet import --as-default ~/.genesis-sectors/pre-seal-t01000.key
```
Set up the genesis miner:
```sh
./lotus-miner init --genesis-miner --actor=t01000 --sector-size=2KiB --pre-sealed-sectors=~/.genesis-sectors --pre-sealed-metadata=~/.genesis-sectors/pre-seal-t01000.json --nosync
```
Now, finally, start up the miner:
```sh
./lotus-miner run --nosync
```
If all went well, you will have your own local Lotus Devnet running.

View File

@ -1,111 +0,0 @@
# Payment Channels
Payment channels are used to transfer funds between two actors.
For example in lotus a payment channel is created when a client wants to fetch data from a provider.
The client sends vouchers for the payment channel, and the provider sends data in response.
The payment channel is created on-chain with an initial amount.
Vouchers allow the client and the provider to exchange funds incrementally off-chain.
The provider can submit vouchers to chain at any stage.
Either party to the payment channel can settle the payment channel on chain.
After a settlement period (currently 12 hours) either party to the payment channel can call collect on chain.
Collect sends the value of submitted vouchers to the channel recipient (the provider), and refunds the remaining channel balance to the channel creator (the client).
Vouchers have a lane, a nonce and a value, where vouchers with a higher nonce supersede vouchers with a lower nonce in the same lane.
Each deal is created on a different lane.
Note that payment channels and vouchers can be used for any situation in which two parties need to incrementally transfer value between each other off-chain.
## Using the CLI
For example a client creates a payment channel to a provider with value 10 FIL.
```sh
$ lotus paych add-funds <client addr> <provider addr> 10
<channel addr>
```
The client creates a voucher in lane 0 (implied) with nonce 1 (implied) and value 2.
```sh
$ lotus paych voucher create <channel addr> 2
<voucher>
```
The client sends the voucher to the provider and the provider adds the voucher to their local store.
```sh
$ lotus paych voucher add <channel addr> <voucher>
```
The provider sends some data to the client.
The client creates a voucher in lane 0 (implied) with nonce 2 (implied) and value 4.
```sh
$ lotus paych voucher create <channel addr> 4
<voucher>
```
The client sends the voucher to the provider and the provider adds the voucher and sends back more data.
etc.
The client can add value to the channel after it has been created by calling `paych add-funds` with the same client and provider addresses.
```sh
$ lotus paych add-funds <client addr> <provider addr> 5
<channel addr> # Same address as above. Channel now has 15
```
Once the client has received all their data, they may settle the channel.
Note that settlement doesn't have to be done immediately.
For example the client may keep the channel open as long as it wants to continue making deals with the provider.
```sh
$ lotus paych settle <channel addr>
```
The provider can submit vouchers to chain (note that lotus does this automatically when it sees a settle message appear on chain).
The provider may have received many vouchers with incrementally higher values.
The provider should submit the best vouchers. Note that there will be one best voucher for each lane.
```sh
$ lotus paych voucher best-spendable <channel addr>
<voucher>
<voucher>
<voucher>
$ lotus paych voucher submit <channel addr> <voucher>
```
Once the settlement period is over, either the client or provider can call collect to disburse funds.
```sh
$ lotus paych collect <channel addr>
```
Check the status of a channel that is still being created using `lotus paych status-by-from-to`.
```sh
$ lotus paych status-by-from-to <from addr> <to addr>
Creating channel
From: t3sb6xzvs6rhlziatagevxpp3dwapdolurtkpn4kyh3kgoo4tn5o7lutjqlsnvpceztlhxu3lzzfe34rvpsjgq
To: t1zip4sblhyrn4oxygzsm6nafbsynp2avmk3xafea
Pending Amt: 10000
Wait Sentinel: bafy2bzacedk2jidsyxcynusted35t5ipkhu2kpiodtwyjr3pimrhke6f5pqbm
```
Check the status of a channel that has been created using `lotus paych status`.
```sh
$ lotus paych status <channel addr>
Channel exists
Channel: t2nydpzhmeqkmid5smtqnowlr2mr5az6rexpmyv6i
From: t3sb6xzvs6rhlziatagevxpp3dwapdolurtkpn4kyh3kgoo4tn5o7lutjqlsnvpceztlhxu3lzzfe34rvpsjgq
To: t1zip4sblhyrn4oxygzsm6nafbsynp2avmk3xafea
Confirmed Amt: 10000
Pending Amt: 6000
Queued Amt: 3000
Voucher Redeemed Amt: 2000
```

View File

@ -1,69 +0,0 @@
# Setting up remote API access
The **Lotus Miner** and the **Lotus Node** applications come with their own local API endpoints setup by default when they are running.
These endpoints are used by `lotus` and `lotus-miner` to interact with the running process. In this section we will explain how to enable remote access to the Lotus APIs.
Note that instructions are the same for `lotus` and `lotus-miner`. For simplicity, we will just show how to do it with `lotus`.
## Setting the listening interface for the API endpoint
By default, the API listens on the local "loopback" interface (`127.0.0.1`). This is configured in the `config.toml` file:
```toml
[API]
# ListenAddress = "/ip4/127.0.0.1/tcp/1234/http"
# RemoteListenAddress = ""
# Timeout = "30s"
```
To access the API remotely, Lotus needs to listen on the right IP/interface. The IP associated to each interface can be usually found with the command `ip a`. Once the right IP is known, it can be set in the configuration:
```toml
[API]
ListenAddress = "/ip4/<EXTERNAL_INTERFACE_IP>/tcp/3453/http" # port is an example
# Only relevant for lotus-miner
# This should be the IP:Port pair where the miner is reachable from anyone trying to dial to it.
# If you have placed a reverse proxy or a NAT'ing device in front of it, this may be different from
# the EXTERNAL_INTERFACE_IP.
RemoteListenAddress = "<EXTERNAL_IP_AS_SEEN_BY_OTHERS:<EXTERNAL_PORT_AS_SEEN_BY_OTHERS>"
```
> `0.0.0.0` can be used too. This is a wildcard that means "all interfaces". Depending on the network setup, this may affect security (listening on the wrong, exposed interface).
After making these changes, please restart the affected process.
## Issuing tokens
Any client wishing to talk to the API endpoints will need a token. Tokens can be generated with:
```sh
lotus auth create-token --perm <read,write,sign,admin>
```
(similarly for the Lotus Miner).
The permissions work as follows:
- `read` - Read node state, no private data.
- `write` - Write to local store / chain, and `read` permissions.
- `sign` - Use private keys stored in wallet for signing, `read` and `write` permissions.
- `admin` - Manage permissions, `read`, `write`, and `sign` permissions.
Tokens can then be used in applications by setting an Authorization header as:
```
Authorization: Bearer <token>
```
## Environment variables
`lotus`, `lotus-miner` and `lotus-worker` can actually interact with their respective applications running on a different node. All is needed to configure them are the following the *environment variables*:
```sh
FULLNODE_API_INFO="TOKEN:/ip4/<IP>/tcp/<PORT>/http"
MINER_API_INFO="TOKEN:/ip4/<IP>/tcp/<PORT>/http"
```

View File

@ -1,3 +0,0 @@
# Getting started
This section will get you started with Lotus. We will setup the Lotus daemon (that should already be [installed](en+install)), start it, create a wallet and use it to send and receive some Filecoin.

View File

@ -1,57 +0,0 @@
# Setup Troubleshooting
## Error: initializing node error: cbor input had wrong number of fields
This happens when you are starting Lotus which has been compiled for one network, but it encounters data in the Lotus data folder which is for a different network, or for an older incompatible version.
The solution is to clear the data folder (see below).
## Config: Clearing data
Here is a command that will delete your chain data, stored wallets, stored data and any miners you have set up:
```sh
rm -rf ~/.lotus ~/.lotusminer
```
Note you do not always need to clear your data for [updating](en+update).
## Error: Failed to connect bootstrap peer
```sh
WARN peermgr peermgr/peermgr.go:131 failed to connect to bootstrap peer: failed to dial : all dials failed
* [/ip4/147.75.80.17/tcp/1347] failed to negotiate security protocol: connected to wrong peer
```
- Try running the build steps again and make sure that you have the latest code from GitHub.
```sh
ERROR hello hello/hello.go:81 other peer has different genesis!
```
- Try deleting your file system's `~/.lotus` directory. Check that it exists with `ls ~/.lotus`.
```sh
- repo is already locked
```
- You already have another lotus daemon running.
## Config: Open files limit
Lotus will attempt to set up the file descriptor (FD) limit automatically. If that does not work, you can still configure your system to allow higher than the default values.
On most systems you can check the open files limit with:
```sh
ulimit -n
```
You can also modify this number by using the `ulimit` command. It gives you the ability to control the resources available for the shell or process started by it. If the number is below 10000, you can change it with the following command prior to starting the Lotus daemon:
```sh
ulimit -n 10000
```
Note that this is not persisted and that systemd manages its own FD limits for services. Please use your favourite search engine to find instructions on how to persist and configure FD limits for your system.

View File

@ -1,169 +0,0 @@
# Setting up Lotus
Your Lotus binaries have been installed and you are ready to start participating in the Filecoin network.
## Selecting the right network
You should have built the Lotus binaries from the right Github branch and Lotus will be fully setup to join the matching [Filecoin network](https://docs.filecoin.io/how-to/networks/). For more information on switching networks, check the [updating Lotus section](en+update).
## Starting the daemon
To start the daemon simply run:
```sh
lotus daemon
```
or if you are using the provided systemd service files, do:
```sh
systemctl start lotus-daemon
```
__If you are using Lotus from China__, make sure you set the following environment variable before running Lotus:
```
export IPFS_GATEWAY="https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/"
```
During the first start, Lotus:
* Will setup its data folder at `~/.lotus`
* Will download the necessary parameters
* Start syncing the Lotus chain
If you started lotus using systemd, the logs will appear in `/var/log/lotus/daemon.log` (not in journalctl as usual), otherwise you will see them in your screen.
Do not be appalled by the amount of warnings and sometimes errors showing in the logs, there are usually part of the usual functioning of the daemon as part of a distributed network.
## Waiting to sync
After the first start, the chain will start syncing until it has reached the tip. You can check how far the syncing process is with:
```sh
lotus sync status
```
You can also interactively wait for the chain to be fully synced with:
```sh
lotus sync wait
```
## Interacting with the Lotus daemon
As shown above, the `lotus` command allows to interact with the running daemon. You will see it getting used in many of the documentation examples.
This command-line-interface is self-documenting:
```sh
# Show general help
lotus --help
# Show specific help for the "client" subcommand
lotus client --help
```
For example, after your Lotus daemon has been running for a few minutes, use `lotus` to check the number of other peers that it is connected to in the Filecoin network:
```sh
lotus net peers
```
## Controlling the logging level
```sh
lotus log set-level
```
This command can be used to toggle the logging levels of the different
systems of a Lotus node. In decreasing order
of logging detail, the levels are `debug`, `info`, `warn`, and `error`.
As an example,
to set the `chain` and `blocksync` to log at the `debug` level, run
`lotus log set-level --system chain --system blocksync debug`.
To see the various logging system, run `lotus log list`.
## Configuration
### Configuration file
The Lotus daemon stores a configuration file in `~/.lotus/config.toml`. Note that by default all settings are commented. Here is an example configuration:
```toml
[API]
# Binding address for the Lotus API
ListenAddress = "/ip4/127.0.0.1/tcp/1234/http"
# Not used by lotus daemon
RemoteListenAddress = ""
# General network timeout value
Timeout = "30s"
# Libp2p provides connectivity to other Filecoin network nodes
[Libp2p]
# Binding address swarm - 0 means random port.
ListenAddresses = ["/ip4/0.0.0.0/tcp/0", "/ip6/::/tcp/0"]
# Insert any addresses you want to explicitally
# announce to other peers here. Otherwise, they are
# guessed.
AnnounceAddresses = []
# Insert any addresses to avoid announcing here.
NoAnnounceAddresses = []
# Connection manager settings, decrease if your
# machine is overwhelmed by connections.
ConnMgrLow = 150
ConnMgrHigh = 180
ConnMgrGrace = "20s"
# Pubsub is used to broadcast information in the network
[Pubsub]
Bootstrapper = false
RemoteTracer = "/dns4/pubsub-tracer.filecoin.io/tcp/4001/p2p/QmTd6UvR47vUidRNZ1ZKXHrAFhqTJAD27rKL9XYghEKgKX"
# This section can be used to enable adding and retriving files from IPFS
[Client]
UseIpfs = false
IpfsMAddr = ""
IpfsUseForRetrieval = false
# Metrics configuration
[Metrics]
Nickname = ""
HeadNotifs = false
```
### Ensuring connectivity to your Lotus daemon
Usually your lotus daemon will establish connectivity with others in the network and try to make itself diallable using uPnP. If you wish to manually ensure that your daemon is reachable:
* Set a fixed port of your choice in the `ListenAddresses` in the Libp2p section (i.e. 6665).
* Open a port in your router that is forwarded to this port. This is usually called featured as "Port forwarding" and the instructions differ from router model to model but there are many guides online.
* Add your public IP/port to `AnnounceAddresses`. i.e. `/ip4/<yourIP>/tcp/6665/`.
Note that it is not a requirement to use Lotus as a client to the network to be fully reachable, as your node already connects to others directly.
### Environment variables
Common to most Lotus binaries:
* `LOTUS_FD_MAX`: Sets the file descriptor limit for the process
* `LOTUS_JAEGER`: Sets the Jaeger URL to send traces. See TODO.
* `LOTUS_DEV`: Any non-empty value will enable more verbose logging, useful only for developers.
Specific to the *Lotus daemon*:
* `LOTUS_PATH`: Location to store Lotus data (defaults to `~/.lotus`).
* `LOTUS_SKIP_GENESIS_CHECK=_yes_`: Set only if you wish to run a lotus network with a different genesis block.
* `LOTUS_CHAIN_TIPSET_CACHE`: Sets the size for the chainstore tipset cache. Defaults to `8192`. Increase if you perform frequent arbitrary tipset lookups.
* `LOTUS_CHAIN_INDEX_CACHE`: Sets the size for the epoch index cache. Defaults to `32768`. Increase if you perform frequent deep chain lookups for block heights far from the latest height.
* `LOTUS_BSYNC_MSG_WINDOW`: Set the initial maximum window size for message fetching blocksync request. Set to 10-20 if you have an internet connection with low bandwidth.
Specific to the *Lotus miner*:
* `LOTUS_MINER_PATH`: Location for the miner's on-disk repo. Defaults to `./lotusminer`.
* A number of environment variables are respected for configuring the behaviour of the Filecoin proving subsystem. [See here](en+miner-setup).

View File

@ -1,58 +0,0 @@
# Obtaining and sending FIL
In order to receive and send FIL with Lotus you will need to have installed the program and be running the Lotus daemon.
## Creating a wallet
```sh
lotus wallet new bls
```
This will print your Filecoin address.
Your wallet information is stored in the `~/.lotus/keystore` (or `$LOTUS_PATH/keystore`). For instructions on export/import, see below.
You can create multiple wallets and list them with:
```sh
lotus wallet list
```
## Obtaining FIL
FIL can be obtained either by using one of the Faucets (available for the test networks) or by buying it from an exchange supporting FIL trading (once mainnet has launched).
Once you have received some FIL you can check your balance with:
```sh
lotus wallet balance
```
Remember that your will only see the latest balance when your daemon is fully synced to the chain.
## Sending FIL
Sending some FIL can be achieved by running:
```sh
lotus wallet send <address> <amount>
```
Make sure to check `lotus wallet send --help` for additional options.
## Exporting and importing a wallet
You can export and re-import a wallet with:
```sh
lotus wallet export <address> > wallet.private
```
and:
```sh
lotus wallet import wallet.private
```
Keep your wallet's private key safe!

View File

@ -1,129 +0,0 @@
# Linux installation
This page will show you the steps to build and install Lotus in your Linux computer.
## Dependencies
### System dependencies
First of all, building Lotus will require installing some system dependencies, usually provided by your distribution.
For Arch Linux:
```sh
sudo pacman -Syu opencl-icd-loader gcc git bzr jq pkg-config opencl-icd-loader opencl-headers
```
For Ubuntu:
```sh
sudo apt update
sudo apt install mesa-opencl-icd ocl-icd-opencl-dev gcc git bzr jq pkg-config curl
sudo apt upgrade
```
For Fedora:
```sh
sudo dnf -y update
sudo dnf -y install gcc git bzr jq pkgconfig mesa-libOpenCL mesa-libOpenCL-devel opencl-headers ocl-icd ocl-icd-devel clang llvm
```
For OpenSUSE:
```sh
sudo zypper in gcc git jq make libOpenCL1 opencl-headers ocl-icd-devel clang llvm
sudo ln -s /usr/lib64/libOpenCL.so.1 /usr/lib64/libOpenCL.so
```
### Rustup
Lotus needs [rustup](https://rustup.rs/):
```sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
Please make sure your `$PATH` variable is correctly configured after the rustup installation so that `cargo` and `rustc` are found in their rustup-configured locations.
### Go
To build lotus you will need a working installation of **[Go1.14](https://golang.org/dl/)**. Follow the [installation instructions](https://golang.org/doc/install), which generally amount to:
```sh
# Example! Check the installation instructions.
wget -c https://dl.google.com/go/go1.14.7.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local
```
## Build and install Lotus
With all the above, you are ready to build and install the Lotus suite (`lotus`, `lotus-miner` and `lotus-worker`):
```sh
git clone https://github.com/filecoin-project/lotus.git
cd lotus/
```
__IF YOU ARE IN CHINA__, set `export GOPROXY=https://goproxy.cn` before building
Now, choose the network that you will be joining:
* For `testnet`: `git checkout master`
* For `nerpa`: `git checkout ntwk-nerpa`
* For `butterfly`: `git checkout ntwk-butterfly`
Once on the right branch, do:
```sh
make clean install
sudo make install
```
This will put `lotus`, `lotus-miner` and `lotus-worker` in `/usr/local/bin`. `lotus` will use the `$HOME/.lotus` folder by default for storage (configuration, chain data, wallets...). `lotus-miner` will use `$HOME/.lotusminer` respectively. See the *environment variables* section below for how to customize these.
> Remeber to [move your Lotus folder](en+update) if you are switching between different networks, or there has been a network reset.
### Native Filecoin FFI
Some newer processors (AMD Zen (and later), Intel Ice Lake) have support SHA extensions. To make full use of your processor's capabilities, make sure you set the following variables BEFORE building from source (as described above):
```sh
export RUSTFLAGS="-C target-cpu=native -g"
export FFI_BUILD_FROM_SOURCE=1
```
> __NOTE__: This method of building does not produce portable binaries! Make sure you run the binary in the same machine as you built it.
### systemd service files
Lotus provides Systemd service files. They can be installed with:
```sh
make install-daemon-service
make install-miner-service
```
After that, you should be able to control Lotus using `systemctl`.
## Troubleshooting
This section mentions some of the common pitfalls for building Lotus. Check the [getting started](en+getting-started) section for more tips on issues when running the lotus daemon.
### Build errors
Please check the build logs closely. If you have a dirty state in your git branch make sure to:
```sh
git checkout <desired_branch>
git reset origin/<desired_branch> --hard
make clean
```
### Slow builds from China
Users from China can speed up their builds by setting:
```sh
export GOPROXY=https://goproxy.cn
```

View File

@ -1,62 +0,0 @@
# MacOS Instructions
## Get XCode Command Line Tools
To check if you already have the XCode Command Line Tools installed via the CLI, run:
```sh
xcode-select -p
```
If this command returns a path, you can move on to the next step. Otherwise, to install via the CLI, run:
```sh
xcode-select --install
```
To update, run:
```sh
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install
```
## Get HomeBrew
We recommend that MacOS users use [HomeBrew](https://brew.sh) to install each the necessary packages.
Check if you have HomeBrew:
```sh
brew -v
```
This command returns a version number if you have HomeBrew installed and nothing otherwise.
In your terminal, enter this command to install Homebrew:
```sh
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```
Use the command `brew install` to install the following packages:
```sh
brew install go bzr jq pkg-config rustup
```
Clone
```sh
git clone https://github.com/filecoin-project/lotus.git
cd lotus/
```
Build
```sh
make clean && make all
sudo make install
```
After intalling Lotus you will be ready to [setup and run the daemon](en+setup.md).

View File

@ -1,39 +0,0 @@
# Installation
Lotus can be installed in [Linux](en-install-linux) and [MacOS](en-install-macos) machines by building it from source. Windows is not supported yet.
This section contains guides to install Lotus in the supported platforms.
Lotus is made of 3 binaries:
* `lotus`: the main [Lotus node](en+setup) (Lotus client)
* `lotus-miner`: an application specifically for [Filecoin mining](en+miner-setup)
* `lotus-worker`: an additional [application to offload some heavy-processing tasks](en+lotus-worker) from the Lotus Miner.
These applications are written in Go, but also import several Rust libraries. Lotus does not distribute
pre-compiled builds.
## Hardware requirements
### For client nodes
* 8GiB of RAM
* Recommended for syncing speed: CPU with support for *Intel SHA Extensions* (AMD since Zen microarchitecture, Intel since Ice Lake).
* Recommended for speed: SSD hard drive (the bigger the better)
### For miners
The following correspond to the latest testing configuration:
* 2 TB of hard drive space
* 8 core CPU
* 128 GiB of RAM with 256 GiB of NVMe SSD storage for swap (or simply, more RAM).
* Recommended for speed: CPU with support for *Intel SHA Extensions* (AMD since Zen microarchitecture, Intel since Ice Lake).
* GPU for block mining. The following have been [confirmed to be fast enough](en+gpus):
- GeForce RTX 2080 Ti
- GeForce RTX 2080 SUPER
- GeForce RTX 2080
- GeForce GTX 1080 Ti
- GeForce GTX 1080
- GeForce GTX 1060

View File

@ -1,72 +0,0 @@
# Updating and restarting Lotus
Updating Lotus is as simple as rebuilding and re-installing the software as explained in the previous sections.
You can verify which version of Lotus you are running with:
```sh
lotus version
```
Make sure that you `git pull` the branch that corresponds to the network that your Lotus daemon is using:
```sh
git pull origin <branch>
make clean
make all
sudo make install # if necessary
```
Finally, restart the Lotus Node and/or Lotus Miner(s).
__CAVEAT__: If you are running miners: check if your miner is safe to shut down and restart: `lotus-miner proving info`. If any deadline shows a block height in the past, do not restart:
In the following example, Deadline Open is 454 which is earlier than Current Epoch of 500. This miner should **not** be shut down or restarted.
```
$ sudo lotus-miner proving info
Miner: t01001
Current Epoch: 500
Proving Period Boundary: 154
Proving Period Start: 154 (2h53m0s ago)
Next Period Start: 3034 (in 21h7m0s)
Faults: 768 (100.00%)
Recovering: 768
Deadline Index: 5
Deadline Sectors: 0
Deadline Open: 454 (23m0s ago)
Deadline Close: 514 (in 7m0s)
Deadline Challenge: 434 (33m0s ago)
Deadline FaultCutoff: 384 (58m0s ago)
```
In this next example, the miner can be safely restarted because no Deadlines are earlier than Current Epoch of 497. You have ~45 minutes before the miner must be back online to declare faults (FaultCutoff). If the miner has no faults, you have about an hour.
```
$ sudo lotus-miner proving info
Miner: t01000
Current Epoch: 497
Proving Period Boundary: 658
Proving Period Start: 658 (in 1h20m30s)
Next Period Start: 3538 (in 25h20m30s)
Faults: 0 (0.00%)
Recovering: 0
Deadline Index: 0
Deadline Sectors: 768
Deadline Open: 658 (in 1h20m30s)
Deadline Close: 718 (in 1h50m30s)
Deadline Challenge: 638 (in 1h10m30s)
Deadline FaultCutoff: 588 (in 45m30s)
```
## Switching networks and network resets
If you wish to switch to a different lotus network or there has been a network reset, you will need to:
* Checkout the appropiate repository branch and rebuild
* Ensure you do not mix Lotus data (`LOTUS_PATH`, usually `~/.lotus`) from a previous or different network. For this, either:
* Rename the folder to something else or,
* Set a different `LOTUS_PATH` for the new network.
* Same for `~/.lotusminer` if you are running a miner.
Note that deleting the Lotus data folder will wipe all the chain data, wallets and configuration, so think twice before taking any non-reversible action.

View File

@ -1,17 +0,0 @@
# Benchmarking additional GPUs
If you want to test a GPU that is not explicitly supported, set the following *environment variable*:
```sh
BELLMAN_CUSTOM_GPU="<NAME>:<NUMBER_OF_CORES>"
```
Here is an example of trying a GeForce GTX 1660 Ti with 1536 cores.
```sh
BELLMAN_CUSTOM_GPU="GeForce GTX 1660 Ti:1536"
```
To get the number of cores for your GPU, you will need to check your cards specifications.
To perform the benchmark you can use Lotus' [benchmarking tool](https://github.com/filecoin-project/lotus/tree/master/cmd/lotus-bench). Results and discussion are tracked in a [GitHub issue thread](https://github.com/filecoin-project/lotus/issues/694).

View File

@ -1,99 +0,0 @@
# Lotus Worker
The **Lotus Worker** is an extra process that can offload heavy processing tasks from your **Lotus Miner**. The sealing process automatically runs in the **Lotus Miner** process, but you can use the Worker on another machine communicating over a fast network to free up resources on the machine running the mining process.
## Installation
The `lotus-worker` application is installed along with the others when running `sudo make install` as shown in the [Installation section](en+install-linux). For simplicity, we recommend following the same procedure in the machines that will run the Lotus Workers (even if the Lotus miner and the Lotus daemon are not used there).
## Setting up the Miner
### Allow external connections to the miner API
First, you will need to ensure your `lotus-miner`'s API is accessible over the network.
To do this, open up `~/.lotusminer/config.toml` (Or if you manually set `LOTUS_MINER_PATH`, look under that directory) and look for the API field.
Default config:
```toml
[API]
ListenAddress = "/ip4/127.0.0.1/tcp/2345/http"
RemoteListenAddress = "127.0.0.1:2345"
```
To make your node accessible over the local area network, you will need to determine your machine's IP on the LAN (`ip a`), and change the `127.0.0.1` in the file to that address.
A more permissive and less secure option is to change it to `0.0.0.0`. This will allow anyone who can connect to your computer on that port to access the miner's API, though they will still need an auth token.
`RemoteListenAddress` must be set to an address which other nodes on your network will be able to reach.
### Create an authentication token
Write down the output of:
```sh
lotus-miner auth api-info --perm admin
```
The Lotus Workers will need this token to connect to the miner.
## Connecting the Lotus Workers
On each machine that will run the `lotus-worker` application you will need to define the following *environment variable*:
```sh
export MINER_API_INFO:<TOKEN>:/ip4/<miner_api_address>/tcp/2345`
```
If you are trying to use `lotus-worker` from China. You should additionally set:
```sh
export IPFS_GATEWAY="https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/"
```
Once that is done, you can run the Worker with:
```sh
lotus-worker run
```
> If you are running multiple workers on the same host, you will need to specify the `--listen` flag and ensure each worker is on a different port.
On your Lotus miner, check that the workers are correctly connected:
```sh
lotus-miner sealing workers
Worker 0, host computer
CPU: [ ] 0 core(s) in use
RAM: [|||||||||||||||||| ] 28% 18.1 GiB/62.7 GiB
VMEM: [|||||||||||||||||| ] 28% 18.1 GiB/62.7 GiB
GPU: GeForce RTX 2080, not used
Worker 1, host othercomputer
CPU: [ ] 0 core(s) in use
RAM: [|||||||||||||| ] 23% 14 GiB/62.7 GiB
VMEM: [|||||||||||||| ] 23% 14 GiB/62.7 GiB
GPU: GeForce RTX 2080, not used
```
## Running locally for manually managing process priority
You can also run the **Lotus Worker** on the same machine as your **Lotus Miner**, so you can manually manage the process priority.
To do so you have to first __disable all seal task types__ in the miner config. This is important to prevent conflicts between the two processes:
```toml
[Storage]
AllowPreCommit1 = false
AllowPreCommit2 = false
AllowCommit = false
AllowUnseal = false
```
You can then run the miner on your local-loopback interface;
```sh
lotus-worker run
```

View File

@ -1,19 +0,0 @@
# Managing deals
While the Lotus Miner is running as a daemon, the `lotus-miner` application can be used to manage and configure the miner:
```sh
lotus-miner storage-deals --help
```
Running the above command will show the different options related to deals. For example, `lotus-miner storage-deals set-ask` allows to set the price for storage that your miner uses to respond ask requests from clients.
If deals are ongoing, you can check the data transfers with:
```sh
lotus-miner data-transfers list
```
Make sure you explore the `lotus-miner` CLI. Every command is self-documented and takes a `--help` flag that offers specific information about it.

View File

@ -1,241 +0,0 @@
# Miner setup
This page will guide you through all you need to know to sucessfully run a **Lotus Miner**. Before proceeding, remember that you should be running the Lotus daemon on a fully synced chain.
## Performance tweaks
This is a list of performance tweaks to consider before starting the miner:
### Building
As [explained already](en+install-linux#native-filecoin-ffi-10) should have exported the following variables before building the Lotus applications:
```sh
export RUSTFLAGS="-C target-cpu=native -g"
export FFI_BUILD_FROM_SOURCE=1
```
### Environment
For high performance mining, we recommend setting the following variables in your environment so that they are available when running any of the Lotus applications:
```sh
# See https://github.com/filecoin-project/bellman
export BELLMAN_CPU_UTILIZATION=0.875
# See https://github.com/filecoin-project/rust-fil-proofs/
export FIL_PROOFS_MAXIMIZE_CACHING=1 # More speed at RAM cost (1x sector-size of RAM - 32 GB).
export FIL_PROOFS_USE_GPU_COLUMN_BUILDER=1 # precommit2 GPU acceleration
export FIL_PROOFS_USE_GPU_TREE_BUILDER=1
```
IF YOU ARE RUNNING FROM CHINA:
```sh
export IPFS_GATEWAY="https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/"
```
IF YOUR MINER RUNS IN A DIFFERENT MACHINE AS THE LOTUS DAEMON:
```sh
export FULLNODE_API_INFO=<api_token>:/ip4/<lotus_daemon_ip>/tcp/<lotus_daemon_port>/http
```
If you will be using systemd service files to run the Lotus daemon and miner, make sure you include these variables manually in the service files.
### Adding swap
If you have only 128GiB of RAM, you will need to make sure your system provides at least an extra 256GiB of fast swap (preferably NVMe SSD):
```sh
sudo fallocate -l 256G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
# show current swap spaces and take note of the current highest priority
swapon --show
# append the following line to /etc/fstab (ensure highest priority) and then reboot
# /swapfile swap swap pri=50 0 0
sudo reboot
# check a 256GB swap file is automatically mounted and has the highest priority
swapon --show
```
## Creating a new BLS wallet
You will need a BLS wallet (`t3...`) for mining. To create it, if you don't have one already, run:
```sh
lotus wallet new bls
```
Next make sure to [send some funds](en+wallet) to this address so that the miner setup can be completed.
## Initializing the miner
> SPACE RACE:
> To participate in the Space race, please register your miner:
>
> - Visit the [faucet](http://spacerace.faucet.glif.io/)
> - Paste the address you created under REQUEST.
> - Press the Request button.
Now that you have a miner address you can initialize the Lotus Miner:
```sh
lotus-miner init --owner=<bls address> --no-local-storage
```
* The `--no-local-storage` flag is used so that we configure specific locations for storage later below.
* The init process will download over 100GiB of initialization parameters to /var/tmp/filecoin-proof-parameters. Make sure there is space or set `FIL_PROOFS_PARAMETER_CACHE` to somewhere else.
* The Lotus Miner configuration folder is created at `~/.lotusminer/` or `$LOTUS_MINER_PATH` if set.
## Reachability
Before you start your miner, it is __very important__ to configure it so that it is reachable from any peer in the Filecoin network. For this you will need a stable public IP and edit your `~/.lotusminer/config.toml` as follows:
```toml
...
[Libp2p]
ListenAddresses = ["/ip4/0.0.0.0/tcp/24001"] # choose a fixed port
AnnounceAddresses = ["/ip4/<YOUR_PUBLIC_IP_ADDRESS>/tcp/24001"] # important!
...
```
Once you start your miner, make sure you can connect to its public IP/port (you can use `telnet`, `nc` for the task...). If you have an active firewall or some sort, you may need to additionally open ports in it.
## Starting the miner
You are now ready to start your Lotus miner:
```sh
lotus-miner run
```
or if you are using the systemd service file:
```sh
systemctl start lotus-miner
```
> __Do not proceed__ from here until you have verified that your miner not only is running, but also __reachable on its public IP address__.
## Publishing the miner addresses
Once the miner is up and running, publish your miner address (which you configured above) on the chain (please ensure it is dialable):
```sh
lotus-miner actor set-addrs /ip4/<YOUR_PUBLIC_IP_ADDRESS>/tcp/24001
```
## Setting locations for sealing and long-term storage
If you used the `--no-local-storage` flag during initialization, you can now specify the disk locations for sealing (SSD recommended) and long-term storage (otherwise you can skip this):
```
lotus-miner storage attach --init --seal <PATH_FOR_SEALING_STORAGE>
lotus-miner storage attach --init --store <PATH_FOR_LONG_TERM_STORAGE>
lotus-miner storage list
```
## Pledging sectors
If you would like to compete for block rewards by increasing your power in the network as soon as possible, you can optionally pledge one or several sectors, depending on your storage. It can also be used to test that the sealing process works correctly. Pledging is equivalent to storing random data instead of real data obtained through storage deals.
> Note that pledging sectors to the mainnet network makes most sense when trying to obtain a reasonable amount of total power in the network, thus obtaining real chances to mine new blocks. Otherwise it is only useful for testing purposes.
If you decide to go ahead, then do:
```sh
lotus-miner sectors pledge
```
This will write data to `$TMPDIR` so make sure that there is enough space available.
You shoud check that your sealing job has started with:
```sh
lotus-miner sealing jobs
```
This will be accommpanied by a file in `<PATH_FOR_SEALING_STORAGE>/unsealed`.
After some minutes, you can check the sealing progress with:
```sh
lotus-miner sectors list
# and
lotus-miner sealing workers
```
When sealing for the new is complete, `pSet: NO` will become `pSet: YES`.
Once the sealing is finished, you will want to configure how long it took your miner to seal this sector and configure the miner accordingly. To find out how long it took use:
```
lotus-miner sectors status --log 0
```
Once you know, you can edit the Miner's `~/.lotusminer/config.toml` accordingly:
```
...
[Dealmaking]
...
ExpectedSealDuration = "12h0m0s" # The time it took your miner
```
You can also take the chance to edit other values, such as `WaitForDealsDelay` which specifies the delay between accepting the first deal and sealing, allowing to place multiple deals in the same sector.
Once you are done editing the configuration, [restart your miner](en+update).
If you wish to be able to re-use a pledged sector for real storage deals before the pledged period of 6 months ends, you will need to mark them for upgrade:
```sh
lotus-miner sectors mark-for-upgrade <sector number>
```
The sector should become inactive within 24 hours. From that point, the pledged storage can be re-used to store real data associated with real storage deals.
## Separate address for windowPoSt messages
WindowPoSt is the mechanism through which storage is verified in Filecoin. It requires miners to submit proofs for all sectors every 24h, which require sending messages to the chain.
Because many other mining related actions require sending messages to the chain, and not all of those are "high value", it may be desirable to use a separate account to send PoSt messages from. This allows for setting lower GasFeeCaps on the lower value messages without creating head-of-line blocking problems for the PoSt messages in congested chain conditions
To set this up, first create a new account, and send it some funds for gas fees:
```sh
lotus wallet new bls
t3defg...
lotus send t3defg... 100
```
Next add the control address:
```sh
lotus-miner actor control set --really-do-it t3defg...
Add t3defg...
Message CID: bafy2..
```
Wait for the message to land on chain:
```sh
lotus state wait-msg bafy2..
...
Exit Code: 0
...
```
Finally, check the miner control address list to make sure the address was correctly setup:
```sh
lotus-miner actor control list
name ID key use balance
owner t01111 t3abcd... other 300 FIL
worker t01111 t3abcd... other 300 FIL
control-0 t02222 t3defg... post 100 FIL
```

View File

@ -1,59 +0,0 @@
# Mining Troubleshooting
## Config: Filecoin Proof Parameters directory
If you want to put the **Filecoin Proof Parameters** in a different directory, use the following environment variable:
```sh
FIL_PROOFS_PARAMETER_CACHE
```
## Error: Can't acquire bellman.lock
The **Bellman** lockfile is created to lock a GPU for a process. This bug can occur when this file isn't properly cleaned up:
```sh
mining block failed: computing election proof: github.com/filecoin-project/lotus/miner.(*Miner).mineOne
```
This bug occurs when the miner can't acquire the `bellman.lock`. To fix it you need to stop the `lotus-miner` and remove `/tmp/bellman.lock`.
## Error: Failed to get api endpoint
```sh
lotus-miner info
# WARN main lotus-miner/main.go:73 failed to get api endpoint: (/Users/myrmidon/.lotusminer) %!w(*errors.errorString=&{API not running (no endpoint)}):
```
If you see this, that means your **Lotus Miner** isn't ready yet. You need to finish [syncing the chain](en+setup#waiting-to-sync-370).
## Error: Your computer may not be fast enough
```sh
CAUTION: block production took longer than the block delay. Your computer may not be fast enough to keep up
```
If you see this, that means your computer is too slow and your blocks are not included in the chain, and you will not receive any rewards.
## Error: No space left on device
```sh
lotus-miner sectors pledge
# No space left on device (os error 28)
```
If you see this, that means `pledge-sector` wrote too much data to `$TMPDIR` which by default is the root partition (This is common for Linux setups). Usually your root partition does not get the largest partition of storage so you will need to change the environment variable to something else.
## Error: GPU unused
If you suspect that your GPU is not being used, first make sure it is properly configured as described in the [testing configuration page](hardware-mining.md). Once you've done that (and set the `BELLMAN_CUSTOM_GPU` as appropriate if necessary) you can verify your GPU is being used by running a quick lotus-bench benchmark.
First, to watch GPU utilization run `nvtop` in one terminal, then in a separate terminal, run:
```sh
make bench
./bench sealing --sector-size=2KiB
```
This process uses a fair amount of GPU, and generally takes ~4 minutes to complete. If you do not see any activity in nvtop from lotus during the entire process, it is likely something is misconfigured with your GPU.

View File

@ -1,8 +0,0 @@
# Storage Mining
This section of the documentation explains how to do storage mining with Lotus. Please note that not everyone can do storage mining, and that you should not attempt it on on networks where sector sizes are 32GB+ unless you meet the [hardware requirements](en+install#hardware-requirements-1).
From this point we assume that you have setup and are running the [Lotus Node](en+setup), that it has fully synced the Filecoin chain and that you are familiar with how to interact with it using the `lotus` command-line interface.
In order to perform storage mining, apart from the Lotus daemon, you will be additionally interacting with the `lotus-miner` and potentially the `lotus-worker` applications (which you should have [installed](en+install-linux) along the `lotus` application already).

View File

@ -1,20 +0,0 @@
# Adding data from IPFS
Lotus supports making deals with data stored in IPFS, without having to re-import it into lotus.
To enable this integration, you need to have an IPFS daemon running in the background.
Then, open up `~/.lotus/config.toml` (or if you manually set `LOTUS_PATH`, look under that directory) and look for the Client field, and set `UseIpfs` to `true`.
```toml
[Client]
UseIpfs = true
```
After restarting the lotus daemon, you should be able to make deals with data in your IPFS node:
```sh
$ ipfs add -r SomeData
QmSomeData
$ ./lotus client deal QmSomeData t01000 0.0000000001 80000
```

View File

@ -1,71 +0,0 @@
# Making storage deals
## Adding a file to Lotus
Before sending data to a Filecoin miner for storage, the data needs to be correctly formatted and packed. This can be achieved by locally importing the data into Lotus with:
```sh
lotus client import ./your-example-file.txt
```
Upon success, this command will return a **Data CID**. This is a very important piece of information, as it will be used to make deals to both store and retrieve the data in the future.
You can list the data CIDs of the files you locally imported with:
```sh
lotus client local
```
## Storing data in the network
To store data in the network you will need to:
* Find a Filecoin miner willing to store it
* Make a deal with the miner agreeing on the price to pay and the duration for which the data should be stored.
You can obtain a list of all miners in the network with:
```sh
lotus state list-miners
t0xxxx
t0xxxy
t0xxxz
...
```
This will print a list of miner IDs. In order to ask for the terms offered by a particular miner, you can then run:
```sh
lotus client query-ask <miner>
```
If you are satisfied with the terms, you can proceed to propose a deal to the miner, using the **Data CID** that you obtained during the import step:
```sh
lotus client deal
```
This command will interactively ask you for the CID, miner ID and duration in days for the deal. You can also call it with arguments:
```sh
lotus client deal <data CID> <miner> <price> <duration>
```
where the `duration` is expressed in blocks (1 block is equivalent to 30s).
## Checking the status of the deals
You can list deals with:
```sh
lotus client list-deals
```
Among other things, this will give you information about the current state on your deals, whether they have been published on chain (by the miners) and whether the miners have been slashed for not honoring them.
For a deal to succeed, the miner needs to be correctly configured and running, accept the deal and *seal* the file correctly. Otherwise, the deal will appear in error state.
You can make deals with multiple miners for the same data.
Once a deal is sucessful and the data is *sealed*, it can be [retrieved](en+retrieving).

View File

@ -1,27 +0,0 @@
# Retrieving Data
Once data has been succesfully [stored](en+making-deals) and sealed by a Filecoin miner, it can be retrieved.
In order to do this we will need to create a **retrieval deal**.
## Finding data by CID
In order to retrieve some data you will need the **Data CID** that was used to create the storage deal.
You can find who is storing the data by running:
```sh
lotus client find <Data CID>
```
## Making a retrieval deal
You can then make a retrieval deal with:
```sh
lotus client retrieve <Data CID> <outfile>
```
This commands take other optional flags (check `--help`).
If the outfile does not exist it will be created in the Lotus repository directory. This process may take 2 to 10 minutes.

View File

@ -1,30 +0,0 @@
# Storage Troubleshooting
## Error: Routing: not found
```
WARN main lotus/main.go:72 routing: not found
```
This error means that the miner is offline.
## Error: Failed to start deal
```sh
WARN main lotus/main.go:72 failed to start deal: computing commP failed: generating CommP: Piece must be at least 127 bytes
```
This error means that there is a minimum file size of 127 bytes.
## Error: 0kb file response during retrieval
This means that the file to be retrieved may have not yet been sealed and is thus, not retrievable yet.
Miners can check sealing progress with this command:
```sh
lotus-miner sectors list
```
When sealing is complete, `pSet: NO` will become `pSet: YES`.

View File

@ -1,11 +0,0 @@
# Storing and retrieving data
Lotus enables you to store any data on the Filecoin network and retrieve it later. This is achieved by making *deals* with miners.
A *storage deal* specifies that a miner should store ceratin data for a previously agreed period and price.
Once a deal is made, the data is then sent to the miners, which regularly proves that it is storing it. If they fail to do so, the miner is penalized (slashed).
The data can be retrieved with a *retrieval deal*.
This section explains how to use Lotus to [store](en+making-deals) and [retrieve](en+retrieving) data from the Filecoin network.