mirror of
https://github.com/logos-messaging/nim-chat-poc.git
synced 2026-02-26 17:03:08 +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];
|
||||
if (peer) {
|
||||
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);
|
||||
} else {
|
||||
snprintf(config, sizeof(config),
|
||||
|
||||
@ -44,6 +44,9 @@ proc createChatClient(
|
||||
if config.hasKey("shardId"):
|
||||
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"):
|
||||
wakuCfg.staticPeers = @[]
|
||||
for peer in config["staticPeers"]:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user