Skip to content

Commit 5c108c0

Browse files
committed
fix API registration
1 parent 07bfe82 commit 5c108c0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

statediff/service.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ type blockChain interface {
6767

6868
// IService is the state-diffing service interface
6969
type IService interface {
70-
// APIs(), Protocols(), Start() and Stop()
70+
// Start() and Stop()
7171
node.Lifecycle
72+
// Method to getting API(s) for this service
73+
APIs() []rpc.API
7274
// Main event loop for processing state diffs
7375
Loop(chainEventCh chan core.ChainEvent)
7476
// Method to subscribe to receive state diff processing output
@@ -138,7 +140,7 @@ func New(stack *node.Node, ethServ *eth.Ethereum, dbParams *DBParams, enableWrit
138140
indexer = ind.NewStateDiffIndexer(blockChain.Config(), db)
139141
}
140142
prom.Init()
141-
serv := &Service{
143+
sds := &Service{
142144
Mutex: sync.Mutex{},
143145
BlockChain: blockChain,
144146
Builder: NewBuilder(blockChain.StateCache()),
@@ -148,7 +150,8 @@ func New(stack *node.Node, ethServ *eth.Ethereum, dbParams *DBParams, enableWrit
148150
indexer: indexer,
149151
enableWriteLoop: enableWriteLoop,
150152
}
151-
stack.RegisterLifecycle(serv)
153+
stack.RegisterLifecycle(sds)
154+
stack.RegisterAPIs(sds.APIs())
152155
return nil
153156
}
154157

0 commit comments

Comments
 (0)