prysm-pulse/cmd/geth/shardingcmd.go
Preston Van Loon ae1dfbbaf9 Refactor proposer
Former-commit-id: 2c934014a8624f84a33850a748dc41227f6a64e8 [formerly eebbc1a6350e0895f770c89efee80204cfd63fba]
Former-commit-id: 74dca03e825ee2a5af2f8e4bce21c8ae0cae70ee
2018-03-31 17:04:22 -04:00

47 lines
1.5 KiB
Go

package main
import (
"github.com/ethereum/go-ethereum/sharding/collator"
"github.com/ethereum/go-ethereum/sharding/proposer"
"github.com/ethereum/go-ethereum/cmd/utils"
cli "gopkg.in/urfave/cli.v1"
)
var (
collatorClientCommand = cli.Command{
Action: utils.MigrateFlags(collatorClient),
Name: "sharding-collator",
Aliases: []string{"shard-collator"},
Usage: "Start a sharding collator client",
ArgsUsage: "[endpoint]",
Flags: []cli.Flag{utils.DataDirFlag, utils.PasswordFileFlag, utils.NetworkIdFlag, utils.IPCPathFlag, utils.DepositFlag},
Category: "SHARDING COMMANDS",
Description: `
Launches a sharding collator client that connects to a running geth node and submit collations to a Sharding Manager Contract. This feature is a work in progress.
`,
}
proposerClientCommand = cli.Command{
Action: utils.MigrateFlags(proposerClient),
Name: "sharding-proposer",
Aliases: []string{"shard-proposer"},
Usage: "Start a sharding proposer client",
ArgsUsage: "[endpoint]",
Flags: []cli.Flag{utils.DataDirFlag, utils.PasswordFileFlag, utils.NetworkIdFlag, utils.IPCPathFlag},
Category: "SHARDING COMMANDS",
Description: `
Launches a sharding proposer client that connects to a running geth node and proposes collations to collator node. This feature is a work in progress.
`,
}
)
func collatorClient(ctx *cli.Context) error {
c := collator.NewCollator(ctx)
return c.Start()
}
func proposerClient(ctx *cli.Context) error {
p := proposer.NewProposer(ctx)
return p.Start()
}