roost/README.md

41 lines
1.5 KiB
Markdown

# Roost
> Where the birds come home to sleep.
Data ingest server, providing an endpoint for nodes to send data for archival.
## Go Details
Currently 1.25.3, will stay updated as quickly as possible. Go is *very* good with backwards compatibility so breaking changes are unlikely.
[Install Go](https://go.dev/learn/)
Once go is installed, `go version` should return >= 1.25.3.
### Install Dependencies
Go will take care of downloading the actual library dependencies (no need for an `npm i` equivalent) but we have some tooling dependencies as well.
- sqlc is a code gen library that gives type-safe APIs against a schema at compile time. Very handy
- `go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest`
### Learn Go
[Use Go By Example](gobyexample.com) - it is an incredible site and will get up to speed quickly. Go is a very simple language so most of the points are easy to look up.
## To run `roost`:
- `cd path/to/roost`
- `go run .`
## To build `roost` for your current target:
- `cd path/to/roost`
- `go build . [-o binary-name]`
- Default binary name is `roost`, in the current directory
## To build for different target:
Go is statically linked (and all the code we use is as well, no additional runtime libraries required), so it is trivial to compile on one architecture and copy the binary over to another.
- `cd path/to/roost`
- `go tool dist list`
- Using the relevant pair above (e.g., `linux/amd64`):
- `GOOS=linux GOARCH=amd64 go build -o roost-linux-amd64`
- The `-o` names the output binary, it could be `bob`