cc-libs/README.md

41 lines
1.7 KiB
Markdown

# 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 the `eventloop` library.
## Servers
Servers listed in `manifest.autostart` are launched at boot by `startup/servers.lua`.
- `/servers/ping-server`: allows a machine to respond to a `ping` command.
## Programs
- `router`: routes messages. You need to set up a router to use all `apis/net`-based programs and libraries.
- `ping`: pings machines using `apis/net`.
- `events`: emits and logs computer events.
- `upgrade`: upgrades the machine. Reads `/trapos/manifest.json` to stay on the current branch; use `--beta` to opt in or `--stable` to opt out.
## Development
See [DEVELOPMENT.md](./DEVELOPMENT.md) for development setup and workflow.