diff --git a/api/api_storage.go b/api/api_storage.go index 5c41473f4..ef960edcf 100644 --- a/api/api_storage.go +++ b/api/api_storage.go @@ -58,7 +58,7 @@ type StorageMiner interface { ActorSectorSize(context.Context, address.Address) (uint64, error) // Temp api for testing - StoreGarbageData(context.Context) error + PledgeSector(context.Context) error // Get the status of a given sector by ID SectorsStatus(context.Context, uint64) (SectorInfo, error) diff --git a/api/struct.go b/api/struct.go index 12b03f4ed..c0ab86713 100644 --- a/api/struct.go +++ b/api/struct.go @@ -134,7 +134,7 @@ type StorageMinerStruct struct { ActorAddress func(context.Context) (address.Address, error) `perm:"read"` ActorSectorSize func(context.Context, address.Address) (uint64, error) `perm:"read"` - StoreGarbageData func(context.Context) error `perm:"write"` + PledgeSector func(context.Context) error `perm:"write"` SectorsStatus func(context.Context, uint64) (SectorInfo, error) `perm:"read"` SectorsList func(context.Context) ([]uint64, error) `perm:"read"` @@ -496,8 +496,8 @@ func (c *StorageMinerStruct) ActorSectorSize(ctx context.Context, addr address.A return c.Internal.ActorSectorSize(ctx, addr) } -func (c *StorageMinerStruct) StoreGarbageData(ctx context.Context) error { - return c.Internal.StoreGarbageData(ctx) +func (c *StorageMinerStruct) PledgeSector(ctx context.Context) error { + return c.Internal.PledgeSector(ctx) } // Get the status of a given sector by ID diff --git a/cmd/lotus-storage-miner/main.go b/cmd/lotus-storage-miner/main.go index 26913a17a..868ae4c8d 100644 --- a/cmd/lotus-storage-miner/main.go +++ b/cmd/lotus-storage-miner/main.go @@ -24,7 +24,7 @@ func main() { runCmd, initCmd, infoCmd, - storeGarbageCmd, + pledgeSectorCmd, sectorsCmd, } jaeger := tracing.SetupJaegerTracing("lotus") diff --git a/cmd/lotus-storage-miner/sectors.go b/cmd/lotus-storage-miner/sectors.go index 2b7a7e177..62e62f3da 100644 --- a/cmd/lotus-storage-miner/sectors.go +++ b/cmd/lotus-storage-miner/sectors.go @@ -12,7 +12,7 @@ import ( lcli "github.com/filecoin-project/lotus/cli" ) -var storeGarbageCmd = &cli.Command{ +var pledgeSectorCmd = &cli.Command{ Name: "pledge-sector", Usage: "store random data in a sector", Action: func(cctx *cli.Context) error { @@ -23,7 +23,7 @@ var storeGarbageCmd = &cli.Command{ defer closer() ctx := lcli.ReqContext(cctx) - return nodeApi.StoreGarbageData(ctx) + return nodeApi.PledgeSector(ctx) }, } diff --git a/lotuspond/front/src/StorageNode.js b/lotuspond/front/src/StorageNode.js index 7851fbb4a..c5c917778 100644 --- a/lotuspond/front/src/StorageNode.js +++ b/lotuspond/front/src/StorageNode.js @@ -37,7 +37,7 @@ class StorageNode extends React.Component { } this.loadInfo = this.loadInfo.bind(this) - this.sealGarbage = this.sealGarbage.bind(this) + this.pledgeSector = this.pledgeSector.bind(this) this.stop = this.stop.bind(this) this.connect() @@ -98,8 +98,8 @@ class StorageNode extends React.Component { this.setState({staged, statusCounts}) } - async sealGarbage() { - await this.state.client.call("Filecoin.StoreGarbageData", []) + async pledgeSector() { + await this.state.client.call("Filecoin.PledgeSector", []) } sealStaged = async () => { @@ -113,7 +113,7 @@ class StorageNode extends React.Component { render() { let runtime =
if (this.state.actor) { - const sealGarbage = [Seal Garbage] + const pledgeSector = [Pledge Sector] const sealStaged = [Seal Staged] runtime = ( @@ -121,7 +121,7 @@ class StorageNode extends React.Component {
v{this.state.version.Version}, {this.state.id.substr(-8)}, {this.state.peers} peers
Repo: LOTUS_STORAGE_PATH={this.props.node.Repo}
- {sealGarbage} {sealStaged} + {pledgeSector} {sealStaged}
diff --git a/node/impl/storminer.go b/node/impl/storminer.go index 1934bec80..29ccdddb2 100644 --- a/node/impl/storminer.go +++ b/node/impl/storminer.go @@ -143,8 +143,8 @@ func (sm *StorageMinerAPI) ActorSectorSize(ctx context.Context, addr address.Add return sm.Full.StateMinerSectorSize(ctx, addr, nil) } -func (sm *StorageMinerAPI) StoreGarbageData(ctx context.Context) error { - return sm.Miner.StoreGarbageData() +func (sm *StorageMinerAPI) PledgeSector(ctx context.Context) error { + return sm.Miner.PledgeSector() } func (sm *StorageMinerAPI) SectorsStatus(ctx context.Context, sid uint64) (api.SectorInfo, error) { diff --git a/storage/garbage.go b/storage/garbage.go index 8b60392cf..18a50a405 100644 --- a/storage/garbage.go +++ b/storage/garbage.go @@ -15,7 +15,7 @@ import ( "github.com/filecoin-project/lotus/lib/sectorbuilder" ) -func (m *Miner) storeGarbage(ctx context.Context, sectorID uint64, existingPieceSizes []uint64, sizes ...uint64) ([]Piece, error) { +func (m *Miner) pledgeSector(ctx context.Context, sectorID uint64, existingPieceSizes []uint64, sizes ...uint64) ([]Piece, error) { if len(sizes) == 0 { return nil, nil } @@ -111,7 +111,7 @@ func (m *Miner) storeGarbage(ctx context.Context, sectorID uint64, existingPiece return out, nil } -func (m *Miner) StoreGarbageData() error { +func (m *Miner) PledgeSector() error { 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 @@ -125,7 +125,7 @@ func (m *Miner) StoreGarbageData() error { return } - pieces, err := m.storeGarbage(ctx, sid, []uint64{}, size) + pieces, err := m.pledgeSector(ctx, sid, []uint64{}, size) if err != nil { log.Errorf("%+v", err) return diff --git a/storage/sector_states.go b/storage/sector_states.go index 5d2a616a8..22320abe7 100644 --- a/storage/sector_states.go +++ b/storage/sector_states.go @@ -52,7 +52,7 @@ func (m *Miner) handlePacking(ctx context.Context, sector SectorInfo) *sectorUpd log.Warnf("Creating %d filler pieces for sector %d", len(fillerSizes), sector.SectorID) } - pieces, err := m.storeGarbage(ctx, sector.SectorID, sector.existingPieces(), fillerSizes...) + pieces, err := m.pledgeSector(ctx, sector.SectorID, sector.existingPieces(), fillerSizes...) if err != nil { return sector.upd().fatal(xerrors.Errorf("filling up the sector (%v): %w", fillerSizes, err)) }