mirror of
https://github.com/logos-messaging/nim-sds.git
synced 2026-01-02 14:13:07 +00:00
updating some build files, logs
This commit is contained in:
parent
44b38583c8
commit
619a4ec689
11
Makefile
11
Makefile
@ -39,6 +39,17 @@ deps: | sds.nims
|
||||
# must be included after the default target
|
||||
-include $(BUILD_SYSTEM_DIR)/makefiles/targets.mk
|
||||
|
||||
## Git version
|
||||
GIT_VERSION ?= $(shell git describe --abbrev=6 --always --tags)
|
||||
## Compilation parameters. If defined in the CLI the assignments won't be executed
|
||||
NIM_PARAMS := $(NIM_PARAMS) -d:git_version=\"$(GIT_VERSION)\"
|
||||
|
||||
ifeq ($(DEBUG), 0)
|
||||
NIM_PARAMS := $(NIM_PARAMS) -d:release
|
||||
else
|
||||
NIM_PARAMS := $(NIM_PARAMS) -d:debug
|
||||
endif
|
||||
|
||||
STATIC ?= 0
|
||||
|
||||
libsds: deps
|
||||
|
||||
@ -246,6 +246,7 @@ proc WrapOutgoingMessage(
|
||||
return RET_ERR
|
||||
|
||||
echo "------------- WrapOutgoingMessage 6"
|
||||
echo "------------- WrapOutgoingMessage messageId: ", $messageId
|
||||
handleRequest(
|
||||
ctx,
|
||||
RequestType.MESSAGE,
|
||||
|
||||
@ -48,6 +48,7 @@ proc process*(
|
||||
of WRAP_MESSAGE:
|
||||
let messageBytes = self.message.toSeq()
|
||||
|
||||
echo "-------------- WRAP_MESSAGE bytes: ", $messageBytes
|
||||
let wrappedMessage = wrapOutgoingMessage(rm[], messageBytes, $self.messageId).valueOr:
|
||||
error "WRAP_MESSAGE failed", error = error
|
||||
return err("error processing WRAP_MESSAGE request: " & $error)
|
||||
|
||||
21
sds.nimble
21
sds.nimble
@ -1,3 +1,5 @@
|
||||
mode = ScriptMode.Verbose
|
||||
|
||||
# Package
|
||||
version = "0.1.0"
|
||||
author = "Waku Team"
|
||||
@ -6,9 +8,14 @@ license = "MIT"
|
||||
srcDir = "src"
|
||||
|
||||
# Dependencies
|
||||
requires "nim >= 2.0.8"
|
||||
requires "chronicles"
|
||||
requires "libp2p"
|
||||
requires "nim >= 2.2.4",
|
||||
"chronicles",
|
||||
"chronos",
|
||||
"stew",
|
||||
"stint",
|
||||
"metrics",
|
||||
"libp2p",
|
||||
"results"
|
||||
|
||||
proc buildLibrary(name: string, srcDir = "./", params = "", `type` = "static") =
|
||||
if not dirExists "build":
|
||||
@ -35,5 +42,11 @@ task libsdsDynamic, "Generate bindings":
|
||||
let name = "libsds"
|
||||
buildLibrary name,
|
||||
"library/",
|
||||
"",
|
||||
"""-d:chronicles_line_numbers \
|
||||
-d:chronicles_runtime_filtering=on \
|
||||
-d:chronicles_sinks="textlines,json" \
|
||||
-d:chronicles_default_output_device=Dynamic \
|
||||
--warning:Deprecated:off \
|
||||
--warning:UnusedImport:on \
|
||||
-d:chronicles_log_level=TRACE """,
|
||||
"dynamic"
|
||||
@ -13,13 +13,17 @@ proc newReliabilityManager*(
|
||||
##
|
||||
## Returns:
|
||||
## A Result containing either a new ReliabilityManager instance or an error.
|
||||
echo "--------------- newReliabilityManager 1"
|
||||
if not channelId.isSome():
|
||||
echo "--------------- newReliabilityManager 2"
|
||||
return err(ReliabilityError.reInvalidArgument)
|
||||
|
||||
try:
|
||||
echo "--------------- newReliabilityManager 3"
|
||||
let bloomFilter =
|
||||
newRollingBloomFilter(config.bloomFilterCapacity, config.bloomFilterErrorRate)
|
||||
|
||||
echo "--------------- newReliabilityManager 4"
|
||||
let rm = ReliabilityManager(
|
||||
lamportTimestamp: 0,
|
||||
messageHistory: @[],
|
||||
@ -29,7 +33,9 @@ proc newReliabilityManager*(
|
||||
channelId: channelId,
|
||||
config: config,
|
||||
)
|
||||
echo "--------------- newReliabilityManager 5"
|
||||
initLock(rm.lock)
|
||||
echo "--------------- newReliabilityManager 6"
|
||||
return ok(rm)
|
||||
except Exception:
|
||||
error "Failed to create ReliabilityManager", msg = getCurrentExceptionMsg()
|
||||
@ -269,11 +275,13 @@ proc setCallbacks*(
|
||||
## - onMessageSent: Callback function called when a message is confirmed as sent.
|
||||
## - onMissingDependencies: Callback function called when a message has missing dependencies.
|
||||
## - onPeriodicSync: Callback function called to notify about periodic sync
|
||||
echo "---------- calling setCallbacks"
|
||||
withLock rm.lock:
|
||||
rm.onMessageReady = onMessageReady
|
||||
rm.onMessageSent = onMessageSent
|
||||
rm.onMissingDependencies = onMissingDependencies
|
||||
rm.onPeriodicSync = onPeriodicSync
|
||||
echo "-------- after setCallbacks"
|
||||
|
||||
proc checkUnacknowledgedMessages(rm: ReliabilityManager) {.gcsafe.} =
|
||||
## Checks and processes unacknowledged messages in the outgoing buffer.
|
||||
|
||||
2
vendor/nimbus-build-system
vendored
2
vendor/nimbus-build-system
vendored
@ -1 +1 @@
|
||||
Subproject commit 5f10509cf880dc035e517ca7bac3163cd5206ba8
|
||||
Subproject commit 0be0663e1af76e869837226a4ef3e586fcc737d3
|
||||
Loading…
x
Reference in New Issue
Block a user