{"id":16359548,"url":"https://github.com/vygr/chrysalib","last_synced_at":"2025-10-26T04:32:01.182Z","repository":{"id":45073954,"uuid":"440573275","full_name":"vygr/ChrysaLib","owner":"vygr","description":"C++ ChrysaLisp services and messaging.","archived":false,"fork":false,"pushed_at":"2024-12-03T15:20:21.000Z","size":5151,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-31T14:35:44.186Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vygr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-21T16:00:29.000Z","updated_at":"2024-12-03T15:23:36.000Z","dependencies_parsed_at":"2023-10-03T22:20:47.032Z","dependency_job_id":null,"html_url":"https://github.com/vygr/ChrysaLib","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vygr%2FChrysaLib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vygr%2FChrysaLib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vygr%2FChrysaLib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vygr%2FChrysaLib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vygr","download_url":"https://codeload.github.com/vygr/ChrysaLib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238259116,"owners_count":19442537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T02:08:43.186Z","updated_at":"2025-10-26T04:31:53.745Z","avatar_url":"https://github.com/vygr.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChrysaLib\n\n![](./screen_shot_1.png)\n\nC++ ChrysaLib !\n\nA version of ChrysaLisp system concepts written in C++.\n\nThe screen shot above shows a network of 1 Intel MacBook, 1 M1 Arm MacBook, 1\nx86 Linux server, 1 x86 Ubuntu 20.04 VM in Virtualbox, 1 Windows 10 PC and last\nbut not least, 1 Raspberry PI4.\n\nAll machines running together, auto configured and sharing the demo apps work.\n5 GUIs running in total across the network. Very robust as nodes come online\nand go offline, things just keep on keeping on !\n\n## Dependencies\n\n### Mac via Brew\n\n`brew install libusb asio sdl2`\n\n### Linux via apt-get\n\n`sudo apt-get install libasio-dev libsdl2-dev libudev-dev autoconf automake\nlibtool git make g++`\n\n### libusb\n\nGo get the latest source tarball download from here https://libusb.info/.\n\nExtract the archive with `Extract Here` from the Ubuntu UI, or with your\nfavorite `tar` application.\n\nGo into the new extracted folder via the terminal and type:\n\n```text\n./autogen.sh\n./configure\nmake all\nsudo make install\n```\n\nThis should install the library into `/usr/local/lib/` and the headers into\n`/usr/local/include/`.\n\n### Windows via Googling\n\nDownload libusb v1.0.24 from https://github.com/libusb/libusb/releases and asio\n1.20.0 (not the boost version) from https://think-async.com/Asio/\n\n`libusb`\n\nAdd the include and lib paths for libusb to your visual studio project and add\nlibusb-1.0.lib as an additional linker dependency.\n\n`asio`\n\nAdd the include path to asio.hpp to your visual studio project there are no\nlink dependencies as including the header also brings in any necessary\nlibraries.\n\nAdd the following preprocessor definitions:\n\nASIO_STANDALONE;BOOST_ALL_NO_LIB;BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING;\nASIO_WINDOWS;ASIO_MSVC\n\n`sdl2`\n\nDownload and install the SDL frameworks from:\nhttps://www.libsdl.org/download-2.0.php\n\nGet the development versions for both frameworks and unzip them somewhere. Copy\nthe .dll files from the lib folders into your ChrysaLib folder.\n\nSDL2.dll\n\nAdd the include directory for SDL to your include path, and similarly for the\nlib directory. SDL2.lib and SDL2main.lib should be added as link dependencies.\n\n## Make\n\nMake with:\n\n```text\nmake -j\n```\n\n## Clean\n\nClean with:\n\n```text\nmake clean\n```\n\n## Run\n\nRun with:\n\n```text\nhub_node [switches] [ip_addr ...]\neg. hub_node -t 10000 -usb -ip 192.168.0.64 192.168.0.65\n-h:       this help info\n-v level: verbosity, default 0, ie none\n-t ms:    exit timeout, default 0, ie never\n-usb:     start the usb link manager\n-ip:      start the ip link manager server\n-shm:     start the shmem link manager server, (CLB-L1, CLB-L2)\n```\n\n## Usage\n\nSo what is it ? How would I use it ? Is this all you're going to provide ?\n\nThis is the lowest layer of the ChrysaLisp messaging and services system\nimplemented in C++. You can use this to create applications and services in C++\nthat can be wired together via USB or IP links.\n\nApplications and services will automatically be kept informed as other peers\njoin and leave the network. Whatever services these peers advertise will become\navailable to use and you talk to them via the messaging system.\n\nMore examples will be forthcoming, but a simple File_Service example source is\nprovided to give the flavour of what you might build as a service, but clearly\nwhatever you can dream up.\n\nDNS resolution for easier setup will follow soon as well as some auto wiring\naid using broadcasts may be possible.\n\n### Likely configuration\n\nWhile you could use the code to construct an arbitrary setup of what process\nruns what services there are some practical matters to consider about who can\nown USB handles and such that make me suggest the following.\n\nRun a `hub_node` on each machine and wire them to other peers `hubs` with:\n\n`./hub_node -ip -usb peer_ip peer_ip ...`\n\nThese hubs take care of USB links getting plugged in between machines and run a\nserver for IP link connections.\n\nFor an application or stand alone service, they should `dial` the `localhost`\n`hub_node` to connect to the network with:\n\n`./hub_node 127.0.0.1`\n\nNothing stops you from having a bundle of services as threads of a single\nprocess, but the router for that bundle `dials` the local `hub` to give them\nall access to the network.\n\nSubnets can exist on the same Ethernet network with no issue. Only the\napplications and services that have `dialed` another member will be seen to be\npart of that subnet.\n\nSubnets can join to each other dynamically if a link comes up between them, and\nthey will split back into individual subnets if the link connecting them goes\ndown.\n\nApplications and services can be created that dynamically probe the service\ndirectory and farm out work to external resources and applications. Robust\nfailure is easy to arrange with the timed message reading and selection lists.\nDiscarding mailboxes and allocating fresh ones as you need allows you to\nsilently ignore any in flight messages that may still be on route.\n\n### File_Service\n\nThe `File_Service` standalone example app/service can be launched with:\n\n`./files_node 127.0.0.1`\n\nThis example is only a base class, you would provide a subclass overriding the\nvirtual methods to provide an implementation for a specific OS or filesystem\nAPI etc.\n\n### GUI_Service\n\nThe `GUI_Service` can be launched with:\n\n`./gui_node 127.0.0.1`\n\nThis is a work in progress, to port the current ChrysaLisp GUI system and\nwidgets over to C++.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvygr%2Fchrysalib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvygr%2Fchrysalib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvygr%2Fchrysalib/lists"}