Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Commit

Permalink
padreader for payload data (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
hunjixin authored and ta0li committed Feb 25, 2022
1 parent 25d1a75 commit fb42451
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 2 additions & 3 deletions app/venus-sealer/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,8 @@ var initCmd = &cli.Command{
Usage: "indicate the deployment method of the venus-market, one of `solo`, `pool`, Default: `solo`",
},
&cli.StringFlag{
Name: "market-url",
Usage: "market url",
Required: true,
Name: "market-url",
Usage: "market url",
},
&cli.StringFlag{
Name: "market-token",
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ require (
github.com/filecoin-project/specs-actors/v6 v6.0.1
github.com/filecoin-project/specs-storage v0.1.1-0.20201105051918-5188d9774506
github.com/filecoin-project/venus v1.1.3-rc1
github.com/filecoin-project/venus-market v1.0.2-0.20211206084715-070874dc17eb
github.com/filecoin-project/venus-market v1.0.2-0.20211217074314-b0f03a224ab5
github.com/filecoin-project/venus-messager v1.2.2-rc1.0.20211201075617-c9dd295b905c
github.com/gbrlsnchs/jwt/v3 v3.0.0
github.com/golang/mock v1.6.0
Expand Down
10 changes: 8 additions & 2 deletions storage-sealing/deals.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package sealing

import (
"context"
"github.com/filecoin-project/go-padreader"

types2 "github.com/filecoin-project/venus-market/types"
"github.com/filecoin-project/venus-sealer/types"
Expand All @@ -19,13 +20,18 @@ func (m *Sealing) DealSector(ctx context.Context) ([]types.DealAssign, error) {

var assigned []types.DealAssign
for _, deal := range deals {
r, err := m.pieceStorage.Read(ctx, deal.PieceStorage)
r, err := m.pieceStorage.Read(ctx, deal.PieceCID.String())
if err != nil {
log.Errorf("read piece from piece storage %v", err)
continue
}

so, err := m.SectorAddPieceToAny(ctx, deal.Length.Unpadded(), r, types.PieceDealInfo{
padR, err := padreader.NewInflator(r, uint64(deal.PayloadSize), deal.PieceSize.Unpadded())
if err != nil {
return nil, err
}

so, err := m.SectorAddPieceToAny(ctx, deal.Length.Unpadded(), padR, types.PieceDealInfo{
PublishCid: &deal.PublishCid,
DealID: deal.DealID,
DealProposal: &deal.DealProposal,
Expand Down

0 comments on commit fb42451

Please sign in to comment.