Build GNUnet applications from the well-typed concurrent comfort of your Haskell.
This project is organized in three layers:
network-transport-cadet (not there yet) | plug-in n-t implementation | Network.Transport.* gnunet-hs | user-friendly library | Network.GNUnet.* bindings-gnunet | autogenerated bindings (in c2hsc/bindings-DSL) | Bindings.GNUnet.* GNUnet | upstream | gnunet_*_service.h
To see how to use the library, the primary destination is
./examples. Also see tests at
./gnunet-hs/test and a netcat at
Here's an impression:
conf <- G.setup "sampleapp" "gnunet.conf" G.NoLog flip runReaderT conf $ G.run $ CADET.withCadet $ \c -> CADET.withConnection c "0E497SHHFSR09123Z8BZYP19DAMBS5K8HX9PQWV8Q8NQRH9B0VN0" (G.hash "myPort") $ CADET.send "ola!"
Note we only test on Linux at the moment.
To work on the library itself, here's how you check things work:
nix-shell cd gnunet-hs cabal new-run gnunet-hs:test
IDE integration is available at
Decide what from GNUnet's API at
gnunet/src/include/*.h you want
Hook up bindings:
c2hscon the header (details in
./bindings-gnunet), add artifact to cabal as exposed module
Build a nicer interface, some suggestions:
gnunetto see how it's used
One complex part of the project is integration between GHC RTS and GNUnet's scheduler, at
Network.GNUnet.SchedulerIntegration. We basically implement
GNUNET_SCHEDULER_Driver in terms of
GHC.Event. It mostly works at the moment.
If you'd like to help make it work 💯:
+RTS -vstreams eventlog to stderr
gdbis your friend
phoityne-vscodemight or might not be useful
By default, GNUnet is supplied via nix. If you wish to have incremental local builds of GNUnet, peruse
contrib/localgnunet.sh (consider invoking with