Merge pull request #2317 from filcloud/issue-2304

fix issue 2304: ux improvements
This commit is contained in:
Łukasz Magiera 2020-07-15 19:38:35 +02:00 committed by GitHub
commit 0f2043d874
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
69 changed files with 562 additions and 525 deletions

View File

@ -93,10 +93,10 @@ jobs:
- store_artifacts:
path: lotus
- store_artifacts:
path: lotus-storage-miner
path: lotus-miner
- store_artifacts:
path: lotus-seal-worker
- run: mkdir linux && mv lotus lotus-storage-miner lotus-seal-worker linux/
path: lotus-worker
- run: mkdir linux && mv lotus lotus-miner lotus-worker linux/
- persist_to_workspace:
root: "."
paths:
@ -223,10 +223,10 @@ jobs:
- store_artifacts:
path: lotus
- store_artifacts:
path: lotus-storage-miner
path: lotus-miner
- store_artifacts:
path: lotus-seal-worker
- run: mkdir darwin && mv lotus lotus-storage-miner lotus-seal-worker darwin/
path: lotus-worker
- run: mkdir darwin && mv lotus lotus-miner lotus-worker darwin/
- persist_to_workspace:
root: "."
paths:

View File

@ -19,15 +19,15 @@ Including what commands you ran, and a description of your setup, is very helpfu
**Sectors list**
The output of `./lotus-storage-miner sectors list`.
The output of `./lotus-miner sectors list`.
**Sectors status**
The output of `./lotus-storage-miner sectors status --log <sectorId>` for the failed sector(s).
The output of `./lotus-miner sectors status --log <sectorId>` for the failed sector(s).
**Lotus storage miner logs**
**Lotus miner logs**
Please go through the logs of your storage miner, and include screenshots of any error-like messages you find.
Please go through the logs of your miner, and include screenshots of any error-like messages you find.
**Version**

17
.gitignore vendored
View File

@ -1,19 +1,21 @@
/lotus
/lotus-storage-miner
/lotus-seal-worker
/lotus-miner
/lotus-worker
/lotus-seed
/lotus-health
/lotus-chainwatch
/lotus-shed
/pond
/townhall
/fountain
/stats
/bench
/lotus-pond
/lotus-townhall
/lotus-fountain
/lotus-stats
/lotus-bench
/bench.json
/lotuspond/front/node_modules
/lotuspond/front/build
/cmd/lotus-townhall/townhall/node_modules
/cmd/lotus-townhall/townhall/build
/cmd/lotus-townhall/townhall/package-lock.json
extern/filecoin-ffi/rust/target
**/*.a
**/*.pc
@ -24,7 +26,6 @@ build/paramfetch.sh
/vendor
/blocks.dot
/blocks.svg
/chainwatch
/chainwatch.db
/bundle
/darwin

123
Makefile
View File

@ -58,10 +58,10 @@ deps: $(BUILD_DEPS)
.PHONY: deps
debug: GOFLAGS+=-tags=debug
debug: lotus lotus-storage-miner lotus-seal-worker lotus-seed
debug: lotus lotus-miner lotus-worker lotus-seed
2k: GOFLAGS+=-tags=2k
2k: lotus lotus-storage-miner lotus-seal-worker lotus-seed
2k: lotus lotus-miner lotus-worker lotus-seed
lotus: $(BUILD_DEPS)
rm -f lotus
@ -71,19 +71,19 @@ lotus: $(BUILD_DEPS)
.PHONY: lotus
BINS+=lotus
lotus-storage-miner: $(BUILD_DEPS)
rm -f lotus-storage-miner
go build $(GOFLAGS) -o lotus-storage-miner ./cmd/lotus-storage-miner
go run github.com/GeertJohan/go.rice/rice append --exec lotus-storage-miner -i ./build
.PHONY: lotus-storage-miner
BINS+=lotus-storage-miner
lotus-miner: $(BUILD_DEPS)
rm -f lotus-miner
go build $(GOFLAGS) -o lotus-miner ./cmd/lotus-storage-miner
go run github.com/GeertJohan/go.rice/rice append --exec lotus-miner -i ./build
.PHONY: lotus-miner
BINS+=lotus-miner
lotus-seal-worker: $(BUILD_DEPS)
rm -f lotus-seal-worker
go build $(GOFLAGS) -o lotus-seal-worker ./cmd/lotus-seal-worker
go run github.com/GeertJohan/go.rice/rice append --exec lotus-seal-worker -i ./build
.PHONY: lotus-seal-worker
BINS+=lotus-seal-worker
lotus-worker: $(BUILD_DEPS)
rm -f lotus-worker
go build $(GOFLAGS) -o lotus-worker ./cmd/lotus-seal-worker
go run github.com/GeertJohan/go.rice/rice append --exec lotus-worker -i ./build
.PHONY: lotus-worker
BINS+=lotus-worker
lotus-shed: $(BUILD_DEPS)
rm -f lotus-shed
@ -92,7 +92,7 @@ lotus-shed: $(BUILD_DEPS)
.PHONY: lotus-shed
BINS+=lotus-shed
build: lotus lotus-storage-miner lotus-seal-worker
build: lotus lotus-miner lotus-worker
@[[ $$(type -P "lotus") ]] && echo "Caution: you have \
an existing lotus binary in your PATH. This may cause problems if you don't run 'sudo make install'" || true
@ -100,8 +100,8 @@ an existing lotus binary in your PATH. This may cause problems if you don't run
install:
install -C ./lotus /usr/local/bin/lotus
install -C ./lotus-storage-miner /usr/local/bin/lotus-storage-miner
install -C ./lotus-seal-worker /usr/local/bin/lotus-seal-worker
install -C ./lotus-miner /usr/local/bin/lotus-miner
install -C ./lotus-worker /usr/local/bin/lotus-worker
install-services: install
mkdir -p /usr/local/lib/systemd/system
@ -115,7 +115,7 @@ install-services: install
clean-services:
rm -f /usr/local/lib/systemd/system/lotus-daemon.service
rm -f /usr/local/lib/systemd/system/lotus-miner.service
rm -f /usr/local/lib/systemd/system/chainwatch.service
rm -f /usr/local/lib/systemd/system/lotus-chainwatch.service
systemctl daemon-reload
# TOOLS
@ -134,66 +134,65 @@ benchmarks:
@curl -X POST 'http://benchmark.kittyhawk.wtf/benchmark' -d '@bench.json' -u "${benchmark_http_cred}"
.PHONY: benchmarks
pond: 2k
go build -o pond ./lotuspond
lotus-pond: 2k
go build -o lotus-pond ./lotuspond
(cd lotuspond/front && npm i && CI=false npm run build)
.PHONY: pond
BINS+=pond
.PHONY: lotus-pond
BINS+=lotus-pond
townhall:
rm -f townhall
go build -o townhall ./cmd/lotus-townhall
lotus-townhall:
rm -f lotus-townhall
go build -o lotus-townhall ./cmd/lotus-townhall
(cd ./cmd/lotus-townhall/townhall && npm i && npm run build)
go run github.com/GeertJohan/go.rice/rice append --exec townhall -i ./cmd/lotus-townhall -i ./build
.PHONY: townhall
BINS+=townhall
go run github.com/GeertJohan/go.rice/rice append --exec lotus-townhall -i ./cmd/lotus-townhall -i ./build
.PHONY: lotus-townhall
BINS+=lotus-townhall
fountain:
rm -f fountain
go build -o fountain ./cmd/lotus-fountain
go run github.com/GeertJohan/go.rice/rice append --exec fountain -i ./cmd/lotus-fountain -i ./build
.PHONY: fountain
BINS+=fountain
lotus-fountain:
rm -f lotus-fountain
go build -o lotus-fountain ./cmd/lotus-fountain
go run github.com/GeertJohan/go.rice/rice append --exec lotus-fountain -i ./cmd/lotus-fountain -i ./build
.PHONY: lotus-fountain
BINS+=lotus-fountain
chainwatch:
rm -f chainwatch
go build -o chainwatch ./cmd/lotus-chainwatch
go run github.com/GeertJohan/go.rice/rice append --exec chainwatch -i ./cmd/lotus-chainwatch -i ./build
.PHONY: chainwatch
BINS+=chainwatch
lotus-chainwatch:
rm -f lotus-chainwatch
go build -o lotus-chainwatch ./cmd/lotus-chainwatch
go run github.com/GeertJohan/go.rice/rice append --exec lotus-chainwatch -i ./cmd/lotus-chainwatch -i ./build
.PHONY: lotus-chainwatch
BINS+=lotus-chainwatch
install-chainwatch-service: chainwatch
install -C ./chainwatch /usr/local/bin/chainwatch
install -C -m 0644 ./scripts/chainwatch.service /usr/local/lib/systemd/system/chainwatch.service
mkdir -p /etc/lotus
install -C ./lotus-chainwatch /usr/local/bin/lotus-chainwatch
install -C -m 0644 ./scripts/lotus-chainwatch.service /usr/local/lib/systemd/system/lotus-chainwatch.service
systemctl daemon-reload
@echo
@echo "chainwatch installed. Don't forget to 'systemctl enable chainwatch' for it to be enabled on startup."
bench:
rm -f bench
go build -o bench ./cmd/lotus-bench
go run github.com/GeertJohan/go.rice/rice append --exec bench -i ./build
.PHONY: bench
BINS+=bench
lotus-bench:
rm -f lotus-bench
go build -o lotus-bench ./cmd/lotus-bench
go run github.com/GeertJohan/go.rice/rice append --exec lotus-bench -i ./build
.PHONY: lotus-bench
BINS+=lotus-bench
stats:
rm -f stats
go build -o stats ./tools/stats
go run github.com/GeertJohan/go.rice/rice append --exec stats -i ./build
.PHONY: stats
BINS+=stats
lotus-stats:
rm -f lotus-stats
go build -o lotus-stats ./cmd/lotus-stats
go run github.com/GeertJohan/go.rice/rice append --exec lotus-stats -i ./build
.PHONY: lotus-stats
BINS+=lotus-stats
health:
lotus-health:
rm -f lotus-health
go build -o lotus-health ./cmd/lotus-health
go run github.com/GeertJohan/go.rice/rice append --exec lotus-health -i ./build
.PHONY: health
BINS+=health
.PHONY: lotus-health
BINS+=lotus-health
testground:
go build -tags testground -o /dev/null ./cmd/lotus
.PHONY: testground
BINS+=testground
@ -203,15 +202,15 @@ buildall: $(BINS)
completions:
./scripts/make-completions.sh lotus
./scripts/make-completions.sh lotus-storage-miner
./scripts/make-completions.sh lotus-miner
.PHONY: completions
install-completions:
mkdir -p /usr/share/bash-completion/completions /usr/local/share/zsh/site-functions/
install -C ./scripts/bash-completion/lotus /usr/share/bash-completion/completions/lotus
install -C ./scripts/bash-completion/lotus-storage-miner /usr/share/bash-completion/completions/lotus-storage-miner
install -C ./scripts/bash-completion/lotus-miner /usr/share/bash-completion/completions/lotus-miner
install -C ./scripts/zsh-completion/lotus /usr/local/share/zsh/site-functions/_lotus
install -C ./scripts/zsh-completion/lotus-storage-miner /usr/local/share/zsh/site-functions/_lotus-storage-miner
install -C ./scripts/zsh-completion/lotus-miner /usr/local/share/zsh/site-functions/_lotus-miner
clean:
rm -rf $(CLEAN) $(BINS)

View File

@ -34,7 +34,7 @@ func NewFullNodeRPC(addr string, requestHeader http.Header) (api.FullNode, jsonr
return &res, closer, err
}
// NewStorageMinerRPC creates a new http jsonrpc client for storage miner
// NewStorageMinerRPC creates a new http jsonrpc client for miner
func NewStorageMinerRPC(addr string, requestHeader http.Header) (api.StorageMiner, jsonrpc.ClientCloser, error) {
var res apistruct.StorageMinerStruct
closer, err := jsonrpc.NewMergeClient(addr, "Filecoin",

View File

@ -89,7 +89,7 @@ func TestDealMining(t *testing.T, b APIBuilder, blocktime time.Duration, carExpo
ctx := context.Background()
n, sn := b(t, 1, []StorageMiner{
{Full: 0, Preseal: PresealGenesis},
{Full: 0, Preseal: 0}, // TODO: Add support for storage miners on non-first full node
{Full: 0, Preseal: 0}, // TODO: Add support for miners on non-first full node
})
client := n[0].FullNode.(*impl.FullNodeAPI)
provider := sn[1]

View File

@ -312,7 +312,7 @@ func MakeGenesisBlock(ctx context.Context, bs bstore.Blockstore, sys runtime.Sys
stateroot, err = SetupStorageMiners(ctx, cs, stateroot, template.Miners)
if err != nil {
return nil, xerrors.Errorf("setup storage miners failed: %w", err)
return nil, xerrors.Errorf("setup miners failed: %w", err)
}
cst := cbor.NewCborStore(bs)

View File

@ -2,6 +2,7 @@ package cli
import (
"fmt"
"os"
"github.com/urfave/cli/v2"
"golang.org/x/xerrors"
@ -126,6 +127,9 @@ var authApiInfoToken = &cli.Command{
}
envVar := envForRepo(t)
if _, ok := os.LookupEnv(envForRepo(t)); !ok {
envVar = envForRepoDeprecation(t)
}
// TODO: Log in audit log when it is implemented

View File

@ -72,13 +72,25 @@ func flagForRepo(t repo.RepoType) string {
case repo.FullNode:
return "repo"
case repo.StorageMiner:
return "storagerepo"
return "miner-repo"
default:
panic(fmt.Sprintf("Unknown repo type: %v", t))
}
}
func envForRepo(t repo.RepoType) string {
switch t {
case repo.FullNode:
return "FULLNODE_API_INFO"
case repo.StorageMiner:
return "MINER_API_INFO"
default:
panic(fmt.Sprintf("Unknown repo type: %v", t))
}
}
// TODO remove after deprecation period
func envForRepoDeprecation(t repo.RepoType) string {
switch t {
case repo.FullNode:
return "FULLNODE_API_INFO"
@ -90,14 +102,24 @@ func envForRepo(t repo.RepoType) string {
}
func GetAPIInfo(ctx *cli.Context, t repo.RepoType) (APIInfo, error) {
if env, ok := os.LookupEnv(envForRepo(t)); ok {
envKey := envForRepo(t)
env, ok := os.LookupEnv(envKey)
if !ok {
// TODO remove after deprecation period
envKey = envForRepoDeprecation(t)
env, ok = os.LookupEnv(envKey)
if ok {
log.Warnf("Use deprecation env(%s) value, please use env(%s) instead.", envKey, envForRepo(t))
}
}
if ok {
sp := strings.SplitN(env, ":", 2)
if len(sp) != 2 {
log.Warnf("invalid env(%s) value, missing token or address", envForRepo(t))
log.Warnf("invalid env(%s) value, missing token or address", envKey)
} else {
ma, err := multiaddr.NewMultiaddr(sp[1])
if err != nil {
return APIInfo{}, xerrors.Errorf("could not parse multiaddr from env(%s): %w", envForRepo(t), err)
return APIInfo{}, xerrors.Errorf("could not parse multiaddr from env(%s): %w", envKey, err)
}
return APIInfo{
Addr: ma,

View File

@ -424,7 +424,7 @@ func (h *handler) msgwait(w http.ResponseWriter, r *http.Request) {
if mw.Receipt.ExitCode != 0 {
w.WriteHeader(400)
w.Write([]byte(xerrors.Errorf("create storage miner failed: exit code %d", mw.Receipt.ExitCode).Error()))
w.Write([]byte(xerrors.Errorf("create miner failed: exit code %d", mw.Receipt.ExitCode).Error()))
return
}
w.WriteHeader(200)
@ -447,7 +447,7 @@ func (h *handler) msgwaitaddr(w http.ResponseWriter, r *http.Request) {
if mw.Receipt.ExitCode != 0 {
w.WriteHeader(400)
w.Write([]byte(xerrors.Errorf("create storage miner failed: exit code %d", mw.Receipt.ExitCode).Error()))
w.Write([]byte(xerrors.Errorf("create miner failed: exit code %d", mw.Receipt.ExitCode).Error()))
return
}
w.WriteHeader(200)

View File

@ -1,14 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Creating Storage Miner - Lotus Fountain</title>
<title>Creating Miner - Lotus Fountain</title>
<link rel="stylesheet" type="text/css" href="main.css">
</head>
<body>
<div class="Index">
<div class="Index-nodes">
<div class="Index-node">
[CREATING STORAGE MINER]
[CREATING MINER]
</div>
<div class="Index-node" id="formnd">
<form id="f" action='/mkminer' method='POST'>
@ -26,7 +26,7 @@
<b>Waiting for transaction on chain..</b>
</div>
<div class="Index-node">
<span>When creating storage miner, DO NOT REFRESH THE PAGE, wait for it to load. This can take more than 5min.</span>
<span>When creating miner, DO NOT REFRESH THE PAGE, wait for it to load. This can take more than 5min.</span>
</div>
<div class="Index-node">
<span>If you don't have an owner/worker address, you can create it by following <a target="_blank" href="https://docs.lotu.sh/en+mining#get-started-22083">these instructions</a>.</span>

View File

@ -1,14 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Creating Storage Miner (wait) - Lotus Fountain</title>
<title>Creating Miner (wait) - Lotus Fountain</title>
<link rel="stylesheet" type="text/css" href="main.css">
</head>
<body>
<div class="Index">
<div class="Index-nodes">
<div class="Index-node">
[CREATING STORAGE MINER]
[CREATING MINER]
</div>
<div class="Index-node">
Gas Funds:&nbsp;&nbsp;&nbsp;<span id="fcid"></span> - <span id="fstate">WAIT</span>
@ -17,12 +17,12 @@
Miner Actor:&nbsp;<span id="mcid"></span> - <span id="mstate">WAIT</span>
</div>
<div class="Index-node" style="display: none" id="fwait">
New storage miners address is: <b id="actaddr">t</b>
New miners address is: <b id="actaddr">t</b>
</div>
<div class="Index-node" style="display: none" id="mwait">
<div style="padding-bottom: 1em">To initialize the storage miner run the following command:</div>
<div style="padding-bottom: 1em">To initialize the miner run the following command:</div>
<div style="overflow-x: visible; white-space: nowrap; background: #353500">
<code>lotus-storage-miner init --actor=<span id="actaddr2">t</span> --owner=<span id="owner">t3</span></code>
<code>lotus-miner init --actor=<span id="actaddr2">t</span> --owner=<span id="owner">t3</span></code>
</div>
</div>
</div>

View File

@ -36,7 +36,9 @@ import (
var log = logging.Logger("main")
const FlagStorageRepo = "workerrepo"
const FlagWorkerRepo = "worker-repo"
// TODO remove after deprecation period
const FlagWorkerRepoDeprecation = "workerrepo"
func main() {
lotuslog.SetupLogLevels()
@ -48,19 +50,23 @@ func main() {
}
app := &cli.App{
Name: "lotus-seal-worker",
Usage: "Remote storage miner worker",
Name: "lotus-worker",
Usage: "Remote miner worker",
Version: build.UserVersion(),
Flags: []cli.Flag{
&cli.StringFlag{
Name: FlagStorageRepo,
EnvVars: []string{"WORKER_PATH"},
Name: FlagWorkerRepo,
Aliases: []string{FlagWorkerRepoDeprecation},
EnvVars: []string{"LOTUS_WORKER_PATH", "WORKER_PATH"},
Value: "~/.lotusworker", // TODO: Consider XDG_DATA_HOME
Usage: fmt.Sprintf("Specify worker repo path. flag %s and env WORKER_PATH are DEPRECATION, will REMOVE SOON", FlagWorkerRepoDeprecation),
},
&cli.StringFlag{
Name: "storagerepo",
EnvVars: []string{"LOTUS_STORAGE_PATH"},
Value: "~/.lotusstorage", // TODO: Consider XDG_DATA_HOME
Name: "miner-repo",
Aliases: []string{"storagerepo"},
EnvVars: []string{"LOTUS_MINER_PATH", "LOTUS_STORAGE_PATH"},
Value: "~/.lotusminer", // TODO: Consider XDG_DATA_HOME
Usage: fmt.Sprintf("Specify miner repo path. flag storagerepo and env LOTUS_STORAGE_PATH are DEPRECATION, will REMOVE SOON"),
},
&cli.BoolFlag{
Name: "enable-gpu-proving",
@ -143,7 +149,7 @@ var runCmd = &cli.Command{
return err
}
if v.APIVersion != build.APIVersion {
return xerrors.Errorf("lotus-storage-miner API version doesn't match: local: ", api.Version{APIVersion: build.APIVersion})
return xerrors.Errorf("lotus-miner API version doesn't match: local: ", api.Version{APIVersion: build.APIVersion})
}
log.Infof("Remote version %s", v)
@ -186,7 +192,7 @@ var runCmd = &cli.Command{
// Open repo
repoPath := cctx.String(FlagStorageRepo)
repoPath := cctx.String(FlagWorkerRepo)
r, err := repo.NewFS(repoPath)
if err != nil {
return err

View File

@ -23,7 +23,7 @@ import (
var infoCmd = &cli.Command{
Name: "info",
Usage: "Print storage miner info",
Usage: "Print miner info",
Flags: []cli.Flag{
&cli.BoolFlag{Name: "color"},
},

View File

@ -50,7 +50,7 @@ import (
var initCmd = &cli.Command{
Name: "init",
Usage: "Initialize a lotus storage miner repo",
Usage: "Initialize a lotus miner repo",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "actor",
@ -107,7 +107,7 @@ var initCmd = &cli.Command{
},
},
Action: func(cctx *cli.Context) error {
log.Info("Initializing lotus storage miner")
log.Info("Initializing lotus miner")
sectorSizeInt, err := units.RAMInBytes(cctx.String("sector-size"))
if err != nil {
@ -151,7 +151,7 @@ var initCmd = &cli.Command{
log.Info("Checking if repo exists")
repoPath := cctx.String(FlagStorageRepo)
repoPath := cctx.String(FlagMinerRepo)
r, err := repo.NewFS(repoPath)
if err != nil {
return err
@ -162,7 +162,7 @@ var initCmd = &cli.Command{
return err
}
if ok {
return xerrors.Errorf("repo at '%s' is already initialized", cctx.String(FlagStorageRepo))
return xerrors.Errorf("repo at '%s' is already initialized", cctx.String(FlagMinerRepo))
}
log.Info("Checking full node version")
@ -236,7 +236,7 @@ var initCmd = &cli.Command{
}
if err := storageMinerInit(ctx, cctx, api, r, ssize, gasPrice); err != nil {
log.Errorf("Failed to initialize lotus-storage-miner: %+v", err)
log.Errorf("Failed to initialize lotus-miner: %+v", err)
path, err := homedir.Expand(repoPath)
if err != nil {
return err
@ -249,7 +249,7 @@ var initCmd = &cli.Command{
}
// TODO: Point to setting storage price, maybe do it interactively or something
log.Info("Storage miner successfully created, you can now start it with 'lotus-storage-miner run'")
log.Info("Miner successfully created, you can now start it with 'lotus-miner run'")
return nil
},
@ -454,11 +454,11 @@ func storageMinerInit(ctx context.Context, cctx *cli.Context, api lapi.FullNode,
cerr := configureStorageMiner(ctx, api, a, peerid, gasPrice)
if err := m.Stop(ctx); err != nil {
log.Error("failed to shut down storage miner: ", err)
log.Error("failed to shut down miner: ", err)
}
if cerr != nil {
return xerrors.Errorf("failed to configure storage miner: %w", cerr)
return xerrors.Errorf("failed to configure miner: %w", cerr)
}
}
@ -492,7 +492,7 @@ func storageMinerInit(ctx context.Context, cctx *cli.Context, api lapi.FullNode,
}
if err := configureStorageMiner(ctx, api, a, peerid, gasPrice); err != nil {
return xerrors.Errorf("failed to configure storage miner: %w", err)
return xerrors.Errorf("failed to configure miner: %w", err)
}
addr = a
@ -505,7 +505,7 @@ func storageMinerInit(ctx context.Context, cctx *cli.Context, api lapi.FullNode,
addr = a
}
log.Infof("Created new storage miner: %s", addr)
log.Infof("Created new miner: %s", addr)
if err := mds.Put(datastore.NewKey("miner-address"), addr.Bytes()); err != nil {
return err
}
@ -654,7 +654,7 @@ func createStorageMiner(ctx context.Context, api lapi.FullNode, peerid peer.ID,
}
if mw.Receipt.ExitCode != 0 {
return address.Undef, xerrors.Errorf("create storage miner failed: exit code %d", mw.Receipt.ExitCode)
return address.Undef, xerrors.Errorf("create miner failed: exit code %d", mw.Receipt.ExitCode)
}
var retval power.CreateMinerReturn
@ -662,6 +662,6 @@ func createStorageMiner(ctx context.Context, api lapi.FullNode, peerid peer.ID,
return address.Undef, err
}
log.Infof("New storage miners address is: %s (%s)", retval.IDAddress, retval.RobustAddress)
log.Infof("New miners address is: %s (%s)", retval.IDAddress, retval.RobustAddress)
return retval.IDAddress, nil
}

View File

@ -2,6 +2,7 @@ package main
import (
"context"
"fmt"
"os"
logging "github.com/ipfs/go-log/v2"
@ -20,7 +21,9 @@ import (
var log = logging.Logger("main")
const FlagStorageRepo = "storagerepo"
const FlagMinerRepo = "miner-repo"
// TODO remove after deprecation period
const FlagMinerRepoDeprecation = "storagerepo"
func main() {
lotuslog.SetupLogLevels()
@ -61,8 +64,8 @@ func main() {
}
app := &cli.App{
Name: "lotus-storage-miner",
Usage: "Filecoin decentralized storage network storage miner",
Name: "lotus-miner",
Usage: "Filecoin decentralized storage network miner",
Version: build.UserVersion(),
EnableBashCompletion: true,
Flags: []cli.Flag{
@ -79,9 +82,11 @@ func main() {
Value: "~/.lotus", // TODO: Consider XDG_DATA_HOME
},
&cli.StringFlag{
Name: FlagStorageRepo,
EnvVars: []string{"LOTUS_STORAGE_PATH"},
Value: "~/.lotusstorage", // TODO: Consider XDG_DATA_HOME
Name: FlagMinerRepo,
Aliases: []string{FlagMinerRepoDeprecation},
EnvVars: []string{"LOTUS_MINER_PATH", "LOTUS_STORAGE_PATH"},
Value: "~/.lotusminer", // TODO: Consider XDG_DATA_HOME
Usage: fmt.Sprintf("Specify miner repo path. flag(%s) and env(LOTUS_STORAGE_PATH) are DEPRECATION, will REMOVE SOON", FlagMinerRepoDeprecation),
},
},

View File

@ -357,7 +357,7 @@ var dealsListCmd = &cli.Command{
var getBlocklistCmd = &cli.Command{
Name: "get-blocklist",
Usage: "List the contents of the storage miner's piece CID blocklist",
Usage: "List the contents of the miner's piece CID blocklist",
Flags: []cli.Flag{
&CidBaseFlag,
},
@ -388,7 +388,7 @@ var getBlocklistCmd = &cli.Command{
var setBlocklistCmd = &cli.Command{
Name: "set-blocklist",
Usage: "Set the storage miner's list of blocklisted piece CIDs",
Usage: "Set the miner's list of blocklisted piece CIDs",
ArgsUsage: "[<path-of-file-containing-newline-delimited-piece-CIDs> (optional, will read from stdin if omitted)]",
Flags: []cli.Flag{},
Action: func(cctx *cli.Context) error {
@ -435,7 +435,7 @@ var setBlocklistCmd = &cli.Command{
var resetBlocklistCmd = &cli.Command{
Name: "reset-blocklist",
Usage: "Remove all entries from the storage miner's piece CID blocklist",
Usage: "Remove all entries from the miner's piece CID blocklist",
Flags: []cli.Flag{},
Action: func(cctx *cli.Context) error {
api, closer, err := lcli.GetStorageMinerAPI(cctx)

View File

@ -30,7 +30,7 @@ import (
var runCmd = &cli.Command{
Name: "run",
Usage: "Start a lotus storage miner process",
Usage: "Start a lotus miner process",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "api",
@ -86,8 +86,8 @@ var runCmd = &cli.Command{
}
}
storageRepoPath := cctx.String(FlagStorageRepo)
r, err := repo.NewFS(storageRepoPath)
minerRepoPath := cctx.String(FlagMinerRepo)
r, err := repo.NewFS(minerRepoPath)
if err != nil {
return err
}
@ -97,7 +97,7 @@ var runCmd = &cli.Command{
return err
}
if !ok {
return xerrors.Errorf("repo at '%s' is not initialized, run 'lotus-storage-miner init' to set it up", storageRepoPath)
return xerrors.Errorf("repo at '%s' is not initialized, run 'lotus-miner init' to set it up", minerRepoPath)
}
shutdownChan := make(chan struct{})

View File

@ -10,7 +10,7 @@ import (
var stopCmd = &cli.Command{
Name: "stop",
Usage: "Stop a running lotus storage miner",
Usage: "Stop a running lotus miner",
Flags: []cli.Flag{},
Action: func(cctx *cli.Context) error {
api, closer, err := lcli.GetAPI(cctx)

View File

@ -278,7 +278,7 @@ var storageFindCmd = &cli.Command{
}
if !cctx.Args().Present() {
return xerrors.New("Usage: lotus-storage-miner storage find [sector number]")
return xerrors.New("Usage: lotus-miner storage find [sector number]")
}
snum, err := strconv.ParseUint(cctx.Args().First(), 10, 64)

View File

@ -69,7 +69,7 @@
},
"filecoin-decentralized-storage-market": {
"title": "Filecoin Decentralized Storage Market",
"value": "Storage Market subsystem is the data entry point into the network. Storage miners only earn power from data stored in a storage deal and all deals live on the Filecoin network."
"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",
@ -96,12 +96,12 @@
"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-storage-miner": {
"title": "Storage Miner (lotus-storage-miner)",
"value": "The Storage 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."
"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 storage miners implementation. The port value is part of the Host interface."
"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",
@ -129,7 +129,7 @@
},
"total-network-power": {
"title": "Total Network Power",
"value": "A reference to all the Power Tables for every subchain, accounting for each Lotus Storage Miner on chain."
"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",

View File

@ -83,9 +83,9 @@
"value": null,
"posts": [
{
"title": "Lotus Seal Worker",
"slug": "en+lotus-seal-worker",
"github": "en/mining-lotus-seal-worker.md",
"title": "Lotus Worker",
"slug": "en+lotus-worker",
"github": "en/mining-lotus-worker.md",
"value": null
},
{

View File

@ -1,6 +1,6 @@
# Remote API Support
You may want to delegate the work **Lotus Storage Miner** or **Lotus Node** performs to other machines.
You may want to delegate the work **Lotus Miner** or **Lotus Node** performs to other machines.
Here is how to setup the necessary authorization and environment variables.
## Environment variables
@ -13,13 +13,13 @@ Using the [JWT you generated](https://lotu.sh/en+api#how-do-i-generate-a-token-1
# Lotus Node
FULLNODE_API_INFO="JWT_TOKEN:/ip4/127.0.0.1/tcp/1234/http"
# Lotus Storage Miner
STORAGE_API_INFO="JWT_TOKEN:/ip4/127.0.0.1/tcp/2345/http"
# Lotus Miner
MINER_API_INFO="JWT_TOKEN:/ip4/127.0.0.1/tcp/2345/http"
```
You can also use `lotus auth api-info --perm admin` to quickly create _API_INFO env vars
- The **Lotus Node**'s `mutliaddr` is in `~/.lotus/api`.
- The default token is in `~/.lotus/token`.
- The **Lotus Storage Miner**'s `multiaddr` is in `~/.lotusstorage/config`.
- The default token is in `~/.lotusstorage/token`.
- The **Lotus Miner**'s `multiaddr` is in `~/.lotusminer/config`.
- The default token is in `~/.lotusminer/token`.

View File

@ -18,9 +18,9 @@ Options:
For now, you can look into different files to find methods available to you based on your needs:
- [Both Lotus node + storage miner APIs](https://github.com/filecoin-project/lotus/blob/master/api/api_common.go)
- [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)
- [Storage miner API](https://github.com/filecoin-project/lotus/blob/master/api/api_storage.go)
- [Lotus miner API](https://github.com/filecoin-project/lotus/blob/master/api/api_storage.go)
The necessary permissions for each are in [api/struct.go](https://github.com/filecoin-project/lotus/blob/master/api/struct.go).
@ -46,7 +46,7 @@ If the request requires authorization, add an authorization header:
```sh
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $(cat ~/.lotusstorage/token)" \
-H "Authorization: Bearer $(cat ~/.lotusminer/token)" \
--data '{ "jsonrpc": "2.0", "method": "Filecoin.ChainHead", "params": [], "id": 3 }' \
'http://127.0.0.1:1234/rpc/v0'
```
@ -58,10 +58,10 @@ curl -X POST \
To authorize your request, you will need to include the **JWT** in a HTTP header, for example:
```sh
-H "Authorization: Bearer $(cat ~/.lotusstorage/token)"
-H "Authorization: Bearer $(cat ~/.lotusminer/token)"
```
Admin token is stored in `~/.lotus/token` for the **Lotus Node** or `~/.lotusstorage/token` for the **Lotus Storage Miner**.
Admin token is stored in `~/.lotus/token` for the **Lotus Node** or `~/.lotusminer/token` for the **Lotus Miner**.
## How do I generate a token?
@ -71,8 +71,8 @@ To generate a JWT with custom permissions, use this command:
# Lotus Node
lotus auth create-token --perm admin
# Lotus Storage Miner
lotus-storage-miner auth create-token --perm admin
# Lotus Miner
lotus-miner auth create-token --perm admin
```
## What authorization level should I use?

View File

@ -344,7 +344,7 @@ At the end of the `Repo()` function we see two mutually exclusive configuration
ApplyIf(isType(repo.FullNode), ConfigFullNode(c)),
ApplyIf(isType(repo.StorageMiner), ConfigStorageMiner(c)),
```
As we said, the repo fully identifies the node so a repo type is also a *node* type, in this case a full node or a storage miner. (FIXME: What is the difference between the two, does *full* imply miner?) In this case the `daemon` command will create a `FullNode`, this is specified in the command logic itself in `main.DaemonCmd()`, the `FsRepo` created (and passed to `node.Repo()`) will be initiated with that type (see `(*FsRepo).Init(t RepoType)`).
As we said, the repo fully identifies the node so a repo type is also a *node* type, in this case a full node or a miner. (FIXME: What is the difference between the two, does *full* imply miner?) In this case the `daemon` command will create a `FullNode`, this is specified in the command logic itself in `main.DaemonCmd()`, the `FsRepo` created (and passed to `node.Repo()`) will be initiated with that type (see `(*FsRepo).Init(t RepoType)`).
## Online

View File

@ -19,7 +19,7 @@ Now go to `http://127.0.0.1:2222`.
## What can I test?
- The `Spawn Node` button starts a new **Lotus Node** in a new draggable window.
- Click `[Spawn Storage Miner]` to start a **Lotus Storage Miner**. This require's the node's wallet to have funds.
- Click `[Spawn Miner]` to start a **Lotus Miner**. This require's the node's wallet to have funds.
- Click on `[Client]` to open the **Lotus Node**'s client interface and propose a deal with an existing Miner. If successful you'll see a payment channel open up with that Miner.
Don't leave Pond unattended for more than 10 hours, the web client will eventually consume all available RAM.
@ -27,6 +27,6 @@ Don't leave Pond unattended for more than 10 hours, the web client will eventual
## Troubleshooting
- Turn it off and on - Start at the top
- `rm -rf ~/.lotus ~/.lotusstorage/`, this command will delete chain sync data, stored wallets, and other configurations so be careful.
- `rm -rf ~/.lotus ~/.lotusminer/`, this command will delete chain sync data, stored wallets, and other configurations so be careful.
- Verify you have the correct versions of dependencies
- If stuck on a bad fork, try `lotus chain sethead --genesis`

View File

@ -32,7 +32,7 @@ Gossip sub spec and some introduction.
# Look at the constructor of a miner
Follow the `lotus-storage-miner` command to see how a miner is created, from the command to the message to the storage power logic.
Follow the `lotus-miner` command to see how a miner is created, from the command to the message to the storage power logic.
# Directory structure so far, main structures seen, their relation

View File

@ -22,9 +22,9 @@ along the way. It can also facilitate the creation of new storage deals. If you
interested in providing your own storage to the network, and do not want to produce blocks
yourself, then the Lotus Node is all you need!
The Lotus Storage Miner does everything you need for the registration of storage, and the
production of new blocks. The Lotus Storage Miner communicates with the network
by talking to a Lotus Node over the JSON-RPC API.
The Lotus Miner does everything you need for the registration of storage, and the
production of new blocks. The Lotus Miner communicates with the network by talking
to a Lotus Node over the JSON-RPC API.
## Setting up a Lotus Node
@ -49,7 +49,7 @@ To update Lotus, follow the instructions [here](https://lotu.sh/en+updating-lotu
### How do I prepare a fresh installation of Lotus?
Stop the Lotus daemon, and delete all related files, including sealed and chain data by
running `rm ~/.lotus ~/.lotusstorage`.
running `rm ~/.lotus ~/.lotusminer`.
Then, install Lotus afresh by following the instructions
found [here](https://docs.lotu.sh/en+getting-started).
@ -126,7 +126,7 @@ Community-contributed Docker and Docker Compose examples are available
### How can I run two miners on the same machine?
You can do so by changing the storage path variable for the second miner, e.g.,
`LOTUS_STORAGE_PATH=~/.lotusstorage2`. You will also need to make sure that no ports collide.
`LOTUS_MINER_PATH=~/.lotusminer2`. You will also need to make sure that no ports collide.
### How do I setup my own local devnet?

View File

@ -9,15 +9,15 @@ For more details about Filecoin, check out the [Filecoin Docs](https://docs.file
- How to install Lotus on [Arch Linux](https://docs.lotu.sh/en+install-lotus-arch), [Ubuntu](https://docs.lotu.sh/en+install-lotus-ubuntu), or [MacOS](https://docs.lotu.sh/en+install-lotus-macos).
- Joining the [Lotus Testnet](https://docs.lotu.sh/en+join-testnet).
- [Storing](https://docs.lotu.sh/en+storing-data) or [retrieving](https://docs.lotu.sh/en+retrieving-data) data.
- Mining Filecoin using the **Lotus Storage Miner** in your [CLI](https://docs.lotu.sh/en+mining).
- Mining Filecoin using the **Lotus Miner** in your [CLI](https://docs.lotu.sh/en+mining).
## How is Lotus designed?
Lotus is architected modularly to keep clean API boundaries while using the same process. Installing Lotus will include two separate programs:
- The **Lotus Node**
- The **Lotus Storage Miner**
- The **Lotus Miner**
The **Lotus Storage Miner** is intended to be run on the machine that manages a single storage miner instance, and is meant to communicate with the **Lotus Node** via the websocket **JSON-RPC** API for all of the chain interaction needs.
The **Lotus Miner** is intended to be run on the machine that manages a single miner instance, and is meant to communicate with the **Lotus Node** via the websocket **JSON-RPC** API for all of the chain interaction needs.
This way, a mining operation may easily run a **Lotus Storage Miner** or many of them, connected to one or many **Lotus Node** instances.
This way, a mining operation may easily run a **Lotus Miner** or many of them, connected to one or many **Lotus Node** instances.

View File

@ -1,6 +1,6 @@
# Protocol Labs Standard Testing Configuration
> This documentation page describes the standard testing configuration the Protocol Labs team has used to test **Lotus Storage Miner**s on Lotus. There is no guarantee this testing configuration will be suitable for Filecoin storage mining at MainNet launch. If you need to buy new hardware to join the Filecoin Testnet, we recommend to buy no more hardware than you require for testing. To learn more please read this [Protocol Labs Standard Testing Configuration post](https://filecoin.io/blog/filecoin-testnet-mining/).
> This documentation page describes the standard testing configuration the Protocol Labs team has used to test **Lotus Miner**s on Lotus. There is no guarantee this testing configuration will be suitable for Filecoin storage mining at MainNet launch. If you need to buy new hardware to join the Filecoin Testnet, we recommend to buy no more hardware than you require for testing. To learn more please read this [Protocol Labs Standard Testing Configuration post](https://filecoin.io/blog/filecoin-testnet-mining/).
**Sector sizes** and **minimum pledged storage** required to mine blocks are two very important Filecoin Testnet parameters that impact hardware decisions. We will continue to refine all parameters during Testnet.

View File

@ -34,13 +34,13 @@ Then, in another console, import the genesis miner key:
Set up the genesis miner:
```sh
./lotus-storage-miner init --genesis-miner --actor=t01000 --sector-size=2KiB --pre-sealed-sectors=~/.genesis-sectors --pre-sealed-metadata=~/.genesis-sectors/pre-seal-t01000.json --nosync
./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-storage-miner run --nosync
./lotus-miner run --nosync
```
If all went well, you will have your own local Lotus Devnet running.

View File

@ -6,7 +6,7 @@ to install a Lotus node and sync to the top of the chain.
## Set up an ask
```
lotus-storage-miner set-price <price>
lotus-miner set-price <price>
```
This command will set up your miner to accept deal proposals that meet the input price.

View File

@ -1,10 +1,10 @@
# Lotus Seal Worker
# Lotus Worker
The **Lotus Seal Worker** is an extra process that can offload heavy processing tasks from your **Lotus Storage Miner**. The sealing process automatically runs in the **Lotus Storage Miner** process, but you can use the Seal Worker on another machine communicating over a fast network to free up resources on the machine running the mining process.
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.
## Note: Using the Lotus Seal Worker from China
## Note: Using the Lotus Worker from China
If you are trying to use `lotus-seal-worker` from China. You should set this **environment variable** on your machine:
If you are trying to use `lotus-worker` from China. You should set this **environment variable** on your machine:
```sh
IPFS_GATEWAY="https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/"
@ -12,17 +12,17 @@ IPFS_GATEWAY="https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/"
## Get Started
Make sure that the `lotus-seal-worker` is compiled and installed by running:
Make sure that the `lotus-worker` is compiled and installed by running:
```sh
make lotus-seal-worker
make lotus-worker
```
## Setting up the Storage Miner
## Setting up the Miner
First, you will need to ensure your `lotus-storage-miner`'s API is accessible over the network.
First, you will need to ensure your `lotus-miner`'s API is accessible over the network.
To do this, open up `~/.lotusstorage/config.toml` (Or if you manually set `LOTUS_STORAGE_PATH`, look under that directory) and look for the API field.
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:
@ -40,22 +40,22 @@ A more permissive and less secure option is to change it to `0.0.0.0`. This will
Next, you will need to [create an authentication token](https://docs.lotu.sh/en+api-scripting-support#generate-a-jwt-46). All Lotus APIs require authentication tokens to ensure your processes are as secure against attackers attempting to make unauthenticated requests to them.
### Connect the Lotus Seal Worker
### Connect the Lotus Worker
On the machine that will run `lotus-seal-worker`, set the `STORAGE_API_INFO` environment variable to `TOKEN:STORAGE_NODE_MULTIADDR`. Where `TOKEN` is the token we created above, and `STORAGE_NODE_MULTIADDR` is the `multiaddr` of the **Lotus Storage Miner** API that was set in `config.toml`.
On the machine that will run `lotus-worker`, set the `MINER_API_INFO` environment variable to `TOKEN:MINER_NODE_MULTIADDR`. Where `TOKEN` is the token we created above, and `NIMER_NODE_MULTIADDR` is the `multiaddr` of the **Lotus Miner** API that was set in `config.toml`.
Once this is set, run:
```sh
lotus-seal-worker run --address 192.168.2.10:2345
lotus-worker run --address 192.168.2.10:2345
```
Replace `192.168.2.10:2345` with the proper IP and port.
To check that the **Lotus Seal Worker** is connected to your **Lotus Storage Miner**, run `lotus-storage-miner workers list` and check that the remote worker count has increased.
To check that the **Lotus Worker** is connected to your **Lotus Miner**, run `lotus-miner workers list` and check that the remote worker count has increased.
```sh
why@computer ~/lotus> lotus-storage-miner workers list
why@computer ~/lotus> lotus-miner workers list
Worker 0, host computer
CPU: [ ] 0 core(s) in use
RAM: [|||||||||||||||||| ] 28% 18.1 GiB/62.7 GiB
@ -71,11 +71,11 @@ Worker 1, host othercomputer
### Running locally for manually managing process priority
You can also run the **Lotus Seal Worker** on the same machine as your **Lotus Storage Miner**, so you can manually manage the 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.
You can then run the storage miner on your local-loopback interface;
You can then run the miner on your local-loopback interface;
```sh
lotus-seal-worker run --address 127.0.0.1:2345
lotus-worker run --address 127.0.0.1:2345
```

View File

@ -16,16 +16,16 @@ The **Bellman** lockfile is created to lock a GPU for a process. This bug can oc
mining block failed: computing election proof: github.com/filecoin-project/lotus/miner.(*Miner).mineOne
```
This bug occurs when the storage miner can't acquire the `bellman.lock`. To fix it you need to stop the `lotus-storage-miner` and remove `/tmp/bellman.lock`.
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-storage-miner info
# WARN main lotus-storage-miner/main.go:73 failed to get api endpoint: (/Users/myrmidon/.lotusstorage) %!w(*errors.errorString=&{API not running (no endpoint)}):
lotus-miner info
# WARN main lotus-storage-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 Storage Miner** isn't ready yet. You need to finish [syncing the chain](https://docs.lotu.sh/en+join-testnet).
If you see this, that means your **Lotus Miner** isn't ready yet. You need to finish [syncing the chain](https://docs.lotu.sh/en+join-testnet).
## Error: Your computer may not be fast enough
@ -38,7 +38,7 @@ If you see this, that means your computer is too slow and your blocks are not in
## Error: No space left on device
```sh
lotus-storage-miner sectors pledge
lotus-miner sectors pledge
# No space left on device (os error 28)
```

View File

@ -4,9 +4,9 @@ Here are instructions to learn how to perform storage mining. For hardware speci
It is useful to [join the Testnet](https://docs.lotu.sh/en+join-testnet) prior to attempting storage mining for the first time.
## Note: Using the Lotus Storage Miner from China
## Note: Using the Lotus Miner from China
If you are trying to use `lotus-storage-miner` from China. You should set this **environment variable** on your machine.
If you are trying to use `lotus-miner` from China. You should set this **environment variable** on your machine.
```sh
IPFS_GATEWAY="https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/"
@ -35,21 +35,21 @@ With your wallet address:
The task will be complete when you see:
```sh
New storage miners address is: <YOUR_NEW_MINING_ADDRESS>
New miners address is: <YOUR_NEW_MINING_ADDRESS>
```
## Initialize the storage miner
## Initialize the miner
In a CLI window, use the following command to start your miner:
```sh
lotus-storage-miner init --actor=ACTOR_VALUE_RECEIVED --owner=OWNER_VALUE_RECEIVED
lotus-miner init --actor=ACTOR_VALUE_RECEIVED --owner=OWNER_VALUE_RECEIVED
```
Example
```sh
lotus-storage-miner init --actor=t01424 --owner=t3spmep2xxsl33o4gxk7yjxcobyohzgj3vejzerug25iinbznpzob6a6kexcbeix73th6vjtzfq7boakfdtd6a
lotus-miner init --actor=t01424 --owner=t3spmep2xxsl33o4gxk7yjxcobyohzgj3vejzerug25iinbznpzob6a6kexcbeix73th6vjtzfq7boakfdtd6a
```
You will have to wait some time for this operation to complete.
@ -59,7 +59,7 @@ You will have to wait some time for this operation to complete.
To mine:
```sh
lotus-storage-miner run
lotus-miner run
```
If you are downloading **Filecoin Proof Parameters**, the download can take some time.
@ -67,14 +67,14 @@ If you are downloading **Filecoin Proof Parameters**, the download can take some
Get information about your miner:
```sh
lotus-storage-miner info
lotus-miner info
# example: miner id `t0111`
```
**Seal** random data to start producing **PoSts**:
```sh
lotus-storage-miner sectors pledge
lotus-miner sectors pledge
```
- Warning: On Linux configurations, this command will write data to `$TMPDIR` which is not usually the largest partition. You should point the value to a larger partition if possible.
@ -94,8 +94,8 @@ lotus state sectors <miner>
### `FIL_PROOFS_MAXIMIZE_CACHING=1` Environment variable
This env var can be used with `lotus-storage-miner`, `lotus-seal-worker`, and `lotus-bench` to make the precommit1 step faster at the cost of some memory use (1x sector size)
This env var can be used with `lotus-miner`, `lotus-worker`, and `lotus-bench` to make the precommit1 step faster at the cost of some memory use (1x sector size)
### `FIL_PROOFS_USE_GPU_COLUMN_BUILDER=1` Environment variable
This env var can be used with `lotus-storage-miner`, `lotus-seal-worker`, and `lotus-bench` to enable experimental precommit2 GPU acceleration
This env var can be used with `lotus-miner`, `lotus-worker`, and `lotus-bench` to enable experimental precommit2 GPU acceleration

View File

@ -2,7 +2,7 @@
> There are recent bug reports with these instructions. If you happen to encounter any problems, please create a [GitHub issue](https://github.com/filecoin-project/lotus/issues/new) and a maintainer will address the problem as soon as they can.
Here are the operations you can perform after you have stored and sealed a **Data CID** with the **Lotus Storage Miner** in the network.
Here are the operations you can perform after you have stored and sealed a **Data CID** with the **Lotus Miner** in the network.
If you would like to learn how to store a **Data CID** on a miner, read the instructions [here](https://docs.lotu.sh/en+storing-data).

View File

@ -1,10 +1,10 @@
# Static Ports
Depending on how your network is set up, you may need to set a static port to successfully connect to peers to perform storage deals with your **Lotus Storage Miner**.
Depending on how your network is set up, you may need to set a static port to successfully connect to peers to perform storage deals with your **Lotus Miner**.
## Setup
To change the random **swarm port**, you may edit the `config.toml` file located under `$LOTUS_STORAGE_PATH`. The default location of this file is `$HOME/.lotusstorage`.
To change the random **swarm port**, you may edit the `config.toml` file located under `$LOTUS_MINER_PATH`. The default location of this file is `$HOME/.lotusminer`.
To change the port to `1347`:

View File

@ -5,7 +5,7 @@
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 ~/.lotusstorage
rm -rf ~/.lotus ~/.lotusminer
```
This command usually resolves any issues with running `lotus` but it is not always required for updates. We will share information about when resetting your chain data and miners is required for an update in the future.

View File

@ -21,7 +21,7 @@ WARN main lotus/main.go:72 failed to start deal: computing commP failed: gene
In order to retrieve a file, it must be sealed. Miners can check sealing progress with this command:
```sh
lotus-storage-miner sectors list
lotus-miner sectors list
```
When sealing is complete, `pSet: NO` will become `pSet: YES`. From now on the **Data CID** is [retrievable](https://docs.lotu.sh/en+retrieving-data) from the **Lotus Storage Miner**.
When sealing is complete, `pSet: NO` will become `pSet: YES`. From now on the **Data CID** is [retrievable](https://docs.lotu.sh/en+retrieving-data) from the **Lotus Miner**.

View File

@ -59,4 +59,4 @@ lotus client list-deals
Upon success, this command will return a **Deal CID**.
The storage miner will need to **seal** the file before it can be retrieved. If the **Lotus Storage Miner** is not running on a machine designed for sealing, the process will take a very long time.
The miner will need to **seal** the file before it can be retrieved. If the **Lotus Miner** is not running on a machine designed for sealing, the process will take a very long time.

File diff suppressed because it is too large Load Diff

View File

@ -106,7 +106,7 @@ class FullNode extends React.Component {
)
}
let storageMine = <a href="#" onClick={this.startStorageMiner} hidden={!this.props.spawnStorageNode}>[Spawn Storage Miner]</a>
let storageMine = <a href="#" onClick={this.startStorageMiner} hidden={!this.props.spawnStorageNode}>[Spawn Miner]</a>
let addresses = this.state.addrs.map((addr) => {
let line = <Address client={this.props.client} addN={this.props.giveN} add10k={true} nonce={true} addr={addr} mountWindow={this.props.mountWindow}/>

View File

@ -127,7 +127,7 @@ class StorageNode extends React.Component {
runtime = (
<div>
<div>v{this.state.version.Version}, <abbr title={this.state.id}>{this.state.id.substr(-8)}</abbr>, {this.state.peers} peers</div>
<div>Repo: LOTUS_STORAGE_PATH={this.props.node.Repo}</div>
<div>Repo: LOTUS_MINER_PATH={this.props.node.Repo}</div>
<div>
{pledgeSector} {sealStaged}
</div>
@ -147,7 +147,7 @@ class StorageNode extends React.Component {
}
return <Window
title={"Storage Miner Node " + this.props.node.ID}
title={"Miner Node " + this.props.node.ID}
initialPosition={{x: this.props.node.ID*30, y: this.props.node.ID * 30}}
onClose={this.stop} >
<div className="CristalScroll">

View File

@ -11,7 +11,7 @@ class StorageNodeInit extends React.Component {
render() {
return <Window
title={"Storage miner initializing"}
title={"Miner initializing"}
initialPosition={'center'}>
<div className="CristalScroll">
<div className="StorageNodeInit">

View File

@ -45,9 +45,9 @@ var onCmd = &cli.Command{
"LOTUS_PATH=" + node.Repo,
}
} else {
cmd = exec.Command("./lotus-storage-miner")
cmd = exec.Command("./lotus-miner")
cmd.Env = []string{
"LOTUS_STORAGE_PATH=" + node.Repo,
"LOTUS_MINER_PATH=" + node.Repo,
"LOTUS_PATH=" + node.FullNode,
}
}
@ -83,7 +83,7 @@ var shCmd = &cli.Command{
}
} else {
shcmd.Env = []string{
"LOTUS_STORAGE_PATH=" + node.Repo,
"LOTUS_MINER_PATH=" + node.Repo,
"LOTUS_PATH=" + node.FullNode,
}
}

View File

@ -176,10 +176,10 @@ func (api *api) SpawnStorage(fullNodeRepo string) (nodeInfo, error) {
}
id := atomic.AddInt32(&api.cmds, 1)
cmd := exec.Command("./lotus-storage-miner", initArgs...)
cmd := exec.Command("./lotus-miner", initArgs...)
cmd.Stderr = io.MultiWriter(os.Stderr, errlogfile)
cmd.Stdout = io.MultiWriter(os.Stdout, logfile)
cmd.Env = append(os.Environ(), "LOTUS_STORAGE_PATH="+dir, "LOTUS_PATH="+fullNodeRepo)
cmd.Env = append(os.Environ(), "LOTUS_MINER_PATH="+dir, "LOTUS_PATH="+fullNodeRepo)
if err := cmd.Run(); err != nil {
return nodeInfo{}, err
}
@ -188,10 +188,10 @@ func (api *api) SpawnStorage(fullNodeRepo string) (nodeInfo, error) {
mux := newWsMux()
cmd = exec.Command("./lotus-storage-miner", "run", "--api", fmt.Sprintf("%d", 2500+id), "--nosync")
cmd = exec.Command("./lotus-miner", "run", "--api", fmt.Sprintf("%d", 2500+id), "--nosync")
cmd.Stderr = io.MultiWriter(os.Stderr, errlogfile, mux.errpw)
cmd.Stdout = io.MultiWriter(os.Stdout, logfile, mux.outpw)
cmd.Env = append(os.Environ(), "LOTUS_STORAGE_PATH="+dir, "LOTUS_PATH="+fullNodeRepo)
cmd.Env = append(os.Environ(), "LOTUS_MINER_PATH="+dir, "LOTUS_PATH="+fullNodeRepo)
if err := cmd.Start(); err != nil {
return nodeInfo{}, err
}
@ -248,7 +248,7 @@ func (api *api) RestartNode(id int32) (nodeInfo, error) {
var cmd *exec.Cmd
if nd.meta.Storage {
cmd = exec.Command("./lotus-storage-miner", "run", "--api", fmt.Sprintf("%d", 2500+id), "--nosync")
cmd = exec.Command("./lotus-miner", "run", "--api", fmt.Sprintf("%d", 2500+id), "--nosync")
} else {
cmd = exec.Command("./lotus", "daemon", "--api", fmt.Sprintf("%d", 2500+id))
}

View File

@ -108,7 +108,7 @@ const (
RegisterClientValidatorKey
// storage miner
// miner
GetParamsKey
HandleDealsKey
HandleRetrievalKey
@ -274,7 +274,7 @@ func Online() Option {
Override(new(*market.FundMgr), market.NewFundMgr),
),
// Storage miner
// miner
ApplyIf(func(s *Settings) bool { return s.nodeType == repo.StorageMiner },
Override(new(api.Common), From(new(common.CommonAPI))),
Override(new(sectorstorage.StorageAuth), modules.StorageAuth),

View File

@ -25,7 +25,7 @@ type FullNode struct {
// // Common
// StorageMiner is a storage miner config
// StorageMiner is a miner config
type StorageMiner struct {
Common

View File

@ -27,12 +27,12 @@ type ConsiderOnlineRetrievalDealsConfigFunc func() (bool, error)
type SetConsiderOnlineRetrievalDealsConfigFunc func(bool) error
// StorageDealPieceCidBlocklistConfigFunc is a function which reads from miner
// config to obtain a list of CIDs for which the storage miner will not accept
// config to obtain a list of CIDs for which the miner will not accept
// storage proposals.
type StorageDealPieceCidBlocklistConfigFunc func() ([]cid.Cid, error)
// SetStorageDealPieceCidBlocklistConfigFunc is a function which is used to set a
// list of CIDs for which the storage miner will reject deal proposals.
// list of CIDs for which the miner will reject deal proposals.
type SetStorageDealPieceCidBlocklistConfigFunc func([]cid.Cid) error
// ConsiderOfflineStorageDealsConfigFunc is a function which reads from miner

View File

@ -1,5 +1,5 @@
package dtypes
// ShutdownChan is a channel to which you send a value if you intend to shut
// down the daemon (or storage miner), including the node and RPC server.
// down the daemon (or miner), including the node and RPC server.
type ShutdownChan chan struct{}

View File

@ -585,7 +585,7 @@ func mutateCfg(r repo.LockedRepo, mutator func(*config.StorageMiner)) error {
setConfigErr := r.SetConfig(func(raw interface{}) {
cfg, ok := raw.(*config.StorageMiner)
if !ok {
typeErr = errors.New("expected storage miner config")
typeErr = errors.New("expected miner config")
return
}

View File

@ -7,4 +7,4 @@ _cli_bash_autocomplete() {
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) );
return 0;
};
complete -F _cli_bash_autocomplete lotus-storage-miner
complete -F _cli_bash_autocomplete lotus-miner

View File

@ -20,8 +20,8 @@ pushd bundle
BINARIES=(
"lotus"
"lotus-storage-miner"
"lotus-seal-worker"
"lotus-miner"
"lotus-worker"
)
export IPFS_PATH=`mktemp -d`

View File

@ -10,15 +10,15 @@ log "> Deploying bootstrap node $host"
log "Stopping lotus daemon"
ssh "$host" 'systemctl stop lotus-daemon' &
ssh "$host" 'systemctl stop lotus-storage-miner' &
ssh "$host" 'systemctl stop lotus-miner' &
wait
ssh "$host" 'rm -rf .lotus' &
ssh "$host" 'rm -rf .lotusstorage' &
ssh "$host" 'rm -rf .lotusminer' &
scp -C lotus "${host}":/usr/local/bin/lotus &
scp -C lotus-storage-miner "${host}":/usr/local/bin/lotus-storage-miner &
scp -C lotus-miner "${host}":/usr/local/bin/lotus-miner &
wait

View File

@ -2,7 +2,7 @@
HOST=$1
ssh "$HOST" '[ -e ~/.lotusstorage/token ]' && exit 0
ssh "$HOST" '[ -e ~/.lotusminer/token ]' && exit 0
ssh "$HOST" 'lotus wallet new bls > addr'
ssh "$HOST" 'curl http://147.75.80.29:777/sendcoll?address=$(cat addr)' &
@ -14,5 +14,5 @@ echo "SYNC WAIT"
sleep 30
ssh "$HOST" 'lotus sync wait'
ssh "$HOST" 'lotus-storage-miner init --owner=$(cat addr)'
ssh "$HOST" 'systemctl start lotus-storage-miner' &
ssh "$HOST" 'lotus-miner init --owner=$(cat addr)'
ssh "$HOST" 'systemctl start lotus-miner' &

View File

@ -11,7 +11,7 @@ HOST=$1
FILES_TO_SEND=(
./lotus
./lotus-storage-miner
./lotus-miner
scripts/lotus-daemon.service
scripts/louts-miner.service
)
@ -21,14 +21,14 @@ rsync -P "${FILES_TO_SEND[@]}" "$HOST:~/lotus-stage/"
ssh "$HOST" 'bash -s' << 'EOF'
set -euo pipefail
systemctl stop lotus-storage-miner
systemctl stop lotus-miner
systemctl stop lotus-daemon
mkdir -p .lotus .lotusstorage
mkdir -p .lotus .lotusminer
cd "$HOME/lotus-stage/"
cp -f lotus lotus-storage-miner /usr/local/bin
cp -f lotus lotus-miner /usr/local/bin
cp -f lotus-daemon.service /etc/systemd/system/lotus-daemon.service
cp -f lotus-miner.service /etc/systemd/system/lotus-storage-miner.service
cp -f lotus-miner.service /etc/systemd/system/lotus-miner.service
systemctl daemon-reload
systemctl start lotus-daemon

View File

@ -2,4 +2,4 @@
set -o xtrace
rm -rf ~/.lotus ~/.lotusstorage/ ~/.genesis-sectors ~/.lotusworker
rm -rf ~/.lotus ~/.lotusminer/ ~/.genesis-sectors ~/.lotusworker

View File

@ -7,4 +7,4 @@ export TRUST_PARAMS=1
tag=${TAG:-debug}
go run -tags=$tag ./cmd/lotus wallet import ~/.genesis-sectors/pre-seal-t01000.key
go run -tags=$tag ./cmd/lotus-storage-miner init --actor=t01000 --genesis-miner --pre-sealed-sectors=~/.genesis-sectors --pre-sealed-metadata=~/.genesis-sectors/pre-seal-t01000.json
go run -tags=$tag ./cmd/lotus-miner init --actor=t01000 --genesis-miner --pre-sealed-sectors=~/.genesis-sectors --pre-sealed-metadata=~/.genesis-sectors/pre-seal-t01000.json

View File

@ -42,8 +42,8 @@ SCRIPTDIR="\$( cd "\$( dirname "\${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
pushd \$SCRIPTDIR/../build
pwd
env RUSTFLAGS="-C target-cpu=native -g" FFI_BUILD_FROM_SOURCE=1 make clean deps lotus lotus-storage-miner lotus-shed
cp lotus lotus-storage-miner lotus-shed ../bin/
env RUSTFLAGS="-C target-cpu=native -g" FFI_BUILD_FROM_SOURCE=1 make clean deps lotus lotus-miner lotus-shed
cp lotus lotus-miner lotus-shed ../bin/
popd
EOF
@ -51,13 +51,13 @@ EOF
cat > "${BASEDIR}/scripts/env.fish" <<EOF
set -x PATH ${BASEDIR}/bin \$PATH
set -x LOTUS_PATH ${BASEDIR}/.lotus
set -x LOTUS_STORAGE_PATH ${BASEDIR}/.lotusstorage
set -x LOTUS_MINER_PATH ${BASEDIR}/.lotusminer
EOF
cat > "${BASEDIR}/scripts/env.bash" <<EOF
export PATH=${BASEDIR}/bin:\$PATH
export LOTUS_PATH=${BASEDIR}/.lotus
export LOTUS_STORAGE_PATH=${BASEDIR}/.lotusstorage
export LOTUS_MINER_PATH=${BASEDIR}/.lotusminer
EOF
cat > "${BASEDIR}/scripts/create_miner.bash" <<EOF
@ -65,7 +65,7 @@ cat > "${BASEDIR}/scripts/create_miner.bash" <<EOF
set -x
lotus wallet import ~/.genesis-sectors/pre-seal-t01000.key
lotus-storage-miner init --genesis-miner --actor=t01000 --sector-size=2KiB --pre-sealed-sectors=~/.genesis-sectors --pre-sealed-metadata=~/.genesis-sectors/pre-seal-t01000.json --nosync
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
EOF
cat > "${BASEDIR}/scripts/pledge_sectors.bash" <<EOF
@ -73,26 +73,26 @@ cat > "${BASEDIR}/scripts/pledge_sectors.bash" <<EOF
set -x
while [ ! -d ${BASEDIR}/.lotusstorage ]; do
while [ ! -d ${BASEDIR}/.lotusminer ]; do
sleep 5
done
while [ ! -f ${BASEDIR}/.lotusstorage/api ]; do
while [ ! -f ${BASEDIR}/.lotusminer/api ]; do
sleep 5
done
sleep 30
sector=\$(lotus-storage-miner sectors list | tail -n1 | awk '{print \$1}' | tr -d ':')
sector=\$(lotus-miner sectors list | tail -n1 | awk '{print \$1}' | tr -d ':')
current="\$sector"
while true; do
if (( \$(lotus-storage-miner sectors list | wc -l) > ${PLEDGE_COUNT} )); then
if (( \$(lotus-miner sectors list | wc -l) > ${PLEDGE_COUNT} )); then
break
fi
while true; do
state=\$(lotus-storage-miner sectors list | tail -n1 | awk '{print \$2}')
state=\$(lotus-miner sectors list | tail -n1 | awk '{print \$2}')
if [ -z "\$state" ]; then
break
@ -102,15 +102,15 @@ while true; do
PreCommit1 | PreCommit2 | Packing | Unsealed | PreCommitting | Committing | CommitWait | FinalizeSector ) sleep 30 ;;
WaitSeed | Proving ) break ;;
* ) echo "Unknown Sector State: \$state"
lotus-storage-miner sectors status --log \$current
lotus-miner sectors status --log \$current
break ;;
esac
done
lotus-storage-miner sectors pledge
lotus-miner sectors pledge
while [ "\$current" == "\$sector" ]; do
sector=\$(lotus-storage-miner sectors list | tail -n1 | awk '{print \$1}' | tr -d ':')
sector=\$(lotus-miner sectors list | tail -n1 | awk '{print \$1}' | tr -d ':')
sleep 5
done
@ -127,13 +127,13 @@ while true; do
echo
echo
echo Storage Miner Info
lotus-storage-miner info
echo Miner Info
lotus-miner info
echo
echo
echo Sector List
lotus-storage-miner sectors list | tail -n4
lotus-miner sectors list | tail -n4
sleep 25
@ -151,7 +151,7 @@ if [ "$BUILD" == "yes" ]; then
bash "${BASEDIR}/scripts/build.bash"
else
cp ./lotus ${BASEDIR}/bin/
cp ./lotus-storage-miner ${BASEDIR}/bin/
cp ./lotus-miner ${BASEDIR}/bin/
cp ./lotus-seed ${BASEDIR}/bin/
cp ./lotus-shed ${BASEDIR}/bin/
fi
@ -186,7 +186,7 @@ export LOTUS_PATH="${BASEDIR}/.lotus"
${BASEDIR}/bin/lotus wait-api
tmux send-keys -t $session:$wminer "${BASEDIR}/scripts/create_miner.bash" C-m
tmux send-keys -t $session:$wminer "lotus-storage-miner run --api 48020 --nosync 2>&1 | tee -a ${BASEDIR}/miner.log" C-m
tmux send-keys -t $session:$wminer "lotus-miner run --api 48020 --nosync 2>&1 | tee -a ${BASEDIR}/miner.log" C-m
tmux send-keys -t $session:$wcli "${BASEDIR}/scripts/monitor.bash" C-m
tmux send-keys -t $session:$wpleding "${BASEDIR}/scripts/pledge_sectors.bash" C-m

View File

@ -4,7 +4,7 @@ filebeat.inputs:
- type: log
paths:
- /root/.lotusstorage/logs
- /root/.lotusminer/logs
fields:
logzio_codec: json
token: <API TOKEN>

View File

@ -86,12 +86,12 @@ mdt0111=$(mktemp -d)
mdt0222=$(mktemp -d)
mdt0333=$(mktemp -d)
env LOTUS_PATH="${ldt0111}" LOTUS_STORAGE_PATH="${mdt0111}" ./lotus-storage-miner init --genesis-miner --actor=t0111 --pre-sealed-sectors="${sdt0111}" --pre-sealed-metadata="${sdt0111}/pre-seal-t0111.json" --nosync=true --sector-size="${SECTOR_SIZE}" || true
env LOTUS_PATH="${ldt0111}" LOTUS_STORAGE_PATH="${mdt0111}" ./lotus-storage-miner run --nosync &
env LOTUS_PATH="${ldt0111}" LOTUS_MINER_PATH="${mdt0111}" ./lotus-miner init --genesis-miner --actor=t0111 --pre-sealed-sectors="${sdt0111}" --pre-sealed-metadata="${sdt0111}/pre-seal-t0111.json" --nosync=true --sector-size="${SECTOR_SIZE}" || true
env LOTUS_PATH="${ldt0111}" LOTUS_MINER_PATH="${mdt0111}" ./lotus-miner run --nosync &
mpid=$!
env LOTUS_PATH="${ldt0222}" LOTUS_STORAGE_PATH="${mdt0222}" ./lotus-storage-miner init --actor=t0222 --pre-sealed-sectors="${sdt0222}" --pre-sealed-metadata="${sdt0222}/pre-seal-t0222.json" --nosync=true --sector-size="${SECTOR_SIZE}" || true
env LOTUS_PATH="${ldt0333}" LOTUS_STORAGE_PATH="${mdt0333}" ./lotus-storage-miner init --actor=t0333 --pre-sealed-sectors="${sdt0333}" --pre-sealed-metadata="${sdt0333}/pre-seal-t0333.json" --nosync=true --sector-size="${SECTOR_SIZE}" || true
env LOTUS_PATH="${ldt0222}" LOTUS_MINER_PATH="${mdt0222}" ./lotus-miner init --actor=t0222 --pre-sealed-sectors="${sdt0222}" --pre-sealed-metadata="${sdt0222}/pre-seal-t0222.json" --nosync=true --sector-size="${SECTOR_SIZE}" || true
env LOTUS_PATH="${ldt0333}" LOTUS_MINER_PATH="${mdt0333}" ./lotus-miner init --actor=t0333 --pre-sealed-sectors="${sdt0333}" --pre-sealed-metadata="${sdt0333}/pre-seal-t0333.json" --nosync=true --sector-size="${SECTOR_SIZE}" || true
kill $mpid
wait $mpid

View File

@ -9,7 +9,7 @@ Environment=GOLOG_LOG_FMT="json"
Environment=LOTUS_DB=""
Environment=LOTUS_PATH="%h/.lotus"
EnvironmentFile=-/etc/lotus/chainwatch.env
ExecStart=/usr/local/bin/chainwatch run
ExecStart=/usr/local/bin/lotus-chainwatch run
[Install]
WantedBy=multi-user.target

View File

@ -1,11 +1,11 @@
[Unit]
Description=Lotus Storage Miner
Description=Lotus Miner
After=network.target
After=lotus-daemon.service
Requires=lotus-daemon.service
[Service]
ExecStart=/usr/local/bin/lotus-storage-miner run
ExecStart=/usr/local/bin/lotus-miner run
Environment=GOLOG_FILE="/var/log/lotus/miner.log"
Environment=GOLOG_LOG_FMT="json"

View File

@ -4,20 +4,20 @@ SESSION=$(cat /proc/sys/kernel/random/uuid)
tmux -2 new-session -d -s $SESSION
tmux new-window -t $SESSION:1 -n 'Storage Miner'
tmux new-window -t $SESSION:1 -n 'Miner'
tmux split-window -h
tmux select-pane -t 0
tmux send-keys "watch -n1 './lotus-storage-miner info'" C-m
tmux send-keys "watch -n1 './lotus-miner info'" C-m
tmux split-window -v
tmux select-pane -t 1
tmux send-keys "watch -n1 './lotus-storage-miner workers list'" C-m
tmux send-keys "watch -n1 './lotus-miner workers list'" C-m
tmux select-pane -t 2
tmux send-keys "watch -n1 './lotus-storage-miner storage list'" C-m
tmux send-keys "watch -n1 './lotus-miner storage list'" C-m
tmux -2 attach-session -t $SESSION

View File

@ -25,8 +25,8 @@ SCRIPTDIR="\$( cd "\$( dirname "\${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
pushd \$SCRIPTDIR/../build
pwd
env RUSTFLAGS="-C target-cpu=native -g" FFI_BUILD_FROM_SOURCE=1 make clean deps lotus lotus-storage-miner lotus-shed
cp lotus lotus-storage-miner lotus-shed ../bin/
env RUSTFLAGS="-C target-cpu=native -g" FFI_BUILD_FROM_SOURCE=1 make clean deps lotus lotus-miner lotus-shed
cp lotus lotus-miner lotus-shed ../bin/
popd
EOF
@ -34,13 +34,13 @@ EOF
cat > "${BASEDIR}/scripts/env.fish" <<EOF
set -x PATH ${BASEDIR}/bin \$PATH
set -x LOTUS_PATH ${BASEDIR}/.lotus
set -x LOTUS_STORAGE_PATH ${BASEDIR}/.lotusstorage
set -x LOTUS_MINER_PATH ${BASEDIR}/.lotusminer
EOF
cat > "${BASEDIR}/scripts/env.bash" <<EOF
export PATH=${BASEDIR}/bin:\$PATH
export LOTUS_PATH=${BASEDIR}/.lotus
export LOTUS_STORAGE_PATH=${BASEDIR}/.lotusstorage
export LOTUS_MINER_PATH=${BASEDIR}/.lotusminer
EOF
cat > "${BASEDIR}/scripts/create_miner.bash" <<EOF
@ -60,7 +60,7 @@ lotus state wait-msg "\${param[f]}"
maddr=\$(curl "$faucet/msgwaitaddr?cid=\${param[f]}" | jq -r '.addr')
lotus-storage-miner init --actor=\$maddr --owner=\$owner
lotus-miner init --actor=\$maddr --owner=\$owner
EOF
cat > "${BASEDIR}/scripts/pledge_sectors.bash" <<EOF
@ -68,26 +68,26 @@ cat > "${BASEDIR}/scripts/pledge_sectors.bash" <<EOF
set -x
while [ ! -d ${BASEDIR}/.lotusstorage ]; do
while [ ! -d ${BASEDIR}/.lotusminer ]; do
sleep 5
done
while [ ! -f ${BASEDIR}/.lotusstorage/api ]; do
while [ ! -f ${BASEDIR}/.lotusminer/api ]; do
sleep 5
done
sleep 30
sector=\$(lotus-storage-miner sectors list | tail -n1 | awk '{print \$1}' | tr -d ':')
sector=\$(lotus-miner sectors list | tail -n1 | awk '{print \$1}' | tr -d ':')
current="\$sector"
while true; do
if (( \$(lotus-storage-miner sectors list | wc -l) > ${PLEDGE_COUNT} )); then
if (( \$(lotus-miner sectors list | wc -l) > ${PLEDGE_COUNT} )); then
break
fi
while true; do
state=\$(lotus-storage-miner sectors list | tail -n1 | awk '{print \$2}')
state=\$(lotus-miner sectors list | tail -n1 | awk '{print \$2}')
if [ -z "\$state" ]; then
break
@ -97,15 +97,15 @@ while true; do
PreCommit1 | PreCommit2 | Packing | Unsealed | PreCommitting | Committing | CommitWait | FinalizeSector ) sleep 30 ;;
WaitSeed | Proving ) break ;;
* ) echo "Unknown Sector State: \$state"
lotus-storage-miner sectors status --log \$current
lotus-miner sectors status --log \$current
break ;;
esac
done
lotus-storage-miner sectors pledge
lotus-miner sectors pledge
while [ "\$current" == "\$sector" ]; do
sector=\$(lotus-storage-miner sectors list | tail -n1 | awk '{print \$1}' | tr -d ':')
sector=\$(lotus-miner sectors list | tail -n1 | awk '{print \$1}' | tr -d ':')
sleep 5
done
@ -122,13 +122,13 @@ while true; do
echo
echo
echo Storage Miner Info
lotus-storage-miner info
echo Miner Info
lotus-miner info
echo
echo
echo Sector List
lotus-storage-miner sectors list | tail -n4
lotus-miner sectors list | tail -n4
sleep 25
@ -170,7 +170,7 @@ tmux send-keys -t $session:$wdaemon "lotus daemon --api 48010 daemon 2>&1 | tee
sleep 30
tmux send-keys -t $session:$wminer "${BASEDIR}/scripts/create_miner.bash" C-m
tmux send-keys -t $session:$wminer "lotus-storage-miner run --api 48020 2>&1 | tee -a ${BASEDIR}/miner.log" C-m
tmux send-keys -t $session:$wminer "lotus-miner run --api 48020 2>&1 | tee -a ${BASEDIR}/miner.log" C-m
tmux send-keys -t $session:$wcli "${BASEDIR}/scripts/monitor.bash" C-m
tmux send-keys -t $session:$wpleding "${BASEDIR}/scripts/pledge_sectors.bash" C-m

View File

@ -3,4 +3,4 @@
HOST=$1
scp scripts/lotus-daemon.service "${HOST}:/etc/systemd/system/lotus-daemon.service"
scp scripts/lotus-miner.service "${HOST}:/etc/systemd/system/lotus-storage-miner.service"
scp scripts/lotus-miner.service "${HOST}:/etc/systemd/system/lotus-miner.service"

View File

@ -9,4 +9,4 @@ _cli_bash_autocomplete() {
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) );
return 0;
};
complete -F _cli_bash_autocomplete lotus-storage-miner
complete -F _cli_bash_autocomplete lotus-miner

View File

@ -5,8 +5,8 @@ In this `docker-examples/` directory are community-contributed Docker and Docker
#### Example Use Cases
- **For a miner**
- basic storage miner (`miner-basic-`)
- distributed storage miner
- basic miner (`miner-basic-`)
- distributed miner
- **For API endpoints for building apps**
- local node for a developer (`api-local-`)
- hosted endpoint for apps / multiple developers (`api-hosted-`)

View File

@ -1,4 +1,4 @@
## Description
- **For a miner**
- basic storage miner
- basic miner