Open triplewz opened 4 years ago
I use the following code, and it works fine.
var commands = []*cli.Command{ // pointer
{
Name: "compile",
Aliases: []string{},
Usage: "compile a circuit",
Action: CompileCircuit,
},
{
Name: "trustedsetup",
Aliases: []string{},
Usage: "generate trusted setup for a circuit",
Action: TrustedSetup,
},
{
Name: "genproofs",
Aliases: []string{},
Usage: "generate the snark proofs",
Action: GenerateProofs,
},
{
Name: "verify",
Aliases: []string{},
Usage: "verify the snark proofs",
Action: VerifyProofs,
},
{
Name: "groth16",
Aliases: []string{},
Usage: "use groth16 protocol",
Subcommands: []*cli.Command{ //pointer
{
Name: "trustedsetup",
Aliases: []string{},
Usage: "generate trusted setup for a circuit",
Action: Groth16TrustedSetup,
},
{
Name: "genproofs",
Aliases: []string{},
Usage: "generate the snark proofs",
Action: Groth16GenerateProofs,
},
{
Name: "verify",
Aliases: []string{},
Usage: "verify the snark proofs",
Action: Groth16VerifyProofs,
},
},
},
}
func main() {
app := cli.NewApp()
app.Name = "go-snarks-cli"
app.Version = "0.0.3-alpha"
app.Flags = []cli.Flag{
&cli.StringFlag{Name: "config"}, //
}
app.Commands = commands
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}
Which version are you using? I've tried just now with the current master
version of this repo, and worked fine
Which version of the urfave/cli
are you using ( https://github.com/arnaucube/go-snark/blob/master/go.mod#L7 )?
Ok, I used version 2 of the urfave/cli, maybe this is the reason.
Hello, when i tried to build main.go, it showed that
What's the reason?