1.7 KiB
TrapOS
A small in-game operating system for ComputerCraft / CC:Tweaked, built around a single-threaded event loop and a routed networking layer.
Installation
wget run https://raw.githubusercontent.com/guillaumearm/cc-libs/master/install.lua
Install the beta branch (one-time opt-in, asks for confirmation):
wget run https://raw.githubusercontent.com/guillaumearm/cc-libs/next/install.lua --beta
Once a machine is on beta, upgrade keeps it on beta — --beta is not needed again. Use upgrade --stable to go back to the stable branch.
After install, every boot shows a colored MOTD with the installed version and branch (lime for stable, orange + [BETA] for beta).
Manifest
The installed file list, version, autostart servers, and current branch all live in manifest.json at the repo root. A copy is persisted locally at /trapos/manifest.json after install, and drives upgrade, startup/motd.lua, and startup/servers.lua.
APIs
/apis/eventloop: a simple event loop API./apis/net: an API to simplify sending and receiving routed messages, based on theeventlooplibrary.
Servers
Servers listed in manifest.autostart are launched at boot by startup/servers.lua.
/servers/ping-server: allows a machine to respond to apingcommand.
Programs
router: routes messages. You need to set up a router to use allapis/net-based programs and libraries.ping: pings machines usingapis/net.events: emits and logs computer events.upgrade: upgrades the machine. Reads/trapos/manifest.jsonto stay on the current branch; use--betato opt in or--stableto opt out.
Development
See DEVELOPMENT.md for development setup and workflow.