Merge pull request #2317 from filcloud/issue-2304
fix issue 2304: ux improvements
This commit is contained in:
commit
0f2043d874
@ -93,10 +93,10 @@ jobs:
|
|||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: lotus
|
path: lotus
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: lotus-storage-miner
|
path: lotus-miner
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: lotus-seal-worker
|
path: lotus-worker
|
||||||
- run: mkdir linux && mv lotus lotus-storage-miner lotus-seal-worker linux/
|
- run: mkdir linux && mv lotus lotus-miner lotus-worker linux/
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
root: "."
|
root: "."
|
||||||
paths:
|
paths:
|
||||||
@ -223,10 +223,10 @@ jobs:
|
|||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: lotus
|
path: lotus
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: lotus-storage-miner
|
path: lotus-miner
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: lotus-seal-worker
|
path: lotus-worker
|
||||||
- run: mkdir darwin && mv lotus lotus-storage-miner lotus-seal-worker darwin/
|
- run: mkdir darwin && mv lotus lotus-miner lotus-worker darwin/
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
root: "."
|
root: "."
|
||||||
paths:
|
paths:
|
||||||
|
8
.github/ISSUE_TEMPLATE/sealingfailed.md
vendored
8
.github/ISSUE_TEMPLATE/sealingfailed.md
vendored
@ -19,15 +19,15 @@ Including what commands you ran, and a description of your setup, is very helpfu
|
|||||||
|
|
||||||
**Sectors list**
|
**Sectors list**
|
||||||
|
|
||||||
The output of `./lotus-storage-miner sectors list`.
|
The output of `./lotus-miner sectors list`.
|
||||||
|
|
||||||
**Sectors status**
|
**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**
|
**Version**
|
||||||
|
|
||||||
|
17
.gitignore
vendored
17
.gitignore
vendored
@ -1,19 +1,21 @@
|
|||||||
/lotus
|
/lotus
|
||||||
/lotus-storage-miner
|
/lotus-miner
|
||||||
/lotus-seal-worker
|
/lotus-worker
|
||||||
/lotus-seed
|
/lotus-seed
|
||||||
/lotus-health
|
/lotus-health
|
||||||
|
/lotus-chainwatch
|
||||||
/lotus-shed
|
/lotus-shed
|
||||||
/pond
|
/lotus-pond
|
||||||
/townhall
|
/lotus-townhall
|
||||||
/fountain
|
/lotus-fountain
|
||||||
/stats
|
/lotus-stats
|
||||||
/bench
|
/lotus-bench
|
||||||
/bench.json
|
/bench.json
|
||||||
/lotuspond/front/node_modules
|
/lotuspond/front/node_modules
|
||||||
/lotuspond/front/build
|
/lotuspond/front/build
|
||||||
/cmd/lotus-townhall/townhall/node_modules
|
/cmd/lotus-townhall/townhall/node_modules
|
||||||
/cmd/lotus-townhall/townhall/build
|
/cmd/lotus-townhall/townhall/build
|
||||||
|
/cmd/lotus-townhall/townhall/package-lock.json
|
||||||
extern/filecoin-ffi/rust/target
|
extern/filecoin-ffi/rust/target
|
||||||
**/*.a
|
**/*.a
|
||||||
**/*.pc
|
**/*.pc
|
||||||
@ -24,7 +26,6 @@ build/paramfetch.sh
|
|||||||
/vendor
|
/vendor
|
||||||
/blocks.dot
|
/blocks.dot
|
||||||
/blocks.svg
|
/blocks.svg
|
||||||
/chainwatch
|
|
||||||
/chainwatch.db
|
/chainwatch.db
|
||||||
/bundle
|
/bundle
|
||||||
/darwin
|
/darwin
|
||||||
|
123
Makefile
123
Makefile
@ -58,10 +58,10 @@ deps: $(BUILD_DEPS)
|
|||||||
.PHONY: deps
|
.PHONY: deps
|
||||||
|
|
||||||
debug: GOFLAGS+=-tags=debug
|
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: GOFLAGS+=-tags=2k
|
||||||
2k: lotus lotus-storage-miner lotus-seal-worker lotus-seed
|
2k: lotus lotus-miner lotus-worker lotus-seed
|
||||||
|
|
||||||
lotus: $(BUILD_DEPS)
|
lotus: $(BUILD_DEPS)
|
||||||
rm -f lotus
|
rm -f lotus
|
||||||
@ -71,19 +71,19 @@ lotus: $(BUILD_DEPS)
|
|||||||
.PHONY: lotus
|
.PHONY: lotus
|
||||||
BINS+=lotus
|
BINS+=lotus
|
||||||
|
|
||||||
lotus-storage-miner: $(BUILD_DEPS)
|
lotus-miner: $(BUILD_DEPS)
|
||||||
rm -f lotus-storage-miner
|
rm -f lotus-miner
|
||||||
go build $(GOFLAGS) -o lotus-storage-miner ./cmd/lotus-storage-miner
|
go build $(GOFLAGS) -o lotus-miner ./cmd/lotus-storage-miner
|
||||||
go run github.com/GeertJohan/go.rice/rice append --exec lotus-storage-miner -i ./build
|
go run github.com/GeertJohan/go.rice/rice append --exec lotus-miner -i ./build
|
||||||
.PHONY: lotus-storage-miner
|
.PHONY: lotus-miner
|
||||||
BINS+=lotus-storage-miner
|
BINS+=lotus-miner
|
||||||
|
|
||||||
lotus-seal-worker: $(BUILD_DEPS)
|
lotus-worker: $(BUILD_DEPS)
|
||||||
rm -f lotus-seal-worker
|
rm -f lotus-worker
|
||||||
go build $(GOFLAGS) -o lotus-seal-worker ./cmd/lotus-seal-worker
|
go build $(GOFLAGS) -o lotus-worker ./cmd/lotus-seal-worker
|
||||||
go run github.com/GeertJohan/go.rice/rice append --exec lotus-seal-worker -i ./build
|
go run github.com/GeertJohan/go.rice/rice append --exec lotus-worker -i ./build
|
||||||
.PHONY: lotus-seal-worker
|
.PHONY: lotus-worker
|
||||||
BINS+=lotus-seal-worker
|
BINS+=lotus-worker
|
||||||
|
|
||||||
lotus-shed: $(BUILD_DEPS)
|
lotus-shed: $(BUILD_DEPS)
|
||||||
rm -f lotus-shed
|
rm -f lotus-shed
|
||||||
@ -92,7 +92,7 @@ lotus-shed: $(BUILD_DEPS)
|
|||||||
.PHONY: lotus-shed
|
.PHONY: lotus-shed
|
||||||
BINS+=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 \
|
@[[ $$(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
|
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:
|
||||||
install -C ./lotus /usr/local/bin/lotus
|
install -C ./lotus /usr/local/bin/lotus
|
||||||
install -C ./lotus-storage-miner /usr/local/bin/lotus-storage-miner
|
install -C ./lotus-miner /usr/local/bin/lotus-miner
|
||||||
install -C ./lotus-seal-worker /usr/local/bin/lotus-seal-worker
|
install -C ./lotus-worker /usr/local/bin/lotus-worker
|
||||||
|
|
||||||
install-services: install
|
install-services: install
|
||||||
mkdir -p /usr/local/lib/systemd/system
|
mkdir -p /usr/local/lib/systemd/system
|
||||||
@ -115,7 +115,7 @@ install-services: install
|
|||||||
clean-services:
|
clean-services:
|
||||||
rm -f /usr/local/lib/systemd/system/lotus-daemon.service
|
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/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
|
systemctl daemon-reload
|
||||||
|
|
||||||
# TOOLS
|
# TOOLS
|
||||||
@ -134,66 +134,65 @@ benchmarks:
|
|||||||
@curl -X POST 'http://benchmark.kittyhawk.wtf/benchmark' -d '@bench.json' -u "${benchmark_http_cred}"
|
@curl -X POST 'http://benchmark.kittyhawk.wtf/benchmark' -d '@bench.json' -u "${benchmark_http_cred}"
|
||||||
.PHONY: benchmarks
|
.PHONY: benchmarks
|
||||||
|
|
||||||
pond: 2k
|
lotus-pond: 2k
|
||||||
go build -o pond ./lotuspond
|
go build -o lotus-pond ./lotuspond
|
||||||
(cd lotuspond/front && npm i && CI=false npm run build)
|
(cd lotuspond/front && npm i && CI=false npm run build)
|
||||||
.PHONY: pond
|
.PHONY: lotus-pond
|
||||||
BINS+=pond
|
BINS+=lotus-pond
|
||||||
|
|
||||||
townhall:
|
lotus-townhall:
|
||||||
rm -f townhall
|
rm -f lotus-townhall
|
||||||
go build -o townhall ./cmd/lotus-townhall
|
go build -o lotus-townhall ./cmd/lotus-townhall
|
||||||
(cd ./cmd/lotus-townhall/townhall && npm i && npm run build)
|
(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
|
go run github.com/GeertJohan/go.rice/rice append --exec lotus-townhall -i ./cmd/lotus-townhall -i ./build
|
||||||
.PHONY: townhall
|
.PHONY: lotus-townhall
|
||||||
BINS+=townhall
|
BINS+=lotus-townhall
|
||||||
|
|
||||||
fountain:
|
lotus-fountain:
|
||||||
rm -f fountain
|
rm -f lotus-fountain
|
||||||
go build -o fountain ./cmd/lotus-fountain
|
go build -o lotus-fountain ./cmd/lotus-fountain
|
||||||
go run github.com/GeertJohan/go.rice/rice append --exec fountain -i ./cmd/lotus-fountain -i ./build
|
go run github.com/GeertJohan/go.rice/rice append --exec lotus-fountain -i ./cmd/lotus-fountain -i ./build
|
||||||
.PHONY: fountain
|
.PHONY: lotus-fountain
|
||||||
BINS+=fountain
|
BINS+=lotus-fountain
|
||||||
|
|
||||||
chainwatch:
|
lotus-chainwatch:
|
||||||
rm -f chainwatch
|
rm -f lotus-chainwatch
|
||||||
go build -o chainwatch ./cmd/lotus-chainwatch
|
go build -o lotus-chainwatch ./cmd/lotus-chainwatch
|
||||||
go run github.com/GeertJohan/go.rice/rice append --exec chainwatch -i ./cmd/lotus-chainwatch -i ./build
|
go run github.com/GeertJohan/go.rice/rice append --exec lotus-chainwatch -i ./cmd/lotus-chainwatch -i ./build
|
||||||
.PHONY: chainwatch
|
.PHONY: lotus-chainwatch
|
||||||
BINS+=chainwatch
|
BINS+=lotus-chainwatch
|
||||||
|
|
||||||
install-chainwatch-service: chainwatch
|
install-chainwatch-service: chainwatch
|
||||||
install -C ./chainwatch /usr/local/bin/chainwatch
|
mkdir -p /etc/lotus
|
||||||
install -C -m 0644 ./scripts/chainwatch.service /usr/local/lib/systemd/system/chainwatch.service
|
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
|
systemctl daemon-reload
|
||||||
@echo
|
@echo
|
||||||
@echo "chainwatch installed. Don't forget to 'systemctl enable chainwatch' for it to be enabled on startup."
|
@echo "chainwatch installed. Don't forget to 'systemctl enable chainwatch' for it to be enabled on startup."
|
||||||
|
|
||||||
bench:
|
lotus-bench:
|
||||||
rm -f bench
|
rm -f lotus-bench
|
||||||
go build -o bench ./cmd/lotus-bench
|
go build -o lotus-bench ./cmd/lotus-bench
|
||||||
go run github.com/GeertJohan/go.rice/rice append --exec bench -i ./build
|
go run github.com/GeertJohan/go.rice/rice append --exec lotus-bench -i ./build
|
||||||
.PHONY: bench
|
.PHONY: lotus-bench
|
||||||
BINS+=bench
|
BINS+=lotus-bench
|
||||||
|
|
||||||
stats:
|
lotus-stats:
|
||||||
rm -f stats
|
rm -f lotus-stats
|
||||||
go build -o stats ./tools/stats
|
go build -o lotus-stats ./cmd/lotus-stats
|
||||||
go run github.com/GeertJohan/go.rice/rice append --exec stats -i ./build
|
go run github.com/GeertJohan/go.rice/rice append --exec lotus-stats -i ./build
|
||||||
.PHONY: stats
|
.PHONY: lotus-stats
|
||||||
BINS+=stats
|
BINS+=lotus-stats
|
||||||
|
|
||||||
health:
|
lotus-health:
|
||||||
rm -f lotus-health
|
rm -f lotus-health
|
||||||
go build -o lotus-health ./cmd/lotus-health
|
go build -o lotus-health ./cmd/lotus-health
|
||||||
go run github.com/GeertJohan/go.rice/rice append --exec lotus-health -i ./build
|
go run github.com/GeertJohan/go.rice/rice append --exec lotus-health -i ./build
|
||||||
|
.PHONY: lotus-health
|
||||||
.PHONY: health
|
BINS+=lotus-health
|
||||||
BINS+=health
|
|
||||||
|
|
||||||
testground:
|
testground:
|
||||||
go build -tags testground -o /dev/null ./cmd/lotus
|
go build -tags testground -o /dev/null ./cmd/lotus
|
||||||
|
|
||||||
.PHONY: testground
|
.PHONY: testground
|
||||||
BINS+=testground
|
BINS+=testground
|
||||||
|
|
||||||
@ -203,15 +202,15 @@ buildall: $(BINS)
|
|||||||
|
|
||||||
completions:
|
completions:
|
||||||
./scripts/make-completions.sh lotus
|
./scripts/make-completions.sh lotus
|
||||||
./scripts/make-completions.sh lotus-storage-miner
|
./scripts/make-completions.sh lotus-miner
|
||||||
.PHONY: completions
|
.PHONY: completions
|
||||||
|
|
||||||
install-completions:
|
install-completions:
|
||||||
mkdir -p /usr/share/bash-completion/completions /usr/local/share/zsh/site-functions/
|
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 /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 /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:
|
clean:
|
||||||
rm -rf $(CLEAN) $(BINS)
|
rm -rf $(CLEAN) $(BINS)
|
||||||
|
@ -34,7 +34,7 @@ func NewFullNodeRPC(addr string, requestHeader http.Header) (api.FullNode, jsonr
|
|||||||
return &res, closer, err
|
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) {
|
func NewStorageMinerRPC(addr string, requestHeader http.Header) (api.StorageMiner, jsonrpc.ClientCloser, error) {
|
||||||
var res apistruct.StorageMinerStruct
|
var res apistruct.StorageMinerStruct
|
||||||
closer, err := jsonrpc.NewMergeClient(addr, "Filecoin",
|
closer, err := jsonrpc.NewMergeClient(addr, "Filecoin",
|
||||||
|
@ -89,7 +89,7 @@ func TestDealMining(t *testing.T, b APIBuilder, blocktime time.Duration, carExpo
|
|||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
n, sn := b(t, 1, []StorageMiner{
|
n, sn := b(t, 1, []StorageMiner{
|
||||||
{Full: 0, Preseal: PresealGenesis},
|
{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)
|
client := n[0].FullNode.(*impl.FullNodeAPI)
|
||||||
provider := sn[1]
|
provider := sn[1]
|
||||||
|
@ -312,7 +312,7 @@ func MakeGenesisBlock(ctx context.Context, bs bstore.Blockstore, sys runtime.Sys
|
|||||||
|
|
||||||
stateroot, err = SetupStorageMiners(ctx, cs, stateroot, template.Miners)
|
stateroot, err = SetupStorageMiners(ctx, cs, stateroot, template.Miners)
|
||||||
if err != nil {
|
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)
|
cst := cbor.NewCborStore(bs)
|
||||||
|
@ -2,6 +2,7 @@ package cli
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
"golang.org/x/xerrors"
|
"golang.org/x/xerrors"
|
||||||
@ -126,6 +127,9 @@ var authApiInfoToken = &cli.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
envVar := envForRepo(t)
|
envVar := envForRepo(t)
|
||||||
|
if _, ok := os.LookupEnv(envForRepo(t)); !ok {
|
||||||
|
envVar = envForRepoDeprecation(t)
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Log in audit log when it is implemented
|
// TODO: Log in audit log when it is implemented
|
||||||
|
|
||||||
|
30
cli/cmd.go
30
cli/cmd.go
@ -72,13 +72,25 @@ func flagForRepo(t repo.RepoType) string {
|
|||||||
case repo.FullNode:
|
case repo.FullNode:
|
||||||
return "repo"
|
return "repo"
|
||||||
case repo.StorageMiner:
|
case repo.StorageMiner:
|
||||||
return "storagerepo"
|
return "miner-repo"
|
||||||
default:
|
default:
|
||||||
panic(fmt.Sprintf("Unknown repo type: %v", t))
|
panic(fmt.Sprintf("Unknown repo type: %v", t))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func envForRepo(t repo.RepoType) string {
|
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 {
|
switch t {
|
||||||
case repo.FullNode:
|
case repo.FullNode:
|
||||||
return "FULLNODE_API_INFO"
|
return "FULLNODE_API_INFO"
|
||||||
@ -90,14 +102,24 @@ func envForRepo(t repo.RepoType) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetAPIInfo(ctx *cli.Context, t repo.RepoType) (APIInfo, error) {
|
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)
|
sp := strings.SplitN(env, ":", 2)
|
||||||
if len(sp) != 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 {
|
} else {
|
||||||
ma, err := multiaddr.NewMultiaddr(sp[1])
|
ma, err := multiaddr.NewMultiaddr(sp[1])
|
||||||
if err != nil {
|
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{
|
return APIInfo{
|
||||||
Addr: ma,
|
Addr: ma,
|
||||||
|
@ -424,7 +424,7 @@ func (h *handler) msgwait(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
if mw.Receipt.ExitCode != 0 {
|
if mw.Receipt.ExitCode != 0 {
|
||||||
w.WriteHeader(400)
|
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
|
return
|
||||||
}
|
}
|
||||||
w.WriteHeader(200)
|
w.WriteHeader(200)
|
||||||
@ -447,7 +447,7 @@ func (h *handler) msgwaitaddr(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
if mw.Receipt.ExitCode != 0 {
|
if mw.Receipt.ExitCode != 0 {
|
||||||
w.WriteHeader(400)
|
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
|
return
|
||||||
}
|
}
|
||||||
w.WriteHeader(200)
|
w.WriteHeader(200)
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Creating Storage Miner - Lotus Fountain</title>
|
<title>Creating Miner - Lotus Fountain</title>
|
||||||
<link rel="stylesheet" type="text/css" href="main.css">
|
<link rel="stylesheet" type="text/css" href="main.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="Index">
|
<div class="Index">
|
||||||
<div class="Index-nodes">
|
<div class="Index-nodes">
|
||||||
<div class="Index-node">
|
<div class="Index-node">
|
||||||
[CREATING STORAGE MINER]
|
[CREATING MINER]
|
||||||
</div>
|
</div>
|
||||||
<div class="Index-node" id="formnd">
|
<div class="Index-node" id="formnd">
|
||||||
<form id="f" action='/mkminer' method='POST'>
|
<form id="f" action='/mkminer' method='POST'>
|
||||||
@ -26,7 +26,7 @@
|
|||||||
<b>Waiting for transaction on chain..</b>
|
<b>Waiting for transaction on chain..</b>
|
||||||
</div>
|
</div>
|
||||||
<div class="Index-node">
|
<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>
|
||||||
<div class="Index-node">
|
<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>
|
<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>
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<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">
|
<link rel="stylesheet" type="text/css" href="main.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="Index">
|
<div class="Index">
|
||||||
<div class="Index-nodes">
|
<div class="Index-nodes">
|
||||||
<div class="Index-node">
|
<div class="Index-node">
|
||||||
[CREATING STORAGE MINER]
|
[CREATING MINER]
|
||||||
</div>
|
</div>
|
||||||
<div class="Index-node">
|
<div class="Index-node">
|
||||||
Gas Funds: <span id="fcid"></span> - <span id="fstate">WAIT</span>
|
Gas Funds: <span id="fcid"></span> - <span id="fstate">WAIT</span>
|
||||||
@ -17,12 +17,12 @@
|
|||||||
Miner Actor: <span id="mcid"></span> - <span id="mstate">WAIT</span>
|
Miner Actor: <span id="mcid"></span> - <span id="mstate">WAIT</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="Index-node" style="display: none" id="fwait">
|
<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>
|
||||||
<div class="Index-node" style="display: none" id="mwait">
|
<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">
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -36,7 +36,9 @@ import (
|
|||||||
|
|
||||||
var log = logging.Logger("main")
|
var log = logging.Logger("main")
|
||||||
|
|
||||||
const FlagStorageRepo = "workerrepo"
|
const FlagWorkerRepo = "worker-repo"
|
||||||
|
// TODO remove after deprecation period
|
||||||
|
const FlagWorkerRepoDeprecation = "workerrepo"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
lotuslog.SetupLogLevels()
|
lotuslog.SetupLogLevels()
|
||||||
@ -48,19 +50,23 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
app := &cli.App{
|
app := &cli.App{
|
||||||
Name: "lotus-seal-worker",
|
Name: "lotus-worker",
|
||||||
Usage: "Remote storage miner worker",
|
Usage: "Remote miner worker",
|
||||||
Version: build.UserVersion(),
|
Version: build.UserVersion(),
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: FlagStorageRepo,
|
Name: FlagWorkerRepo,
|
||||||
EnvVars: []string{"WORKER_PATH"},
|
Aliases: []string{FlagWorkerRepoDeprecation},
|
||||||
|
EnvVars: []string{"LOTUS_WORKER_PATH", "WORKER_PATH"},
|
||||||
Value: "~/.lotusworker", // TODO: Consider XDG_DATA_HOME
|
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{
|
&cli.StringFlag{
|
||||||
Name: "storagerepo",
|
Name: "miner-repo",
|
||||||
EnvVars: []string{"LOTUS_STORAGE_PATH"},
|
Aliases: []string{"storagerepo"},
|
||||||
Value: "~/.lotusstorage", // TODO: Consider XDG_DATA_HOME
|
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{
|
&cli.BoolFlag{
|
||||||
Name: "enable-gpu-proving",
|
Name: "enable-gpu-proving",
|
||||||
@ -143,7 +149,7 @@ var runCmd = &cli.Command{
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if v.APIVersion != build.APIVersion {
|
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)
|
log.Infof("Remote version %s", v)
|
||||||
|
|
||||||
@ -186,7 +192,7 @@ var runCmd = &cli.Command{
|
|||||||
|
|
||||||
// Open repo
|
// Open repo
|
||||||
|
|
||||||
repoPath := cctx.String(FlagStorageRepo)
|
repoPath := cctx.String(FlagWorkerRepo)
|
||||||
r, err := repo.NewFS(repoPath)
|
r, err := repo.NewFS(repoPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -23,7 +23,7 @@ import (
|
|||||||
|
|
||||||
var infoCmd = &cli.Command{
|
var infoCmd = &cli.Command{
|
||||||
Name: "info",
|
Name: "info",
|
||||||
Usage: "Print storage miner info",
|
Usage: "Print miner info",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&cli.BoolFlag{Name: "color"},
|
&cli.BoolFlag{Name: "color"},
|
||||||
},
|
},
|
||||||
|
@ -50,7 +50,7 @@ import (
|
|||||||
|
|
||||||
var initCmd = &cli.Command{
|
var initCmd = &cli.Command{
|
||||||
Name: "init",
|
Name: "init",
|
||||||
Usage: "Initialize a lotus storage miner repo",
|
Usage: "Initialize a lotus miner repo",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "actor",
|
Name: "actor",
|
||||||
@ -107,7 +107,7 @@ var initCmd = &cli.Command{
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Action: func(cctx *cli.Context) error {
|
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"))
|
sectorSizeInt, err := units.RAMInBytes(cctx.String("sector-size"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -151,7 +151,7 @@ var initCmd = &cli.Command{
|
|||||||
|
|
||||||
log.Info("Checking if repo exists")
|
log.Info("Checking if repo exists")
|
||||||
|
|
||||||
repoPath := cctx.String(FlagStorageRepo)
|
repoPath := cctx.String(FlagMinerRepo)
|
||||||
r, err := repo.NewFS(repoPath)
|
r, err := repo.NewFS(repoPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -162,7 +162,7 @@ var initCmd = &cli.Command{
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if ok {
|
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")
|
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 {
|
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)
|
path, err := homedir.Expand(repoPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -249,7 +249,7 @@ var initCmd = &cli.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Point to setting storage price, maybe do it interactively or something
|
// 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
|
return nil
|
||||||
},
|
},
|
||||||
@ -454,11 +454,11 @@ func storageMinerInit(ctx context.Context, cctx *cli.Context, api lapi.FullNode,
|
|||||||
cerr := configureStorageMiner(ctx, api, a, peerid, gasPrice)
|
cerr := configureStorageMiner(ctx, api, a, peerid, gasPrice)
|
||||||
|
|
||||||
if err := m.Stop(ctx); err != nil {
|
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 {
|
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 {
|
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
|
addr = a
|
||||||
@ -505,7 +505,7 @@ func storageMinerInit(ctx context.Context, cctx *cli.Context, api lapi.FullNode,
|
|||||||
addr = a
|
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 {
|
if err := mds.Put(datastore.NewKey("miner-address"), addr.Bytes()); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -654,7 +654,7 @@ func createStorageMiner(ctx context.Context, api lapi.FullNode, peerid peer.ID,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if mw.Receipt.ExitCode != 0 {
|
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
|
var retval power.CreateMinerReturn
|
||||||
@ -662,6 +662,6 @@ func createStorageMiner(ctx context.Context, api lapi.FullNode, peerid peer.ID,
|
|||||||
return address.Undef, err
|
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
|
return retval.IDAddress, nil
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
logging "github.com/ipfs/go-log/v2"
|
logging "github.com/ipfs/go-log/v2"
|
||||||
@ -20,7 +21,9 @@ import (
|
|||||||
|
|
||||||
var log = logging.Logger("main")
|
var log = logging.Logger("main")
|
||||||
|
|
||||||
const FlagStorageRepo = "storagerepo"
|
const FlagMinerRepo = "miner-repo"
|
||||||
|
// TODO remove after deprecation period
|
||||||
|
const FlagMinerRepoDeprecation = "storagerepo"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
lotuslog.SetupLogLevels()
|
lotuslog.SetupLogLevels()
|
||||||
@ -61,8 +64,8 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
app := &cli.App{
|
app := &cli.App{
|
||||||
Name: "lotus-storage-miner",
|
Name: "lotus-miner",
|
||||||
Usage: "Filecoin decentralized storage network storage miner",
|
Usage: "Filecoin decentralized storage network miner",
|
||||||
Version: build.UserVersion(),
|
Version: build.UserVersion(),
|
||||||
EnableBashCompletion: true,
|
EnableBashCompletion: true,
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
@ -79,9 +82,11 @@ func main() {
|
|||||||
Value: "~/.lotus", // TODO: Consider XDG_DATA_HOME
|
Value: "~/.lotus", // TODO: Consider XDG_DATA_HOME
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: FlagStorageRepo,
|
Name: FlagMinerRepo,
|
||||||
EnvVars: []string{"LOTUS_STORAGE_PATH"},
|
Aliases: []string{FlagMinerRepoDeprecation},
|
||||||
Value: "~/.lotusstorage", // TODO: Consider XDG_DATA_HOME
|
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),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -357,7 +357,7 @@ var dealsListCmd = &cli.Command{
|
|||||||
|
|
||||||
var getBlocklistCmd = &cli.Command{
|
var getBlocklistCmd = &cli.Command{
|
||||||
Name: "get-blocklist",
|
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{
|
Flags: []cli.Flag{
|
||||||
&CidBaseFlag,
|
&CidBaseFlag,
|
||||||
},
|
},
|
||||||
@ -388,7 +388,7 @@ var getBlocklistCmd = &cli.Command{
|
|||||||
|
|
||||||
var setBlocklistCmd = &cli.Command{
|
var setBlocklistCmd = &cli.Command{
|
||||||
Name: "set-blocklist",
|
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)]",
|
ArgsUsage: "[<path-of-file-containing-newline-delimited-piece-CIDs> (optional, will read from stdin if omitted)]",
|
||||||
Flags: []cli.Flag{},
|
Flags: []cli.Flag{},
|
||||||
Action: func(cctx *cli.Context) error {
|
Action: func(cctx *cli.Context) error {
|
||||||
@ -435,7 +435,7 @@ var setBlocklistCmd = &cli.Command{
|
|||||||
|
|
||||||
var resetBlocklistCmd = &cli.Command{
|
var resetBlocklistCmd = &cli.Command{
|
||||||
Name: "reset-blocklist",
|
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{},
|
Flags: []cli.Flag{},
|
||||||
Action: func(cctx *cli.Context) error {
|
Action: func(cctx *cli.Context) error {
|
||||||
api, closer, err := lcli.GetStorageMinerAPI(cctx)
|
api, closer, err := lcli.GetStorageMinerAPI(cctx)
|
||||||
|
@ -30,7 +30,7 @@ import (
|
|||||||
|
|
||||||
var runCmd = &cli.Command{
|
var runCmd = &cli.Command{
|
||||||
Name: "run",
|
Name: "run",
|
||||||
Usage: "Start a lotus storage miner process",
|
Usage: "Start a lotus miner process",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "api",
|
Name: "api",
|
||||||
@ -86,8 +86,8 @@ var runCmd = &cli.Command{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
storageRepoPath := cctx.String(FlagStorageRepo)
|
minerRepoPath := cctx.String(FlagMinerRepo)
|
||||||
r, err := repo.NewFS(storageRepoPath)
|
r, err := repo.NewFS(minerRepoPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -97,7 +97,7 @@ var runCmd = &cli.Command{
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if !ok {
|
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{})
|
shutdownChan := make(chan struct{})
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
var stopCmd = &cli.Command{
|
var stopCmd = &cli.Command{
|
||||||
Name: "stop",
|
Name: "stop",
|
||||||
Usage: "Stop a running lotus storage miner",
|
Usage: "Stop a running lotus miner",
|
||||||
Flags: []cli.Flag{},
|
Flags: []cli.Flag{},
|
||||||
Action: func(cctx *cli.Context) error {
|
Action: func(cctx *cli.Context) error {
|
||||||
api, closer, err := lcli.GetAPI(cctx)
|
api, closer, err := lcli.GetAPI(cctx)
|
||||||
|
@ -278,7 +278,7 @@ var storageFindCmd = &cli.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !cctx.Args().Present() {
|
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)
|
snum, err := strconv.ParseUint(cctx.Args().First(), 10, 64)
|
||||||
|
@ -69,7 +69,7 @@
|
|||||||
},
|
},
|
||||||
"filecoin-decentralized-storage-market": {
|
"filecoin-decentralized-storage-market": {
|
||||||
"title": "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": {
|
"filecoin-proof-parameters": {
|
||||||
"title": "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 message’s gas price and consumption, forming a market."
|
"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 message’s gas price and consumption, forming a market."
|
||||||
},
|
},
|
||||||
"lotus-storage-miner": {
|
"lotus-storage-miner": {
|
||||||
"title": "Storage Miner (lotus-storage-miner)",
|
"title": "Miner (lotus-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."
|
"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": {
|
"swarm-port": {
|
||||||
"title": "Swarm Port (Libp2p)",
|
"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": {
|
"daemon": {
|
||||||
"title": "Lotus Daemon",
|
"title": "Lotus Daemon",
|
||||||
@ -129,7 +129,7 @@
|
|||||||
},
|
},
|
||||||
"total-network-power": {
|
"total-network-power": {
|
||||||
"title": "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": {
|
"chain-block-height": {
|
||||||
"title": "Chain Block Height",
|
"title": "Chain Block Height",
|
||||||
|
@ -83,9 +83,9 @@
|
|||||||
"value": null,
|
"value": null,
|
||||||
"posts": [
|
"posts": [
|
||||||
{
|
{
|
||||||
"title": "Lotus Seal Worker",
|
"title": "Lotus Worker",
|
||||||
"slug": "en+lotus-seal-worker",
|
"slug": "en+lotus-worker",
|
||||||
"github": "en/mining-lotus-seal-worker.md",
|
"github": "en/mining-lotus-worker.md",
|
||||||
"value": null
|
"value": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Remote API Support
|
# 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.
|
Here is how to setup the necessary authorization and environment variables.
|
||||||
|
|
||||||
## 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
|
# Lotus Node
|
||||||
FULLNODE_API_INFO="JWT_TOKEN:/ip4/127.0.0.1/tcp/1234/http"
|
FULLNODE_API_INFO="JWT_TOKEN:/ip4/127.0.0.1/tcp/1234/http"
|
||||||
|
|
||||||
# Lotus Storage Miner
|
# Lotus Miner
|
||||||
STORAGE_API_INFO="JWT_TOKEN:/ip4/127.0.0.1/tcp/2345/http"
|
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
|
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 **Lotus Node**'s `mutliaddr` is in `~/.lotus/api`.
|
||||||
- The default token is in `~/.lotus/token`.
|
- The default token is in `~/.lotus/token`.
|
||||||
- The **Lotus Storage Miner**'s `multiaddr` is in `~/.lotusstorage/config`.
|
- The **Lotus Miner**'s `multiaddr` is in `~/.lotusminer/config`.
|
||||||
- The default token is in `~/.lotusstorage/token`.
|
- The default token is in `~/.lotusminer/token`.
|
||||||
|
@ -18,9 +18,9 @@ Options:
|
|||||||
|
|
||||||
For now, you can look into different files to find methods available to you based on your needs:
|
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)
|
- [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).
|
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
|
```sh
|
||||||
curl -X POST \
|
curl -X POST \
|
||||||
-H "Content-Type: application/json" \
|
-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 }' \
|
--data '{ "jsonrpc": "2.0", "method": "Filecoin.ChainHead", "params": [], "id": 3 }' \
|
||||||
'http://127.0.0.1:1234/rpc/v0'
|
'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:
|
To authorize your request, you will need to include the **JWT** in a HTTP header, for example:
|
||||||
|
|
||||||
```sh
|
```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?
|
## How do I generate a token?
|
||||||
|
|
||||||
@ -71,8 +71,8 @@ To generate a JWT with custom permissions, use this command:
|
|||||||
# Lotus Node
|
# Lotus Node
|
||||||
lotus auth create-token --perm admin
|
lotus auth create-token --perm admin
|
||||||
|
|
||||||
# Lotus Storage Miner
|
# Lotus Miner
|
||||||
lotus-storage-miner auth create-token --perm admin
|
lotus-miner auth create-token --perm admin
|
||||||
```
|
```
|
||||||
|
|
||||||
## What authorization level should I use?
|
## What authorization level should I use?
|
||||||
|
@ -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.FullNode), ConfigFullNode(c)),
|
||||||
ApplyIf(isType(repo.StorageMiner), ConfigStorageMiner(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
|
## Online
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ Now go to `http://127.0.0.1:2222`.
|
|||||||
## What can I test?
|
## What can I test?
|
||||||
|
|
||||||
- The `Spawn Node` button starts a new **Lotus Node** in a new draggable window.
|
- 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.
|
- 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.
|
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
|
## Troubleshooting
|
||||||
|
|
||||||
- Turn it off and on - Start at the top
|
- 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
|
- Verify you have the correct versions of dependencies
|
||||||
- If stuck on a bad fork, try `lotus chain sethead --genesis`
|
- If stuck on a bad fork, try `lotus chain sethead --genesis`
|
||||||
|
@ -32,7 +32,7 @@ Gossip sub spec and some introduction.
|
|||||||
|
|
||||||
# Look at the constructor of a miner
|
# 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
|
# Directory structure so far, main structures seen, their relation
|
||||||
|
|
||||||
|
@ -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
|
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!
|
yourself, then the Lotus Node is all you need!
|
||||||
|
|
||||||
The Lotus Storage Miner does everything you need for the registration of storage, and the
|
The Lotus Miner does everything you need for the registration of storage, and the
|
||||||
production of new blocks. The Lotus Storage Miner communicates with the network
|
production of new blocks. The Lotus Miner communicates with the network by talking
|
||||||
by talking to a Lotus Node over the JSON-RPC API.
|
to a Lotus Node over the JSON-RPC API.
|
||||||
|
|
||||||
## Setting up a Lotus Node
|
## 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?
|
### How do I prepare a fresh installation of Lotus?
|
||||||
|
|
||||||
Stop the Lotus daemon, and delete all related files, including sealed and chain data by
|
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
|
Then, install Lotus afresh by following the instructions
|
||||||
found [here](https://docs.lotu.sh/en+getting-started).
|
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?
|
### 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.,
|
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?
|
### How do I setup my own local devnet?
|
||||||
|
|
||||||
|
@ -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).
|
- 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).
|
- 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.
|
- [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?
|
## 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:
|
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 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.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Protocol Labs Standard Testing Configuration
|
# 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.
|
**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.
|
||||||
|
|
||||||
|
@ -34,13 +34,13 @@ Then, in another console, import the genesis miner key:
|
|||||||
Set up the genesis miner:
|
Set up the genesis miner:
|
||||||
|
|
||||||
```sh
|
```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:
|
Now, finally, start up the miner:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./lotus-storage-miner run --nosync
|
./lotus-miner run --nosync
|
||||||
```
|
```
|
||||||
|
|
||||||
If all went well, you will have your own local Lotus Devnet running.
|
If all went well, you will have your own local Lotus Devnet running.
|
||||||
|
@ -6,7 +6,7 @@ to install a Lotus node and sync to the top of the chain.
|
|||||||
## Set up an ask
|
## 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.
|
This command will set up your miner to accept deal proposals that meet the input price.
|
||||||
|
@ -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
|
```sh
|
||||||
IPFS_GATEWAY="https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/"
|
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
|
## 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
|
```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:
|
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.
|
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:
|
Once this is set, run:
|
||||||
|
|
||||||
```sh
|
```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.
|
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
|
```sh
|
||||||
why@computer ~/lotus> lotus-storage-miner workers list
|
why@computer ~/lotus> lotus-miner workers list
|
||||||
Worker 0, host computer
|
Worker 0, host computer
|
||||||
CPU: [ ] 0 core(s) in use
|
CPU: [ ] 0 core(s) in use
|
||||||
RAM: [|||||||||||||||||| ] 28% 18.1 GiB/62.7 GiB
|
RAM: [|||||||||||||||||| ] 28% 18.1 GiB/62.7 GiB
|
||||||
@ -71,11 +71,11 @@ Worker 1, host othercomputer
|
|||||||
|
|
||||||
### Running locally for manually managing process priority
|
### 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.
|
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
|
```sh
|
||||||
lotus-seal-worker run --address 127.0.0.1:2345
|
lotus-worker run --address 127.0.0.1:2345
|
||||||
```
|
```
|
@ -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
|
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
|
## Error: Failed to get api endpoint
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
lotus-storage-miner info
|
lotus-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)}):
|
# 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
|
## 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
|
## Error: No space left on device
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
lotus-storage-miner sectors pledge
|
lotus-miner sectors pledge
|
||||||
# No space left on device (os error 28)
|
# No space left on device (os error 28)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -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.
|
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
|
```sh
|
||||||
IPFS_GATEWAY="https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/"
|
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:
|
The task will be complete when you see:
|
||||||
|
|
||||||
```sh
|
```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:
|
In a CLI window, use the following command to start your miner:
|
||||||
|
|
||||||
```sh
|
```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
|
Example
|
||||||
|
|
||||||
```sh
|
```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.
|
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:
|
To mine:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
lotus-storage-miner run
|
lotus-miner run
|
||||||
```
|
```
|
||||||
|
|
||||||
If you are downloading **Filecoin Proof Parameters**, the download can take some time.
|
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:
|
Get information about your miner:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
lotus-storage-miner info
|
lotus-miner info
|
||||||
# example: miner id `t0111`
|
# example: miner id `t0111`
|
||||||
```
|
```
|
||||||
|
|
||||||
**Seal** random data to start producing **PoSts**:
|
**Seal** random data to start producing **PoSts**:
|
||||||
|
|
||||||
```sh
|
```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.
|
- 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
|
### `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
|
### `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
|
||||||
|
@ -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.
|
> 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).
|
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).
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
# Static Ports
|
# 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
|
## 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`:
|
To change the port to `1347`:
|
||||||
|
|
||||||
|
@ -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:
|
Here is a command that will delete your chain data, stored wallets, stored data and any miners you have set up:
|
||||||
|
|
||||||
```sh
|
```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.
|
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.
|
||||||
|
@ -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:
|
In order to retrieve a file, it must be sealed. Miners can check sealing progress with this command:
|
||||||
|
|
||||||
```sh
|
```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**.
|
||||||
|
@ -59,4 +59,4 @@ lotus client list-deals
|
|||||||
|
|
||||||
Upon success, this command will return a **Deal CID**.
|
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.
|
||||||
|
452
lotuspond/front/package-lock.json
generated
452
lotuspond/front/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -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 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}/>
|
let line = <Address client={this.props.client} addN={this.props.giveN} add10k={true} nonce={true} addr={addr} mountWindow={this.props.mountWindow}/>
|
||||||
|
@ -127,7 +127,7 @@ class StorageNode extends React.Component {
|
|||||||
runtime = (
|
runtime = (
|
||||||
<div>
|
<div>
|
||||||
<div>v{this.state.version.Version}, <abbr title={this.state.id}>{this.state.id.substr(-8)}</abbr>, {this.state.peers} peers</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>
|
<div>
|
||||||
{pledgeSector} {sealStaged}
|
{pledgeSector} {sealStaged}
|
||||||
</div>
|
</div>
|
||||||
@ -147,7 +147,7 @@ class StorageNode extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return <Window
|
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}}
|
initialPosition={{x: this.props.node.ID*30, y: this.props.node.ID * 30}}
|
||||||
onClose={this.stop} >
|
onClose={this.stop} >
|
||||||
<div className="CristalScroll">
|
<div className="CristalScroll">
|
||||||
|
@ -11,7 +11,7 @@ class StorageNodeInit extends React.Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
return <Window
|
return <Window
|
||||||
title={"Storage miner initializing"}
|
title={"Miner initializing"}
|
||||||
initialPosition={'center'}>
|
initialPosition={'center'}>
|
||||||
<div className="CristalScroll">
|
<div className="CristalScroll">
|
||||||
<div className="StorageNodeInit">
|
<div className="StorageNodeInit">
|
||||||
|
@ -45,9 +45,9 @@ var onCmd = &cli.Command{
|
|||||||
"LOTUS_PATH=" + node.Repo,
|
"LOTUS_PATH=" + node.Repo,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cmd = exec.Command("./lotus-storage-miner")
|
cmd = exec.Command("./lotus-miner")
|
||||||
cmd.Env = []string{
|
cmd.Env = []string{
|
||||||
"LOTUS_STORAGE_PATH=" + node.Repo,
|
"LOTUS_MINER_PATH=" + node.Repo,
|
||||||
"LOTUS_PATH=" + node.FullNode,
|
"LOTUS_PATH=" + node.FullNode,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ var shCmd = &cli.Command{
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
shcmd.Env = []string{
|
shcmd.Env = []string{
|
||||||
"LOTUS_STORAGE_PATH=" + node.Repo,
|
"LOTUS_MINER_PATH=" + node.Repo,
|
||||||
"LOTUS_PATH=" + node.FullNode,
|
"LOTUS_PATH=" + node.FullNode,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -176,10 +176,10 @@ func (api *api) SpawnStorage(fullNodeRepo string) (nodeInfo, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
id := atomic.AddInt32(&api.cmds, 1)
|
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.Stderr = io.MultiWriter(os.Stderr, errlogfile)
|
||||||
cmd.Stdout = io.MultiWriter(os.Stdout, logfile)
|
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 {
|
if err := cmd.Run(); err != nil {
|
||||||
return nodeInfo{}, err
|
return nodeInfo{}, err
|
||||||
}
|
}
|
||||||
@ -188,10 +188,10 @@ func (api *api) SpawnStorage(fullNodeRepo string) (nodeInfo, error) {
|
|||||||
|
|
||||||
mux := newWsMux()
|
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.Stderr = io.MultiWriter(os.Stderr, errlogfile, mux.errpw)
|
||||||
cmd.Stdout = io.MultiWriter(os.Stdout, logfile, mux.outpw)
|
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 {
|
if err := cmd.Start(); err != nil {
|
||||||
return nodeInfo{}, err
|
return nodeInfo{}, err
|
||||||
}
|
}
|
||||||
@ -248,7 +248,7 @@ func (api *api) RestartNode(id int32) (nodeInfo, error) {
|
|||||||
|
|
||||||
var cmd *exec.Cmd
|
var cmd *exec.Cmd
|
||||||
if nd.meta.Storage {
|
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 {
|
} else {
|
||||||
cmd = exec.Command("./lotus", "daemon", "--api", fmt.Sprintf("%d", 2500+id))
|
cmd = exec.Command("./lotus", "daemon", "--api", fmt.Sprintf("%d", 2500+id))
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,7 @@ const (
|
|||||||
|
|
||||||
RegisterClientValidatorKey
|
RegisterClientValidatorKey
|
||||||
|
|
||||||
// storage miner
|
// miner
|
||||||
GetParamsKey
|
GetParamsKey
|
||||||
HandleDealsKey
|
HandleDealsKey
|
||||||
HandleRetrievalKey
|
HandleRetrievalKey
|
||||||
@ -274,7 +274,7 @@ func Online() Option {
|
|||||||
Override(new(*market.FundMgr), market.NewFundMgr),
|
Override(new(*market.FundMgr), market.NewFundMgr),
|
||||||
),
|
),
|
||||||
|
|
||||||
// Storage miner
|
// miner
|
||||||
ApplyIf(func(s *Settings) bool { return s.nodeType == repo.StorageMiner },
|
ApplyIf(func(s *Settings) bool { return s.nodeType == repo.StorageMiner },
|
||||||
Override(new(api.Common), From(new(common.CommonAPI))),
|
Override(new(api.Common), From(new(common.CommonAPI))),
|
||||||
Override(new(sectorstorage.StorageAuth), modules.StorageAuth),
|
Override(new(sectorstorage.StorageAuth), modules.StorageAuth),
|
||||||
|
@ -25,7 +25,7 @@ type FullNode struct {
|
|||||||
|
|
||||||
// // Common
|
// // Common
|
||||||
|
|
||||||
// StorageMiner is a storage miner config
|
// StorageMiner is a miner config
|
||||||
type StorageMiner struct {
|
type StorageMiner struct {
|
||||||
Common
|
Common
|
||||||
|
|
||||||
|
@ -27,12 +27,12 @@ type ConsiderOnlineRetrievalDealsConfigFunc func() (bool, error)
|
|||||||
type SetConsiderOnlineRetrievalDealsConfigFunc func(bool) error
|
type SetConsiderOnlineRetrievalDealsConfigFunc func(bool) error
|
||||||
|
|
||||||
// StorageDealPieceCidBlocklistConfigFunc is a function which reads from miner
|
// 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.
|
// storage proposals.
|
||||||
type StorageDealPieceCidBlocklistConfigFunc func() ([]cid.Cid, error)
|
type StorageDealPieceCidBlocklistConfigFunc func() ([]cid.Cid, error)
|
||||||
|
|
||||||
// SetStorageDealPieceCidBlocklistConfigFunc is a function which is used to set a
|
// 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
|
type SetStorageDealPieceCidBlocklistConfigFunc func([]cid.Cid) error
|
||||||
|
|
||||||
// ConsiderOfflineStorageDealsConfigFunc is a function which reads from miner
|
// ConsiderOfflineStorageDealsConfigFunc is a function which reads from miner
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
package dtypes
|
package dtypes
|
||||||
|
|
||||||
// ShutdownChan is a channel to which you send a value if you intend to shut
|
// 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{}
|
type ShutdownChan chan struct{}
|
||||||
|
@ -585,7 +585,7 @@ func mutateCfg(r repo.LockedRepo, mutator func(*config.StorageMiner)) error {
|
|||||||
setConfigErr := r.SetConfig(func(raw interface{}) {
|
setConfigErr := r.SetConfig(func(raw interface{}) {
|
||||||
cfg, ok := raw.(*config.StorageMiner)
|
cfg, ok := raw.(*config.StorageMiner)
|
||||||
if !ok {
|
if !ok {
|
||||||
typeErr = errors.New("expected storage miner config")
|
typeErr = errors.New("expected miner config")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,4 +7,4 @@ _cli_bash_autocomplete() {
|
|||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) );
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) );
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
complete -F _cli_bash_autocomplete lotus-storage-miner
|
complete -F _cli_bash_autocomplete lotus-miner
|
@ -20,8 +20,8 @@ pushd bundle
|
|||||||
|
|
||||||
BINARIES=(
|
BINARIES=(
|
||||||
"lotus"
|
"lotus"
|
||||||
"lotus-storage-miner"
|
"lotus-miner"
|
||||||
"lotus-seal-worker"
|
"lotus-worker"
|
||||||
)
|
)
|
||||||
|
|
||||||
export IPFS_PATH=`mktemp -d`
|
export IPFS_PATH=`mktemp -d`
|
||||||
|
@ -10,15 +10,15 @@ log "> Deploying bootstrap node $host"
|
|||||||
log "Stopping lotus daemon"
|
log "Stopping lotus daemon"
|
||||||
|
|
||||||
ssh "$host" 'systemctl stop lotus-daemon' &
|
ssh "$host" 'systemctl stop lotus-daemon' &
|
||||||
ssh "$host" 'systemctl stop lotus-storage-miner' &
|
ssh "$host" 'systemctl stop lotus-miner' &
|
||||||
|
|
||||||
wait
|
wait
|
||||||
|
|
||||||
ssh "$host" 'rm -rf .lotus' &
|
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 "${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
|
wait
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
HOST=$1
|
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" 'lotus wallet new bls > addr'
|
||||||
ssh "$HOST" 'curl http://147.75.80.29:777/sendcoll?address=$(cat addr)' &
|
ssh "$HOST" 'curl http://147.75.80.29:777/sendcoll?address=$(cat addr)' &
|
||||||
@ -14,5 +14,5 @@ echo "SYNC WAIT"
|
|||||||
sleep 30
|
sleep 30
|
||||||
|
|
||||||
ssh "$HOST" 'lotus sync wait'
|
ssh "$HOST" 'lotus sync wait'
|
||||||
ssh "$HOST" 'lotus-storage-miner init --owner=$(cat addr)'
|
ssh "$HOST" 'lotus-miner init --owner=$(cat addr)'
|
||||||
ssh "$HOST" 'systemctl start lotus-storage-miner' &
|
ssh "$HOST" 'systemctl start lotus-miner' &
|
||||||
|
@ -11,7 +11,7 @@ HOST=$1
|
|||||||
|
|
||||||
FILES_TO_SEND=(
|
FILES_TO_SEND=(
|
||||||
./lotus
|
./lotus
|
||||||
./lotus-storage-miner
|
./lotus-miner
|
||||||
scripts/lotus-daemon.service
|
scripts/lotus-daemon.service
|
||||||
scripts/louts-miner.service
|
scripts/louts-miner.service
|
||||||
)
|
)
|
||||||
@ -21,14 +21,14 @@ rsync -P "${FILES_TO_SEND[@]}" "$HOST:~/lotus-stage/"
|
|||||||
ssh "$HOST" 'bash -s' << 'EOF'
|
ssh "$HOST" 'bash -s' << 'EOF'
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
systemctl stop lotus-storage-miner
|
systemctl stop lotus-miner
|
||||||
systemctl stop lotus-daemon
|
systemctl stop lotus-daemon
|
||||||
mkdir -p .lotus .lotusstorage
|
mkdir -p .lotus .lotusminer
|
||||||
|
|
||||||
cd "$HOME/lotus-stage/"
|
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-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 daemon-reload
|
||||||
systemctl start lotus-daemon
|
systemctl start lotus-daemon
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
set -o xtrace
|
set -o xtrace
|
||||||
|
|
||||||
rm -rf ~/.lotus ~/.lotusstorage/ ~/.genesis-sectors ~/.lotusworker
|
rm -rf ~/.lotus ~/.lotusminer/ ~/.genesis-sectors ~/.lotusworker
|
||||||
|
@ -7,4 +7,4 @@ export TRUST_PARAMS=1
|
|||||||
tag=${TAG:-debug}
|
tag=${TAG:-debug}
|
||||||
|
|
||||||
go run -tags=$tag ./cmd/lotus wallet import ~/.genesis-sectors/pre-seal-t01000.key
|
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
|
||||||
|
@ -42,8 +42,8 @@ SCRIPTDIR="\$( cd "\$( dirname "\${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|||||||
pushd \$SCRIPTDIR/../build
|
pushd \$SCRIPTDIR/../build
|
||||||
|
|
||||||
pwd
|
pwd
|
||||||
env RUSTFLAGS="-C target-cpu=native -g" FFI_BUILD_FROM_SOURCE=1 make clean deps lotus lotus-storage-miner lotus-shed
|
env RUSTFLAGS="-C target-cpu=native -g" FFI_BUILD_FROM_SOURCE=1 make clean deps lotus lotus-miner lotus-shed
|
||||||
cp lotus lotus-storage-miner lotus-shed ../bin/
|
cp lotus lotus-miner lotus-shed ../bin/
|
||||||
|
|
||||||
popd
|
popd
|
||||||
EOF
|
EOF
|
||||||
@ -51,13 +51,13 @@ EOF
|
|||||||
cat > "${BASEDIR}/scripts/env.fish" <<EOF
|
cat > "${BASEDIR}/scripts/env.fish" <<EOF
|
||||||
set -x PATH ${BASEDIR}/bin \$PATH
|
set -x PATH ${BASEDIR}/bin \$PATH
|
||||||
set -x LOTUS_PATH ${BASEDIR}/.lotus
|
set -x LOTUS_PATH ${BASEDIR}/.lotus
|
||||||
set -x LOTUS_STORAGE_PATH ${BASEDIR}/.lotusstorage
|
set -x LOTUS_MINER_PATH ${BASEDIR}/.lotusminer
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > "${BASEDIR}/scripts/env.bash" <<EOF
|
cat > "${BASEDIR}/scripts/env.bash" <<EOF
|
||||||
export PATH=${BASEDIR}/bin:\$PATH
|
export PATH=${BASEDIR}/bin:\$PATH
|
||||||
export LOTUS_PATH=${BASEDIR}/.lotus
|
export LOTUS_PATH=${BASEDIR}/.lotus
|
||||||
export LOTUS_STORAGE_PATH=${BASEDIR}/.lotusstorage
|
export LOTUS_MINER_PATH=${BASEDIR}/.lotusminer
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > "${BASEDIR}/scripts/create_miner.bash" <<EOF
|
cat > "${BASEDIR}/scripts/create_miner.bash" <<EOF
|
||||||
@ -65,7 +65,7 @@ cat > "${BASEDIR}/scripts/create_miner.bash" <<EOF
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
lotus wallet import ~/.genesis-sectors/pre-seal-t01000.key
|
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
|
EOF
|
||||||
|
|
||||||
cat > "${BASEDIR}/scripts/pledge_sectors.bash" <<EOF
|
cat > "${BASEDIR}/scripts/pledge_sectors.bash" <<EOF
|
||||||
@ -73,26 +73,26 @@ cat > "${BASEDIR}/scripts/pledge_sectors.bash" <<EOF
|
|||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
while [ ! -d ${BASEDIR}/.lotusstorage ]; do
|
while [ ! -d ${BASEDIR}/.lotusminer ]; do
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
|
|
||||||
while [ ! -f ${BASEDIR}/.lotusstorage/api ]; do
|
while [ ! -f ${BASEDIR}/.lotusminer/api ]; do
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
|
|
||||||
sleep 30
|
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"
|
current="\$sector"
|
||||||
|
|
||||||
while true; do
|
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
|
break
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while true; do
|
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
|
if [ -z "\$state" ]; then
|
||||||
break
|
break
|
||||||
@ -102,15 +102,15 @@ while true; do
|
|||||||
PreCommit1 | PreCommit2 | Packing | Unsealed | PreCommitting | Committing | CommitWait | FinalizeSector ) sleep 30 ;;
|
PreCommit1 | PreCommit2 | Packing | Unsealed | PreCommitting | Committing | CommitWait | FinalizeSector ) sleep 30 ;;
|
||||||
WaitSeed | Proving ) break ;;
|
WaitSeed | Proving ) break ;;
|
||||||
* ) echo "Unknown Sector State: \$state"
|
* ) echo "Unknown Sector State: \$state"
|
||||||
lotus-storage-miner sectors status --log \$current
|
lotus-miner sectors status --log \$current
|
||||||
break ;;
|
break ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
lotus-storage-miner sectors pledge
|
lotus-miner sectors pledge
|
||||||
|
|
||||||
while [ "\$current" == "\$sector" ]; do
|
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
|
sleep 5
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -127,13 +127,13 @@ while true; do
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
echo Storage Miner Info
|
echo Miner Info
|
||||||
lotus-storage-miner info
|
lotus-miner info
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
echo Sector List
|
echo Sector List
|
||||||
lotus-storage-miner sectors list | tail -n4
|
lotus-miner sectors list | tail -n4
|
||||||
|
|
||||||
sleep 25
|
sleep 25
|
||||||
|
|
||||||
@ -151,7 +151,7 @@ if [ "$BUILD" == "yes" ]; then
|
|||||||
bash "${BASEDIR}/scripts/build.bash"
|
bash "${BASEDIR}/scripts/build.bash"
|
||||||
else
|
else
|
||||||
cp ./lotus ${BASEDIR}/bin/
|
cp ./lotus ${BASEDIR}/bin/
|
||||||
cp ./lotus-storage-miner ${BASEDIR}/bin/
|
cp ./lotus-miner ${BASEDIR}/bin/
|
||||||
cp ./lotus-seed ${BASEDIR}/bin/
|
cp ./lotus-seed ${BASEDIR}/bin/
|
||||||
cp ./lotus-shed ${BASEDIR}/bin/
|
cp ./lotus-shed ${BASEDIR}/bin/
|
||||||
fi
|
fi
|
||||||
@ -186,7 +186,7 @@ export LOTUS_PATH="${BASEDIR}/.lotus"
|
|||||||
${BASEDIR}/bin/lotus wait-api
|
${BASEDIR}/bin/lotus wait-api
|
||||||
|
|
||||||
tmux send-keys -t $session:$wminer "${BASEDIR}/scripts/create_miner.bash" C-m
|
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:$wcli "${BASEDIR}/scripts/monitor.bash" C-m
|
||||||
tmux send-keys -t $session:$wpleding "${BASEDIR}/scripts/pledge_sectors.bash" C-m
|
tmux send-keys -t $session:$wpleding "${BASEDIR}/scripts/pledge_sectors.bash" C-m
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ filebeat.inputs:
|
|||||||
|
|
||||||
- type: log
|
- type: log
|
||||||
paths:
|
paths:
|
||||||
- /root/.lotusstorage/logs
|
- /root/.lotusminer/logs
|
||||||
fields:
|
fields:
|
||||||
logzio_codec: json
|
logzio_codec: json
|
||||||
token: <API TOKEN>
|
token: <API TOKEN>
|
||||||
|
@ -86,12 +86,12 @@ mdt0111=$(mktemp -d)
|
|||||||
mdt0222=$(mktemp -d)
|
mdt0222=$(mktemp -d)
|
||||||
mdt0333=$(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_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_STORAGE_PATH="${mdt0111}" ./lotus-storage-miner run --nosync &
|
env LOTUS_PATH="${ldt0111}" LOTUS_MINER_PATH="${mdt0111}" ./lotus-miner run --nosync &
|
||||||
mpid=$!
|
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="${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_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="${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
|
kill $mpid
|
||||||
wait $mpid
|
wait $mpid
|
||||||
|
@ -9,7 +9,7 @@ Environment=GOLOG_LOG_FMT="json"
|
|||||||
Environment=LOTUS_DB=""
|
Environment=LOTUS_DB=""
|
||||||
Environment=LOTUS_PATH="%h/.lotus"
|
Environment=LOTUS_PATH="%h/.lotus"
|
||||||
EnvironmentFile=-/etc/lotus/chainwatch.env
|
EnvironmentFile=-/etc/lotus/chainwatch.env
|
||||||
ExecStart=/usr/local/bin/chainwatch run
|
ExecStart=/usr/local/bin/lotus-chainwatch run
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
@ -1,11 +1,11 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Lotus Storage Miner
|
Description=Lotus Miner
|
||||||
After=network.target
|
After=network.target
|
||||||
After=lotus-daemon.service
|
After=lotus-daemon.service
|
||||||
Requires=lotus-daemon.service
|
Requires=lotus-daemon.service
|
||||||
|
|
||||||
[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_FILE="/var/log/lotus/miner.log"
|
||||||
Environment=GOLOG_LOG_FMT="json"
|
Environment=GOLOG_LOG_FMT="json"
|
||||||
|
|
||||||
|
@ -4,20 +4,20 @@ SESSION=$(cat /proc/sys/kernel/random/uuid)
|
|||||||
|
|
||||||
tmux -2 new-session -d -s $SESSION
|
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 split-window -h
|
||||||
|
|
||||||
tmux select-pane -t 0
|
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 split-window -v
|
||||||
|
|
||||||
tmux select-pane -t 1
|
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 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
|
tmux -2 attach-session -t $SESSION
|
||||||
|
@ -25,8 +25,8 @@ SCRIPTDIR="\$( cd "\$( dirname "\${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|||||||
pushd \$SCRIPTDIR/../build
|
pushd \$SCRIPTDIR/../build
|
||||||
|
|
||||||
pwd
|
pwd
|
||||||
env RUSTFLAGS="-C target-cpu=native -g" FFI_BUILD_FROM_SOURCE=1 make clean deps lotus lotus-storage-miner lotus-shed
|
env RUSTFLAGS="-C target-cpu=native -g" FFI_BUILD_FROM_SOURCE=1 make clean deps lotus lotus-miner lotus-shed
|
||||||
cp lotus lotus-storage-miner lotus-shed ../bin/
|
cp lotus lotus-miner lotus-shed ../bin/
|
||||||
|
|
||||||
popd
|
popd
|
||||||
EOF
|
EOF
|
||||||
@ -34,13 +34,13 @@ EOF
|
|||||||
cat > "${BASEDIR}/scripts/env.fish" <<EOF
|
cat > "${BASEDIR}/scripts/env.fish" <<EOF
|
||||||
set -x PATH ${BASEDIR}/bin \$PATH
|
set -x PATH ${BASEDIR}/bin \$PATH
|
||||||
set -x LOTUS_PATH ${BASEDIR}/.lotus
|
set -x LOTUS_PATH ${BASEDIR}/.lotus
|
||||||
set -x LOTUS_STORAGE_PATH ${BASEDIR}/.lotusstorage
|
set -x LOTUS_MINER_PATH ${BASEDIR}/.lotusminer
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > "${BASEDIR}/scripts/env.bash" <<EOF
|
cat > "${BASEDIR}/scripts/env.bash" <<EOF
|
||||||
export PATH=${BASEDIR}/bin:\$PATH
|
export PATH=${BASEDIR}/bin:\$PATH
|
||||||
export LOTUS_PATH=${BASEDIR}/.lotus
|
export LOTUS_PATH=${BASEDIR}/.lotus
|
||||||
export LOTUS_STORAGE_PATH=${BASEDIR}/.lotusstorage
|
export LOTUS_MINER_PATH=${BASEDIR}/.lotusminer
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat > "${BASEDIR}/scripts/create_miner.bash" <<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')
|
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
|
EOF
|
||||||
|
|
||||||
cat > "${BASEDIR}/scripts/pledge_sectors.bash" <<EOF
|
cat > "${BASEDIR}/scripts/pledge_sectors.bash" <<EOF
|
||||||
@ -68,26 +68,26 @@ cat > "${BASEDIR}/scripts/pledge_sectors.bash" <<EOF
|
|||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
while [ ! -d ${BASEDIR}/.lotusstorage ]; do
|
while [ ! -d ${BASEDIR}/.lotusminer ]; do
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
|
|
||||||
while [ ! -f ${BASEDIR}/.lotusstorage/api ]; do
|
while [ ! -f ${BASEDIR}/.lotusminer/api ]; do
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
|
|
||||||
sleep 30
|
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"
|
current="\$sector"
|
||||||
|
|
||||||
while true; do
|
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
|
break
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while true; do
|
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
|
if [ -z "\$state" ]; then
|
||||||
break
|
break
|
||||||
@ -97,15 +97,15 @@ while true; do
|
|||||||
PreCommit1 | PreCommit2 | Packing | Unsealed | PreCommitting | Committing | CommitWait | FinalizeSector ) sleep 30 ;;
|
PreCommit1 | PreCommit2 | Packing | Unsealed | PreCommitting | Committing | CommitWait | FinalizeSector ) sleep 30 ;;
|
||||||
WaitSeed | Proving ) break ;;
|
WaitSeed | Proving ) break ;;
|
||||||
* ) echo "Unknown Sector State: \$state"
|
* ) echo "Unknown Sector State: \$state"
|
||||||
lotus-storage-miner sectors status --log \$current
|
lotus-miner sectors status --log \$current
|
||||||
break ;;
|
break ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
lotus-storage-miner sectors pledge
|
lotus-miner sectors pledge
|
||||||
|
|
||||||
while [ "\$current" == "\$sector" ]; do
|
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
|
sleep 5
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -122,13 +122,13 @@ while true; do
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
echo Storage Miner Info
|
echo Miner Info
|
||||||
lotus-storage-miner info
|
lotus-miner info
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
echo Sector List
|
echo Sector List
|
||||||
lotus-storage-miner sectors list | tail -n4
|
lotus-miner sectors list | tail -n4
|
||||||
|
|
||||||
sleep 25
|
sleep 25
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ tmux send-keys -t $session:$wdaemon "lotus daemon --api 48010 daemon 2>&1 | tee
|
|||||||
sleep 30
|
sleep 30
|
||||||
|
|
||||||
tmux send-keys -t $session:$wminer "${BASEDIR}/scripts/create_miner.bash" C-m
|
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:$wcli "${BASEDIR}/scripts/monitor.bash" C-m
|
||||||
tmux send-keys -t $session:$wpleding "${BASEDIR}/scripts/pledge_sectors.bash" C-m
|
tmux send-keys -t $session:$wpleding "${BASEDIR}/scripts/pledge_sectors.bash" C-m
|
||||||
|
|
||||||
|
@ -3,4 +3,4 @@
|
|||||||
HOST=$1
|
HOST=$1
|
||||||
|
|
||||||
scp scripts/lotus-daemon.service "${HOST}:/etc/systemd/system/lotus-daemon.service"
|
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"
|
||||||
|
@ -9,4 +9,4 @@ _cli_bash_autocomplete() {
|
|||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) );
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) );
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
complete -F _cli_bash_autocomplete lotus-storage-miner
|
complete -F _cli_bash_autocomplete lotus-miner
|
@ -5,8 +5,8 @@ In this `docker-examples/` directory are community-contributed Docker and Docker
|
|||||||
#### Example Use Cases
|
#### Example Use Cases
|
||||||
|
|
||||||
- **For a miner**
|
- **For a miner**
|
||||||
- basic storage miner (`miner-basic-`)
|
- basic miner (`miner-basic-`)
|
||||||
- distributed storage miner
|
- distributed miner
|
||||||
- **For API endpoints for building apps**
|
- **For API endpoints for building apps**
|
||||||
- local node for a developer (`api-local-`)
|
- local node for a developer (`api-local-`)
|
||||||
- hosted endpoint for apps / multiple developers (`api-hosted-`)
|
- hosted endpoint for apps / multiple developers (`api-hosted-`)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
## Description
|
## Description
|
||||||
|
|
||||||
- **For a miner**
|
- **For a miner**
|
||||||
- basic storage miner
|
- basic miner
|
||||||
|
Loading…
Reference in New Issue
Block a user