mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-02 14:03:06 +00:00
* introduce createNode # Conflicts: # apps/wakunode2/cli_args.nim * remove confutils dependency on the library * test: remove websocket in default test config * update to latest specs * test: cli_args * align to spec changes (sovereign, message conf, entrypoints * accept enr, entree and multiaddr as entry points * post rebase * format * change from "sovereign" to "core" * add example * get example to continue running * nitpicks * idiomatic constructors * fix enum naming * replace procs with consts * remove messageConfirmation * use pure enum * rename example file
23 lines
667 B
Nim
23 lines
667 B
Nim
{.push raises: [].}
|
|
|
|
import std/[strutils, net]
|
|
import ./envvar_serialization
|
|
|
|
export net, envvar_serialization
|
|
|
|
proc readValue*(
|
|
r: var EnvvarReader, value: var IpAddress
|
|
) {.raises: [SerializationError].} =
|
|
try:
|
|
value = parseIpAddress(r.readValue(string))
|
|
except ValueError, IOError:
|
|
raise newException(
|
|
SerializationError, "Invalid IP address: " & getCurrentExceptionMsg()
|
|
)
|
|
|
|
proc readValue*(r: var EnvvarReader, value: var Port) {.raises: [SerializationError].} =
|
|
try:
|
|
value = parseUInt(r.readValue(string)).Port
|
|
except ValueError, IOError:
|
|
raise newException(SerializationError, "Invalid Port: " & getCurrentExceptionMsg())
|