mirror of
https://github.com/logos-messaging/nim-sds.git
synced 2026-01-04 07:03:09 +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
|
# must be included after the default target
|
||||||
-include $(BUILD_SYSTEM_DIR)/makefiles/targets.mk
|
-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
|
STATIC ?= 0
|
||||||
|
|
||||||
libsds: deps
|
libsds: deps
|
||||||
|
|||||||
@ -246,6 +246,7 @@ proc WrapOutgoingMessage(
|
|||||||
return RET_ERR
|
return RET_ERR
|
||||||
|
|
||||||
echo "------------- WrapOutgoingMessage 6"
|
echo "------------- WrapOutgoingMessage 6"
|
||||||
|
echo "------------- WrapOutgoingMessage messageId: ", $messageId
|
||||||
handleRequest(
|
handleRequest(
|
||||||
ctx,
|
ctx,
|
||||||
RequestType.MESSAGE,
|
RequestType.MESSAGE,
|
||||||
|
|||||||
@ -48,6 +48,7 @@ proc process*(
|
|||||||
of WRAP_MESSAGE:
|
of WRAP_MESSAGE:
|
||||||
let messageBytes = self.message.toSeq()
|
let messageBytes = self.message.toSeq()
|
||||||
|
|
||||||
|
echo "-------------- WRAP_MESSAGE bytes: ", $messageBytes
|
||||||
let wrappedMessage = wrapOutgoingMessage(rm[], messageBytes, $self.messageId).valueOr:
|
let wrappedMessage = wrapOutgoingMessage(rm[], messageBytes, $self.messageId).valueOr:
|
||||||
error "WRAP_MESSAGE failed", error = error
|
error "WRAP_MESSAGE failed", error = error
|
||||||
return err("error processing WRAP_MESSAGE request: " & $error)
|
return err("error processing WRAP_MESSAGE request: " & $error)
|
||||||
|
|||||||
21
sds.nimble
21
sds.nimble
@ -1,3 +1,5 @@
|
|||||||
|
mode = ScriptMode.Verbose
|
||||||
|
|
||||||
# Package
|
# Package
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
author = "Waku Team"
|
author = "Waku Team"
|
||||||
@ -6,9 +8,14 @@ license = "MIT"
|
|||||||
srcDir = "src"
|
srcDir = "src"
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
requires "nim >= 2.0.8"
|
requires "nim >= 2.2.4",
|
||||||
requires "chronicles"
|
"chronicles",
|
||||||
requires "libp2p"
|
"chronos",
|
||||||
|
"stew",
|
||||||
|
"stint",
|
||||||
|
"metrics",
|
||||||
|
"libp2p",
|
||||||
|
"results"
|
||||||
|
|
||||||
proc buildLibrary(name: string, srcDir = "./", params = "", `type` = "static") =
|
proc buildLibrary(name: string, srcDir = "./", params = "", `type` = "static") =
|
||||||
if not dirExists "build":
|
if not dirExists "build":
|
||||||
@ -35,5 +42,11 @@ task libsdsDynamic, "Generate bindings":
|
|||||||
let name = "libsds"
|
let name = "libsds"
|
||||||
buildLibrary name,
|
buildLibrary name,
|
||||||
"library/",
|
"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"
|
"dynamic"
|
||||||
@ -13,13 +13,17 @@ proc newReliabilityManager*(
|
|||||||
##
|
##
|
||||||
## Returns:
|
## Returns:
|
||||||
## A Result containing either a new ReliabilityManager instance or an error.
|
## A Result containing either a new ReliabilityManager instance or an error.
|
||||||
|
echo "--------------- newReliabilityManager 1"
|
||||||
if not channelId.isSome():
|
if not channelId.isSome():
|
||||||
|
echo "--------------- newReliabilityManager 2"
|
||||||
return err(ReliabilityError.reInvalidArgument)
|
return err(ReliabilityError.reInvalidArgument)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
echo "--------------- newReliabilityManager 3"
|
||||||
let bloomFilter =
|
let bloomFilter =
|
||||||
newRollingBloomFilter(config.bloomFilterCapacity, config.bloomFilterErrorRate)
|
newRollingBloomFilter(config.bloomFilterCapacity, config.bloomFilterErrorRate)
|
||||||
|
|
||||||
|
echo "--------------- newReliabilityManager 4"
|
||||||
let rm = ReliabilityManager(
|
let rm = ReliabilityManager(
|
||||||
lamportTimestamp: 0,
|
lamportTimestamp: 0,
|
||||||
messageHistory: @[],
|
messageHistory: @[],
|
||||||
@ -29,7 +33,9 @@ proc newReliabilityManager*(
|
|||||||
channelId: channelId,
|
channelId: channelId,
|
||||||
config: config,
|
config: config,
|
||||||
)
|
)
|
||||||
|
echo "--------------- newReliabilityManager 5"
|
||||||
initLock(rm.lock)
|
initLock(rm.lock)
|
||||||
|
echo "--------------- newReliabilityManager 6"
|
||||||
return ok(rm)
|
return ok(rm)
|
||||||
except Exception:
|
except Exception:
|
||||||
error "Failed to create ReliabilityManager", msg = getCurrentExceptionMsg()
|
error "Failed to create ReliabilityManager", msg = getCurrentExceptionMsg()
|
||||||
@ -269,11 +275,13 @@ proc setCallbacks*(
|
|||||||
## - onMessageSent: Callback function called when a message is confirmed as sent.
|
## - onMessageSent: Callback function called when a message is confirmed as sent.
|
||||||
## - onMissingDependencies: Callback function called when a message has missing dependencies.
|
## - onMissingDependencies: Callback function called when a message has missing dependencies.
|
||||||
## - onPeriodicSync: Callback function called to notify about periodic sync
|
## - onPeriodicSync: Callback function called to notify about periodic sync
|
||||||
|
echo "---------- calling setCallbacks"
|
||||||
withLock rm.lock:
|
withLock rm.lock:
|
||||||
rm.onMessageReady = onMessageReady
|
rm.onMessageReady = onMessageReady
|
||||||
rm.onMessageSent = onMessageSent
|
rm.onMessageSent = onMessageSent
|
||||||
rm.onMissingDependencies = onMissingDependencies
|
rm.onMissingDependencies = onMissingDependencies
|
||||||
rm.onPeriodicSync = onPeriodicSync
|
rm.onPeriodicSync = onPeriodicSync
|
||||||
|
echo "-------- after setCallbacks"
|
||||||
|
|
||||||
proc checkUnacknowledgedMessages(rm: ReliabilityManager) {.gcsafe.} =
|
proc checkUnacknowledgedMessages(rm: ReliabilityManager) {.gcsafe.} =
|
||||||
## Checks and processes unacknowledged messages in the outgoing buffer.
|
## 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