Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Miner filters in storage attach #386

Merged
merged 2 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions cmd/curio/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ over time
Name: "deny-types",
Usage: "file types to deny storing in this path",
},
&cli.StringSliceFlag{
Name: "allow-miners",
Usage: "miners to allow storing in this path",
},
&cli.StringSliceFlag{
Name: "deny-miners",
Usage: "miners to deny storing in this path",
},
},
Action: func(cctx *cli.Context) error {
minerApi, closer, err := rpc.GetCurioAPI(cctx)
Expand Down Expand Up @@ -150,6 +158,19 @@ over time
}
}

for _, m := range cctx.StringSlice("allow-miners") {
_, err := address.NewFromString(m)
if err != nil {
return xerrors.Errorf("parsing allow-miners: %w", err)
}
}
for _, m := range cctx.StringSlice("deny-miners") {
_, err := address.NewFromString(m)
if err != nil {
return xerrors.Errorf("parsing deny-miners: %w", err)
}
}

cfg := storiface.LocalStorageMeta{
ID: storiface.ID(uuid.New().String()),
Weight: cctx.Uint64("weight"),
Expand All @@ -161,6 +182,9 @@ over time

AllowTypes: cctx.StringSlice("allow-types"),
DenyTypes: cctx.StringSlice("deny-types"),

AllowMiners: cctx.StringSlice("allow-miners"),
DenyMiners: cctx.StringSlice("deny-miners"),
}

if !(cfg.CanStore || cfg.CanSeal) {
Expand Down
22 changes: 12 additions & 10 deletions documentation/en/curio-cli/curio.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,18 @@ DESCRIPTION:


OPTIONS:
--init initialize the path first (default: false)
--weight value (for init) path weight (default: 10)
--seal (for init) use path for sealing (default: false)
--store (for init) use path for long-term storage (default: false)
--max-storage value (for init) limit storage space for sectors (expensive for very large paths!)
--groups value [ --groups value ] path group names
--allow-to value [ --allow-to value ] path groups allowed to pull data from this path (allow all if not specified)
--allow-types value [ --allow-types value ] file types to allow storing in this path
--deny-types value [ --deny-types value ] file types to deny storing in this path
--help, -h show help
--init initialize the path first (default: false)
--weight value (for init) path weight (default: 10)
--seal (for init) use path for sealing (default: false)
--store (for init) use path for long-term storage (default: false)
--max-storage value (for init) limit storage space for sectors (expensive for very large paths!)
--groups value [ --groups value ] path group names
--allow-to value [ --allow-to value ] path groups allowed to pull data from this path (allow all if not specified)
--allow-types value [ --allow-types value ] file types to allow storing in this path
--deny-types value [ --deny-types value ] file types to deny storing in this path
--allow-miners value [ --allow-miners value ] miners to allow storing in this path
--deny-miners value [ --deny-miners value ] miners to deny storing in this path
--help, -h show help
```

#### curio cli storage detach
Expand Down
Loading