Lazzeruz 9b722b8669 More changes yay
Renamed a bunch of stuff to the right Github. Hope it works.
2023-12-09 21:18:29 +01:00

27 lines
572 B
Go

package server
import (
"time"
"github.com/zoomy-network/zoomyd/domain/dagconfig"
"github.com/zoomy-network/zoomyd/infrastructure/network/rpcclient"
)
func connectToRPC(params *dagconfig.Params, rpcServer string, timeout uint32) (*rpcclient.RPCClient, error) {
rpcAddress, err := params.NormalizeRPCServerAddress(rpcServer)
if err != nil {
return nil, err
}
rpcClient, err := rpcclient.NewRPCClient(rpcAddress)
if err != nil {
return nil, err
}
if timeout != 0 {
rpcClient.SetTimeout(time.Duration(timeout) * time.Second)
}
return rpcClient, err
}