remove --enable-markets flag, read from repo

This commit is contained in:
Anton Evangelatov 2021-07-02 15:08:25 +02:00
parent 724f728f60
commit ab6e01e379
3 changed files with 19 additions and 316 deletions

View File

@ -22,6 +22,7 @@ import (
"github.com/filecoin-project/lotus/lib/ulimit"
"github.com/filecoin-project/lotus/metrics"
"github.com/filecoin-project/lotus/node"
"github.com/filecoin-project/lotus/node/config"
"github.com/filecoin-project/lotus/node/modules/dtypes"
"github.com/filecoin-project/lotus/node/repo"
)
@ -43,11 +44,6 @@ var runCmd = &cli.Command{
Name: "nosync",
Usage: "don't check full-node sync status",
},
&cli.BoolFlag{
Name: "enable-markets",
Usage: "",
Value: true,
},
&cli.BoolFlag{
Name: "manage-fdlimit",
Usage: "manage open file limit",
@ -123,6 +119,23 @@ var runCmd = &cli.Command{
return xerrors.Errorf("repo at '%s' is not initialized, run 'lotus-miner init' to set it up", minerRepoPath)
}
lr, err := r.Lock(repo.StorageMiner)
if err != nil {
return err
}
c, err := lr.Config()
if err != nil {
return err
}
cfg, ok := c.(*config.StorageMiner)
if !ok {
return xerrors.Errorf("invalid config for repo, got: %T", c)
}
bootstrapLibP2P := cfg.Subsystems.EnableStorageMarket
lr.Close()
shutdownChan := make(chan struct{})
var minerapi api.StorageMiner
@ -147,15 +160,7 @@ var runCmd = &cli.Command{
return xerrors.Errorf("getting API endpoint: %w", err)
}
//lr, _ := r.Lock(repo.StorageMiner)
//c, _ := lr.Config()
//cfg, ok := c.(*config.StorageMiner)
//if !ok {
//log.Fatalf("invalid config from repo, got: %T", c)
//}
//if cfg.Subsystems.EnableStorageMarket {
if cctx.Bool("enable-markets") {
if bootstrapLibP2P {
log.Infof("Bootstrapping libp2p network with full node")
// Bootstrap with full node
@ -171,8 +176,6 @@ var runCmd = &cli.Command{
log.Infof("No markets subsystem enabled, so no libp2p network bootstrapping")
}
//_ = lr.Close()
log.Infof("Remote version %s", v)
// Instantiate the miner node handler.

BIN
dev.gen

Binary file not shown.

View File

@ -1,300 +0,0 @@
{
"NetworkVersion": 13,
"Accounts": [
{
"Type": "account",
"Balance": "50000000000000000000000000",
"Meta": {
"Owner": "t3wsuwcjemfa4puhlbi3awgahpdtkkxfbjeopzb66ddlpcophfslb4ovvbv7bebmpgvtmr6tngfdef4um7zara"
}
}
],
"Miners": [
{
"ID": "t01000",
"Owner": "t3wsuwcjemfa4puhlbi3awgahpdtkkxfbjeopzb66ddlpcophfslb4ovvbv7bebmpgvtmr6tngfdef4um7zara",
"Worker": "t3wsuwcjemfa4puhlbi3awgahpdtkkxfbjeopzb66ddlpcophfslb4ovvbv7bebmpgvtmr6tngfdef4um7zara",
"PeerId": "12D3KooWDx1q8XxEHXuGCh8nE6in1RLMGGbomLo9TjKxdZbewUea",
"MarketBalance": "0",
"PowerBalance": "0",
"SectorSize": 2048,
"Sectors": [
{
"CommR": {
"/": "bagboea4b5abcb36rlxm7ql3mjkdymhioqedmzrajnqseycnrtd5whzgxrbf5etqo"
},
"CommD": {
"/": "baga6ea4seaqgpxg3uaomxyhkpc2rexx62a7w4jeitd4rzbfg4ktaowsisqwscaq"
},
"SectorID": 0,
"Deal": {
"PieceCID": {
"/": "baga6ea4seaqgpxg3uaomxyhkpc2rexx62a7w4jeitd4rzbfg4ktaowsisqwscaq"
},
"PieceSize": 2048,
"VerifiedDeal": false,
"Client": "t3wsuwcjemfa4puhlbi3awgahpdtkkxfbjeopzb66ddlpcophfslb4ovvbv7bebmpgvtmr6tngfdef4um7zara",
"Provider": "t01000",
"Label": "0",
"StartEpoch": 0,
"EndEpoch": 9001,
"StoragePricePerEpoch": "0",
"ProviderCollateral": "0",
"ClientCollateral": "0"
},
"ProofType": 5
},
{
"CommR": {
"/": "bagboea4b5abcbsjglrcrxraosp5qd4ntfa7lyokuyyyxwsx7liaatmoaey4rs2ke"
},
"CommD": {
"/": "baga6ea4seaqjwvw2qzqy7aousluji424lqsvpvo2i2uruso4uvicfm4eogs32ly"
},
"SectorID": 1,
"Deal": {
"PieceCID": {
"/": "baga6ea4seaqjwvw2qzqy7aousluji424lqsvpvo2i2uruso4uvicfm4eogs32ly"
},
"PieceSize": 2048,
"VerifiedDeal": false,
"Client": "t3wsuwcjemfa4puhlbi3awgahpdtkkxfbjeopzb66ddlpcophfslb4ovvbv7bebmpgvtmr6tngfdef4um7zara",
"Provider": "t01000",
"Label": "1",
"StartEpoch": 0,
"EndEpoch": 9001,
"StoragePricePerEpoch": "0",
"ProviderCollateral": "0",
"ClientCollateral": "0"
},
"ProofType": 5
},
{
"CommR": {
"/": "bagboea4b5abca6omqhoiuk3gp4olq3nlxq3ivbsjphqfcmqqvtebh5xdxpiacx3n"
},
"CommD": {
"/": "baga6ea4seaqkkpsy2n3kqlnezppfvqszry32psvjatr3ur5dva3blj34sfitkgi"
},
"SectorID": 2,
"Deal": {
"PieceCID": {
"/": "baga6ea4seaqkkpsy2n3kqlnezppfvqszry32psvjatr3ur5dva3blj34sfitkgi"
},
"PieceSize": 2048,
"VerifiedDeal": false,
"Client": "t3wsuwcjemfa4puhlbi3awgahpdtkkxfbjeopzb66ddlpcophfslb4ovvbv7bebmpgvtmr6tngfdef4um7zara",
"Provider": "t01000",
"Label": "2",
"StartEpoch": 0,
"EndEpoch": 9001,
"StoragePricePerEpoch": "0",
"ProviderCollateral": "0",
"ClientCollateral": "0"
},
"ProofType": 5
},
{
"CommR": {
"/": "bagboea4b5abcaqstvnte4h5hyscfadixlqtpwpeqgzthuom2bv5bcwfe23p5yja3"
},
"CommD": {
"/": "baga6ea4seaqahsm5vpi7y5cviri5r6aqxrxkv7vuetrc5neg26kicqjnknssyhy"
},
"SectorID": 3,
"Deal": {
"PieceCID": {
"/": "baga6ea4seaqahsm5vpi7y5cviri5r6aqxrxkv7vuetrc5neg26kicqjnknssyhy"
},
"PieceSize": 2048,
"VerifiedDeal": false,
"Client": "t3wsuwcjemfa4puhlbi3awgahpdtkkxfbjeopzb66ddlpcophfslb4ovvbv7bebmpgvtmr6tngfdef4um7zara",
"Provider": "t01000",
"Label": "3",
"StartEpoch": 0,
"EndEpoch": 9001,
"StoragePricePerEpoch": "0",
"ProviderCollateral": "0",
"ClientCollateral": "0"
},
"ProofType": 5
},
{
"CommR": {
"/": "bagboea4b5abca2pbffycxwjt2663qbvxnyfwgx44wxffa6yvbfi52vneoewpbtil"
},
"CommD": {
"/": "baga6ea4seaqfhkkwj4qbjo7h3fluvwovjkm2zairs2s4hpw42ofqgsxhv5ahudy"
},
"SectorID": 4,
"Deal": {
"PieceCID": {
"/": "baga6ea4seaqfhkkwj4qbjo7h3fluvwovjkm2zairs2s4hpw42ofqgsxhv5ahudy"
},
"PieceSize": 2048,
"VerifiedDeal": false,
"Client": "t3wsuwcjemfa4puhlbi3awgahpdtkkxfbjeopzb66ddlpcophfslb4ovvbv7bebmpgvtmr6tngfdef4um7zara",
"Provider": "t01000",
"Label": "4",
"StartEpoch": 0,
"EndEpoch": 9001,
"StoragePricePerEpoch": "0",
"ProviderCollateral": "0",
"ClientCollateral": "0"
},
"ProofType": 5
},
{
"CommR": {
"/": "bagboea4b5abcbf37ugtzegx3r3o2vapvdi5b5kmsbsbihzf3jup24rbkmh73npzi"
},
"CommD": {
"/": "baga6ea4seaqpe434qqmqtwkwgelughhzvsw4paiejvhhdzmbexu4tyfq34pu4ka"
},
"SectorID": 5,
"Deal": {
"PieceCID": {
"/": "baga6ea4seaqpe434qqmqtwkwgelughhzvsw4paiejvhhdzmbexu4tyfq34pu4ka"
},
"PieceSize": 2048,
"VerifiedDeal": false,
"Client": "t3wsuwcjemfa4puhlbi3awgahpdtkkxfbjeopzb66ddlpcophfslb4ovvbv7bebmpgvtmr6tngfdef4um7zara",
"Provider": "t01000",
"Label": "5",
"StartEpoch": 0,
"EndEpoch": 9001,
"StoragePricePerEpoch": "0",
"ProviderCollateral": "0",
"ClientCollateral": "0"
},
"ProofType": 5
},
{
"CommR": {
"/": "bagboea4b5abcbhpeqdzlued6vhfttm34kii666yx7yfgsgh22ggt4posnzpmczsc"
},
"CommD": {
"/": "baga6ea4seaqi7gm62wcdim5wo6sw5pytfro7bduhg6puann353n6hrzkejq5kpa"
},
"SectorID": 6,
"Deal": {
"PieceCID": {
"/": "baga6ea4seaqi7gm62wcdim5wo6sw5pytfro7bduhg6puann353n6hrzkejq5kpa"
},
"PieceSize": 2048,
"VerifiedDeal": false,
"Client": "t3wsuwcjemfa4puhlbi3awgahpdtkkxfbjeopzb66ddlpcophfslb4ovvbv7bebmpgvtmr6tngfdef4um7zara",
"Provider": "t01000",
"Label": "6",
"StartEpoch": 0,
"EndEpoch": 9001,
"StoragePricePerEpoch": "0",
"ProviderCollateral": "0",
"ClientCollateral": "0"
},
"ProofType": 5
},
{
"CommR": {
"/": "bagboea4b5abcbeyhkkygqwal3yqotylwcy276z23vrmmbc46am4l2tcgdgemmxsx"
},
"CommD": {
"/": "baga6ea4seaqbcbosan5gczfwwshsybdp435isirhrtx7mbeqstzvsg357kedoaa"
},
"SectorID": 7,
"Deal": {
"PieceCID": {
"/": "baga6ea4seaqbcbosan5gczfwwshsybdp435isirhrtx7mbeqstzvsg357kedoaa"
},
"PieceSize": 2048,
"VerifiedDeal": false,
"Client": "t3wsuwcjemfa4puhlbi3awgahpdtkkxfbjeopzb66ddlpcophfslb4ovvbv7bebmpgvtmr6tngfdef4um7zara",
"Provider": "t01000",
"Label": "7",
"StartEpoch": 0,
"EndEpoch": 9001,
"StoragePricePerEpoch": "0",
"ProviderCollateral": "0",
"ClientCollateral": "0"
},
"ProofType": 5
},
{
"CommR": {
"/": "bagboea4b5abcao3ju6z2iddoo3geqxqeoyn4flswssfdt46rgdb3knglruxacerf"
},
"CommD": {
"/": "baga6ea4seaqidbukpgrforz5c7fsp4azsrtekxhn4jvevm6i27odolaaaxysmhq"
},
"SectorID": 8,
"Deal": {
"PieceCID": {
"/": "baga6ea4seaqidbukpgrforz5c7fsp4azsrtekxhn4jvevm6i27odolaaaxysmhq"
},
"PieceSize": 2048,
"VerifiedDeal": false,
"Client": "t3wsuwcjemfa4puhlbi3awgahpdtkkxfbjeopzb66ddlpcophfslb4ovvbv7bebmpgvtmr6tngfdef4um7zara",
"Provider": "t01000",
"Label": "8",
"StartEpoch": 0,
"EndEpoch": 9001,
"StoragePricePerEpoch": "0",
"ProviderCollateral": "0",
"ClientCollateral": "0"
},
"ProofType": 5
},
{
"CommR": {
"/": "bagboea4b5abcbn7h3c6usm4agt6d66qg6n27jlfyhb2revurj3zhy4bw27mpjnb3"
},
"CommD": {
"/": "baga6ea4seaql57676vo2ekforzormyz5syewhqza3wjaygjseyrmuptrgdxvsgy"
},
"SectorID": 9,
"Deal": {
"PieceCID": {
"/": "baga6ea4seaql57676vo2ekforzormyz5syewhqza3wjaygjseyrmuptrgdxvsgy"
},
"PieceSize": 2048,
"VerifiedDeal": false,
"Client": "t3wsuwcjemfa4puhlbi3awgahpdtkkxfbjeopzb66ddlpcophfslb4ovvbv7bebmpgvtmr6tngfdef4um7zara",
"Provider": "t01000",
"Label": "9",
"StartEpoch": 0,
"EndEpoch": 9001,
"StoragePricePerEpoch": "0",
"ProviderCollateral": "0",
"ClientCollateral": "0"
},
"ProofType": 5
}
]
}
],
"NetworkName": "localnet-cd5cfecc-1e68-420a-b754-7d0b427a30cd",
"VerifregRootKey": {
"Type": "multisig",
"Balance": "0",
"Meta": {
"Signers": [
"t1ceb34gnsc6qk5dt6n7xg6ycwzasjhbxm3iylkiy"
],
"Threshold": 1,
"VestingDuration": 0,
"VestingStart": 0
}
},
"RemainderAccount": {
"Type": "multisig",
"Balance": "0",
"Meta": {
"Signers": [
"t1ceb34gnsc6qk5dt6n7xg6ycwzasjhbxm3iylkiy"
],
"Threshold": 1,
"VestingDuration": 0,
"VestingStart": 0
}
}
}