feat: curio: add StorageInit api (#11918)

* feat: add StorageInit api

* remove unused variables

* fix gen check
This commit is contained in:
Lee 2024-04-26 16:26:57 +08:00 committed by GitHub
parent ec6d3e1483
commit 0f7c74e499
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 601 additions and 533 deletions

View File

@ -17,6 +17,7 @@ type Curio interface {
AllocatePieceToSector(ctx context.Context, maddr address.Address, piece PieceDealInfo, rawSize int64, source url.URL, header http.Header) (SectorOffset, error) //perm:write
StorageInit(ctx context.Context, path string, opts storiface.LocalStorageMeta) error //perm:admin
StorageAddLocal(ctx context.Context, path string) error //perm:admin
StorageDetachLocal(ctx context.Context, path string) error //perm:admin
StorageList(ctx context.Context) (map[storiface.ID][]storiface.Decl, error) //perm:admin

View File

@ -136,6 +136,8 @@ type CurioMethods struct {
StorageInfo func(p0 context.Context, p1 storiface.ID) (storiface.StorageInfo, error) `perm:"admin"`
StorageInit func(p0 context.Context, p1 string, p2 storiface.LocalStorageMeta) error `perm:"admin"`
StorageList func(p0 context.Context) (map[storiface.ID][]storiface.Decl, error) `perm:"admin"`
StorageLocal func(p0 context.Context) (map[storiface.ID]string, error) `perm:"admin"`
@ -1580,6 +1582,17 @@ func (s *CurioStub) StorageInfo(p0 context.Context, p1 storiface.ID) (storiface.
return *new(storiface.StorageInfo), ErrNotSupported
}
func (s *CurioStruct) StorageInit(p0 context.Context, p1 string, p2 storiface.LocalStorageMeta) error {
if s.Internal.StorageInit == nil {
return ErrNotSupported
}
return s.Internal.StorageInit(p0, p1, p2)
}
func (s *CurioStub) StorageInit(p0 context.Context, p1 string, p2 storiface.LocalStorageMeta) error {
return ErrNotSupported
}
func (s *CurioStruct) StorageList(p0 context.Context) (map[storiface.ID][]storiface.Decl, error) {
if s.Internal.StorageList == nil {
return *new(map[storiface.ID][]storiface.Decl), ErrNotSupported

File diff suppressed because it is too large Load Diff

View File

@ -242,7 +242,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4399"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4412"
}
},
{
@ -473,7 +473,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4410"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4423"
}
},
{
@ -572,7 +572,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4421"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4434"
}
},
{
@ -604,7 +604,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4432"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4445"
}
},
{
@ -710,7 +710,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4443"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4456"
}
},
{
@ -803,7 +803,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4454"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4467"
}
},
{
@ -887,7 +887,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4465"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4478"
}
},
{
@ -987,7 +987,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4476"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4489"
}
},
{
@ -1043,7 +1043,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4487"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4500"
}
},
{
@ -1116,7 +1116,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4498"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4511"
}
},
{
@ -1189,7 +1189,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4509"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4522"
}
},
{
@ -1236,7 +1236,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4520"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4533"
}
},
{
@ -1268,7 +1268,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4531"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4544"
}
},
{
@ -1305,7 +1305,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4553"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4566"
}
},
{
@ -1352,7 +1352,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4564"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4577"
}
},
{
@ -1392,7 +1392,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4575"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4588"
}
},
{
@ -1439,7 +1439,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4586"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4599"
}
},
{
@ -1468,7 +1468,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4597"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4610"
}
},
{
@ -1605,7 +1605,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4608"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4621"
}
},
{
@ -1634,7 +1634,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4619"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4632"
}
},
{
@ -1688,7 +1688,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4630"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4643"
}
},
{
@ -1779,7 +1779,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4641"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4654"
}
},
{
@ -1807,7 +1807,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4652"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4665"
}
},
{
@ -1897,7 +1897,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4663"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4676"
}
},
{
@ -2153,7 +2153,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4674"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4687"
}
},
{
@ -2398,7 +2398,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4685"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4698"
}
},
{
@ -2454,7 +2454,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4696"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4709"
}
},
{
@ -2501,7 +2501,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4707"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4720"
}
},
{
@ -2599,7 +2599,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4718"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4731"
}
},
{
@ -2665,7 +2665,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4729"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4742"
}
},
{
@ -2731,7 +2731,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4740"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4753"
}
},
{
@ -2840,7 +2840,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4751"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4764"
}
},
{
@ -2898,7 +2898,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4762"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4775"
}
},
{
@ -3020,7 +3020,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4773"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4786"
}
},
{
@ -3207,7 +3207,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4784"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4797"
}
},
{
@ -3411,7 +3411,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4795"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4808"
}
},
{
@ -3502,7 +3502,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4806"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4819"
}
},
{
@ -3560,7 +3560,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4817"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4830"
}
},
{
@ -3818,7 +3818,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4828"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4841"
}
},
{
@ -4093,7 +4093,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4839"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4852"
}
},
{
@ -4121,7 +4121,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4850"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4863"
}
},
{
@ -4159,7 +4159,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4861"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4874"
}
},
{
@ -4267,7 +4267,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4872"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4885"
}
},
{
@ -4305,7 +4305,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4883"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4896"
}
},
{
@ -4334,7 +4334,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4894"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4907"
}
},
{
@ -4397,7 +4397,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4905"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4918"
}
},
{
@ -4460,7 +4460,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4916"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4929"
}
},
{
@ -4505,7 +4505,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4927"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4940"
}
},
{
@ -4627,7 +4627,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4938"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4951"
}
},
{
@ -4782,7 +4782,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4949"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4962"
}
},
{
@ -4836,7 +4836,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4960"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4973"
}
},
{
@ -4890,7 +4890,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4971"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4984"
}
},
{
@ -4992,7 +4992,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4982"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4995"
}
},
{
@ -5215,7 +5215,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L4993"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5006"
}
},
{
@ -5398,7 +5398,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5004"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5017"
}
},
{
@ -5592,7 +5592,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5015"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5028"
}
},
{
@ -5638,7 +5638,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5026"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5039"
}
},
{
@ -5788,7 +5788,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5037"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5050"
}
},
{
@ -5925,7 +5925,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5048"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5061"
}
},
{
@ -5993,7 +5993,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5059"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5072"
}
},
{
@ -6110,7 +6110,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5070"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5083"
}
},
{
@ -6201,7 +6201,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5081"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5094"
}
},
{
@ -6287,7 +6287,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5092"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5105"
}
},
{
@ -6314,7 +6314,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5103"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5116"
}
},
{
@ -6341,7 +6341,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5114"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5127"
}
},
{
@ -6409,7 +6409,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5125"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5138"
}
},
{
@ -6915,7 +6915,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5136"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5149"
}
},
{
@ -7012,7 +7012,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5147"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5160"
}
},
{
@ -7112,7 +7112,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5158"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5171"
}
},
{
@ -7212,7 +7212,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5169"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5182"
}
},
{
@ -7337,7 +7337,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5180"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5193"
}
},
{
@ -7446,7 +7446,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5191"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5204"
}
},
{
@ -7549,7 +7549,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5202"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5215"
}
},
{
@ -7679,7 +7679,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5213"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5226"
}
},
{
@ -7786,7 +7786,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5224"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5237"
}
},
{
@ -7847,7 +7847,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5235"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5248"
}
},
{
@ -7915,7 +7915,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5246"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5259"
}
},
{
@ -7996,7 +7996,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5257"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5270"
}
},
{
@ -8155,7 +8155,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5268"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5281"
}
},
{
@ -8248,7 +8248,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5279"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5292"
}
},
{
@ -8449,7 +8449,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5290"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5303"
}
},
{
@ -8560,7 +8560,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5301"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5314"
}
},
{
@ -8691,7 +8691,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5312"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5325"
}
},
{
@ -8777,7 +8777,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5323"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5336"
}
},
{
@ -8804,7 +8804,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5334"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5347"
}
},
{
@ -8857,7 +8857,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5345"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5358"
}
},
{
@ -8945,7 +8945,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5356"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5369"
}
},
{
@ -9396,7 +9396,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5367"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5380"
}
},
{
@ -9563,7 +9563,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5378"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5391"
}
},
{
@ -9736,7 +9736,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5389"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5402"
}
},
{
@ -9804,7 +9804,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5400"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5413"
}
},
{
@ -9872,7 +9872,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5411"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5424"
}
},
{
@ -10033,7 +10033,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5422"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5435"
}
},
{
@ -10078,7 +10078,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5444"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5457"
}
},
{
@ -10123,7 +10123,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5455"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5468"
}
},
{
@ -10150,7 +10150,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5466"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L5479"
}
}
]

File diff suppressed because it is too large Load Diff

View File

@ -161,7 +161,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7292"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7305"
}
},
{
@ -252,7 +252,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7303"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7316"
}
},
{
@ -420,7 +420,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7314"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7327"
}
},
{
@ -447,7 +447,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7325"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7338"
}
},
{
@ -597,7 +597,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7336"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7349"
}
},
{
@ -700,7 +700,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7347"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7360"
}
},
{
@ -803,7 +803,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7358"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7371"
}
},
{
@ -925,7 +925,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7369"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7382"
}
},
{
@ -1135,7 +1135,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7380"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7393"
}
},
{
@ -1306,7 +1306,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7391"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7404"
}
},
{
@ -3350,7 +3350,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7402"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7415"
}
},
{
@ -3470,7 +3470,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7413"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7426"
}
},
{
@ -3531,7 +3531,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7424"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7437"
}
},
{
@ -3569,7 +3569,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7435"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7448"
}
},
{
@ -3729,7 +3729,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7446"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7459"
}
},
{
@ -3913,7 +3913,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7457"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7470"
}
},
{
@ -4054,7 +4054,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7468"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7481"
}
},
{
@ -4107,7 +4107,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7479"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7492"
}
},
{
@ -4250,7 +4250,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7490"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7503"
}
},
{
@ -4474,7 +4474,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7501"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7514"
}
},
{
@ -4601,7 +4601,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7512"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7525"
}
},
{
@ -4768,7 +4768,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7523"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7536"
}
},
{
@ -4895,7 +4895,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7534"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7547"
}
},
{
@ -4933,7 +4933,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7545"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7558"
}
},
{
@ -4972,7 +4972,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7556"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7569"
}
},
{
@ -4995,7 +4995,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7567"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7580"
}
},
{
@ -5034,7 +5034,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7578"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7591"
}
},
{
@ -5057,7 +5057,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7589"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7602"
}
},
{
@ -5096,7 +5096,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7600"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7613"
}
},
{
@ -5130,7 +5130,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7611"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7624"
}
},
{
@ -5184,7 +5184,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7622"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7635"
}
},
{
@ -5223,7 +5223,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7633"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7646"
}
},
{
@ -5262,7 +5262,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7644"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7657"
}
},
{
@ -5297,7 +5297,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7655"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7668"
}
},
{
@ -5477,7 +5477,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7666"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7679"
}
},
{
@ -5506,7 +5506,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7677"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7690"
}
},
{
@ -5529,7 +5529,7 @@
"deprecated": false,
"externalDocs": {
"description": "Github remote link",
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7688"
"url": "https://github.com/filecoin-project/lotus/blob/master/api/proxy_gen.go#L7701"
}
}
]

View File

@ -9,9 +9,11 @@ import (
"net/http"
"net/url"
"os"
"path/filepath"
"time"
"github.com/gbrlsnchs/jwt/v3"
"github.com/google/uuid"
"github.com/gorilla/mux"
logging "github.com/ipfs/go-log/v2"
"github.com/mitchellh/go-homedir"
@ -39,6 +41,8 @@ import (
"github.com/filecoin-project/lotus/storage/sealer/storiface"
)
const metaFile = "sectorstore.json"
var log = logging.Logger("curio/rpc")
var permissioned = os.Getenv("LOTUS_DISABLE_AUTH_PERMISSIONED") != "1"
@ -162,6 +166,40 @@ func (p *CurioAPI) Shutdown(context.Context) error {
return nil
}
func (p *CurioAPI) StorageInit(ctx context.Context, path string, opts storiface.LocalStorageMeta) error {
path, err := homedir.Expand(path)
if err != nil {
return xerrors.Errorf("expanding local path: %w", err)
}
if err := os.MkdirAll(path, 0755); err != nil {
if !os.IsExist(err) {
return err
}
}
_, err = os.Stat(filepath.Join(path, metaFile))
if !os.IsNotExist(err) {
if err == nil {
return xerrors.Errorf("path is already initialized")
}
return err
}
if opts.ID == "" {
opts.ID = storiface.ID(uuid.New().String())
}
if !(opts.CanStore || opts.CanSeal) {
return xerrors.Errorf("must specify at least one of --store or --seal")
}
b, err := json.MarshalIndent(opts, "", " ")
if err != nil {
return xerrors.Errorf("marshaling storage config: %w", err)
}
if err := os.WriteFile(filepath.Join(path, metaFile), b, 0644); err != nil {
return xerrors.Errorf("persisting storage metadata (%s): %w", filepath.Join(path, metaFile), err)
}
return nil
}
func (p *CurioAPI) StorageAddLocal(ctx context.Context, path string) error {
path, err := homedir.Expand(path)
if err != nil {

View File

@ -1,11 +1,8 @@
package main
import (
"encoding/json"
"fmt"
"math/bits"
"os"
"path/filepath"
"sort"
"strconv"
"strings"
@ -28,8 +25,6 @@ import (
"github.com/filecoin-project/lotus/storage/sealer/storiface"
)
const metaFile = "sectorstore.json"
var storageCmd = &cli.Command{
Name: "storage",
Usage: "manage sector storage",
@ -122,20 +117,6 @@ over time
}
if cctx.Bool("init") {
if err := os.MkdirAll(p, 0755); err != nil {
if !os.IsExist(err) {
return err
}
}
_, err := os.Stat(filepath.Join(p, metaFile))
if !os.IsNotExist(err) {
if err == nil {
return xerrors.Errorf("path is already initialized")
}
return err
}
var maxStor int64
if cctx.IsSet("max-storage") {
maxStor, err = units.RAMInBytes(cctx.String("max-storage"))
@ -144,7 +125,7 @@ over time
}
}
cfg := &storiface.LocalStorageMeta{
cfg := storiface.LocalStorageMeta{
ID: storiface.ID(uuid.New().String()),
Weight: cctx.Uint64("weight"),
CanSeal: cctx.Bool("seal"),
@ -158,13 +139,8 @@ over time
return xerrors.Errorf("must specify at least one of --store or --seal")
}
b, err := json.MarshalIndent(cfg, "", " ")
if err != nil {
return xerrors.Errorf("marshaling storage config: %w", err)
}
if err := os.WriteFile(filepath.Join(p, metaFile), b, 0644); err != nil {
return xerrors.Errorf("persisting storage metadata (%s): %w", filepath.Join(p, metaFile), err)
if err := minerApi.StorageInit(ctx, p, cfg); err != nil {
return xerrors.Errorf("init storage: %w", err)
}
}

View File

@ -12,6 +12,7 @@
* [StorageDetachLocal](#StorageDetachLocal)
* [StorageFindSector](#StorageFindSector)
* [StorageInfo](#StorageInfo)
* [StorageInit](#StorageInit)
* [StorageList](#StorageList)
* [StorageLocal](#StorageLocal)
* [StorageStat](#StorageStat)
@ -269,6 +270,45 @@ Response:
}
```
### StorageInit
Perms: admin
Inputs:
```json
[
"string value",
{
"ID": "76f1988b-ef30-4d7e-b3ec-9a627f4ba5a8",
"Weight": 42,
"CanSeal": true,
"CanStore": true,
"MaxStorage": 42,
"Groups": [
"string value"
],
"AllowTo": [
"string value"
],
"AllowTypes": [
"string value"
],
"DenyTypes": [
"string value"
],
"AllowMiners": [
"string value"
],
"DenyMiners": [
"string value"
]
}
]
```
Response: `{}`
### StorageList