Adding TCP Port

This commit is contained in:
aya 2025-02-04 15:59:13 +02:00
parent 339afb5733
commit 0e698eae2f

View File

@ -1,12 +1,13 @@
package utilities
import (
"errors"
"math/rand"
"sync"
"time"
"errors"
"go.uber.org/zap"
"github.com/waku-org/waku-go-bindings/waku"
"go.uber.org/zap"
)
var (
@ -27,13 +28,13 @@ var DefaultWakuConfig = &waku.WakuConfig{
Store: false,
Filter: false,
Lightpush: false,
Discv5UdpPort: GenerateUniquePort(),
TcpPort: GenerateUniquePort(),
}
// WakuConfigOption is a function that applies a change to a WakuConfig.
type WakuConfigOption func(*waku.WakuConfig)
func GenerateUniquePort() int {
rng := rand.New(rand.NewSource(time.Now().UnixNano())) // Local RNG instance
@ -50,7 +51,6 @@ func GenerateUniquePort() int {
}
}
func CheckWakuNodeNull(logger *zap.Logger, node interface{}) error {
if node == nil {
err := errors.New("WakuNode instance is nil")
@ -60,4 +60,4 @@ func CheckWakuNodeNull(logger *zap.Logger, node interface{}) error {
return err
}
return nil
}
}