mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-08 02:31:19 +00:00
dd384d3a22
Former-commit-id: b2defb3e277217d0d5bef86f1d4078668791d251 [formerly 6a6bd5c309442805ccac942325e0feef69dd17ab] Former-commit-id: 2a26568478ed072db7c8e299eb40644b1c7c10d2
38 lines
1.3 KiB
Go
38 lines
1.3 KiB
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/ethereum/go-ethereum/cmd/utils"
|
|
node "github.com/ethereum/go-ethereum/sharding/node"
|
|
cli "gopkg.in/urfave/cli.v1"
|
|
)
|
|
|
|
var (
|
|
shardingCommand = cli.Command{
|
|
Action: utils.MigrateFlags(shardingCmd),
|
|
Name: "sharding",
|
|
Usage: "Start a sharding-enabled node",
|
|
ArgsUsage: "[endpoint]",
|
|
Flags: []cli.Flag{utils.ActorFlag, utils.DataDirFlag, utils.PasswordFileFlag, utils.NetworkIdFlag, utils.IPCPathFlag, utils.DepositFlag},
|
|
Category: "SHARDING COMMANDS",
|
|
Description: `
|
|
Launches a sharding node that manages services related to submitting collations to a Sharding Manager Contract, notary and proposer services, and shardp2p connections. This feature is a work in progress.
|
|
`,
|
|
}
|
|
)
|
|
|
|
// shardingCmd is the main cmd line entry point for starting a sharding-enabled node.
|
|
// A sharding node launches a suite of services including notary services,
|
|
// proposer services, and a shardp2p protocol.
|
|
func shardingCmd(ctx *cli.Context) error {
|
|
// configures a sharding-enabled node using the cli's context.
|
|
shardingNode, err := node.New(ctx)
|
|
if err != nil {
|
|
return fmt.Errorf("could not initialize sharding node instance: %v", err)
|
|
}
|
|
defer shardingNode.Close()
|
|
// starts a connection to a geth node and kicks off every registered service.
|
|
return shardingNode.Start()
|
|
}
|