Skip to content

Commit

Permalink
fix API registration
Browse files Browse the repository at this point in the history
  • Loading branch information
i-norden committed Nov 11, 2020
1 parent 07bfe82 commit 5c108c0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions statediff/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ type blockChain interface {

// IService is the state-diffing service interface
type IService interface {
// APIs(), Protocols(), Start() and Stop()
// Start() and Stop()
node.Lifecycle
// Method to getting API(s) for this service
APIs() []rpc.API
// Main event loop for processing state diffs
Loop(chainEventCh chan core.ChainEvent)
// Method to subscribe to receive state diff processing output
Expand Down Expand Up @@ -138,7 +140,7 @@ func New(stack *node.Node, ethServ *eth.Ethereum, dbParams *DBParams, enableWrit
indexer = ind.NewStateDiffIndexer(blockChain.Config(), db)
}
prom.Init()
serv := &Service{
sds := &Service{
Mutex: sync.Mutex{},
BlockChain: blockChain,
Builder: NewBuilder(blockChain.StateCache()),
Expand All @@ -148,7 +150,8 @@ func New(stack *node.Node, ethServ *eth.Ethereum, dbParams *DBParams, enableWrit
indexer: indexer,
enableWriteLoop: enableWriteLoop,
}
stack.RegisterLifecycle(serv)
stack.RegisterLifecycle(sds)
stack.RegisterAPIs(sds.APIs())
return nil
}

Expand Down

0 comments on commit 5c108c0

Please sign in to comment.