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

Method Start

cmd/cql-eth-exchange/exchange.go:133–150  ·  view source on GitHub ↗

Start connects to server and listen to new blocks for token exchanges.

(ctx context.Context)

Source from the content-addressed store, hash-verified

131
132// Start connects to server and listen to new blocks for token exchanges.
133func (e *Exchange) Start(ctx context.Context) (err error) {
134 e.newBlockCh = make(chan *types.Block)
135 e.newBlockHeaderCh = make(chan *types.Header)
136 e.wg = &sync.WaitGroup{}
137
138 err = e.connectServer(ctx)
139 if err != nil {
140 return
141 }
142
143 // process old blocks
144 err = e.fetchOldBlocks(ctx)
145
146 e.wg.Add(1)
147 go e.process()
148
149 return
150}
151
152// Stop stops the exchange service and disconnect from the ethereum network.
153func (e *Exchange) Stop() {

Callers 1

mainFunction · 0.95

Calls 4

connectServerMethod · 0.95
fetchOldBlocksMethod · 0.95
processMethod · 0.95
AddMethod · 0.45

Tested by

no test coverage detected