Skip to content

Commit

Permalink
doc(indexer): more clarity for ChainIndexer configuration setup (#12701)
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg authored Nov 19, 2024
1 parent 8003997 commit 1f5f51f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
5 changes: 5 additions & 0 deletions documentation/en/default-lotus-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@
[Fevm]
# EnableEthRPC enables eth_ RPC methods.
# Note: Setting this to true will also require that ChainIndexer is enabled, otherwise it will cause an error at startup.
# Set EnableIndexer in the ChainIndexer section of the config to true to enable the ChainIndexer.
#
# type: bool
# env var: LOTUS_FEVM_ENABLEETHRPC
Expand All @@ -249,6 +250,7 @@
# EnableActorEventsAPI enables the Actor events API that enables clients to consume events
# emitted by (smart contracts + built-in Actors).
# Note: Setting this to true will also require that ChainIndexer is enabled, otherwise it will cause an error at startup.
# Set EnableIndexer in the ChainIndexer section of the config to true to enable the ChainIndexer.
#
# type: bool
# env var: LOTUS_EVENTS_ENABLEACTOREVENTSAPI
Expand Down Expand Up @@ -294,6 +296,9 @@
#
# Setting this to true will enable the indexer, which will significantly improve RPC performance.
# It is strongly recommended to keep this set to true if you are an RPC provider.
#
# If EnableEthRPC or EnableActorEventsAPI are set to true, the ChainIndexer must be enabled using
# this option to avoid errors at startup.
#
# type: bool
# env var: LOTUS_CHAININDEXER_ENABLEINDEXER
Expand Down
4 changes: 2 additions & 2 deletions node/builder_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ func ConfigFullNode(c interface{}) Option {
}

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

return Options(
Expand Down
11 changes: 8 additions & 3 deletions node/config/doc_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions node/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ type FeeConfig struct {
type FevmConfig struct {
// EnableEthRPC enables eth_ RPC methods.
// Note: Setting this to true will also require that ChainIndexer is enabled, otherwise it will cause an error at startup.
// Set EnableIndexer in the ChainIndexer section of the config to true to enable the ChainIndexer.
EnableEthRPC bool

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

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

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

0 comments on commit 1f5f51f

Please sign in to comment.