mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-08-25 15:31:16 +00:00
Chore: adapt cli args for delivery api (#3744)
* LogosDeliveryAPI: NodeConfig -> WakluNodeConf + mode selector and logos.dev preset * Adjustment made on test, logos.dev preset * change default agentString from nwaku to logos-delivery * Add p2pReliability switch to presets and make it default to true. * Borrow entryNode idea from NodeConfig to WakuNodeConf to easy shortcut among diffrent bootstrap node list all needs different formats * Fix rateLimit assignment for builder * Remove Core mode default as we already have a defaul, user must override * Removed obsolate API createNode with NodeConfig - tests are refactored for WakuNodeConf usage * Fix failing test due to twn-clusterid(1) default has overwrite for maxMessagSize. Fix readme.
This commit is contained in:
@@ -59,19 +59,24 @@ when isMainModule:
|
||||
|
||||
echo "Starting Waku node..."
|
||||
|
||||
let config =
|
||||
if (args.ethRpcEndpoint == ""):
|
||||
# Create a basic configuration for the Waku node
|
||||
# No RLN as we don't have an ETH RPC Endpoint
|
||||
NodeConfig.init(
|
||||
protocolsConfig = ProtocolsConfig.init(entryNodes = @[], clusterId = 42)
|
||||
)
|
||||
else:
|
||||
# Connect to TWN, use ETH RPC Endpoint for RLN
|
||||
NodeConfig.init(mode = WakuMode.Core, ethRpcEndpoints = @[args.ethRpcEndpoint])
|
||||
# Use WakuNodeConf (the CLI configuration type) for node setup
|
||||
var conf = defaultWakuNodeConf().valueOr:
|
||||
echo "Failed to create default config: ", error
|
||||
quit(QuitFailure)
|
||||
|
||||
if args.ethRpcEndpoint == "":
|
||||
# Create a basic configuration for the Waku node
|
||||
# No RLN as we don't have an ETH RPC Endpoint
|
||||
conf.mode = Core
|
||||
conf.preset = "logos.dev"
|
||||
else:
|
||||
# Connect to TWN, use ETH RPC Endpoint for RLN
|
||||
conf.mode = Core
|
||||
conf.preset = "twn"
|
||||
conf.ethClientUrls = @[EthRpcUrl(args.ethRpcEndpoint)]
|
||||
|
||||
# Create the node using the library API's createNode function
|
||||
let node = (waitFor createNode(config)).valueOr:
|
||||
let node = (waitFor createNode(conf)).valueOr:
|
||||
echo "Failed to create node: ", error
|
||||
quit(QuitFailure)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user