diff --git a/cmd/loadtest/app.go b/cmd/loadtest/app.go index 37382b01..bd8b0c3d 100644 --- a/cmd/loadtest/app.go +++ b/cmd/loadtest/app.go @@ -36,7 +36,7 @@ type ( } loadTestParams struct { // inputs - URL *url.URL + RPCEndpoint *url.URL Requests *int64 Concurrency *int64 BatchSize *uint64 @@ -163,12 +163,12 @@ var LoadtestCmd = &cobra.Command{ func init() { ltp := new(loadTestParams) - urlInput := LoadtestCmd.PersistentFlags().StringP("url", "u", "http://localhost:8545", "The url of the JSON-RPC") - if urlInput == nil { + rpcEndpoint := LoadtestCmd.PersistentFlags().StringP("rpc-endpoint", "r", "http://localhost:8545", "The RPC endpoint") + if rpcEndpoint == nil { panic("URL is empty") } var err error - ltp.URL, err = validateUrl(*urlInput) + ltp.RPCEndpoint, err = validateUrl(*rpcEndpoint) if err != nil { panic(err) } diff --git a/cmd/loadtest/loadtest.go b/cmd/loadtest/loadtest.go index 063c0894..4a007cec 100644 --- a/cmd/loadtest/loadtest.go +++ b/cmd/loadtest/loadtest.go @@ -294,7 +294,7 @@ func runLoadTest(ctx context.Context) error { overallTimer = new(time.Timer) } - rpc, err := ethrpc.DialContext(ctx, inputLoadTestParams.URL.String()) + rpc, err := ethrpc.DialContext(ctx, inputLoadTestParams.RPCEndpoint.String()) if err != nil { log.Error().Err(err).Msg("Unable to dial rpc") return err