This repo houses solutions Fly.io's Gossip Glomers challenges, implemented in C.
❓: What's Gossip Glomers? See here for more information!
The workflow to develop this project leverages Docker to provide the runtime for maelstrom
(the testing framework for Gossip Glomers). For developer quality of life (dev QoL), we recommend developing locally and volume mounting
the container. This allows you to use your local development environment (e.g., choice of editor, LSP, debugger, etc.) while still having the runtime available for testing and program execution.
The following are what's needed to set up the development and execution environments for this project:
- Docker Desktop (namely, the Docker daemon will need to be running to run the container)
Note that the following two dependencies are already included in the runtime (see Dockerfile
), but are worth installing locally for dev QoL (e.g., LSPs may require having json-c
source on hand).
-
json-c
(e.g., on Mac, this can be installed usingbrew install json-c
; see the project Github for more information) -
pkg-config
(e.g., on Mac, this can be installed usingbrew install pkg-config
)
The top-level Makefile
governs the build dependency graph. For convenience, the entire project can be built by simply executing:
make
in the container's /app
directory (read: the same directory, in the container, mounted to the local directory containing this project).
To run the solution to Challenge 1: Echo, execute the following (in /app
) in the container (after building the project):
maelstrom test -w echo --bin build/challenge-1.out --node-count 1 --time-limit 10
To run the solution to Challenge 2: Unique ID Generation, execute the following (in /app
) in the container (after building the project):
maelstrom test -w unique-ids --bin build/challenge-2.out --time-limit 30 --rate 1000 --node-count 3 --availability total --nemesis partition
To run the solution to Challenge 3a: Single Node Broadcast, execute the following (in /app
) in the container (after building the project):
maelstrom test -w broadcast --bin build/challenge-3a.out --node-count 1 --time-limit 20 --rate 10
To run the solution to Challenge 3b: Multi Node Broadcast and Challenge 3c: Fault Tolerant Broadcast, execute the following (in /app
) in the container (after building the project):
# Challenge 3b
maelstrom test -w broadcast --bin build/challenge-3bc.out --node-count 5 --time-limit 20 --rate 10
# Challenge 3c
maelstrom test -w broadcast --bin build/challenge-3bc.out --node-count 5 --time-limit 20 --rate 10 --nemesis partition
Everything looks good! ヽ(‘ー`)ノ