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

membership #175

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ build/.*
.vscode
/venv
scratchpad
node_modules

# to ensure tests build: itests/ go test -c .
/itests/itests.test
Expand All @@ -24,4 +25,6 @@ scratchpad
# in dirty git state if removed from the docker context
!extern/filecoin-ffi/rust/filecoin.pc

node_modules
# Premium smart contract deployment
/premium/sol/deployments/

1 change: 1 addition & 0 deletions cmd/curio/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func main() {
fetchParamCmd,
ffiCmd,
calcCmd,
premiumCmd,
}

jaeger := tracing.SetupJaegerTracing("curio")
Expand Down
45 changes: 45 additions & 0 deletions cmd/curio/premium.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package main

import (
"fmt"

"github.com/urfave/cli/v2"

"github.com/filecoin-project/curio/deps"
"github.com/filecoin-project/curio/premium"
)

var premiumCmd = &cli.Command{
Name: "premium",
Usage: "View premium information",
Subcommands: []*cli.Command{
{
Name: "id",
Usage: "Get the current premium ID. Ensure all miner addresses are in the base layer.",
Action: getID,
Flags: []cli.Flag{
&cli.StringSliceFlag{
Name: "layers",
Usage: "list of layers to be interpreted (atop defaults). Includes: base",
EnvVars: []string{"CURIO_LAYERS"},
Aliases: []string{"l", "layer"},
},
},
},
},
}

func getID(cctx *cli.Context) error {
db, err := deps.MakeDB(cctx)
if err != nil {
return err
}

layers := append([]string{"base"}, cctx.StringSlice("layers")...)
cfg, err := deps.GetConfig(cctx.Context, layers, db)
if err != nil {
return err
}
fmt.Println(premium.GetCurrentID(cfg))
return nil
}
1 change: 1 addition & 0 deletions cmd/sptool/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func main() {
spcli.InfoCmd(SPTActorGetter),
sectorsCmd,
provingCmd,
premiumCmd,
//multiSigCmd,
}

Expand Down
Loading
Loading