Skip to content

Commit

Permalink
nits dasRpcServer.go
Browse files Browse the repository at this point in the history
  • Loading branch information
emilianobonassi authored May 25, 2024
1 parent 1d088e5 commit 5931051
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions das/dasRpcServer.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@ type DASRPCServer struct {
daHealthChecker DataAvailabilityServiceHealthChecker
}

func StartDASRPCServer(ctx context.Context, addr string, portNum uint64, rpcServerTimeouts genericconf.HTTPServerTimeoutConfig, RPCServerBodyLimit int, daReader DataAvailabilityServiceReader, daWriter DataAvailabilityServiceWriter, daHealthChecker DataAvailabilityServiceHealthChecker) (*http.Server, error) {
func StartDASRPCServer(ctx context.Context, addr string, portNum uint64, rpcServerTimeouts genericconf.HTTPServerTimeoutConfig, rpcServerBodyLimit int, daReader DataAvailabilityServiceReader, daWriter DataAvailabilityServiceWriter, daHealthChecker DataAvailabilityServiceHealthChecker) (*http.Server, error) {
listener, err := net.Listen("tcp", fmt.Sprintf("%s:%d", addr, portNum))
if err != nil {
return nil, err
}
return StartDASRPCServerOnListener(ctx, listener, rpcServerTimeouts, RPCServerBodyLimit, daReader, daWriter, daHealthChecker)
return StartDASRPCServerOnListener(ctx, listener, rpcServerTimeouts, rpcServerBodyLimit, daReader, daWriter, daHealthChecker)
}

func StartDASRPCServerOnListener(ctx context.Context, listener net.Listener, rpcServerTimeouts genericconf.HTTPServerTimeoutConfig, RPCServerBodyLimit int, daReader DataAvailabilityServiceReader, daWriter DataAvailabilityServiceWriter, daHealthChecker DataAvailabilityServiceHealthChecker) (*http.Server, error) {
func StartDASRPCServerOnListener(ctx context.Context, listener net.Listener, rpcServerTimeouts genericconf.HTTPServerTimeoutConfig, rpcServerBodyLimit int, daReader DataAvailabilityServiceReader, daWriter DataAvailabilityServiceWriter, daHealthChecker DataAvailabilityServiceHealthChecker) (*http.Server, error) {
if daWriter == nil {
return nil, errors.New("No writer backend was configured for DAS RPC server. Has the BLS signing key been set up (--data-availability.key.key-dir or --data-availability.key.priv-key options)?")
}
rpcServer := rpc.NewServer()
if RPCServerBodyLimit > 0 {
rpcServer.SetHTTPBodyLimit(RPCServerBodyLimit)
if rpcServerBodyLimit > 0 {
rpcServer.SetHTTPBodyLimit(rpcServerBodyLimit)
}
err := rpcServer.RegisterName("das", &DASRPCServer{
daReader: daReader,
Expand Down

0 comments on commit 5931051

Please sign in to comment.