2025-02-09 12:27:57 +02:00
|
|
|
package waku
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"time"
|
2025-02-14 17:01:03 +02:00
|
|
|
|
|
|
|
|
"github.com/waku-org/waku-go-bindings/waku/common"
|
2025-02-18 12:25:19 +02:00
|
|
|
"google.golang.org/protobuf/proto"
|
2025-02-09 12:27:57 +02:00
|
|
|
)
|
|
|
|
|
|
2025-02-18 12:25:19 +02:00
|
|
|
var DefaultWakuConfig WakuConfig
|
|
|
|
|
var DefaultStoreQueryRequest common.StoreQueryRequest
|
2025-02-11 16:21:14 +02:00
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
|
|
|
|
|
udpPort, _, err1 := GetFreePortIfNeeded(0, 0)
|
|
|
|
|
tcpPort, _, err2 := GetFreePortIfNeeded(0, 0)
|
|
|
|
|
|
|
|
|
|
if err1 != nil || err2 != nil {
|
|
|
|
|
Error("Failed to get free ports %v %v", err1, err2)
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-18 12:25:19 +02:00
|
|
|
DefaultWakuConfig = WakuConfig{
|
2025-02-11 16:21:14 +02:00
|
|
|
Relay: false,
|
|
|
|
|
LogLevel: "DEBUG",
|
|
|
|
|
Discv5Discovery: true,
|
|
|
|
|
ClusterID: 16,
|
|
|
|
|
Shards: []uint16{64},
|
|
|
|
|
PeerExchange: false,
|
|
|
|
|
Store: false,
|
|
|
|
|
Filter: false,
|
|
|
|
|
Lightpush: false,
|
|
|
|
|
Discv5UdpPort: udpPort,
|
|
|
|
|
TcpPort: tcpPort,
|
|
|
|
|
}
|
2025-02-18 12:25:19 +02:00
|
|
|
|
|
|
|
|
DefaultStoreQueryRequest = common.StoreQueryRequest{
|
|
|
|
|
IncludeData: true,
|
|
|
|
|
ContentTopics: &[]string{"test-content-topic"},
|
|
|
|
|
PaginationLimit: proto.Uint64(uint64(50)),
|
|
|
|
|
PaginationForward: true,
|
|
|
|
|
TimeStart: proto.Int64(time.Now().Add(-5 * time.Minute).UnixNano()), // 5 mins before now
|
|
|
|
|
}
|
2025-02-11 16:21:14 +02:00
|
|
|
}
|
|
|
|
|
|
2025-02-09 12:27:57 +02:00
|
|
|
const ConnectPeerTimeout = 10 * time.Second //default timeout for node to connect to another node
|
|
|
|
|
|
|
|
|
|
var DefaultPubsubTopic = "/waku/2/rs/16/64"
|
|
|
|
|
var (
|
2025-02-11 16:21:14 +02:00
|
|
|
MinPort = 1024 // Minimum allowable port (exported)
|
|
|
|
|
MaxPort = 65535 // Maximum allowable port (exported)
|
2025-02-09 12:27:57 +02:00
|
|
|
)
|