hello

command
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

hello

A program that updates itself. Run 1.0.0 on a device, publish 1.1.0, and watch it become 1.1.0 on its own.

# 1. Build every platform for 1.0.0; put the right binary on the device.
./release.sh 1.0.0 http://<server-host>:8089
scp dist/hello_linux_arm64 device:hello

# 2. Run the update server (go build -o ota ../../cmd/ota).
cp dist/hello.pub keys; echo devtoken > tok; echo admintoken > admin
ota serve -addr :8089 -data-dir data -verifier ed25519 -ed25519-keys keys \
  -token-file tok -admin-token-file admin

# 3. On the device.
OTA_TOKEN=devtoken ./hello -every 10s

# 4. Publish 1.1.0 and roll it out. Passing the server's data directory puts
#    the binaries in its blob store, so the upload is just the signed offer.
./release.sh 1.1.0 http://<server-host>:8089 data
curl -H 'Authorization: Bearer admintoken' -d @dist/upload.json localhost:8089/v1/admin/offers
curl -X PUT -H 'Authorization: Bearer admintoken' -d '{"version":"1.1.0","percent":100}' \
  localhost:8089/v1/admin/rollouts/hello/stable

The device logs downloading, installed, then hello 1.1.0, and after 30 seconds of running cleanly, committed. release.sh creates hello.key on first run; keep it, since every build pins its public key.

Documentation

Overview

Command hello is a program that keeps itself up to date: it prints its version, then checks the update server every -every and becomes the new version when a signed one is offered. Build it with release.sh.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL