2018-01-15 00:10:02 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2018-03-31 04:07:42 +00:00
|
|
|
"github.com/ethereum/go-ethereum/sharding/collator"
|
|
|
|
//"github.com/ethereum/go-ethereum/sharding/proposer"
|
2018-01-15 00:10:02 +00:00
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/cmd/utils"
|
|
|
|
cli "gopkg.in/urfave/cli.v1"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2018-03-08 19:18:20 +00:00
|
|
|
collatorClientCommand = cli.Command{
|
|
|
|
Action: utils.MigrateFlags(collatorClient),
|
|
|
|
Name: "sharding-collator",
|
|
|
|
Aliases: []string{"shard-collator"},
|
|
|
|
Usage: "Start a sharding collator client",
|
2018-01-21 00:07:41 +00:00
|
|
|
ArgsUsage: "[endpoint]",
|
2018-03-06 04:17:55 +00:00
|
|
|
Flags: []cli.Flag{utils.DataDirFlag, utils.PasswordFileFlag, utils.NetworkIdFlag, utils.IPCPathFlag, utils.DepositFlag},
|
2018-01-21 00:07:41 +00:00
|
|
|
Category: "SHARDING COMMANDS",
|
|
|
|
Description: `
|
2018-03-08 19:18:20 +00:00
|
|
|
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.
|
2018-03-06 05:57:42 +00:00
|
|
|
`,
|
|
|
|
}
|
2018-03-08 19:18:20 +00:00
|
|
|
proposerClientCommand = cli.Command{
|
|
|
|
Action: utils.MigrateFlags(proposerClient),
|
|
|
|
Name: "sharding-proposer",
|
|
|
|
Aliases: []string{"shard-proposer"},
|
|
|
|
Usage: "Start a sharding proposer client",
|
2018-03-06 05:57:42 +00:00
|
|
|
ArgsUsage: "[endpoint]",
|
2018-03-06 16:28:23 +00:00
|
|
|
Flags: []cli.Flag{utils.DataDirFlag, utils.PasswordFileFlag, utils.NetworkIdFlag, utils.IPCPathFlag},
|
2018-03-06 05:57:42 +00:00
|
|
|
Category: "SHARDING COMMANDS",
|
|
|
|
Description: `
|
2018-03-08 19:18:20 +00:00
|
|
|
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.
|
2018-01-21 00:07:41 +00:00
|
|
|
`,
|
2018-01-15 00:10:02 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2018-03-08 19:18:20 +00:00
|
|
|
func collatorClient(ctx *cli.Context) error {
|
2018-03-31 18:25:39 +00:00
|
|
|
c := collator.NewCollator(ctx)
|
|
|
|
return c.Start()
|
2018-01-15 00:10:02 +00:00
|
|
|
}
|
2018-03-06 05:57:42 +00:00
|
|
|
|
2018-03-08 19:18:20 +00:00
|
|
|
func proposerClient(ctx *cli.Context) error {
|
2018-03-31 04:07:42 +00:00
|
|
|
/*p := proposer.NewProposerClient(ctx)
|
|
|
|
if err := proposer.ProposerStart(p); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
p.Wait()
|
|
|
|
*/
|
2018-03-06 05:57:42 +00:00
|
|
|
return nil
|
|
|
|
}
|