{"id":15392613,"url":"https://github.com/jackdbd/gossip-glomers","last_synced_at":"2025-07-05T17:03:55.424Z","repository":{"id":244382970,"uuid":"815064580","full_name":"jackdbd/gossip-glomers","owner":"jackdbd","description":"My solutions to the Gossip Glomers distributed systems challenges.","archived":false,"fork":false,"pushed_at":"2025-02-11T23:57:22.000Z","size":134,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-11T06:49:21.424Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://fly.io/dist-sys/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jackdbd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2024-06-14T09:19:51.000Z","updated_at":"2024-06-16T22:47:29.000Z","dependencies_parsed_at":"2025-07-05T17:02:11.933Z","dependency_job_id":null,"html_url":"https://github.com/jackdbd/gossip-glomers","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"21cc1332f8af2a3bbdb4630ead0552bb0ec16272"},"previous_names":["jackdbd/gossip-glomers"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jackdbd/gossip-glomers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Fgossip-glomers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Fgossip-glomers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Fgossip-glomers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Fgossip-glomers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jackdbd","download_url":"https://codeload.github.com/jackdbd/gossip-glomers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Fgossip-glomers/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263775816,"owners_count":23509601,"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-01T15:15:22.612Z","updated_at":"2025-07-05T17:03:55.374Z","avatar_url":"https://github.com/jackdbd.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gossip Glomers\n\nMy solutions to the [Gossip Glomers](https://fly.io/dist-sys/) distributed systems challenges.\n\n## Installation\n\n### If you use Nix\n\nThis repository contains a `flake.nix` that declares a reproducible nix shell.\n\nYou can enter this shell and install all the dependencies by running [nix develop](https://nix.dev/manual/nix/2.13/command-ref/new-cli/nix3-develop). If you use [nix-direnv](https://github.com/nix-community/nix-direnv), you don't even have to type `nix develop`, and nix will automatically enter the shell when you `cd` into the project root directory.\n\n### If you don't use Nix\n\nIn order to run Maelstrom, you will need to have the following dependencies on your system:\n\n- JDK version 11 or higher (e.g. [OpenJDK](https://openjdk.org/), [Eclipse Temurin](https://adoptium.net/temurin/releases/))\n- [Graphviz](https://graphviz.org/)\n- [gnuplot](http://www.gnuplot.info/)\n\nYou can find more details on the [Prerequisites](https://github.com/jepsen-io/maelstrom/blob/main/doc/01-getting-ready/index.md#prerequisites) section on the Maelstrom docs.\n\n### Download Maelstrom\n\nThe challenges are built on top of a platform called [Maelstrom](https://github.com/jepsen-io/maelstrom), which in turn, is built on [Jepsen](https://github.com/jepsen-io/jepsen).\n\nWhether you are using Nix or not, you will need to download a recent release of Maelstrom.\n\n```sh\nwget \"https://github.com/jepsen-io/maelstrom/releases/download/$MAELSTROM_VERSION/maelstrom.tar.bz2\" \u0026\u0026 \\\ntar -xvf maelstrom.tar.bz2 \u0026\u0026 \\\nrm maelstrom.tar.bz2\n```\n\n### Install Node.js dependencies\n\nWhether you are using Nix or not, you will need to install the Node.js dependencies.\n\n```sh\nnpm install\n```\n\n## Test a solution against a workload\n\nIn order to test whether a Gossip Glomers solution is correct, you can tell Maelstrom to run it against a [workload](https://github.com/jepsen-io/maelstrom/blob/main/doc/workloads.md). Specify your program using the `--bin` flag, and `maelstrom test` will run it on one or more [nodes](https://github.com/jepsen-io/maelstrom/blob/main/doc/protocol.md#nodes-and-networks).\n\nYour program doesn't have to be a binary. If it's a Node.js program, you just need to:\n\n1. have Node.js installed\n2. be able to execute that program (e.g. `chmod 755 program.js`)\n3. have the appropriate shabang at the top (e.g. `#!/usr/bin/env node`)\n\n### Babashka\n\nTest the `echo.clj` program against the `echo` workload.\n\n```sh\ncd maelstrom\n\n./maelstrom test -w echo \\\n  --bin ./demo/clojure/echo.clj \\\n  --node-count 1 --time-limit 10\n```\n\n### Go\n\nCompile the `echo` binary.\n\n```sh\nmkdir maelstrom-echo\ngo get github.com/jepsen-io/maelstrom/demo/go\ngo install .\n```\n\nTest the `echo` program against the `echo` workload.\n\n```sh\ncd maelstrom\n\n./maelstrom test -w echo \\\n  --bin ~/go/bin/maelstrom-echo \\\n  --node-count 1 --time-limit 10\n```\n\n### Node.js\n\nRun a simple demo against the `echo.js` program.\n\n```sh\nnode solutions/nodejs/echo.js demo\n```\n\nTest the `echo.js` solution against the `echo` workload (1 node, 10 seconds).\n\n```sh\n./maelstrom/maelstrom test -w echo \\\n  --bin ./solutions/nodejs/echo.js \\\n  --node-count 1 --time-limit 10\n```\n\nTest the `unique-ids.js` solution against the `unique-ids` workload.\n\n```sh\n./maelstrom/maelstrom test -w unique-ids \\\n  --bin ./solutions/nodejs/unique-ids.js \\\n  --availability total \\\n  --nemesis partition \\\n  --node-count 3 \\\n  --rate 1000 \\\n  --time-limit 30\n```\n\n### Node.js Single Executable Application\n\nCompile the `echo.js` program as a Node.js [Single Executable Application](https://nodejs.org/api/single-executable-applications.html).\n\n```sh\nnpm run sea:echo\n```\n\n\u003e [!NOTE]\n\u003e The Node.js single executable application feature is still experimental, and it currently only supports running a **single embedded script** using the **CommonJS** module system. That's why I'm using esbuild to create a bundle of each solution.\n\nTest the `echo` program against the `echo` workload (3 nodes, 15 seconds).\n\n```sh\n./maelstrom/maelstrom test -w echo \\\n  --bin ./solutions/nodejs-sea/echo/echo \\\n  --node-count 3 --time-limit 15\n```\n\nCompile the `unique-ids.js` solution and test it against the `unique-ids` workload.\n\n```sh\nnpm run unique-ids:sea:compile\nnpm run unique-ids:sea:test\n```\n\n### Zig example\n\nTODO\n\n## Troubleshooting\n\nIf a Maelstrom test fails, you can run the Maelstrom web server to inspect your results.\n\nIn one terminal, launch the Maelstrom (Jepsen) web server:\n\n```sh\n./maelstrom/maelstrom serve\n```\n\nIn another terminal, test one of your solutions against a Maelstrom workload:\n\n```sh\n./maelstrom/maelstrom test -w echo \\\n  --bin ./solutions/nodejs/echo.js \\\n  --node-count 3 --time-limit 15\n\n./maelstrom/maelstrom test -w echo \\\n  --bin ./maelstrom/demo/clojure/echo.clj \\\n  --node-count 2 --time-limit 10\n```\n\nVisit [http://localhost:8080](http://localhost:8080) in your browser to inspect the results.\n\n![The Maelstrom web server showing a valid test run and an incomplete one](./assets/images/maelstrom-server.png)\n\nHere you can see a few messages exchanged between Maelstrom clients (`c6`, `c7`, `c8`) and Maelstrom nodes (`n0`, `n1`, `n2`). These messages were sent during a test run of the `unique-ids` Maelstrom workflow.\n\n![Maelstrom messages for the unique-ids workflow](./assets/images/maelstrom-messages-unique-ids.png)\n\nYou can find the STDERR logs (e.g. the ones created by [debug](https://github.com/debug-js/debug)) in this directory:\n\n```txt\nstore/\u003cmaelstrom-workload\u003e/\u003ctimestamp|latest\u003e/node-logs\n```\n\nFor example, the STDERR logs of the `n2` node of the `latest` run of the `unique-ids` workload will be located here:\n\n```txt\nstore/unique-ids/latest/node-logs/n2.log\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackdbd%2Fgossip-glomers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjackdbd%2Fgossip-glomers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackdbd%2Fgossip-glomers/lists"}