KadNode
KadNode copied to clipboard
KadNode as a library
Is it possible that this project serves a library to include in other projects. I really would like to use it for example in chat applications to resolve ip by public key as 'dns' .
It is not possible yet, but I would love to do it and will give it a shoot very soon. The project has recently been rewritten and I currently prepare the new release (packaging, testing etc.).
I've already created some cmake projects based on this cmake template (https://github.com/cginternals/cmake-init) which also has packaging for deb and rpm. Let me know if I can help anyhow.
Thanks, but that would be too much of a change right now. Anyway, how do you like the library to operate?
- kadnode, just as a library?
- how should the API look like?
So far this is the first API method I came up with: int kadnode_lookup( const char query[], IP addr_array[], size_t addr_num );
How should settings be provided?
Also important, how should the (non-blocking) event loop be integrated? Maybe the library should utilize its own thread.
I plan to provide to config as strings, not as file. For my own I would run the event loop in my own thread, but for convenience the library should additionally have its own thread.
Here is an example how I would like to use it. https://github.com/hyphaproject/hypha/blob/namesystem/source/utils/source/namesystem.cpp
I think it good practice to not do threading in the library. Some people want to use pthreads or other libs that might not be compatible. Your example looks about right. Might take a few days to implement something usable.
Library support won't make it into 2.0.0. There is too much work to be done. It will be a testing release anyway.