Skip to content

Commit

Permalink
Fix disperser client (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-shim authored Jan 16, 2024
1 parent 1d8e363 commit bd5897e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
11 changes: 5 additions & 6 deletions clients/disperser_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
disperser_rpc "github.com/Layr-Labs/eigenda/api/grpc/disperser"
"github.com/Layr-Labs/eigenda/core"
"github.com/Layr-Labs/eigenda/disperser"
"github.com/Layr-Labs/eigenda/retriever/flags"
"github.com/urfave/cli"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/credentials/insecure"
Expand All @@ -23,11 +21,12 @@ type Config struct {
UseSecureGrpcFlag bool
}

func NewConfig(ctx *cli.Context) *Config {
func NewConfig(hostname, port string, timeout time.Duration, useSecureGrpcFlag bool) *Config {
return &Config{
Hostname: ctx.GlobalString(flags.HostnameFlag.Name),
Port: ctx.GlobalString(flags.GrpcPortFlag.Name),
Timeout: ctx.Duration(flags.TimeoutFlag.Name),
Hostname: hostname,
Port: port,
Timeout: timeout,
UseSecureGrpcFlag: useSecureGrpcFlag,
}
}

Expand Down
9 changes: 6 additions & 3 deletions tools/traffic/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ type Config struct {
LoggingConfig logging.Config
RandomizeBlobs bool
InstanceLaunchInterval time.Duration
UseSecureGrpcFlag bool
}

func NewConfig(ctx *cli.Context) *Config {
return &Config{
Config: *clients.NewConfig(ctx),
Config: *clients.NewConfig(
ctx.GlobalString(flags.HostnameFlag.Name),
ctx.GlobalString(flags.GrpcPortFlag.Name),
ctx.Duration(flags.TimeoutFlag.Name),
ctx.GlobalBool(flags.UseSecureGrpcFlag.Name),
),
NumInstances: ctx.GlobalUint(flags.NumInstancesFlag.Name),
RequestInterval: ctx.Duration(flags.RequestIntervalFlag.Name),
DataSize: ctx.GlobalUint64(flags.DataSizeFlag.Name),
Expand All @@ -34,6 +38,5 @@ func NewConfig(ctx *cli.Context) *Config {
LoggingConfig: logging.ReadCLIConfig(ctx, flags.FlagPrefix),
RandomizeBlobs: ctx.GlobalBool(flags.RandomizeBlobsFlag.Name),
InstanceLaunchInterval: ctx.Duration(flags.InstanceLaunchIntervalFlag.Name),
UseSecureGrpcFlag: ctx.GlobalBool(flags.UseSecureGrpcFlag.Name),
}
}

0 comments on commit bd5897e

Please sign in to comment.