MCPcopy Create free account
hub / github.com/CPChain/chain / run

Function run

cmd/cpchain/cmd_run.go:112–128  ·  view source on GitHub ↗
(ctx *cli.Context)

Source from the content-addressed store, hash-verified

110}
111
112func run(ctx *cli.Context) error {
113 isRunningChain = true
114 err := times.InvalidSystemClock()
115 if err != nil {
116 log.Warn(InvalidSystemClockWarn)
117 log.Fatalf("system clock need to be synchronized.there is more than %v seconds gap between ntp and this server", times.MaxGapDuration)
118 }
119
120 if ctx.IsSet(flags.MineFlagName) && ctx.IsSet(flags.ValidatorFlagName) {
121 log.Fatalf("A node cannot be both miner and validator.")
122 }
123
124 n := createNode(ctx)
125 bootstrap(ctx, n)
126 n.Wait()
127 return nil
128}
129
130// Register chain services for a *full* node.
131func registerChainService(cfg *cpc.Config, n *node.Node, cliCtx *cli.Context) {

Callers

nothing calls this directly

Calls 4

createNodeFunction · 0.85
bootstrapFunction · 0.85
WaitMethod · 0.80
WarnMethod · 0.65

Tested by

no test coverage detected