remote calc winningpost proof
This commit is contained in:
parent
885ecb97ad
commit
449b33abee
@ -3,6 +3,7 @@ package api
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@ -165,6 +166,8 @@ type StorageMiner interface {
|
||||
CreateBackup(ctx context.Context, fpath string) error //perm:admin
|
||||
|
||||
CheckProvable(ctx context.Context, pp abi.RegisteredPoStProof, sectors []storage.SectorRef, expensive bool) (map[abi.SectorNumber]string, error) //perm:admin
|
||||
|
||||
ComputeProof(ctx context.Context, ssi []builtin.SectorInfo, rand abi.PoStRandomness) ([]builtin.PoStProof, error) //perm:read
|
||||
}
|
||||
|
||||
var _ storiface.WorkerReturn = *new(StorageMiner)
|
||||
|
@ -20,6 +20,7 @@ import (
|
||||
"github.com/filecoin-project/go-state-types/dline"
|
||||
"github.com/filecoin-project/lotus/api"
|
||||
apitypes "github.com/filecoin-project/lotus/api/types"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin/paych"
|
||||
"github.com/filecoin-project/lotus/chain/types"
|
||||
@ -532,6 +533,8 @@ type StorageMinerStruct struct {
|
||||
|
||||
CheckProvable func(p0 context.Context, p1 abi.RegisteredPoStProof, p2 []storage.SectorRef, p3 bool) (map[abi.SectorNumber]string, error) `perm:"admin"`
|
||||
|
||||
ComputeProof func(p0 context.Context, p1 []builtin.SectorInfo, p2 abi.PoStRandomness) ([]builtin.PoStProof, error) `perm:"read"`
|
||||
|
||||
CreateBackup func(p0 context.Context, p1 string) error `perm:"admin"`
|
||||
|
||||
DealsConsiderOfflineRetrievalDeals func(p0 context.Context) (bool, error) `perm:"admin"`
|
||||
@ -1706,6 +1709,10 @@ func (s *StorageMinerStruct) CheckProvable(p0 context.Context, p1 abi.Registered
|
||||
return s.Internal.CheckProvable(p0, p1, p2, p3)
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) ComputeProof(p0 context.Context, p1 []builtin.SectorInfo, p2 abi.PoStRandomness) ([]builtin.PoStProof, error) {
|
||||
return s.Internal.ComputeProof(p0, p1, p2)
|
||||
}
|
||||
|
||||
func (s *StorageMinerStruct) CreateBackup(p0 context.Context, p1 string) error {
|
||||
return s.Internal.CreateBackup(p0, p1)
|
||||
}
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -14,6 +14,8 @@
|
||||
* [AuthVerify](#AuthVerify)
|
||||
* [Check](#Check)
|
||||
* [CheckProvable](#CheckProvable)
|
||||
* [Compute](#Compute)
|
||||
* [ComputeProof](#ComputeProof)
|
||||
* [Create](#Create)
|
||||
* [CreateBackup](#CreateBackup)
|
||||
* [Deals](#Deals)
|
||||
@ -295,6 +297,24 @@ Response:
|
||||
}
|
||||
```
|
||||
|
||||
## Compute
|
||||
|
||||
|
||||
### ComputeProof
|
||||
|
||||
|
||||
Perms: read
|
||||
|
||||
Inputs:
|
||||
```json
|
||||
[
|
||||
null,
|
||||
null
|
||||
]
|
||||
```
|
||||
|
||||
Response: `null`
|
||||
|
||||
## Create
|
||||
|
||||
|
||||
|
@ -3,6 +3,8 @@ package impl
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"github.com/filecoin-project/lotus/chain/actors/builtin"
|
||||
"github.com/filecoin-project/lotus/chain/gen"
|
||||
"net/http"
|
||||
"os"
|
||||
"strconv"
|
||||
@ -63,7 +65,8 @@ type StorageMinerAPI struct {
|
||||
AddrSel *storage.AddressSelector
|
||||
DealPublisher *storageadapter.DealPublisher
|
||||
|
||||
DS dtypes.MetadataDS
|
||||
Epp gen.WinningPoStProver
|
||||
DS dtypes.MetadataDS
|
||||
|
||||
ConsiderOnlineStorageDealsConfigFunc dtypes.ConsiderOnlineStorageDealsConfigFunc
|
||||
SetConsiderOnlineStorageDealsConfigFunc dtypes.SetConsiderOnlineStorageDealsConfigFunc
|
||||
@ -696,4 +699,8 @@ func (sm *StorageMinerAPI) Discover(ctx context.Context) (apitypes.OpenRPCDocume
|
||||
return build.OpenRPCDiscoverJSON_Miner(), nil
|
||||
}
|
||||
|
||||
func (sm *StorageMinerAPI) ComputeProof(ctx context.Context, ssi []builtin.SectorInfo, rand abi.PoStRandomness) ([]builtin.PoStProof, error) {
|
||||
return sm.Epp.ComputeProof(ctx, ssi, rand)
|
||||
}
|
||||
|
||||
var _ api.StorageMiner = &StorageMinerAPI{}
|
||||
|
Loading…
Reference in New Issue
Block a user