diff --git a/documentation/en/default-lotus-config.toml b/documentation/en/default-lotus-config.toml index 8d3eda9d496..41bc082da38 100644 --- a/documentation/en/default-lotus-config.toml +++ b/documentation/en/default-lotus-config.toml @@ -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 @@ -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 @@ -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 diff --git a/node/builder_chain.go b/node/builder_chain.go index 8672fa56803..72d6f2ee7f1 100644 --- a/node/builder_chain.go +++ b/node/builder_chain.go @@ -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( diff --git a/node/config/doc_gen.go b/node/config/doc_gen.go index d448f5b9ab3..feab3d5b6e0 100644 --- a/node/config/doc_gen.go +++ b/node/config/doc_gen.go @@ -83,7 +83,10 @@ It is a crucial component for optimizing Lotus RPC response times. Default: false (indexer is disabled) 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.`, +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.`, }, { Name: "GCRetentionEpochs", @@ -179,7 +182,8 @@ may increase startup time.`, Comment: `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.`, +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.`, }, { Name: "FilterTTL", @@ -255,7 +259,8 @@ rewards. This address should have adequate funds to cover gas fees.`, Type: "bool", Comment: `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.`, +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.`, }, { Name: "EthTraceFilterMaxResults", diff --git a/node/config/types.go b/node/config/types.go index 46be4089d63..3824427b2af 100644 --- a/node/config/types.go +++ b/node/config/types.go @@ -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 @@ -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 @@ -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.