MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / Start

Method Start

blockproducer/chain.go:328–339  ·  view source on GitHub ↗

Start starts the chain by step: 1. sync the chain 2. goroutine for getting blocks 3. goroutine for getting txes.

()

Source from the content-addressed store, hash-verified

326// 2. goroutine for getting blocks
327// 3. goroutine for getting txes.
328func (c *Chain) Start() {
329 // Start blocks/txs processing goroutines
330 c.goFunc(c.processBlocks)
331 c.goFunc(c.processTxs)
332 // Synchronize heads to current block period
333 c.syncHeads()
334 // TODO(leventeliu): subscribe ChainBus.
335 // ...
336 // Start main cycle and service
337 c.goFunc(c.mainCycle)
338 c.startService(c)
339}
340
341// Stop stops the main process of the sql-chain.
342func (c *Chain) Stop() (err error) {

Callers 1

TestChainFunction · 0.45

Calls 3

goFuncMethod · 0.95
syncHeadsMethod · 0.95
startServiceMethod · 0.95

Tested by 1

TestChainFunction · 0.36