mirror of
https://github.com/logos-messaging/logos-chat.git
synced 2026-03-08 00:13:13 +00:00
fix: peers and pubsub
This commit is contained in:
parent
3921bd8bbd
commit
cdafc250e5
@ -672,7 +672,7 @@ int main(int argc, char *argv[]) {
|
|||||||
char config[2048];
|
char config[2048];
|
||||||
if (peer) {
|
if (peer) {
|
||||||
snprintf(config, sizeof(config),
|
snprintf(config, sizeof(config),
|
||||||
"{\"name\":\"%s\",\"port\":%d,\"clusterId\":%d,\"shardId\":%d,\"staticPeer\":\"%s\"}",
|
"{\"name\":\"%s\",\"port\":%d,\"clusterId\":%d,\"shardId\":%d,\"staticPeers\":[\"%s\"]}",
|
||||||
name, port, cluster_id, shard_id, peer);
|
name, port, cluster_id, shard_id, peer);
|
||||||
} else {
|
} else {
|
||||||
snprintf(config, sizeof(config),
|
snprintf(config, sizeof(config),
|
||||||
|
|||||||
@ -44,6 +44,9 @@ proc createChatClient(
|
|||||||
if config.hasKey("shardId"):
|
if config.hasKey("shardId"):
|
||||||
wakuCfg.shardId = @[config["shardId"].getInt().uint16]
|
wakuCfg.shardId = @[config["shardId"].getInt().uint16]
|
||||||
|
|
||||||
|
if config.hasKey("clusterId") or config.hasKey("shardId"):
|
||||||
|
wakuCfg.pubsubTopic = "/waku/2/rs/" & $wakuCfg.clusterId & "/" & $wakuCfg.shardId[0]
|
||||||
|
|
||||||
if config.hasKey("staticPeers"):
|
if config.hasKey("staticPeers"):
|
||||||
wakuCfg.staticPeers = @[]
|
wakuCfg.staticPeers = @[]
|
||||||
for peer in config["staticPeers"]:
|
for peer in config["staticPeers"]:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user