mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-20 16:41:11 +00:00
68eba02cc2
* Remove most of the remaining geth code and set up bazel for this * chmod +x * Add flake check * better flake detection Former-commit-id: 5c332ecbf2923943f646f1fe40befa95be883329 [formerly 99590fc354514584700e5ce8d7d30a8a7d541f29] Former-commit-id: e5f919b553fe698e98090965d34eb721990b5693
45 lines
1.5 KiB
Go
45 lines
1.5 KiB
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/prysmaticlabs/geth-sharding/cmd/utils"
|
|
"github.com/prysmaticlabs/geth-sharding/internal/debug"
|
|
|
|
node "github.com/prysmaticlabs/geth-sharding/sharding/node"
|
|
cli "gopkg.in/urfave/cli.v1"
|
|
)
|
|
|
|
var (
|
|
flags = []cli.Flag{utils.ActorFlag, utils.DataDirFlag, utils.PasswordFileFlag, utils.NetworkIdFlag, utils.IPCPathFlag, utils.DepositFlag, utils.ShardIDFlag}
|
|
shardingCommand = cli.Command{
|
|
Action: utils.MigrateFlags(shardingCmd),
|
|
Name: "sharding",
|
|
Usage: "Start a sharding-enabled node",
|
|
ArgsUsage: "[endpoint]",
|
|
Flags: append(flags, debug.Flags...),
|
|
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 {
|
|
if err := debug.Setup(ctx); err != nil {
|
|
return err
|
|
}
|
|
|
|
// 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)
|
|
}
|
|
// starts a connection to a geth node and kicks off every registered service.
|
|
shardingNode.Start()
|
|
return nil
|
|
}
|