---------------------------------2020-11-24---------------------------------
要搞清楚KG的收益
从跟踪一个新KG开始
官方代码:https://github.com/filecoin-project/lotus
对官方代码1.2.1调度部分修改,编译,部署
三台矿机配置
192.168.1.127 跑lotus和miner
Intel(R) Xeon(R) CPU E5-2678 v3 @ 2.50GHz 12核 48线程 内存512G 固态 3.7T GeForce RTX 2080 Ti
192.168.1.112 跑worker
AMD EPYC 7302P 16-Core Processor 1493.855MHz 16核 32线程 内存 512G GeForce RTX 3080 10GB / 20GB
192.168.1.113 跑worker
AMD EPYC 7302P 16-Core Processor 1495.807MHz 16核 32线程 内存 512G GeForce RTX 3080 10GB / 20GB
环境变量
export PATH=$PATH:/usr/local/go/bin
export PATH="$HOME/.cargo/bin:$PATH"
export CGO_CFLAGS="-D__BLST_PORTABLE__"
export FIL_PROOFS_PARAMETER_CACHE=/var/tmp/filecoin-proof-parameters
export IPFS_GATEWAY=https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/
export FIL_PROOFS_PARENT_CACHE=/var/tmp/filecoin-parents
export FIL_PROOFS_USE_GPU_COLUMN_BUILDER=1
export FIL_PROOFS_USE_GPU_TREE_BUILDER=1
export FIL_PROOFS_MAXIMIZE_CACHING=0
export FIL_PROOFS_USE_MULTICORE_SDR=1
export RUST_BACKTRACE=full
export RUST_LOG=debug
export FIL_PROOFS_SDR_PARENTS_CACHE_SIZE=1073741824
export LOTUS_PATH=/date/lotus
export LOTUS_MINER_PATH=/date/miner
export FULLNODE_API_INFO=lotus-dir-token:/ip4/192.168.1.127/tcp/1234/http
export MINER_API_INFO=lotus-miner-dir-token:/ip4/192.168.1.127/tcp/2345/http
127 lotus命令创建一个钱包:
lotus wallet new bls
f3qimpukscd75m5mdjfabcjsmkeirfnimvgz6fzfbh3kpwqmgcxdfingttdkke6lb2nghr3ousdp674tohk76a
# 钱包余额:0.712 FIL
代码实现: chain/wallet/wallet.go
// chain/wallet/wallet.go
func (w *LocalWallet) WalletNew(ctx context.Context, typ types.KeyType) (address.Address, error) {
w.lk.Lock()
defer w.lk.Unlock()
k, err := GenerateKey(typ)
if err != nil {
return address.Undef, err
}
if err := w.keystore.Put(KNamePrefix+k.Address.String(), k.KeyInfo); err != nil {
return address.Undef, xerrors.Errorf("saving to keystore: %w", err)
}
w.keys[k.Address] = k
_, err = w.keystore.Get(KDefault)
if err != nil {
if !xerrors.Is(err, types.ErrKeyInfoNotFound) {
return address.Undef, err
}
if err := w.keystore.Put(KDefault, k.KeyInfo); err != nil {
return address.Undef, xerrors.Errorf("failed to set new key as default: %w", err)
}
}
return k.Address, nil
}
127 用钱包地址 f3qimpukscd75m5mdjfabcjsmkeirfnimvgz6fzfbh3kpwqmgcxdfingttdkke6lb2nghr3ousdp674tohk76a 创建矿工:
lotus-miner init --owner=f3qimpukscd75m5mdjfabcjsmkeirfnimvgz6fzfbh3kpwqmgcxdfingttdkke6lb2nghr3ousdp674tohk76a --sector-size=32GiB
2020-11-24T15:45:56.238+0800 INFO main lotus-storage-miner/init.go:702 Pushed CreateMiner message: bafy2bzacebsgthptjsg7rqu6gsqqsmtvq6d5wyitvfymvcawwkotfmphi5cts
2020-11-24T15:45:56.238+0800 INFO main lotus-storage-miner/init.go:703 Waiting for confirmation
2020-11-24T15:49:30.347+0800 INFO main lotus-storage-miner/init.go:719 New miners address is: f085415 (f2o6qs6shb52v5t4ejwsnkx5j6i7h7lworwf7xvua)
2020-11-24T15:49:30.347+0800 INFO main lotus-storage-miner/init.go:533 Created new miner: f085415
2020-11-24T15:49:30.351+0800 INFO main lotus-storage-miner/init.go:266 Miner successfully created, you can now start it with 'lotus-miner run'
代码实现:cmd/lotus-storage-miner/init.go
var initCmd = &cli.Command{
Name: "init",
Usage: "Initialize a lotus miner repo",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "actor",
Usage: "specify the address of an already created miner actor",
},
&cli.BoolFlag{
Name: "genesis-miner",
Usage: "enable genesis mining (DON'T USE ON BOOTSTRAPPED NETWORK)",
Hidden: true,
},
&cli.BoolFlag{
Name: "create-worker-key",
Usage: "create separate worker key",
},
&cli.StringFlag{
Name: "worker",
Aliases: []string{"w"},
Usage: "worker key to use (overrides --create-worker-key)",
},
&cli.StringFlag{
Name: "owner",
Aliases: []string{"o"},
Usage: "owner key to use",
},
&cli.StringFlag{
Name: "sector-size",
Usage: "specify sector size to use",
Value: units.BytesSize(float64(policy.GetDefaultSectorSize())),
},
&cli.StringSliceFlag{
Name: "pre-sealed-sectors",
Usage: "specify set of presealed sectors for starting as a genesis miner",
},
&cli.StringFlag{
Name: "pre-sealed-metadata",
Usage: "specify the metadata file for the presealed sectors",
},
&cli.BoolFlag{
Name: "nosync",
Usage: "don't check full-node sync status",
},
&cli.BoolFlag{
Name: "symlink-imported-sectors",
Usage: "attempt to symlink to presealed sectors instead of copying them into place",
},
&cli.BoolFlag{
Name: "no-local-storage",
Usage: "don't use storageminer repo for sector storage",
},
&cli.StringFlag{
Name: "gas-premium",
Usage: "set gas premium for initialization messages in AttoFIL",
Value: "0",
},
&cli.StringFlag{
Name: "from",
Usage: "select which address to send actor creation message from",
},
},
Subcommands: []*cli.Command{
initRestoreCmd,
},
Action: func(cctx *cli.Context) error {
log.Info("Initializing lotus miner")
sectorSizeInt, err := units.RAMInBytes(cctx.String("sector-size"))
if err != nil {
return err
}
ssize := abi.SectorSize(sectorSizeInt)
gasPrice, err := types.BigFromString(cctx.String("gas-premium"))
if err != nil {
return xerrors.Errorf("failed to parse gas-price flag: %s", err)
}
symlink := cctx.Bool("symlink-imported-sectors")
if symlink {
log.Info("will attempt to symlink to imported sectors")
}
ctx := lcli.ReqContext(cctx)
log.Info("Checking proof parameters")
if err := paramfetch.GetParams(ctx, build.ParametersJSON(), uint64(ssize)); err != nil {
return xerrors.Errorf("fetching proof parameters: %w", err)
}
log.Info("Trying to connect to full node RPC")
api, closer, err := lcli.GetFullNodeAPI(cctx) // TODO: consider storing full node address in config
if err != nil {
return err
}
defer closer()
log.Info("Checking full node sync status")
if !cctx.Bool("genesis-miner") && !cctx.Bool("nosync") {
if err := lcli.SyncWait(ctx, api, false); err != nil {
return xerrors.Errorf("sync wait: %w", err)
}
}
log.Info("Checking if repo exists")
repoPath := cctx.String(FlagMinerRepo)
r, err := repo.NewFS(repoPath)
if err != nil {
return err
}
ok, err := r.Exists()
if err != nil {
return err
}
if ok {
return xerrors.Errorf("repo at '%s' is already initialized", cctx.String(FlagMinerRepo))
}
log.Info("Checking full node version")
v, err := api.Version(ctx)
if err != nil {
return err
}
if !v.APIVersion.EqMajorMinor(build.FullAPIVersion) {
return xerrors.Errorf("Remote API version didn't match (expected %s, remote %s)", build.FullAPIVersion, v.APIVersion)
}
log.Info("Initializing repo")
if err := r.Init(repo.StorageMiner); err != nil {
return err
}
{
lr, err := r.Lock(repo.StorageMiner)
if err != nil {
return err
}
var localPaths []stores.LocalPath
if pssb := cctx.StringSlice("pre-sealed-sectors"); len(pssb) != 0 {
log.Infof("Setting up storage config with presealed sectors: %v", pssb)
for _, psp := range pssb {
psp, err := homedir.Expand(psp)
if err != nil {
return err
}
localPaths = append(localPaths, stores.LocalPath{
Path: psp,
})
}
}
if !cctx.Bool("no-local-storage") {
b, err := json.MarshalIndent(&stores.LocalStorageMeta{
ID: stores.ID(uuid.New().String()),
Weight: 10,
CanSeal: true,
CanStore: true,
}, "", " ")
if err != nil {
return xerrors.Errorf("marshaling storage config: %w", err)
}
if err := ioutil.WriteFile(filepath.Join(lr.Path(), "sectorstore.json"), b, 0644); err != nil {
return xerrors.Errorf("persisting storage metadata (%s): %w", filepath.Join(lr.Path(), "sectorstore.json"), err)
}
localPaths = append(localPaths, stores.LocalPath{
Path: lr.Path(),
})
}
if err := lr.SetStorage(func(sc *stores.StorageConfig) {
sc.StoragePaths = append(sc.StoragePaths, localPaths...)
}); err != nil {
return xerrors.Errorf("set storage config: %w", err)
}
if err := lr.Close(); err != nil {
return err
}
}
if err := storageMinerInit(ctx, cctx, api, r, ssize, gasPrice); err != nil {
log.Errorf("Failed to initialize lotus-miner: %+v", err)
path, err := homedir.Expand(repoPath)
if err != nil {
return err
}
log.Infof("Cleaning up %s after attempt...", path)
if err := os.RemoveAll(path); err != nil {
log.Errorf("Failed to clean up failed storage repo: %s", err)
}
return xerrors.Errorf("Storage-miner init failed")
}
// TODO: Point to setting storage price, maybe do it interactively or something
log.Info("Miner successfully created, you can now start it with 'lotus-miner run'")
return nil
},
}
查看飞狐浏览器:搜索地址 f3qimpukscd75m5mdjfabcjsmkeirfnimvgz6fzfbh3kpwqmgcxdfingttdkke6lb2nghr3ousdp674tohk76a
发现创建新矿工会消耗这个地址一点点矿工费:0.712 - 0.000002344188202536 - 0.000000002099831168 = 0.711997653711966
后来又转入两个Fil,新余额为 2.711997653711966
127 启动 miner
nohup lotus-miner run > /root/miner.log &
代码实现:cmd/lotus-storage-miner/run.go
var runCmd = &cli.Command{
Name: "run",
Usage: "Start a lotus miner process",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "miner-api",
Usage: "2345",
},
&cli.BoolFlag{
Name: "enable-gpu-proving",
Usage: "enable use of GPU for mining operations",
Value: true,
},
&cli.BoolFlag{
Name: "nosync",
Usage: "don't check full-node sync status",
},
&cli.BoolFlag{
Name: "manage-fdlimit",
Usage: "manage open file limit",
Value: true,
},
},
Action: func(cctx *cli.Context) error {
if !cctx.Bool("enable-gpu-proving") {
err := os.Setenv("BELLMAN_NO_GPU", "true")
if err != nil {
return err
}
}
nodeApi, ncloser, err := lcli.GetFullNodeAPI(cctx)
if err != nil {
return xerrors.Errorf("getting full node api: %w", err)
}
defer ncloser()
ctx := lcli.DaemonContext(cctx)
// Register all metric views
if err := view.Register(
metrics.DefaultViews...,
); err != nil {
log.Fatalf("Cannot register the view: %v", err)
}
v, err := nodeApi.Version(ctx)
if err != nil {
return err
}
if cctx.Bool("manage-fdlimit") {
if _, _, err := ulimit.ManageFdLimit(); err != nil {
log.Errorf("setting file descriptor limit: %s", err)
}
}
if v.APIVersion != build.FullAPIVersion {
return xerrors.Errorf("lotus-daemon API version doesn't match: expected: %s", api.Version{APIVersion: build.FullAPIVersion})
}
log.Info("Checking full node sync status")
if !cctx.Bool("nosync") {
if err := lcli.SyncWait(ctx, nodeApi, false); err != nil {
return xerrors.Errorf("sync wait: %w", err)
}
}
minerRepoPath := cctx.String(FlagMinerRepo)
r, err := repo.NewFS(minerRepoPath)
if err != nil {
return err
}
ok, err := r.Exists()
if err != nil {
return err
}
if !ok {
return xerrors.Errorf("repo at '%s' is not initialized, run 'lotus-miner init' to set it up", minerRepoPath)
}
shutdownChan := make(chan struct{})
var minerapi api.StorageMiner
stop, err := node.New(ctx,
node.StorageMiner(&minerapi),
node.Override(new(dtypes.ShutdownChan), shutdownChan),
node.Online(),
node.Repo(r),
node.ApplyIf(func(s *node.Settings) bool { return cctx.IsSet("miner-api") },
node.Override(new(dtypes.APIEndpoint), func() (dtypes.APIEndpoint, error) {
return multiaddr.NewMultiaddr("/ip4/127.0.0.1/tcp/" + cctx.String("miner-api"))
})),
node.Override(new(api.FullNode), nodeApi),
)
if err != nil {
return xerrors.Errorf("creating node: %w", err)
}
endpoint, err := r.APIEndpoint()
if err != nil {
return xerrors.Errorf("getting API endpoint: %w", err)
}
// Bootstrap with full node
remoteAddrs, err := nodeApi.NetAddrsListen(ctx)
if err != nil {
return xerrors.Errorf("getting full node libp2p address: %w", err)
}
if err := minerapi.NetConnect(ctx, remoteAddrs); err != nil {
return xerrors.Errorf("connecting to full node (libp2p): %w", err)
}
log.Infof("Remote version %s", v)
lst, err := manet.Listen(endpoint)
if err != nil {
return xerrors.Errorf("could not listen: %w", err)
}
mux := mux.NewRouter()
rpcServer := jsonrpc.NewServer()
rpcServer.Register("Filecoin", apistruct.PermissionedStorMinerAPI(metrics.MetricedStorMinerAPI(minerapi)))
mux.Handle("/rpc/v0", rpcServer)
mux.PathPrefix("/remote").HandlerFunc(minerapi.(*impl.StorageMinerAPI).ServeRemote)
mux.PathPrefix("/").Handler(http.DefaultServeMux) // pprof
ah := &auth.Handler{
Verify: minerapi.AuthVerify,
Next: mux.ServeHTTP,
}
srv := &http.Server{
Handler: ah,
BaseContext: func(listener net.Listener) context.Context {
ctx, _ := tag.New(context.Background(), tag.Upsert(metrics.APIInterface, "lotus-miner"))
return ctx
},
}
sigChan := make(chan os.Signal, 2)
go func() {
select {
case sig := <-sigChan:
log.Warnw("received shutdown", "signal", sig)
case <-shutdownChan:
log.Warn("received shutdown")
}
log.Warn("Shutting down...")
if err := stop(context.TODO()); err != nil {
log.Errorf("graceful shutting down failed: %s", err)
}
if err := srv.Shutdown(context.TODO()); err != nil {
log.Errorf("shutting down RPC server failed: %s", err)
}
log.Warn("Graceful shutdown successful")
}()
signal.Notify(sigChan, syscall.SIGTERM, syscall.SIGINT)
return srv.Serve(manet.NetListener(lst))
},
}
lotus-miner 配置文件 /date/miner/config.toml
# Default config:
[API]
ListenAddress = "/ip4/192.168.1.127/tcp/2345/http"
RemoteListenAddress = "192.168.1.127:2345"
# Timeout = "30s"
#
[Libp2p]
ListenAddresses = ["/ip4/0.0.0.0/tcp/42991", "/ip6/::/tcp/42991"]
AnnounceAddresses = ["/ip4/116.132.221.24/tcp/42991"]
# NoAnnounceAddresses = []
# ConnMgrLow = 150
# ConnMgrHigh = 180
# ConnMgrGrace = "20s"
#
[Pubsub]
# Bootstrapper = false
# RemoteTracer = "/dns4/pubsub-tracer.filecoin.io/tcp/4001/p2p/QmTd6UvR47vUidRNZ1ZKXHrAFhqTJAD27rKL9XYghEKgKX"
#
[Dealmaking]
# ConsiderOnlineStorageDeals = true
# ConsiderOfflineStorageDeals = true
# ConsiderOnlineRetrievalDeals = true
# ConsiderOfflineRetrievalDeals = true
# PieceCidBlocklist = []
# ExpectedSealDuration = "24h0m0s"
# Filter = ""
# RetrievalFilter = ""
#
[Sealing]
# MaxWaitDealsSectors = 2
# MaxSealingSectors = 0
# MaxSealingSectorsForDeals = 0
# WaitDealsDelay = "6h0m0s"
#
[Storage]
# ParallelFetchLimit = 10
AllowAddPiece = false
AllowPreCommit1 = false
AllowPreCommit2 = false
AllowCommit = false
AllowUnseal = false
AllowMyScheduler = false
#
[Fees]
# MaxPreCommitGasFee = "0.025 FIL"
# MaxCommitGasFee = "0.05 FIL"
# MaxWindowPoStGasFee = "5 FIL"
# MaxPublishDealsFee = "0.05 FIL"
# MaxMarketBalanceAddFee = "0.007 FIL"
#
修改:/date/miner/api
/ip4/192.168.1.127/tcp/2345/http
重启:lotus-miner
lotus-miner stop
nohup lotus-miner run > /root/miner.log &
worker 112 环境变量:token是假的
export PATH=$PATH:/usr/local/go/bin
export PATH="$HOME/.cargo/bin:$PATH"
export FIL_PROOFS_PARAMETER_CACHE=/var/tmp/filecoin-proof-parameters
export IPFS_GATEWAY=https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/
export FIL_PROOFS_PARENT_CACHE=/var/tmp/filecoin-parents
export FIL_PROOFS_USE_GPU_COLUMN_BUILDER=1
export FIL_PROOFS_USE_GPU_TREE_BUILDER=1
export FIL_PROOFS_MAXIMIZE_CACHING=1
export FIL_PROOFS_USE_MULTICORE_SDR=1
export RUST_BACKTRACE=full
export RUST_LOG=debug
export FIL_PROOFS_SDR_PARENTS_CACHE_SIZE=1073741824
export MINER_API_INFO=eyJhbGciOiJIUzI1NiIsInR5c.eyJBb6WyJyZWFkIiwid3JpdGUiLCJzaWduIiwiYWRtaW4iXX0.G-wQuid3bXGnCBYE6dgo5ixki_Sp0xFItCXk:/ip4/192.168.1.127/tcp/2345/http
启动 112上的worker 脚本
source /etc/profile
nohup env FIL_PROOFS_USE_GPU_COLUMN_BUILDER=1 FIL_PROOFS_USE_GPU_TREE_BUILDER=1 GPU_DEVICE_ORDINAL=0 CUDA_VISIBLE_DEVICES=0 FIL_PROOFS_USE_MULTICORE_SDR=1 taskset -c 0,1,2,3 lotus-worker --worker-repo=/worker/worker2345 --miner-repo=/data/miner run --listen=192.168.1.112:2345 --addpiece=true --precommit1=true --precommit2=true --commit=true --parallel-fetch-limit=2 >> /root/worker2345.log 2>&1 &
第一次查看lotus-miner info
root@lotus_127:~# lotus-miner info
Full node: [sync ok]
Miner: f085415
Sector Size: 32 GiB
Byte Power: 0 B / 1.053 EiB (0.0000%)
Actual Power: 0 / 1.05 Ei (0.0000%)
Committed: 0 B
Proving: 0 B
Below minimum power threshold, no blocks will be won
Deals: 0, 0 B
Active: 0, 0 B (Verified: 0, 0 B)
Miner Balance: 0 FIL
PreCommit: 0 FIL
Pledge: 0 FIL
Vesting: 0 FIL
Available: 0 FIL
Worker Balance: 2.711997653711966296 FIL
Market (Escrow): 0 FIL
Market (Locked): 0 FIL
Expected Seal Duration: 24h0m0s
Sectors:
Total: 0
代码实现:cmd/lotus-storage-miner/info.go
var infoCmd = &cli.Command{
Name: "info",
Usage: "Print miner info",
Subcommands: []*cli.Command{
infoAllCmd,
},
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "hide-sectors-info",
Usage: "hide sectors info",
},
},
Action: infoCmdAct,
}
func infoCmdAct(cctx *cli.Context) error {
color.NoColor = !cctx.Bool("color")
nodeApi, closer, err := lcli.GetStorageMinerAPI(cctx)
if err != nil {
return err
}
defer closer()
api, acloser, err := lcli.GetFullNodeAPI(cctx)
if err != nil {
return err
}
defer acloser()
ctx := lcli.ReqContext(cctx)
fmt.Print("Full node: ")
head, err := api.ChainHead(ctx)
if err != nil {
return err
}
switch {
case time.Now().Unix()-int64(head.MinTimestamp()) < int64(build.BlockDelaySecs*3/2): // within 1.5 epochs
fmt.Printf("[%s]", color.GreenString("sync ok"))
case time.Now().Unix()-int64(head.MinTimestamp()) < int64(build.BlockDelaySecs*5): // within 5 epochs
fmt.Printf("[%s]", color.YellowString("sync slow (%s behind)", time.Now().Sub(time.Unix(int64(head.MinTimestamp()), 0)).Truncate(time.Second)))
default:
fmt.Printf("[%s]", color.RedString("sync behind! (%s behind)", time.Now().Sub(time.Unix(int64(head.MinTimestamp()), 0)).Truncate(time.Second)))
}
fmt.Println()
maddr, err := getActorAddress(ctx, nodeApi, cctx.String("actor"))
if err != nil {
return err
}
mact, err := api.StateGetActor(ctx, maddr, types.EmptyTSK)
if err != nil {
return err
}
tbs := bufbstore.NewTieredBstore(apibstore.NewAPIBlockstore(api), blockstore.NewTemporary())
mas, err := miner.Load(adt.WrapStore(ctx, cbor.NewCborStore(tbs)), mact)
if err != nil {
return err
}
fmt.Printf("Miner: %s\n", color.BlueString("%s", maddr))
// Sector size
mi, err := api.StateMinerInfo(ctx, maddr, types.EmptyTSK)
if err != nil {
return err
}
fmt.Printf("Sector Size: %s\n", types.SizeStr(types.NewInt(uint64(mi.SectorSize))))
pow, err := api.StateMinerPower(ctx, maddr, types.EmptyTSK)
if err != nil {
return err
}
rpercI := types.BigDiv(types.BigMul(pow.MinerPower.RawBytePower, types.NewInt(1000000)), pow.TotalPower.RawBytePower)
qpercI := types.BigDiv(types.BigMul(pow.MinerPower.QualityAdjPower, types.NewInt(1000000)), pow.TotalPower.QualityAdjPower)
fmt.Printf("Byte Power: %s / %s (%0.4f%%)\n",
color.BlueString(types.SizeStr(pow.MinerPower.RawBytePower)),
types.SizeStr(pow.TotalPower.RawBytePower),
float64(rpercI.Int64())/10000)
fmt.Printf("Actual Power: %s / %s (%0.4f%%)\n",
color.GreenString(types.DeciStr(pow.MinerPower.QualityAdjPower)),
types.DeciStr(pow.TotalPower.QualityAdjPower),
float64(qpercI.Int64())/10000)
secCounts, err := api.StateMinerSectorCount(ctx, maddr, types.EmptyTSK)
if err != nil {
return err
}
proving := secCounts.Active + secCounts.Faulty
nfaults := secCounts.Faulty
fmt.Printf("\tCommitted: %s\n", types.SizeStr(types.BigMul(types.NewInt(secCounts.Live), types.NewInt(uint64(mi.SectorSize)))))
if nfaults == 0 {
fmt.Printf("\tProving: %s\n", types.SizeStr(types.BigMul(types.NewInt(proving), types.NewInt(uint64(mi.SectorSize)))))
} else {
var faultyPercentage float64
if secCounts.Live != 0 {
faultyPercentage = float64(10000*nfaults/secCounts.Live) / 100.
}
fmt.Printf("\tProving: %s (%s Faulty, %.2f%%)\n",
types.SizeStr(types.BigMul(types.NewInt(proving), types.NewInt(uint64(mi.SectorSize)))),
types.SizeStr(types.BigMul(types.NewInt(nfaults), types.NewInt(uint64(mi.SectorSize)))),
faultyPercentage)
}
if !pow.HasMinPower {
fmt.Print("Below minimum power threshold, no blocks will be won")
} else {
expWinChance := float64(types.BigMul(qpercI, types.NewInt(build.BlocksPerEpoch)).Int64()) / 1000000
if expWinChance > 0 {
if expWinChance > 1 {
expWinChance = 1
}
winRate := time.Duration(float64(time.Second*time.Duration(build.BlockDelaySecs)) / expWinChance)
winPerDay := float64(time.Hour*24) / float64(winRate)
fmt.Print("Expected block win rate: ")
color.Blue("%.4f/day (every %s)", winPerDay, winRate.Truncate(time.Second))
}
}
fmt.Println()
deals, err := nodeApi.MarketListIncompleteDeals(ctx)
if err != nil {
return err
}
var nactiveDeals, nVerifDeals, ndeals uint64
var activeDealBytes, activeVerifDealBytes, dealBytes abi.PaddedPieceSize
for _, deal := range deals {
ndeals++
dealBytes += deal.Proposal.PieceSize
if deal.State == storagemarket.StorageDealActive {
nactiveDeals++
activeDealBytes += deal.Proposal.PieceSize
if deal.Proposal.VerifiedDeal {
nVerifDeals++
activeVerifDealBytes += deal.Proposal.PieceSize
}
}
}
fmt.Printf("Deals: %d, %s\n", ndeals, types.SizeStr(types.NewInt(uint64(dealBytes))))
fmt.Printf("\tActive: %d, %s (Verified: %d, %s)\n", nactiveDeals, types.SizeStr(types.NewInt(uint64(activeDealBytes))), nVerifDeals, types.SizeStr(types.NewInt(uint64(activeVerifDealBytes))))
fmt.Println()
// NOTE: there's no need to unlock anything here. Funds only
// vest on deadline boundaries, and they're unlocked by cron.
lockedFunds, err := mas.LockedFunds()
if err != nil {
return xerrors.Errorf("getting locked funds: %w", err)
}
availBalance, err := mas.AvailableBalance(mact.Balance)
if err != nil {
return xerrors.Errorf("getting available balance: %w", err)
}
fmt.Printf("Miner Balance: %s\n", color.YellowString("%s", types.FIL(mact.Balance)))
fmt.Printf("\tPreCommit: %s\n", types.FIL(lockedFunds.PreCommitDeposits))
fmt.Printf("\tPledge: %s\n", types.FIL(lockedFunds.InitialPledgeRequirement))
fmt.Printf("\tVesting: %s\n", types.FIL(lockedFunds.VestingFunds))
color.Green("\tAvailable: %s", types.FIL(availBalance))
wb, err := api.WalletBalance(ctx, mi.Worker)
if err != nil {
return xerrors.Errorf("getting worker balance: %w", err)
}
color.Cyan("Worker Balance: %s", types.FIL(wb))
mb, err := api.StateMarketBalance(ctx, maddr, types.EmptyTSK)
if err != nil {
return xerrors.Errorf("getting market balance: %w", err)
}
fmt.Printf("Market (Escrow): %s\n", types.FIL(mb.Escrow))
fmt.Printf("Market (Locked): %s\n", types.FIL(mb.Locked))
fmt.Println()
sealdur, err := nodeApi.SectorGetExpectedSealDuration(ctx)
if err != nil {
return err
}
fmt.Printf("Expected Seal Duration: %s\n\n", sealdur)
if !cctx.Bool("hide-sectors-info") {
fmt.Println("Sectors:")
err = sectorsInfo(ctx, nodeApi)
if err != nil {
return err
}
}
// TODO: grab actr state / info
// * Sealed sectors (count / bytes)
// * Power
return nil
}
第一次查看存储列表
root@lotus_127:~# lotus-miner storage list
7186899a-9ca4-4574-89fd-8a4884ec8739:
[#### ] 370 GiB/3.637 TiB 9%
Unsealed: 0; Sealed: 0; Caches: 0; Reserved: 0 B
Weight: 10; Use: Seal Store
Local: /date/miner
URL: http://192.168.1.127:2345/remote
136d1159-da39-4abe-af9f-5acac9fbb9c7:
[ ] 3.743 GiB/3.637 TiB 0%
Unsealed: 0; Sealed: 0; Caches: 0; Reserved: 0 B
Weight: 10; Use: Seal
URL: http://192.168.1.112:2345/remote (latency: 1.4ms)
woker 113 环境变量 token是假的
export PATH="$HOME/.cargo/bin:$PATH"
export PATH=$PATH:/usr/local/go/bin
export FIL_PROOFS_PARAMETER_CACHE=/var/tmp/filecoin-proof-parameters
export IPFS_GATEWAY=https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/
export FIL_PROOFS_PARENT_CACHE=/var/tmp/filecoin-parents
export FIL_PROOFS_USE_GPU_COLUMN_BUILDER=1
export FIL_PROOFS_USE_GPU_TREE_BUILDER=1
export FIL_PROOFS_MAXIMIZE_CACHING=1
export FIL_PROOFS_USE_MULTICORE_SDR=1
export RUST_BACKTRACE=full
export RUST_LOG=debug
export FIL_PROOFS_SDR_PARENTS_CACHE_SIZE=1073741824
export MINER_API_INFO=eyJhbGciOiJIUzI1NiIsInR5c.eyJBb6WyJyZWFkIiwid3JpdGUiLCJzaWduIiwiYWRtaW4iXX0.G-wQuid3bXGnCBYE6dgo5ixki_Sp0xFItCXk:/ip4/192.168.1.127/tcp/2345/http
启动113上worker 脚本
#!/bin/bash
source /etc/profile
nohup env FIL_PROOFS_USE_GPU_COLUMN_BUILDER=1 FIL_PROOFS_USE_GPU_TREE_BUILDER=1 GPU_DEVICE_ORDINAL=0 CUDA_VISIBLE_DEVICES=0 FIL_PROOFS_USE_MULTICORE_SDR=1 taskset -c 0,1,2,3 lotus-worker --worker-repo=/worker/worker2345 --miner-repo=/data/miner run --listen=192.168.1.113:2345 --addpiece=true --precommit1=true --precommit2=true --commit=true --parallel-fetch-limit=2 >> /root/worker2345.log 2>&1 &
112,113启动成功后等待任务
root@lotus_112:~# tail -f worker2345.log
2020-11-24T17:12:19.907+0800 INFO badger v2@v2.2007.2/levels.go:183 All 0 tables opened in 0s
2020-11-24T17:12:19.907+0800 INFO badger v2@v2.2007.2/value.go:1158 Replaying file id: 0 at offset: 0
2020-11-24T17:12:19.907+0800 INFO badger v2@v2.2007.2/value.go:1178 Replay took: 3.106µs
2020-11-24T17:12:19.907+0800 INFO main lotus-seal-worker/main.go:390 Opening local storage; connecting to master
2020-11-24T17:12:19.909+0800 INFO main lotus-seal-worker/main.go:441 Setting up control endpoint at 192.168.1.112:2345
2020-11-24T17:12:19.911+0800 INFO main lotus-seal-worker/main.go:544 Making sure no local tasks are running
2020-11-24T17:12:20.922+0800 INFO main lotus-seal-worker/main.go:567 Worker registered successfully, waiting for tasks
2020-11-24T17:44:47.829+0800 INFO badger v2@v2.2007.2/levels.go:183 All 0 tables opened in 0s
2020-11-24T17:44:47.829+0800 INFO badger v2@v2.2007.2/value.go:1158 Replaying file id: 0 at offset: 0
2020-11-24T17:44:47.829+0800 INFO badger v2@v2.2007.2/value.go:1178 Replay took: 1.122µs
2020-11-24T17:44:47.829+0800 INFO main lotus-seal-worker/main.go:390 Opening local storage; connecting to master
2020-11-24T17:44:47.830+0800 INFO main lotus-seal-worker/main.go:441 Setting up control endpoint at 192.168.1.113:2345
2020-11-24T17:44:47.831+0800 INFO main lotus-seal-worker/main.go:544 Making sure no local tasks are running
2020-11-24T17:44:48.703+0800 INFO main lotus-seal-worker/main.go:567 Worker registered successfully, waiting for tasks
127上查看存储 lotus-miner storage list
root@lotus_127:~# lotus-miner storage list
7186899a-9ca4-4574-89fd-8a4884ec8739:
[#### ] 370.1 GiB/3.637 TiB 9%
Unsealed: 0; Sealed: 0; Caches: 0; Reserved: 0 B
Weight: 10; Use: Seal Store
Local: /date/miner
URL: http://192.168.1.127:2345/remote
136d1159-da39-4abe-af9f-5acac9fbb9c7:
[ ] 3.743 GiB/3.637 TiB 0%
Unsealed: 0; Sealed: 0; Caches: 0; Reserved: 0 B
Weight: 10; Use: Seal
URL: http://192.168.1.112:2345/remote (latency: 1.7ms)
e43c7e13-080d-4371-ba6e-53c0ee263ced:
[###### ] 449.4 GiB/3.491 TiB 12%
Unsealed: 0; Sealed: 0; Caches: 0; Reserved: 0 B
Weight: 10; Use: Seal
URL: http://192.168.1.113:2345/remote (latency: 1.8ms)
aa7e143a-33f4-4337-8b4f-85b6d41a4675:
Error: fsstat: path not found:
127 上操作 压两个扇区的任务
root@lotus_127:~# lotus-miner sectors pledge
root@lotus_127:~# lotus-miner sectors pledge
代码实现:extern/storage-sealing/garbage.go
func (m *Sealing) PledgeSector() error {
cfg, err := m.getConfig()
if err != nil {
return xerrors.Errorf("getting config: %w", err)
}
if cfg.MaxSealingSectors > 0 {
if m.stats.curSealing() > cfg.MaxSealingSectors {
return xerrors.Errorf("too many sectors sealing (curSealing: %d, max: %d)", m.stats.curSealing(), cfg.MaxSealingSectors)
}
}
go func() {
ctx := context.TODO() // we can't use the context from command which invokes
// this, as we run everything here async, and it's cancelled when the
// command exits 我们无法在调用此命令的命令中使用上下文,因为我们在此处异步运行所有内容,并且在命令退出时被取消
size := abi.PaddedPieceSize(m.sealer.SectorSize()).Unpadded()
log.Info("==========[PledgeSector] size = ",size) //add by ck
sid, err := m.sc.Next()
if err != nil {
log.Errorf("%+v", err)
return
}
log.Info("==========[PledgeSector] sid = ",sid) //add by ck
err = m.sealer.NewSector(ctx, m.minerSector(sid))
if err != nil {
log.Errorf("%+v", err)
return
}
pieces, err := m.pledgeSector(ctx, m.minerSector(sid), []abi.UnpaddedPieceSize{}, size)
if err != nil {
log.Errorf("%+v", err)
return
}
ps := make([]Piece, len(pieces))
for idx := range ps {
log.Info("==========[PledgeSector] piece = ",pieces[idx])
ps[idx] = Piece{
Piece: pieces[idx],
DealInfo: nil,
}
}
if err := m.newSectorCC(sid, ps); err != nil {
log.Errorf("%+v", err)
return
}
}()
return nil
}
观察发现:112和113各接受一个任务,miner调度日志
2020-11-24T17:51:11.173+0800 WARN advmgr sector-storage/manager.go:321 stub NewSector
2020-11-24T17:51:11.173+0800 INFO sectors storage-sealing/garbage.go:17 Pledge {{85415 0} 3}, contains []
2020-11-24T17:51:11.173+0800 DEBUG advmgr sector-storage/sched.go:676 SCHED 1 queued; 6 open windows
2020-11-24T17:51:11.177+0800 DEBUG stores stores/index.go:397 not allocating on aa7e143a-33f4-4337-8b4f-85b6d41a4675, didn't receive heartbeats for 8m26.023760511s
2020-11-24T17:51:11.179+0800 DEBUG stores stores/index.go:397 not allocating on aa7e143a-33f4-4337-8b4f-85b6d41a4675, didn't receive heartbeats for 8m26.026578043s
2020-11-24T17:51:11.182+0800 DEBUG stores stores/index.go:397 not allocating on aa7e143a-33f4-4337-8b4f-85b6d41a4675, didn't receive heartbeats for 8m26.029550835s
2020-11-24T17:51:11.185+0800 DEBUG stores stores/index.go:397 not allocating on aa7e143a-33f4-4337-8b4f-85b6d41a4675, didn't receive heartbeats for 8m26.032076989s
2020-11-24T17:51:11.185+0800 DEBUG advmgr sector-storage/sched.go:770 SCHED windows: [{allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]}]
2020-11-24T17:51:11.185+0800 DEBUG advmgr sector-storage/sched.go:771 SCHED Acceptable win: [[4 5 2 3]]
2020-11-24T17:51:11.185+0800 DEBUG advmgr sector-storage/sched.go:785 SCHED try assign sqi:0 sector 0 to window 4
2020-11-24T17:51:11.185+0800 DEBUG advmgr sector-storage/sched.go:792 SCHED ASSIGNED sqi:0 sector 0 task seal/v0/addpiece to window 4
2020-11-24T17:51:11.185+0800 DEBUG advmgr sector-storage/sched_worker.go:367 assign worker sector 0
2020-11-24T17:51:11.185+0800 DEBUG advmgr sector-storage/sched.go:676 SCHED 0 queued; 6 open windows
2020-11-24T17:51:11.185+0800 DEBUG advmgr sector-storage/sched.go:770 SCHED windows: [{allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]}]
2020-11-24T17:51:11.185+0800 DEBUG advmgr sector-storage/sched.go:771 SCHED Acceptable win: []
2020-11-24T17:51:11.186+0800 DEBUG advmgr sector-storage/sched_worker.go:277 task done {"workerid": [112,42,183,4,144,29,78,27,185,105,58,147,136,215,69,77]}
2020-11-24T17:51:11.186+0800 DEBUG advmgr sector-storage/sched.go:676 SCHED 0 queued; 6 open windows
2020-11-24T17:51:11.187+0800 DEBUG advmgr sector-storage/sched.go:770 SCHED windows: [{allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]}]
2020-11-24T17:51:11.187+0800 DEBUG advmgr sector-storage/sched.go:771 SCHED Acceptable win: []
2020-11-24T17:51:11.187+0800 DEBUG stores stores/index.go:397 not allocating on aa7e143a-33f4-4337-8b4f-85b6d41a4675, didn't receive heartbeats for 8m26.03462603s
2020-11-24T17:51:12.974+0800 WARN advmgr sector-storage/manager.go:321 stub NewSector
2020-11-24T17:51:12.974+0800 INFO sectors storage-sealing/garbage.go:17 Pledge {{85415 1} 3}, contains []
2020-11-24T17:51:12.974+0800 DEBUG advmgr sector-storage/sched.go:676 SCHED 1 queued; 6 open windows
2020-11-24T17:51:12.977+0800 DEBUG stores stores/index.go:397 not allocating on aa7e143a-33f4-4337-8b4f-85b6d41a4675, didn't receive heartbeats for 8m27.82367263s
2020-11-24T17:51:12.979+0800 DEBUG stores stores/index.go:397 not allocating on aa7e143a-33f4-4337-8b4f-85b6d41a4675, didn't receive heartbeats for 8m27.826478426s
2020-11-24T17:51:12.982+0800 DEBUG stores stores/index.go:397 not allocating on aa7e143a-33f4-4337-8b4f-85b6d41a4675, didn't receive heartbeats for 8m27.829134707s
2020-11-24T17:51:12.984+0800 DEBUG stores stores/index.go:397 not allocating on aa7e143a-33f4-4337-8b4f-85b6d41a4675, didn't receive heartbeats for 8m27.831270844s
2020-11-24T17:51:12.984+0800 DEBUG advmgr sector-storage/sched.go:770 SCHED windows: [{allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]}]
2020-11-24T17:51:12.984+0800 DEBUG advmgr sector-storage/sched.go:771 SCHED Acceptable win: [[2 3 4 5]]
2020-11-24T17:51:12.984+0800 DEBUG advmgr sector-storage/sched.go:785 SCHED try assign sqi:0 sector 1 to window 2
2020-11-24T17:51:12.984+0800 DEBUG advmgr sector-storage/sched.go:792 SCHED ASSIGNED sqi:0 sector 1 task seal/v0/addpiece to window 2
2020-11-24T17:51:12.984+0800 DEBUG advmgr sector-storage/sched_worker.go:367 assign worker sector 1
2020-11-24T17:51:12.984+0800 DEBUG advmgr sector-storage/sched.go:676 SCHED 0 queued; 6 open windows
2020-11-24T17:51:12.985+0800 DEBUG advmgr sector-storage/sched.go:770 SCHED windows: [{allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]}]
2020-11-24T17:51:12.985+0800 DEBUG advmgr sector-storage/sched.go:771 SCHED Acceptable win: []
2020-11-24T17:51:12.986+0800 DEBUG advmgr sector-storage/sched_worker.go:277 task done {"workerid": [143,37,18,255,95,106,70,69,170,79,127,28,128,165,71,96]}
2020-11-24T17:51:12.986+0800 DEBUG advmgr sector-storage/sched.go:676 SCHED 0 queued; 6 open windows
2020-11-24T17:51:12.986+0800 DEBUG advmgr sector-storage/sched.go:770 SCHED windows: [{allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]}]
2020-11-24T17:51:12.986+0800 DEBUG advmgr sector-storage/sched.go:771 SCHED Acceptable win: []
2020-11-24T17:51:12.987+0800 DEBUG stores stores/index.go:397 not allocating on aa7e143a-33f4-4337-8b4f-85b6d41a4675, didn't receive heartbeats for 8m27.833797003s
2020-11-24T17:52:00.244+0800 INFO rpc go-jsonrpc@v0.1.2-0.20201008195726-68c6a2704e49/client.go:346 rpc output message buffer {"n": 2}
2020-11-24T17:52:00.245+0800 INFO rpc go-jsonrpc@v0.1.2-0.20201008195726-68c6a2704e49/client.go:346 rpc output message buffer {"n": 2}
127查看miner info,还没发现扇区
root@lotus_127:~# lotus-miner info
Full node: [sync ok]
Miner: f085415
Sector Size: 32 GiB
Byte Power: 0 B / 1.054 EiB (0.0000%)
Actual Power: 0 / 1.05 Ei (0.0000%)
Committed: 0 B
Proving: 0 B
Below minimum power threshold, no blocks will be won
Deals: 0, 0 B
Active: 0, 0 B (Verified: 0, 0 B)
Miner Balance: 0 FIL
PreCommit: 0 FIL
Pledge: 0 FIL
Vesting: 0 FIL
Available: 0 FIL
Worker Balance: 2.711997653711966296 FIL
Market (Escrow): 0 FIL
Market (Locked): 0 FIL
Expected Seal Duration: 24h0m0s
Sectors:
Total: 0
127 上查看任务
root@lotus_127:~# lotus-miner sealing jobs
ID Sector Worker Hostname Task State Time
2787cb98 0 702ab704 lotus_113 AP running 3m17s
52b5899e 1 8f2512ff lotus_112 AP running 3m15.2s
代码实现:cmd/lotus-storage-miner/sealing.go
var sealingJobsCmd = &cli.Command{
Name: "jobs",
Usage: "list workers",
Flags: []cli.Flag{
&cli.BoolFlag{Name: "color"},
},
Action: func(cctx *cli.Context) error {
color.NoColor = !cctx.Bool("color")
nodeApi, closer, err := lcli.GetStorageMinerAPI(cctx)
if err != nil {
return err
}
defer closer()
ctx := lcli.ReqContext(cctx)
jobs, err := nodeApi.WorkerJobs(ctx)
if err != nil {
return xerrors.Errorf("getting worker jobs: %w", err)
}
type line struct {
storiface.WorkerJob
wid uuid.UUID
}
lines := make([]line, 0)
for wid, jobs := range jobs {
for _, job := range jobs {
lines = append(lines, line{
WorkerJob: job,
wid: wid,
})
}
}
// oldest first
sort.Slice(lines, func(i, j int) bool {
if lines[i].RunWait != lines[j].RunWait {
return lines[i].RunWait < lines[j].RunWait
}
if lines[i].Start.Equal(lines[j].Start) {
return lines[i].ID.ID.String() < lines[j].ID.ID.String()
}
return lines[i].Start.Before(lines[j].Start)
})
workerHostnames := map[uuid.UUID]string{}
wst, err := nodeApi.WorkerStats(ctx)
if err != nil {
return xerrors.Errorf("getting worker stats: %w", err)
}
for wid, st := range wst {
workerHostnames[wid] = st.Info.Hostname
}
tw := tabwriter.NewWriter(os.Stdout, 2, 4, 2, ' ', 0)
_, _ = fmt.Fprintf(tw, "ID\tSector\tWorker\tHostname\tTask\tState\tTime\n")
for _, l := range lines {
state := "running"
if l.RunWait > 0 {
state = fmt.Sprintf("assigned(%d)", l.RunWait-1)
}
if l.RunWait == -1 {
state = "ret-wait"
}
dur := "n/a"
if !l.Start.IsZero() {
dur = time.Now().Sub(l.Start).Truncate(time.Millisecond * 100).String()
}
_, _ = fmt.Fprintf(tw, "%s\t%d\t%s\t%s\t%s\t%s\t%s\n",
hex.EncodeToString(l.ID.ID[10:]),
l.Sector.Number,
hex.EncodeToString(l.wid[5:]),
workerHostnames[l.wid],
l.Task.Short(),
state,
dur)
}
return tw.Flush()
},
}
127 上查看存储
root@lotus_127:~# lotus-miner storage list
7186899a-9ca4-4574-89fd-8a4884ec8739:
[#### ] 370.2 GiB/3.637 TiB 9%
Unsealed: 0; Sealed: 0; Caches: 0; Reserved: 0 B
Weight: 10; Use: Seal Store
Local: /date/miner
URL: http://192.168.1.127:2345/remote
136d1159-da39-4abe-af9f-5acac9fbb9c7:
[ ] 67.74 GiB/3.637 TiB 1%
Unsealed: 0; Sealed: 0; Caches: 0; Reserved: 32 GiB
Weight: 10; Use: Seal
URL: http://192.168.1.112:2345/remote (latency: 1.3ms)
e43c7e13-080d-4371-ba6e-53c0ee263ced:
[######* ] 513.4 GiB/3.491 TiB 14%
Unsealed: 0; Sealed: 0; Caches: 0; Reserved: 32 GiB
Weight: 10; Use: Seal
URL: http://192.168.1.113:2345/remote (latency: 1.5ms)
代码实现:cmd/lotus-storage-miner/storage.go
var storageListCmd = &cli.Command{
Name: "list",
Usage: "list local storage paths",
Flags: []cli.Flag{
&cli.BoolFlag{Name: "color"},
},
Action: func(cctx *cli.Context) error {
color.NoColor = !cctx.Bool("color")
nodeApi, closer, err := lcli.GetStorageMinerAPI(cctx)
if err != nil {
return err
}
defer closer()
ctx := lcli.ReqContext(cctx)
st, err := nodeApi.StorageList(ctx)
if err != nil {
return err
}
local, err := nodeApi.StorageLocal(ctx)
if err != nil {
return err
}
type fsInfo struct {
stores.ID
sectors []stores.Decl
stat fsutil.FsStat
}
sorted := make([]fsInfo, 0, len(st))
for id, decls := range st {
st, err := nodeApi.StorageStat(ctx, id)
if err != nil {
sorted = append(sorted, fsInfo{ID: id, sectors: decls})
continue
}
sorted = append(sorted, fsInfo{id, decls, st})
}
sort.Slice(sorted, func(i, j int) bool {
if sorted[i].stat.Capacity != sorted[j].stat.Capacity {
return sorted[i].stat.Capacity > sorted[j].stat.Capacity
}
return sorted[i].ID < sorted[j].ID
})
for _, s := range sorted {
var cnt [3]int
for _, decl := range s.sectors {
for i := range cnt {
if decl.SectorFileType&(1<<i) != 0 {
cnt[i]++
}
}
}
fmt.Printf("%s:\n", s.ID)
pingStart := time.Now()
st, err := nodeApi.StorageStat(ctx, s.ID)
if err != nil {
fmt.Printf("\t%s: %s:\n", color.RedString("Error"), err)
continue
}
ping := time.Now().Sub(pingStart)
usedPercent := (st.Capacity - st.Available) * 100 / st.Capacity
percCol := color.FgGreen
switch {
case usedPercent > 98:
percCol = color.FgRed
case usedPercent > 90:
percCol = color.FgYellow
}
var barCols = int64(50)
set := (st.Capacity - st.Available) * barCols / st.Capacity
used := (st.Capacity - (st.Available + st.Reserved)) * barCols / st.Capacity
reserved := set - used
bar := strings.Repeat("#", int(used)) + strings.Repeat("*", int(reserved)) + strings.Repeat(" ", int(barCols-set))
fmt.Printf("\t[%s] %s/%s %s\n", color.New(percCol).Sprint(bar),
types.SizeStr(types.NewInt(uint64(st.Capacity-st.Available))),
types.SizeStr(types.NewInt(uint64(st.Capacity))),
color.New(percCol).Sprintf("%d%%", usedPercent))
fmt.Printf("\t%s; %s; %s; Reserved: %s\n",
color.YellowString("Unsealed: %d", cnt[0]),
color.GreenString("Sealed: %d", cnt[1]),
color.BlueString("Caches: %d", cnt[2]),
types.SizeStr(types.NewInt(uint64(st.Reserved))))
si, err := nodeApi.StorageInfo(ctx, s.ID)
if err != nil {
return err
}
fmt.Print("\t")
if si.CanSeal || si.CanStore {
fmt.Printf("Weight: %d; Use: ", si.Weight)
if si.CanSeal {
fmt.Print(color.MagentaString("Seal "))
}
if si.CanStore {
fmt.Print(color.CyanString("Store"))
}
fmt.Println("")
} else {
fmt.Print(color.HiYellowString("Use: ReadOnly"))
}
if localPath, ok := local[s.ID]; ok {
fmt.Printf("\tLocal: %s\n", color.GreenString(localPath))
}
for i, l := range si.URLs {
var rtt string
if _, ok := local[s.ID]; !ok && i == 0 {
rtt = " (latency: " + ping.Truncate(time.Microsecond*100).String() + ")"
}
fmt.Printf("\tURL: %s%s\n", l, rtt) // TODO; try pinging maybe?? print latency?
}
fmt.Println()
}
return nil
},
}
扇区 0 和 1目前都处于 AP状态,查看磁盘上的文件树
root@lotus_112:/worker/worker2345# tree -sh -D
.
├── [ 27 Nov 24 17:12] api
├── [ 10 Nov 24 17:12] cache
├── [ 19 Nov 24 17:12] config.toml
├── [ 67 Nov 24 17:12] datastore
│ ├── [ 72 Nov 24 17:12] client
│ │ ├── [ 20 Nov 24 17:12] 000000.vlog
│ │ ├── [ 28 Nov 24 17:12] KEYREGISTRY
│ │ ├── [ 5 Nov 24 17:12] LOCK
│ │ └── [ 16 Nov 24 17:12] MANIFEST
│ ├── [ 132 Nov 24 17:12] metadata
│ │ ├── [ 151 Nov 24 17:51] 000002.log
│ │ ├── [ 16 Nov 24 17:12] CURRENT
│ │ ├── [ 16 Nov 24 17:12] CURRENT.bak
│ │ ├── [ 0 Nov 24 17:12] LOCK
│ │ ├── [ 930 Nov 24 17:12] LOG
│ │ └── [ 41 Nov 24 17:12] MANIFEST-000003
│ └── [ 92 Nov 24 17:12] staging
│ ├── [ 20 Nov 24 17:12] 000000.vlog
│ ├── [ 28 Nov 24 17:12] KEYREGISTRY
│ ├── [ 5 Nov 24 17:12] LOCK
│ └── [ 16 Nov 24 17:12] MANIFEST
├── [ 10 Nov 24 17:12] keystore
├── [ 357 Nov 24 17:12] myscheduler.json
├── [ 0 Nov 24 17:12] repo.lock
├── [ 10 Nov 24 17:12] sealed
├── [ 106 Nov 24 17:12] sectorstore.json
├── [ 74 Nov 24 17:12] storage.json
├── [ 136 Nov 24 17:12] token
└── [ 33 Nov 24 17:51] unsealed
└── [ 32G Nov 24 17:58] s-t085415-1
8 directories, 22 files
root@lotus_113:/worker/worker2345# tree -sh -D
.
├── [ 27 Nov 24 17:44] api
├── [ 6 Nov 24 17:44] cache
├── [ 19 Nov 24 17:44] config.toml
├── [ 67 Nov 24 17:44] datastore
│ ├── [ 92 Nov 24 17:44] client
│ │ ├── [ 20 Nov 24 17:44] 000000.vlog
│ │ ├── [ 28 Nov 24 17:44] KEYREGISTRY
│ │ ├── [ 6 Nov 24 17:44] LOCK
│ │ └── [ 16 Nov 24 17:44] MANIFEST
│ ├── [ 132 Nov 24 17:44] metadata
│ │ ├── [ 151 Nov 24 17:51] 000002.log
│ │ ├── [ 16 Nov 24 17:44] CURRENT
│ │ ├── [ 16 Nov 24 17:44] CURRENT.bak
│ │ ├── [ 0 Nov 24 17:44] LOCK
│ │ ├── [ 929 Nov 24 17:44] LOG
│ │ └── [ 41 Nov 24 17:44] MANIFEST-000003
│ └── [ 92 Nov 24 17:44] staging
│ ├── [ 20 Nov 24 17:44] 000000.vlog
│ ├── [ 28 Nov 24 17:44] KEYREGISTRY
│ ├── [ 6 Nov 24 17:44] LOCK
│ └── [ 16 Nov 24 17:44] MANIFEST
├── [ 6 Nov 24 17:44] keystore
├── [ 357 Nov 24 17:44] myscheduler.json
├── [ 0 Nov 24 17:44] repo.lock
├── [ 6 Nov 24 17:44] sealed
├── [ 106 Nov 24 17:44] sectorstore.json
├── [ 74 Nov 24 17:44] storage.json
├── [ 136 Nov 24 17:44] token
└── [ 33 Nov 24 17:51] unsealed
└── [ 32G Nov 24 17:59] s-t085415-0
8 directories, 22 files
root@lotus_127:/date/miner# tree -sh -D
.
├── [ 32 Nov 24 17:08] api
├── [ 10 Nov 24 16:26] cache
├── [1.3K Nov 24 16:40] config.toml
├── [ 67 Nov 24 15:45] datastore
│ ├── [ 72 Nov 24 17:07] client
│ │ ├── [ 20 Nov 24 17:07] 000000.vlog
│ │ ├── [ 28 Nov 24 15:45] KEYREGISTRY
│ │ ├── [ 5 Nov 24 17:07] LOCK
│ │ └── [ 16 Nov 24 17:07] MANIFEST
│ ├── [ 198 Nov 24 17:07] metadata
│ │ ├── [ 130 Nov 24 16:25] 000002.ldb
│ │ ├── [ 771 Nov 24 16:51] 000005.ldb
│ │ ├── [ 422 Nov 24 17:07] 000008.ldb
│ │ ├── [ 491 Nov 24 17:51] 000009.log
│ │ ├── [ 16 Nov 24 17:07] CURRENT
│ │ ├── [ 16 Nov 24 17:07] CURRENT.bak
│ │ ├── [ 0 Nov 24 15:45] LOCK
│ │ ├── [2.3K Nov 24 17:07] LOG
│ │ └── [ 422 Nov 24 17:07] MANIFEST-000010
│ └── [ 92 Nov 24 17:07] staging
│ ├── [ 20 Nov 24 17:07] 000000.vlog
│ ├── [ 28 Nov 24 15:45] KEYREGISTRY
│ ├── [ 5 Nov 24 17:07] LOCK
│ └── [ 16 Nov 24 17:07] MANIFEST
├── [ 10 Nov 24 16:26] data-transfer
├── [ 175 Nov 24 17:08] journal
│ ├── [3.6K Nov 24 16:46] lotus-journal-2020-11-24T162639+0800.ndjson
│ ├── [3.6K Nov 24 16:53] lotus-journal-2020-11-24T165319+0800.ndjson
│ └── [5.9K Nov 24 17:46] lotus-journal-2020-11-24T170858+0800.ndjson
├── [ 78 Nov 24 16:26] keystore
│ ├── [ 86 Nov 24 16:26] MF2XI2BNNJ3XILLQOJUXMYLUMU
│ └── [ 130 Nov 24 15:45] NRUWE4BSOAWWQ33TOQ
├── [ 0 Nov 24 17:07] repo.lock
├── [ 10 Nov 24 16:26] sealed
├── [ 105 Nov 24 15:45] sectorstore.json
├── [ 67 Nov 24 15:45] storage.json
├── [ 136 Nov 24 16:26] token
└── [ 10 Nov 24 16:26] unsealed
10 directories, 28 files
AP 结束,开始P1
root@lotus_127:/date/miner# lotus-miner sealing jobs
ID Sector Worker Hostname Task State Time
bd92197a 1 8f2512ff lotus_112 PC1 running 21.3s
c75a1da8 0 702ab704 lotus_113 PC1 running 16.1s
root@lotus_112:/worker/worker2345# tree -sh -D
.
├── [ 27 Nov 24 17:12] api
├── [ 33 Nov 24 18:02] cache
│ └── [ 43 Nov 24 18:02] s-t085415-1
│ └── [ 64G Nov 24 18:02] sc-02-data-tree-d.dat
├── [ 19 Nov 24 17:12] config.toml
├── [ 67 Nov 24 17:12] datastore
│ ├── [ 72 Nov 24 17:12] client
│ │ ├── [ 20 Nov 24 17:12] 000000.vlog
│ │ ├── [ 28 Nov 24 17:12] KEYREGISTRY
│ │ ├── [ 5 Nov 24 17:12] LOCK
│ │ └── [ 16 Nov 24 17:12] MANIFEST
│ ├── [ 132 Nov 24 17:12] metadata
│ │ ├── [ 614 Nov 24 18:02] 000002.log
│ │ ├── [ 16 Nov 24 17:12] CURRENT
│ │ ├── [ 16 Nov 24 17:12] CURRENT.bak
│ │ ├── [ 0 Nov 24 17:12] LOCK
│ │ ├── [ 930 Nov 24 17:12] LOG
│ │ └── [ 41 Nov 24 17:12] MANIFEST-000003
│ └── [ 92 Nov 24 17:12] staging
│ ├── [ 20 Nov 24 17:12] 000000.vlog
│ ├── [ 28 Nov 24 17:12] KEYREGISTRY
│ ├── [ 5 Nov 24 17:12] LOCK
│ └── [ 16 Nov 24 17:12] MANIFEST
├── [ 10 Nov 24 17:12] keystore
├── [ 357 Nov 24 17:12] myscheduler.json
├── [ 0 Nov 24 17:12] repo.lock
├── [ 33 Nov 24 18:02] sealed
│ └── [ 32G Nov 24 18:02] s-t085415-1
├── [ 106 Nov 24 17:12] sectorstore.json
├── [ 74 Nov 24 17:12] storage.json
├── [ 136 Nov 24 17:12] token
└── [ 33 Nov 24 17:51] unsealed
└── [ 32G Nov 24 18:02] s-t085415-1
9 directories, 24 files
root@lotus_113:/worker/worker2345# tree -sh -D
.
├── [ 27 Nov 24 17:44] api
├── [ 25 Nov 24 18:02] cache
│ └── [ 35 Nov 24 18:02] s-t085415-0
│ └── [ 64G Nov 24 18:03] sc-02-data-tree-d.dat
├── [ 19 Nov 24 17:44] config.toml
├── [ 67 Nov 24 17:44] datastore
│ ├── [ 92 Nov 24 17:44] client
│ │ ├── [ 20 Nov 24 17:44] 000000.vlog
│ │ ├── [ 28 Nov 24 17:44] KEYREGISTRY
│ │ ├── [ 6 Nov 24 17:44] LOCK
│ │ └── [ 16 Nov 24 17:44] MANIFEST
│ ├── [ 132 Nov 24 17:44] metadata
│ │ ├── [ 614 Nov 24 18:02] 000002.log
│ │ ├── [ 16 Nov 24 17:44] CURRENT
│ │ ├── [ 16 Nov 24 17:44] CURRENT.bak
│ │ ├── [ 0 Nov 24 17:44] LOCK
│ │ ├── [ 929 Nov 24 17:44] LOG
│ │ └── [ 41 Nov 24 17:44] MANIFEST-000003
│ └── [ 92 Nov 24 17:44] staging
│ ├── [ 20 Nov 24 17:44] 000000.vlog
│ ├── [ 28 Nov 24 17:44] KEYREGISTRY
│ ├── [ 6 Nov 24 17:44] LOCK
│ └── [ 16 Nov 24 17:44] MANIFEST
├── [ 6 Nov 24 17:44] keystore
├── [ 357 Nov 24 17:44] myscheduler.json
├── [ 0 Nov 24 17:44] repo.lock
├── [ 33 Nov 24 18:02] sealed
│ └── [ 32G Nov 24 18:02] s-t085415-0
├── [ 106 Nov 24 17:44] sectorstore.json
├── [ 74 Nov 24 17:44] storage.json
├── [ 136 Nov 24 17:44] token
└── [ 33 Nov 24 17:51] unsealed
└── [ 32G Nov 24 18:02] s-t085415-0
查jobs
root@lotus_127:~# lotus-miner sealing jobs
ID Sector Worker Hostname Task State Time
bd92197a 1 8f2512ff lotus_112 PC1 running 37m36.2s
c75a1da8 0 702ab704 lotus_113 PC1 running 37m31s
113 观察扇区0 cache目录文件
0-1层 19分钟 1-2层 27分钟
112 观察扇区1 cache目录文件
0-1层 17分钟,1-2层 21分钟,2-3层 20分钟
127上查看sealing workers
root@lotus_127:~# lotus-miner sealing workers
Worker 702ab704-901d-4e1b-b969-3a9388d7454d, host lotus_113
CPU: [|||||||||||||||| ] 1/4 core(s) in use
RAM: [||||||||||||||| ] 24% 125.4 GiB/503.8 GiB
VMEM: [|||||||||||||||| ] 26% 133.4 GiB/511.8 GiB
GPU: GeForce RTX 3080, not used
Types: [ precommit/1,precommit/2,unseal,addpiece,commit/1,commit/2,fetch,finalize, ]
P1Max: 7 P2Max: 1 C2Max: 1 DiskHoldMax: 0 APDiskHoldMax: 0 BindAP: false BindP1: false BindP2: false
Tasks: [ Running: | Preparing: | Capacity: 5 AP 7 P1 1 P2 1 C2 | DiskUsed: 16 APDiskUsed: 1 ]
Worker 8f2512ff-5f6a-4645-aa4f-7f1c80a54760, host lotus_112
CPU: [|||||||||||||||| ] 1/4 core(s) in use
RAM: [||||||||||||||| ] 24% 125.4 GiB/503.8 GiB
VMEM: [|||||||||||||||| ] 26% 133.4 GiB/511.8 GiB
GPU: GeForce RTX 3080, not used
Types: [ precommit/2,unseal,addpiece,commit/1,commit/2,fetch,finalize,precommit/1, ]
P1Max: 7 P2Max: 1 C2Max: 1 DiskHoldMax: 0 APDiskHoldMax: 0 BindAP: false BindP1: false BindP2: false
Tasks: [ Running: | Preparing: | Capacity: 5 AP 7 P1 1 P2 1 C2 | DiskUsed: 16 APDiskUsed: 1 ]
Worker b195b128-2fdf-4b87-b707-a3ea5430fb74, host lotus_127
CPU: [ ] 0/48 core(s) in use
RAM: [| ] 2% 10.45 GiB/503.7 GiB
VMEM: [| ] 2% 10.45 GiB/503.7 GiB
GPU: GeForce RTX 2080 Ti, not used
GPU: GeForce RTX 2080 Ti, not used
Types: [ fetch,unsealread,commit/1,finalize, ]
P1Max: 0 P2Max: 1 C2Max: 1 DiskHoldMax: 0 APDiskHoldMax: 0 BindAP: false BindP1: true BindP2: false
Tasks: [ Running: | Preparing: | Capacity: | DiskUsed: 0 APDiskUsed: 0 ]
查看 miner info
root@lotus_127:~# lotus-miner info
Full node: [sync ok]
Miner: f085415
Sector Size: 32 GiB
Byte Power: 0 B / 1.055 EiB (0.0000%)
Actual Power: 0 / 1.05 Ei (0.0000%)
Committed: 0 B
Proving: 0 B
Below minimum power threshold, no blocks will be won
Deals: 0, 0 B
Active: 0, 0 B (Verified: 0, 0 B)
Miner Balance: 0 FIL
PreCommit: 0 FIL
Pledge: 0 FIL
Vesting: 0 FIL
Available: 0 FIL
Worker Balance: 2.711997653711966296 FIL
Market (Escrow): 0 FIL
Market (Locked): 0 FIL
Expected Seal Duration: 24h0m0s
Sectors:
Total: 2
PreCommit1: 2
比较 112和113的密封速度
112 密封一层 需要20分钟
113 密封一层 需要27分钟
查看资源:
112 htop
113 htop
113 上 0扇区文件
112 上 1扇区文件
-----------------------------------2020-11-25 星期三------------------------------
继续跟进小集群:
昨天 112上跑的扇区1,113上跑的扇区0,112上速度比较快,但应该是最终失败了,113上的0扇区成功完成。
112上的1扇区被调度到113上继续跑,现在跑到了C2
127 上查看 lotus-miner info,信息解读在信息里面注释
root@lotus_127:~# lotus-miner info
Full node: [sync slow (52s behind)]
Miner: f085415 # 矿工号
Sector Size: 32 GiB # 扇区大小
Byte Power: 0 B / 1.068 EiB (0.0000%) # 字节能量,算力,密封的扇区总大小以及全网占比
Actual Power: 0 / 1.07 Ei (0.0000%) # 实际算力
Committed: 32 GiB # 已提交的算力
Proving: 0 B # 以证明的算力
Below minimum power threshold, no blocks will be won # 低于最小算力阈值,不能出块
Deals: 0, 0 B # 订单量
Active: 0, 0 B (Verified: 0, 0 B) # 已激活验证的订单量
Miner Balance: 0.368571146750810506 FIL #矿工的总余额
PreCommit: 0.10488498073156947 FIL # 预提交质押
Pledge: 0.220646829234548252 FIL # 扇区质押
Vesting: 0 FIL
Available: 0.043039336784692784 FIL # 有效余额
Worker Balance: 2.343420739714275956 FIL # 工人余额
Market (Escrow): 0 FIL # 第三方托管金额
Market (Locked): 0 FIL # 锁定金额
Expected Seal Duration: 24h0m0s # 预计密封时间
Sectors: # 扇区信息
Total: 2 # 总数
Proving: 1 # 证明中
Committing: 1 # 提交中
Miner Balance = PreCommit + Pledge + Vesting + Available
查看 127 miner路径下的文件
root@lotus_127:/date/miner# tree -sh -D
.
├── [ 32 Nov 24 17:08] api
├── [ 53 Nov 25 1:22] cache
│ ├── [ 10 Nov 25 1:22] fetching
│ └── [4.0K Nov 25 1:22] s-t085415-0
│ ├── [ 64 Nov 25 1:22] p_aux
│ ├── [9.1M Nov 25 1:22] sc-02-data-tree-r-last-0.dat
│ ├── [9.1M Nov 25 1:22] sc-02-data-tree-r-last-1.dat
│ ├── [9.1M Nov 25 1:22] sc-02-data-tree-r-last-2.dat
│ ├── [9.1M Nov 25 1:22] sc-02-data-tree-r-last-3.dat
│ ├── [9.1M Nov 25 1:22] sc-02-data-tree-r-last-4.dat
│ ├── [9.1M Nov 25 1:22] sc-02-data-tree-r-last-5.dat
│ ├── [9.1M Nov 25 1:22] sc-02-data-tree-r-last-6.dat
│ ├── [9.1M Nov 25 1:22] sc-02-data-tree-r-last-7.dat
│ └── [1.1K Nov 25 1:22] t_aux
├── [1.3K Nov 24 16:40] config.toml
├── [ 67 Nov 24 15:45] datastore
│ ├── [ 72 Nov 24 17:07] client
│ │ ├── [ 20 Nov 24 17:07] 000000.vlog
│ │ ├── [ 28 Nov 24 15:45] KEYREGISTRY
│ │ ├── [ 5 Nov 24 17:07] LOCK
│ │ └── [ 16 Nov 24 17:07] MANIFEST
│ ├── [ 198 Nov 24 17:07] metadata
│ │ ├── [ 130 Nov 24 16:25] 000002.ldb
│ │ ├── [ 771 Nov 24 16:51] 000005.ldb
│ │ ├── [ 422 Nov 24 17:07] 000008.ldb
│ │ ├── [561K Nov 25 13:15] 000009.log
│ │ ├── [ 16 Nov 24 17:07] CURRENT
│ │ ├── [ 16 Nov 24 17:07] CURRENT.bak
│ │ ├── [ 0 Nov 24 15:45] LOCK
│ │ ├── [2.3K Nov 24 17:07] LOG
│ │ └── [ 422 Nov 24 17:07] MANIFEST-000010
│ └── [ 92 Nov 24 17:07] staging
│ ├── [ 20 Nov 24 17:07] 000000.vlog
│ ├── [ 28 Nov 24 15:45] KEYREGISTRY
│ ├── [ 5 Nov 24 17:07] LOCK
│ └── [ 16 Nov 24 17:07] MANIFEST
├── [ 10 Nov 24 16:26] data-transfer
├── [ 175 Nov 24 17:08] journal
│ ├── [3.6K Nov 24 16:46] lotus-journal-2020-11-24T162639+0800.ndjson
│ ├── [3.6K Nov 24 16:53] lotus-journal-2020-11-24T165319+0800.ndjson
│ └── [ 72K Nov 25 13:16] lotus-journal-2020-11-24T170858+0800.ndjson
├── [ 78 Nov 24 16:26] keystore
│ ├── [ 86 Nov 24 16:26] MF2XI2BNNJ3XILLQOJUXMYLUMU
│ └── [ 130 Nov 24 15:45] NRUWE4BSOAWWQ33TOQ
├── [ 0 Nov 24 17:07] repo.lock
├── [ 53 Nov 25 1:22] sealed
│ ├── [ 10 Nov 25 1:22] fetching
│ └── [ 32G Nov 25 1:22] s-t085415-0
├── [ 105 Nov 24 15:45] sectorstore.json
├── [ 67 Nov 24 15:45] storage.json
├── [ 136 Nov 24 16:26] token
└── [ 10 Nov 24 16:26] unsealed
13 directories, 39 files
113 1扇区上跑完C2,又跑1扇区的P1了,这是为什么?看 113上的worker日志
2020-11-25T13:13:45.714 INFO bellperson::groth16::prover > prover time: 2320.337593677s
2020-11-25T13:13:48.587 INFO filecoin_proofs::api::seal > snark_proof:finish
2020-11-25T13:13:48.587 INFO filecoin_proofs::api::seal > verify_seal:start: SectorId(1)
2020-11-25T13:13:48.587 INFO filecoin_proofs::caches > trying parameters memory cache for: STACKED[34359738368]-verifying-key
2020-11-25T13:13:48.587 INFO filecoin_proofs::caches > found params in memory cache for STACKED[34359738368]-verifying-key
2020-11-25T13:13:48.587 INFO filecoin_proofs::api::seal > got verifying key (34359738368) while verifying seal
2020-11-25T13:13:48.603 INFO filecoin_proofs::api::seal > verify_seal:finish: SectorId(1)
2020-11-25T13:13:48.603 INFO filecoin_proofs::api::seal > seal_commit_phase2:finish: SectorId(1)
2020-11-25T13:13:48.603 INFO filcrypto::proofs::api > seal_commit_phase2: finish
2020-11-25T13:15:48.023+0800 DEBUG advmgr sector-storage/worker_local.go:153 acquired sector {{85415 1} 3} (e:1; a:0): {{0 0} /worker/worker2345/unsealed/s-t085415-1 }
2020-11-25T13:15:48.025+0800 INFO stores stores/local.go:608 remove /worker/worker2345/sealed/s-t085415-1
2020-11-25T13:15:51.091+0800 INFO stores stores/local.go:608 remove /worker/worker2345/cache/s-t085415-1
2020-11-25T13:16:10.463+0800 DEBUG advmgr sector-storage/worker_local.go:153 acquired sector {{85415 1} 3} (e:1; a:6): {{0 0} /worker/worker2345/unsealed/s-t085415-1 /worker/worker2345/sealed/s-t085415-1 /worker/worker2345/cache/s-t085415-1}
2020-11-25T13:16:10.463 INFO filcrypto::proofs::api > seal_pre_commit_phase1: start
2020-11-25T13:16:10.463 INFO filecoin_proofs::api::seal > seal_pre_commit_phase1:start: SectorId(1)
2020-11-25T13:16:47.414 INFO filecoin_proofs::api::seal > building merkle tree for the original data
2020-11-25T13:18:23.488 INFO filecoin_proofs::api::seal > verifying pieces
2020-11-25T13:18:23.488 INFO filecoin_proofs::pieces > verifying 1 pieces
2020-11-25T13:18:23.488 INFO storage_proofs_porep::stacked::vanilla::proof > replicate_phase1
2020-11-25T13:18:23.488 INFO storage_proofs_porep::stacked::vanilla::graph > using parent_cache[1073741824 / 1073741824]
2020-11-25T13:18:23.488 INFO storage_proofs_porep::stacked::vanilla::cache > parent cache: opening /var/tmp/filecoin-parents/v28-sdr-parent-e1fa5d5b811ddbd118be3412c4a8c329156b8b8acc72632bca459455b5a05a13.cache, verify enabled: false
2020-11-25T13:18:23.488 INFO storage_proofs_porep::stacked::vanilla::proof > multi core replication
2020-11-25T13:18:23.488 INFO storage_proofs_porep::stacked::vanilla::create_label::multi > create labels
2020-11-25T13:18:23.488 DEBUG storage_proofs_porep::stacked::vanilla::cores > checked out core group 0
2020-11-25T13:18:23.488 DEBUG storage_proofs_porep::stacked::vanilla::create_label::multi > binding core in main thread
2020-11-25T13:18:23.488 DEBUG storage_proofs_porep::stacked::vanilla::cores > allowed cpuset: 0
2020-11-25T13:18:23.488 DEBUG storage_proofs_porep::stacked::vanilla::cores > binding to 0
2020-11-25T13:18:23.488 INFO storage_proofs_porep::stacked::vanilla::memory_handling > initializing cache
2020-11-25T13:18:35.450 INFO storage_proofs_porep::stacked::vanilla::create_label::multi > Layer 1
2020-11-25T13:18:35.450 INFO storage_proofs_porep::stacked::vanilla::create_label::multi > Creating labels for layer 1
2020-11-25T13:18:35.450 DEBUG storage_proofs_porep::stacked::vanilla::create_label::multi > PRODUCER NOT READY! 1
2020-11-25T13:18:35.450 DEBUG storage_proofs_porep::stacked::vanilla::create_label::multi > binding core in producer thread 2
2020-11-25T13:18:35.450 INFO storage_proofs_porep::stacked::vanilla::create_label::multi > created label runner
2020-11-25T13:18:35.451 DEBUG storage_proofs_porep::stacked::vanilla::create_label::multi > PRODUCER NOT READY! 513
2020-11-25T13:18:35.451 DEBUG storage_proofs_porep::stacked::vanilla::create_label::multi > binding core in producer thread 1
2020-11-25T13:18:35.451 INFO storage_proofs_porep::stacked::vanilla::create_label::multi > created label runner
2020-11-25T13:18:35.451 DEBUG storage_proofs_porep::stacked::vanilla::create_label::multi > binding core in producer thread 0
2020-11-25T13:18:35.451 DEBUG storage_proofs_porep::stacked::vanilla::create_label::multi > PRODUCER NOT READY! 1281
2020-11-25T13:18:35.451 DEBUG storage_proofs_porep::stacked::vanilla::cores > allowed cpuset: 1
2020-11-25T13:18:35.452 DEBUG storage_proofs_porep::stacked::vanilla::cores > binding to 1
2020-11-25T13:18:35.452 INFO storage_proofs_porep::stacked::vanilla::create_label::multi > created label runner
看一下miner对应时间段的日志,验证出错了,链上的sealed CID 不匹配,提交检查验证,无效的证明。
2020-11-25T13:13:00.351+0800 INFO rpc go-jsonrpc@v0.1.2-0.20201008195726-68c6a2704e49/client.go:346 rpc output message buffer {"n": 2}
2020-11-25T13:13:48.614+0800 WARN sectors storage-sealing/checks.go:169 on-chain sealed CID doesn't match!
2020-11-25T13:13:48.614 INFO filcrypto::proofs::api > verify_seal: start
2020-11-25T13:13:48.614 INFO filecoin_proofs::api::seal > verify_seal:start: SectorId(1)
2020-11-25T13:13:48.614 INFO filecoin_proofs::caches > trying parameters memory cache for: STACKED[34359738368]-verifying-key
2020-11-25T13:13:48.614 INFO filecoin_proofs::caches > found params in memory cache for STACKED[34359738368]-verifying-key
2020-11-25T13:13:48.614 INFO filecoin_proofs::api::seal > got verifying key (34359738368) while verifying seal
2020-11-25T13:13:48.634 INFO filecoin_proofs::api::seal > verify_seal:finish: SectorId(1)
2020-11-25T13:13:48.634 INFO filcrypto::proofs::api > verify_seal: finish
2020-11-25T13:13:48.635+0800 WARN sectors storage-sealing/fsm.go:507 sector 1 got error event sealing.SectorCommitFailed: commit check error: invalid proof (compute error?)
2020-11-25T13:13:48.647+0800 WARN sectors storage-sealing/checks.go:169 on-chain sealed CID doesn't match!
2020-11-25T13:13:48.647 INFO filcrypto::proofs::api > verify_seal: start
2020-11-25T13:13:48.647 INFO filecoin_proofs::api::seal > verify_seal:start: SectorId(1)
2020-11-25T13:13:48.647 INFO filecoin_proofs::caches > trying parameters memory cache for: STACKED[34359738368]-verifying-key
2020-11-25T13:13:48.647 INFO filecoin_proofs::caches > found params in memory cache for STACKED[34359738368]-verifying-key
2020-11-25T13:13:48.647 INFO filecoin_proofs::api::seal > got verifying key (34359738368) while verifying seal
2020-11-25T13:13:48.667 INFO filecoin_proofs::api::seal > verify_seal:finish: SectorId(1)
2020-11-25T13:13:48.667 INFO filcrypto::proofs::api > verify_seal: finish
2020-11-25T13:13:48.668+0800 INFO sectors storage-sealing/states_failed.go:26 CommitFailed(1), waiting 59.331995268s before retrying
2020-11-25T13:14:00.270+0800 INFO rpc go-jsonrpc@v0.1.2-0.20201008195726-68c6a2704e49/client.go:346 rpc output message buffer {"n": 2}
扇区1看来是有问题,验证过不去,是删除呢,还是继续呢?跟112的机器有关系吗?
看一下浏览器:
注意余额变化: 0.1154 + 0.1154 + 0.1378 = 0.3686
得到结论:PreCommitSector + PreCommitSector + ProveCommitSector 预提交扇区质押和提交扇区证明质押 加起来等于矿工账号的总余额,
其中一部分用于质押 0.3255 ,
一部分直接释放:0.0430
质押比例是 88%,后续观察看看怎么释放的......
现在再压一个新扇区:2,112接收,进入P1,113目前正在密封扇区1,如果这次再失败,就把扇区1删除
37分钟,112上的扇区2的第一层还没出来
root@lotus_127:~# lotus-miner sealing jobs
ID Sector Worker Hostname Task State Time
afb0502a 1 702ab704 lotus_113 PC1 running 2h21m47s
be345d2b 2 8f2512ff lotus_112 PC1 running 38m18.8s
113 接了扇区 3 的 AP
root@lotus_127:~# lotus-miner sealing jobs
ID Sector Worker Hostname Task State Time
afb0502a 1 702ab704 lotus_113 PC1 running 2h24m18.9s
be345d2b 2 8f2512ff lotus_112 PC1 running 40m50.7s
be4e81c9 3 702ab704 lotus_113 AP running 53.8s
113 1和3扇区P1数据
---------------------------2020-12-28------------------------------------
昨天从IDC拖回两台矿机服务器,包括112,所以112退出了本集群,那就追踪127 miner和113 worker。
终于跑成功一个扇区,并连续三天通过了时空证明。追踪一下资金流转:
root@lotus_127:~# lotus-miner info
Full node: [sync ok]
Miner: f085415
Sector Size: 32 GiB
Byte Power: 32 GiB / 1.106 EiB (0.0000%)
Actual Power: 32 Gi / 1.11 Ei (0.0000%)
Committed: 32 GiB
Proving: 32 GiB
Below minimum power threshold, no blocks will be won
Deals: 0, 0 B
Active: 0, 0 B (Verified: 0, 0 B)
Miner Balance: 0.263686166019241036 FIL
PreCommit: 0 FIL
Pledge: 0.220646829234548252 FIL
Vesting: 0 FIL
Available: 0.043039336784692784 FIL
Worker Balance: 1.650123503981364189 FIL
Market (Escrow): 0 FIL
Market (Locked): 0 FIL
Expected Seal Duration: 24h0m0s
Sectors:
Total: 4
Proving: 1
PreCommit1: 1
Removed: 1
SealPreCommit1Failed: 1
矿工f085415明细
矿工钱包明细
通过跟踪观察,f085415矿工账号的余额有变化:之前是0.3686,现在是0.2637,其中可用余额0.0430没变化,质押余额减少 0.3255-0.2206 = 0.1049
命令行 lotus-miner info 前后对比发现,PreCommit质押的 0.10488变成0了,看看这是为什么?0.10488这个钱去哪里了呢?被惩罚了吗?
Worker Balance 原来 2.3434 现在 1.6501:资金流向
给自己转了0.5,给钱包测试转了0.5,剩下的是三次提交post矿工费
查看下存储状态,工作状态,扇区状态
root@lotus_127:~# lotus-miner storage list
7186899a-9ca4-4574-89fd-8a4884ec8739:
[###### ] 452.9 GiB/3.637 TiB 12%
Unsealed: 0; Sealed: 1; Caches: 1; Reserved: 0 B
Weight: 10; Use: Seal Store
Local: /date/miner
URL: http://192.168.1.127:2345/remote
e43c7e13-080d-4371-ba6e-53c0ee263ced:
[################### ] 1.354 TiB/3.491 TiB 38%
Unsealed: 1; Sealed: 1; Caches: 1; Reserved: 0 B
Weight: 10; Use: Seal
URL: http://192.168.1.113:2345/remote (latency: 1.4ms)
136d1159-da39-4abe-af9f-5acac9fbb9c7:
Error: do request: Get "http://192.168.1.112:2345/remote/stat/136d1159-da39-4abe-af9f-5acac9fbb9c7": dial tcp 192.168.1.112:2345: connect: no route to host:
aa7e143a-33f4-4337-8b4f-85b6d41a4675:
Error: fsstat: path not found:
root@lotus_127:~# lotus-miner sealing jobs
ID Sector Worker Hostname Task State Time
be345d2b 2 8f2512ff PC1 running 69h12m23.9s
root@lotus_127:~# lotus-miner sectors list
ID State OnChain Active Expiration Deals
0 Proving YES YES 1816552 (in 1 year 24 weeks) CC
2 PreCommit1 NO NO n/a CC
3 SealPreCommit1Failed NO NO n/a CC
127上 0 扇区密封完成的证明数据,在cache下 s-t085415-0/p_aux t_aux,然后8个9.1M的sc-02-data-tree-r-last-x.dat文件,这写是计算完成的mkertree文件
127 上 0扇区的密封完的数据文件在:sealed目录下:s-t085415
127 上查看扇区状态,扇区1已被删除,2和3仍然处于 P1状态,没有上链,没有激活
扇区 1 的数据还在,跑到C2的第1层,扇区3重新跑P1了,
127上操作删除扇区2和3
root@lotus_127:/date/miner# lotus-miner sectors update-state --really-do-it 1 Removed
root@lotus_127:/date/miner# lotus-miner sectors update-state --really-do-it 2 Removed
删除没有效果,过一会,扇区1和3的状态依然是P1,数据也在
重启127上的miner和113上的worker,在看看: jobs 扇区2变成了 ret-wait,扇区3还是跑P1
再删一下扇区2,miner日志报错
2020-11-28T16:53:17.006+0800 DEBUG advmgr sector-storage/sched.go:676 SCHED 1 queued; 4 open windows
2020-11-28T16:53:17.012+0800 DEBUG advmgr sector-storage/sched.go:770 SCHED windows: [{allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]}]
2020-11-28T16:53:17.012+0800 DEBUG advmgr sector-storage/sched.go:771 SCHED Acceptable win: [[2 3]]
2020-11-28T16:53:17.012+0800 DEBUG advmgr sector-storage/sched.go:785 SCHED try assign sqi:0 sector 2 to window 2
2020-11-28T16:53:17.013+0800 DEBUG advmgr sector-storage/sched.go:792 SCHED ASSIGNED sqi:0 sector 2 task seal/v0/precommit/1 to window 2
2020-11-28T16:53:17.013+0800 DEBUG advmgr sector-storage/sched_worker.go:367 assign worker sector 2
2020-11-28T16:53:17.013+0800 DEBUG advmgr sector-storage/sched.go:676 SCHED 0 queued; 4 open windows
2020-11-28T16:53:17.013+0800 DEBUG advmgr sector-storage/sched.go:770 SCHED windows: [{allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]}]
2020-11-28T16:53:17.013+0800 DEBUG advmgr sector-storage/sched.go:771 SCHED Acceptable win: []
2020-11-28T16:53:17.016+0800 DEBUG advmgr sector-storage/sched_worker.go:277 task done {"workerid": [77,143,212,168,107,241,64,123,181,183,248,2,164,38,196,172]}
2020-11-28T16:53:17.017+0800 WARN advmgr sector-storage/manager_calltracker.go:149 canceling started (not running) work %sseal/v0/precommit/1([[{"ID":{"Miner":85415,"Number":2},"ProofType":8},"wGGBQBhh0ZLTvpjwhPcYEqQW1w99sWfXxcZcDksGb4U=",[{"Size":34359738368,"PieceCID":{"/":"baga6ea4seaqao7s73y24kcutaosvacpdjgfe5pw76ooefnyqw4ynr3d2y6x2mpq"}}]]])
2020-11-28T16:53:17.017+0800 DEBUG advmgr sector-storage/sched.go:676 SCHED 0 queued; 4 open windows
2020-11-28T16:53:17.017+0800 DEBUG advmgr sector-storage/sched.go:770 SCHED windows: [{allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]}]
2020-11-28T16:53:17.017+0800 DEBUG advmgr sector-storage/sched.go:771 SCHED Acceptable win: []
2020-11-28T16:53:17.018+0800 WARN sectors storage-sealing/fsm.go:507 sector 2 got error event sealing.SectorSealPreCommit1Failed: seal pre commit(1) failed: storage call error 0: failed to acquire sector {85415 2} from remote(1): sector not found
2020-11-28T16:53:17.020+0800 INFO sectors storage-sealing/states_failed.go:26 SealPreCommit1Failed(2), waiting 59.979693702s before retrying
2020-11-28T16:54:17.002+0800 ERROR evtsm go-statemachine@v0.0.0-20200925024713-05bd7c71fbfe/machine.go:83 Executing event planner failed: running planner for state Removed failed:
github.com/filecoin-project/lotus/extern/storage-sealing.(*Sealing).plan
/root/lotus-xiong/extern/storage-sealing/fsm.go:214
- didn't expect any events in state Removed, got [{User:{}}]:
github.com/filecoin-project/lotus/extern/storage-sealing.final
/root/lotus-xiong/extern/storage-sealing/fsm.go:466
127上查看扇区列表,sectors list 扇区2没了
127上设置接单真实数据 开始密封前的等待时间
lotus-miner sectors set-seal-delay 15
127 压两个新扇区,miner日志
2020-11-28T17:08:03.386+0800 WARN advmgr sector-storage/manager.go:321 stub NewSector
2020-11-28T17:08:03.387+0800 INFO sectors storage-sealing/garbage.go:17 Pledge {{85415 4} 8}, contains []
2020-11-28T17:08:03.387+0800 DEBUG advmgr sector-storage/sched.go:676 SCHED 1 queued; 4 open windows
2020-11-28T17:08:03.391+0800 DEBUG advmgr sector-storage/sched.go:770 SCHED windows: [{allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]}]
2020-11-28T17:08:03.391+0800 DEBUG advmgr sector-storage/sched.go:771 SCHED Acceptable win: [[2 3]]
2020-11-28T17:08:03.391+0800 DEBUG advmgr sector-storage/sched.go:785 SCHED try assign sqi:0 sector 4 to window 2
2020-11-28T17:08:03.391+0800 DEBUG advmgr sector-storage/sched.go:792 SCHED ASSIGNED sqi:0 sector 4 task seal/v0/addpiece to window 2
2020-11-28T17:08:03.391+0800 DEBUG advmgr sector-storage/sched_worker.go:367 assign worker sector 4
2020-11-28T17:08:03.391+0800 DEBUG advmgr sector-storage/sched.go:676 SCHED 0 queued; 4 open windows
2020-11-28T17:08:03.392+0800 DEBUG advmgr sector-storage/sched.go:770 SCHED windows: [{allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]}]
2020-11-28T17:08:03.392+0800 DEBUG advmgr sector-storage/sched.go:771 SCHED Acceptable win: []
2020-11-28T17:08:03.392+0800 DEBUG advmgr sector-storage/sched_worker.go:277 task done {"workerid": [77,143,212,168,107,241,64,123,181,183,248,2,164,38,196,172]}
2020-11-28T17:08:03.392+0800 DEBUG advmgr sector-storage/sched.go:676 SCHED 0 queued; 4 open windows
2020-11-28T17:08:03.393+0800 DEBUG advmgr sector-storage/sched.go:770 SCHED windows: [{allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]}]
2020-11-28T17:08:03.393+0800 DEBUG advmgr sector-storage/sched.go:771 SCHED Acceptable win: []
2020-11-28T17:08:05.791+0800 WARN advmgr sector-storage/manager.go:321 stub NewSector
2020-11-28T17:08:05.792+0800 INFO sectors storage-sealing/garbage.go:17 Pledge {{85415 5} 8}, contains []
2020-11-28T17:08:05.792+0800 DEBUG advmgr sector-storage/sched.go:676 SCHED 1 queued; 4 open windows
2020-11-28T17:08:05.797+0800 DEBUG advmgr sector-storage/sched.go:770 SCHED windows: [{allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]}]
2020-11-28T17:08:05.797+0800 DEBUG advmgr sector-storage/sched.go:771 SCHED Acceptable win: [[2 3]]
2020-11-28T17:08:05.797+0800 DEBUG advmgr sector-storage/sched.go:785 SCHED try assign sqi:0 sector 5 to window 2
2020-11-28T17:08:05.797+0800 DEBUG advmgr sector-storage/sched.go:792 SCHED ASSIGNED sqi:0 sector 5 task seal/v0/addpiece to window 2
2020-11-28T17:08:05.797+0800 DEBUG advmgr sector-storage/sched_worker.go:367 assign worker sector 5
2020-11-28T17:08:05.797+0800 DEBUG advmgr sector-storage/sched.go:676 SCHED 0 queued; 4 open windows
2020-11-28T17:08:05.797+0800 DEBUG advmgr sector-storage/sched.go:770 SCHED windows: [{allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]}]
2020-11-28T17:08:05.797+0800 DEBUG advmgr sector-storage/sched.go:771 SCHED Acceptable win: []
2020-11-28T17:08:05.798+0800 DEBUG advmgr sector-storage/sched_worker.go:277 task done {"workerid": [77,143,212,168,107,241,64,123,181,183,248,2,164,38,196,172]}
2020-11-28T17:08:05.798+0800 DEBUG advmgr sector-storage/sched.go:676 SCHED 0 queued; 4 open windows
2020-11-28T17:08:05.798+0800 DEBUG advmgr sector-storage/sched.go:770 SCHED windows: [{allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]} {allocated:{memUsedMin:0 memUsedMax:0 gpuUsed:false cpuUse:0 preCommit1Used:0 preCommit2Used:0 commit2Used:0 apUsed:0 cond:<nil>} todo:[]}]
2020-11-28T17:08:05.798+0800 DEBUG advmgr sector-storage/sched.go:771 SCHED Acceptable win: []
127 查看jobs
127 查看 sealing workers
113 查看worker日志
2020-11-28T17:22:08.151 INFO filcrypto::proofs::api > generate_data_commitment: start
2020-11-28T17:22:08.151 INFO filecoin_proofs::api::seal > compute_comm_d:start
2020-11-28T17:22:08.151 INFO filecoin_proofs::pieces > verifying 8192 pieces
2020-11-28T17:22:08.153 INFO filecoin_proofs::api::seal > compute_comm_d:finish
2020-11-28T17:22:08.153 INFO filcrypto::proofs::api > generate_data_commitment: finish
2020-11-28T17:22:08.180+0800 DEBUG advmgr sector-storage/worker_local.go:153 acquired sector {{85415 4} 8} (e:1; a:0): {{0 0} /worker/worker2345/unsealed/s-t085415-4 }
2020-11-28T17:22:08.185+0800 DEBUG advmgr sector-storage/worker_local.go:153 acquired sector {{85415 4} 8} (e:1; a:6): {{0 0} /worker/worker2345/unsealed/s-t085415-4 /worker/worker2345/sealed/s-t085415-4 /worker/worker2345/cache/s-t085415-4}
2020-11-28T17:22:08.185 INFO filcrypto::proofs::api > seal_pre_commit_phase1: start
2020-11-28T17:22:08.185 INFO filecoin_proofs::api::seal > seal_pre_commit_phase1:start: SectorId(4)
2020-11-28T17:22:13.029 INFO filecoin_proofs::api > generate_piece_commitment:start
2020-11-28T17:22:13.109 INFO filecoin_proofs::api > generate_piece_commitment:finish
2020-11-28T17:22:13.116 INFO filcrypto::proofs::api > generate_data_commitment: start
2020-11-28T17:22:13.116 INFO filecoin_proofs::api::seal > compute_comm_d:start
2020-11-28T17:22:13.116 INFO filecoin_proofs::pieces > verifying 8192 pieces
2020-11-28T17:22:13.118 INFO filecoin_proofs::api::seal > compute_comm_d:finish
2020-11-28T17:22:13.118 INFO filcrypto::proofs::api > generate_data_commitment: finish
2020-11-28T17:22:13.143+0800 DEBUG advmgr sector-storage/worker_local.go:153 acquired sector {{85415 5} 8} (e:1; a:0): {{0 0} /worker/worker2345/unsealed/s-t085415-5 }
2020-11-28T17:22:13.148+0800 DEBUG advmgr sector-storage/worker_local.go:153 acquired sector {{85415 5} 8} (e:1; a:6): {{0 0} /worker/worker2345/unsealed/s-t085415-5 /worker/worker2345/sealed/s-t085415-5 /worker/worker2345/cache/s-t085415-5}
2020-11-28T17:22:13.148 INFO filcrypto::proofs::api > seal_pre_commit_phase1: start
2020-11-28T17:22:13.148 INFO filecoin_proofs::api::seal > seal_pre_commit_phase1:start: SectorId(5)
2020-11-28T17:22:53.728 INFO filecoin_proofs::api::seal > building merkle tree for the original data
2020-11-28T17:22:54.407 INFO filecoin_proofs::api::seal > building merkle tree for the original data
113 查看文件目录
root@lotus_113:/worker/worker2345# tree -shD
.
├── [ 27 Nov 28 16:37] api
├── [ 79 Nov 28 17:22] cache
│ ├── [ 111 Nov 28 17:31] s-t085415-3
│ │ ├── [ 32G Nov 28 17:00] sc-02-data-layer-1.dat
│ │ ├── [ 32G Nov 28 17:31] sc-02-data-layer-2.dat
│ │ └── [ 64G Nov 28 16:40] sc-02-data-tree-d.dat
│ ├── [ 43 Nov 28 17:22] s-t085415-4
│ │ └── [ 64G Nov 28 17:30] sc-02-data-tree-d.dat
│ └── [ 35 Nov 28 17:22] s-t085415-5
│ └── [ 64G Nov 28 17:30] sc-02-data-tree-d.dat
├── [ 19 Nov 24 17:44] config.toml
├── [ 67 Nov 24 17:44] datastore
│ ├── [ 92 Nov 28 16:37] client
│ │ ├── [ 20 Nov 28 16:30] 000000.vlog
│ │ ├── [ 28 Nov 24 17:44] KEYREGISTRY
│ │ ├── [ 5 Nov 28 16:37] LOCK
│ │ └── [ 16 Nov 28 16:37] MANIFEST
│ ├── [ 198 Nov 28 16:37] metadata
│ │ ├── [4.6K Nov 25 17:17] 000004.ldb
│ │ ├── [ 979 Nov 28 15:34] 000007.ldb
│ │ ├── [ 470 Nov 28 16:37] 000010.ldb
│ │ ├── [7.9K Nov 28 17:22] 000011.log
│ │ ├── [ 16 Nov 28 16:37] CURRENT
│ │ ├── [ 16 Nov 28 16:37] CURRENT.bak
│ │ ├── [ 0 Nov 24 17:44] LOCK
│ │ ├── [2.7K Nov 28 16:37] LOG
│ │ └── [ 597 Nov 28 16:37] MANIFEST-000012
│ └── [ 92 Nov 28 16:37] staging
│ ├── [ 20 Nov 28 16:30] 000000.vlog
│ ├── [ 28 Nov 24 17:44] KEYREGISTRY
│ ├── [ 5 Nov 28 16:37] LOCK
│ └── [ 16 Nov 28 16:37] MANIFEST
├── [ 6 Nov 24 17:44] keystore
├── [ 357 Nov 24 17:44] myscheduler.json
├── [ 0 Nov 28 16:37] repo.lock
├── [ 102 Nov 28 17:22] sealed
│ ├── [ 32G Nov 25 17:19] s-t085415-1
│ ├── [ 32G Nov 28 16:38] s-t085415-3
│ ├── [ 32G Nov 28 17:22] s-t085415-4
│ └── [ 32G Nov 28 17:22] s-t085415-5
├── [ 106 Nov 24 17:44] sectorstore.json
├── [ 74 Nov 24 17:44] storage.json
├── [ 136 Nov 28 16:37] token
└── [ 99 Nov 28 17:08] unsealed
├── [ 10 Nov 24 23:28] fetching
├── [ 32G Nov 25 15:50] s-t085415-3
├── [ 32G Nov 28 17:22] s-t085415-4
└── [ 32G Nov 28 17:22] s-t085415-5
12 directories, 36 files
root@lotus_113:/worker# ls
filecoin-parents worker2345 worker2345.old
root@lotus_113:/worker# cd worker2345
root@lotus_113:/worker/worker2345# tree -shD
.
├── [ 27 Nov 28 16:37] api
├── [ 79 Nov 28 17:22] cache
│ ├── [ 213 Nov 28 18:57] s-t085415-3
│ │ ├── [ 32G Nov 28 17:00] sc-02-data-layer-1.dat
│ │ ├── [ 32G Nov 28 17:31] sc-02-data-layer-2.dat
│ │ ├── [ 32G Nov 28 18:00] sc-02-data-layer-3.dat
│ │ ├── [ 32G Nov 28 18:29] sc-02-data-layer-4.dat
│ │ ├── [ 32G Nov 28 18:57] sc-02-data-layer-5.dat
│ │ └── [ 64G Nov 28 16:40] sc-02-data-tree-d.dat
│ ├── [ 145 Nov 28 18:50] s-t085415-4
│ │ ├── [ 32G Nov 28 17:53] sc-02-data-layer-1.dat
│ │ ├── [ 32G Nov 28 18:22] sc-02-data-layer-2.dat
│ │ ├── [ 32G Nov 28 18:50] sc-02-data-layer-3.dat
│ │ └── [ 64G Nov 28 17:30] sc-02-data-tree-d.dat
│ └── [ 125 Nov 28 18:48] s-t085415-5
│ ├── [ 32G Nov 28 17:51] sc-02-data-layer-1.dat
│ ├── [ 32G Nov 28 18:19] sc-02-data-layer-2.dat
│ ├── [ 32G Nov 28 18:48] sc-02-data-layer-3.dat
│ └── [ 64G Nov 28 17:30] sc-02-data-tree-d.dat
├── [ 19 Nov 24 17:44] config.toml
├── [ 67 Nov 24 17:44] datastore
│ ├── [ 92 Nov 28 16:37] client
│ │ ├── [ 20 Nov 28 16:30] 000000.vlog
│ │ ├── [ 28 Nov 24 17:44] KEYREGISTRY
│ │ ├── [ 5 Nov 28 16:37] LOCK
│ │ └── [ 16 Nov 28 16:37] MANIFEST
│ ├── [ 198 Nov 28 16:37] metadata
│ │ ├── [4.6K Nov 25 17:17] 000004.ldb
│ │ ├── [ 979 Nov 28 15:34] 000007.ldb
│ │ ├── [ 470 Nov 28 16:37] 000010.ldb
│ │ ├── [7.9K Nov 28 17:22] 000011.log
│ │ ├── [ 16 Nov 28 16:37] CURRENT
│ │ ├── [ 16 Nov 28 16:37] CURRENT.bak
│ │ ├── [ 0 Nov 24 17:44] LOCK
│ │ ├── [2.7K Nov 28 16:37] LOG
│ │ └── [ 597 Nov 28 16:37] MANIFEST-000012
│ └── [ 92 Nov 28 16:37] staging
│ ├── [ 20 Nov 28 16:30] 000000.vlog
│ ├── [ 28 Nov 24 17:44] KEYREGISTRY
│ ├── [ 5 Nov 28 16:37] LOCK
│ └── [ 16 Nov 28 16:37] MANIFEST
├── [ 6 Nov 24 17:44] keystore
├── [ 357 Nov 24 17:44] myscheduler.json
├── [ 0 Nov 28 16:37] repo.lock
├── [ 79 Nov 28 17:36] sealed
│ ├── [ 32G Nov 28 16:38] s-t085415-3
│ ├── [ 32G Nov 28 17:22] s-t085415-4
│ └── [ 32G Nov 28 17:22] s-t085415-5
├── [ 106 Nov 24 17:44] sectorstore.json
├── [ 74 Nov 24 17:44] storage.json
├── [ 136 Nov 28 16:37] token
└── [ 99 Nov 28 17:08] unsealed
├── [ 10 Nov 24 23:28] fetching
├── [ 32G Nov 25 15:50] s-t085415-3
├── [ 32G Nov 28 17:22] s-t085415-4
└── [ 32G Nov 28 17:22] s-t085415-5
12 directories, 44 files