mirror of
https://github.com/logos-messaging/nim-chat-poc.git
synced 2026-07-08 09:30:13 +00:00
Global, restart-based Required/None anonymity mode: route chat messages through the
libp2p mixnet for sender anonymity, on the logos-delivery (efafdfdc2) nwaku stack.
Static RLN spam protection; no on-chain LEZ gifter / dynamic membership.
Delivery (src/chat/delivery/waku_client.nim):
- WakuConfig.mixEnabled/mixNodes/minMixPoolSize; parseMixNodes, waitForMixPool,
getMixPoolSize, mixReady.
- Required mode: sendBytes -> lightpushPublish(mixify=true) over the mix pool,
fail-fast below minMixPoolSize (no relay fallback). None mode: relay publish.
Errors propagate up to chat_send_message.
- Receive via WakuFilter (subscribe to static peers; no relay mounted), refreshed
by a 60s keep-alive.
- Static RLN: pre-populated rln_tree.db + per-peer keystore; nodekey config to adopt
a provisioned identity. No per-send root-convergence wait (static membership).
API / build:
- chat_get_mix_status FFI -> {mixEnabled,mixReady,mixPoolSize,minPoolSize}.
- Reproducible nix build: librln consumed as a cdylib (avoids the two-Rust-staticlib
symbol collision); -d:libp2p_mix_experimental_exit_is_dest.
- vendor/nwaku -> efafdfdc2; vendor/nim-protobuf-serialization -> 38d24eb (0.4.0).
26 lines
1.0 KiB
Nim
26 lines
1.0 KiB
Nim
import std/[os, strutils]
|
|
|
|
# all vendor subdirectories
|
|
for dir in walkDir(thisDir() / "vendor"):
|
|
if dir.kind == pcDir:
|
|
switch("path", dir.path)
|
|
switch("path", dir.path / "src")
|
|
|
|
switch("path", thisDir() / "vendor/libchat/nim-bindings")
|
|
switch("path", thisDir() / "vendor/libchat/nim-bindings/src")
|
|
|
|
# nwaku (PR #3807) consumes deps via nimble rather than vendored submodules,
|
|
# so add each package dir under nimbledeps/pkgs2 (and its src/) to the nim
|
|
# search path. The dir name carries the "<name>-<version>-<sha>" stamp; nim
|
|
# resolves imports by package name relative to those paths.
|
|
let nwakuDeps = thisDir() / "vendor/nwaku/nimbledeps/pkgs2"
|
|
if dirExists(nwakuDeps):
|
|
for pkg in walkDir(nwakuDeps):
|
|
if pkg.kind == pcDir:
|
|
# The chat ships its own FFI framework via vendor/nim-ffi; skip the
|
|
# nwaku-vendored `ffi` package(s) to avoid a declareLibrary API clash.
|
|
if pkg.path.lastPathPart.startsWith("ffi-"):
|
|
continue
|
|
switch("path", pkg.path)
|
|
if dirExists(pkg.path / "src"):
|
|
switch("path", pkg.path / "src") |