Skip to content

Commit 1f5f51f

Browse files
authored
doc(indexer): more clarity for ChainIndexer configuration setup (#12701)
1 parent 8003997 commit 1f5f51f

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

documentation/en/default-lotus-config.toml

+5
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@
223223
[Fevm]
224224
# EnableEthRPC enables eth_ RPC methods.
225225
# Note: Setting this to true will also require that ChainIndexer is enabled, otherwise it will cause an error at startup.
226+
# Set EnableIndexer in the ChainIndexer section of the config to true to enable the ChainIndexer.
226227
#
227228
# type: bool
228229
# env var: LOTUS_FEVM_ENABLEETHRPC
@@ -249,6 +250,7 @@
249250
# EnableActorEventsAPI enables the Actor events API that enables clients to consume events
250251
# emitted by (smart contracts + built-in Actors).
251252
# Note: Setting this to true will also require that ChainIndexer is enabled, otherwise it will cause an error at startup.
253+
# Set EnableIndexer in the ChainIndexer section of the config to true to enable the ChainIndexer.
252254
#
253255
# type: bool
254256
# env var: LOTUS_EVENTS_ENABLEACTOREVENTSAPI
@@ -294,6 +296,9 @@
294296
#
295297
# Setting this to true will enable the indexer, which will significantly improve RPC performance.
296298
# It is strongly recommended to keep this set to true if you are an RPC provider.
299+
#
300+
# If EnableEthRPC or EnableActorEventsAPI are set to true, the ChainIndexer must be enabled using
301+
# this option to avoid errors at startup.
297302
#
298303
# type: bool
299304
# env var: LOTUS_CHAININDEXER_ENABLEINDEXER

node/builder_chain.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,10 @@ func ConfigFullNode(c interface{}) Option {
180180
}
181181

182182
if cfg.Fevm.EnableEthRPC && !cfg.ChainIndexer.EnableIndexer {
183-
return Error(xerrors.New("chain indexer must be enabled if ETH RPC is enabled"))
183+
return Error(xerrors.New("EnableIndexer in the ChainIndexer configuration section must be set to true when setting EnableEthRPC to true"))
184184
}
185185
if cfg.Events.EnableActorEventsAPI && !cfg.ChainIndexer.EnableIndexer {
186-
return Error(xerrors.New("chain indexer must be enabled if actor events API is enabled"))
186+
return Error(xerrors.New("EnableIndexer in the ChainIndexer configuration section must be set to true when setting EnableActorEventsAPI to true"))
187187
}
188188

189189
return Options(

node/config/doc_gen.go

+8-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node/config/types.go

+5
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,7 @@ type FeeConfig struct {
540540
type FevmConfig struct {
541541
// EnableEthRPC enables eth_ RPC methods.
542542
// Note: Setting this to true will also require that ChainIndexer is enabled, otherwise it will cause an error at startup.
543+
// Set EnableIndexer in the ChainIndexer section of the config to true to enable the ChainIndexer.
543544
EnableEthRPC bool
544545

545546
// EthTraceFilterMaxResults sets the maximum results returned per request by trace_filter
@@ -557,6 +558,7 @@ type EventsConfig struct {
557558
// EnableActorEventsAPI enables the Actor events API that enables clients to consume events
558559
// emitted by (smart contracts + built-in Actors).
559560
// Note: Setting this to true will also require that ChainIndexer is enabled, otherwise it will cause an error at startup.
561+
// Set EnableIndexer in the ChainIndexer section of the config to true to enable the ChainIndexer.
560562
EnableActorEventsAPI bool
561563

562564
// FilterTTL specifies the time to live for actor event filters. Filters that haven't been accessed longer than
@@ -587,6 +589,9 @@ type ChainIndexerConfig struct {
587589
//
588590
// Setting this to true will enable the indexer, which will significantly improve RPC performance.
589591
// It is strongly recommended to keep this set to true if you are an RPC provider.
592+
//
593+
// If EnableEthRPC or EnableActorEventsAPI are set to true, the ChainIndexer must be enabled using
594+
// this option to avoid errors at startup.
590595
EnableIndexer bool
591596

592597
// GCRetentionEpochs specifies the number of epochs for which data is retained in the Indexer.

0 commit comments

Comments
 (0)