Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(indexer): more clarity for ChainIndexer configuration setup #12701

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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