Skip to content

Commit

Permalink
Appease the linter
Browse files Browse the repository at this point in the history
  • Loading branch information
2opremio committed Feb 6, 2025
1 parent de200a1 commit 372638d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
8 changes: 4 additions & 4 deletions cmd/stellar-rpc/internal/config/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ type Config struct {
CaptiveCoreStoragePath string
StellarCoreBinaryPath string
CaptiveCoreConfigPath string
CaptiveCoreHTTPPort uint
CaptiveCoreHTTPQueryPort uint
CaptiveCoreHTTPQueryThreadPoolSize uint
CaptiveCoreHTTPQuerySnapshotLedgers uint
CaptiveCoreHTTPPort uint16
CaptiveCoreHTTPQueryPort uint16
CaptiveCoreHTTPQueryThreadPoolSize uint16
CaptiveCoreHTTPQuerySnapshotLedgers uint16

Endpoint string
AdminEndpoint string
Expand Down
8 changes: 4 additions & 4 deletions cmd/stellar-rpc/internal/config/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,25 +86,25 @@ func (cfg *Config) options() Options {
Name: "stellar-captive-core-http-port",
Usage: "HTTP port for Captive Core to listen on (0 disables the HTTP server)",
ConfigKey: &cfg.CaptiveCoreHTTPPort,
DefaultValue: uint(defaultCaptiveCoreHTTPPort),
DefaultValue: uint16(defaultCaptiveCoreHTTPPort),
},
{
Name: "stellar-captive-core-http-query-port",
Usage: "HTTP port for Captive Core to listen on for high-performance queries like /getledgerentry (0 disables the HTTP server, must not conflict with CAPTIVE_CORE_HTTP_PORT)",
ConfigKey: &cfg.CaptiveCoreHTTPQueryPort,
DefaultValue: uint(0), // Disabled by default, although it normally uses 11628
DefaultValue: uint16(0), // Disabled by default, although it normally uses 11628
},
{
Name: "stellar-captive-core-http-query-thread-pool-size",
Usage: "Number of threads to use by Captive Core's high-performance query server",
ConfigKey: &cfg.CaptiveCoreHTTPQueryThreadPoolSize,
DefaultValue: uint(runtime.NumCPU()), //nolint:gosec
DefaultValue: uint16(runtime.NumCPU()), //nolint:gosec
},
{
Name: "stellar-captive-core-http-query-snapshot-ledgers",
Usage: "Size of ledger history in Captive Core's high-performance query server (don't touch unless you know what you are doing)",
ConfigKey: &cfg.CaptiveCoreHTTPQuerySnapshotLedgers,
DefaultValue: uint(4),
DefaultValue: uint16(4),
},
{
Name: "log-level",
Expand Down
9 changes: 5 additions & 4 deletions cmd/stellar-rpc/internal/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,15 @@ func newCaptiveCore(cfg *config.Config, logger *supportlog.Entry) (*ledgerbacken
if cfg.CaptiveCoreHTTPQueryPort != 0 {
// Only try to enable the server if the port passed is non-zero
queryServerParams = &ledgerbackend.HTTPQueryServerParams{
Port: uint16(cfg.CaptiveCoreHTTPQueryPort),
ThreadPoolSize: uint16(cfg.CaptiveCoreHTTPQueryThreadPoolSize),
SnapshotLedgers: uint16(cfg.CaptiveCoreHTTPQuerySnapshotLedgers),
Port: cfg.CaptiveCoreHTTPQueryPort,
ThreadPoolSize: cfg.CaptiveCoreHTTPQueryThreadPoolSize,
SnapshotLedgers: cfg.CaptiveCoreHTTPQuerySnapshotLedgers,
}
}

httpPort := uint(cfg.CaptiveCoreHTTPQueryPort)
captiveCoreTomlParams := ledgerbackend.CaptiveCoreTomlParams{
HTTPPort: &cfg.CaptiveCoreHTTPPort,
HTTPPort: &httpPort,
HistoryArchiveURLs: cfg.HistoryArchiveURLs,
NetworkPassphrase: cfg.NetworkPassphrase,
Strict: true,
Expand Down

0 comments on commit 372638d

Please sign in to comment.