Documentation ¶
Index ¶
- type Miner
- func (m *Miner) AllocatePiece(size abi.UnpaddedPieceSize) (sectorNum abi.SectorNumber, offset uint64, err error)
- func (m *Miner) ForceSectorState(ctx context.Context, num abi.SectorNumber, state fsm.SectorState) error
- func (m *Miner) GetSectorInfo(sectorNum abi.SectorNumber) (fsm.SectorInfo, error)
- func (m *Miner) ListSectors() ([]fsm.SectorInfo, error)
- func (m *Miner) PledgeSector(ctx context.Context) error
- func (m *Miner) Run(ctx context.Context) error
- func (m *Miner) SealPiece(ctx context.Context, size abi.UnpaddedPieceSize, r io.Reader, ...) error
- func (m *Miner) Stop(ctx context.Context) error
- type MinerAddressGetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Miner ¶
type Miner struct {
// contains filtered or unexported fields
}
func NewMiner ¶
func NewMiner(api node.Interface, minerAddressGetter MinerAddressGetter, dst datastore.Batching, mgr sectorstorage.SectorManager, sid fsm.SectorIDCounter, ver ffiwrapper.Verifier, pcp fsm.PreCommitPolicy) *Miner
func (*Miner) AllocatePiece ¶
func (m *Miner) AllocatePiece(size abi.UnpaddedPieceSize) (sectorNum abi.SectorNumber, offset uint64, err error)
AllocatePiece produces information about where a piece of a given size can be written.
TODO: This signature doesn't make much sense. Returning a sector ID here means that we won't have the ability to move the piece around (i.e. do intelligent bin packing) after allocating. -- @laser
func (*Miner) ForceSectorState ¶
func (m *Miner) ForceSectorState(ctx context.Context, num abi.SectorNumber, state fsm.SectorState) error
ForceSectorState puts a sector with given ID into the given state.
func (*Miner) GetSectorInfo ¶
func (m *Miner) GetSectorInfo(sectorNum abi.SectorNumber) (fsm.SectorInfo, error)
GetSectorInfo produces information about a sector managed by this storage miner, or an error if the miner does not manage a sector with the provided identity.
func (*Miner) ListSectors ¶
func (m *Miner) ListSectors() ([]fsm.SectorInfo, error)
ListSectors lists all the sectors managed by this storage miner (sealed or otherwise).
func (*Miner) PledgeSector ¶
PledgeSector allocates a new sector, fills it with self-deal junk, and seals that sector.
func (*Miner) Run ¶
Run starts the Miner, which causes it (and its collaborating objects) to start listening for sector state-transitions. It is undefined behavior to call this method more than once. It is undefined behavior to call this method concurrently with any other Miner method. This method blocks until all sectors have been restarted (in the finite-state machine), and returns any preflight check-errors or errors encountered when restarting sectors.
func (*Miner) SealPiece ¶
func (m *Miner) SealPiece(ctx context.Context, size abi.UnpaddedPieceSize, r io.Reader, sectorNum abi.SectorNumber, deal fsm.DealInfo) error
SealPiece writes the provided piece to a newly-created sector which it immediately seals.
func (*Miner) Stop ¶
Stop causes the miner to stop listening for sector state transitions. It is undefined behavior to call this method before calling Start. It is undefined behavior to call this method more than once. It is undefined behavior to call this method concurrently with any other Miner method.