=====================================================================
___ __ _ __
___ _____/ (_)___ / /_(_) /__
/ _ \/ ___/ / / __ \/ __/ / //_/
/ __/ /__/ / / /_/ / /_/ / ,<
\___/\___/_/_/ .___/\__/_/_/|_|
/_/
=====================================================================
Superhighway84 on FreeBSD
2022-01-17 | #ipfs #smolweb #freebsd
Intro
A couple of weeks ago I saw Superhighway84[1] on HackerNews[2] and started to check it out, but didn't get very far. I finally spent some time to get it up and running on FreeBSD[3] which works, but requires a few additional steps.
2: https://news.ycombinator.com/item?id=29698412 (https://news.ycombinator.com)
3: https://www.freebsd.org (https://www.freebsd.org)
I wanted to get Superhighway84 on a spare RaspberryPi 3 running FreeBSD 13, primarily used for a Gemini Capsule in FreeBSD[4], since it doesn't have much traffic and is mostly idle.
Superhighway84 is an USENET-inspired decentralized internet discussion system, featuring a retro text user interface and powered by IPFS and OrbitDB.
IPFS on FreeBSD
Superhighway84 uses IPFS[5] as it's backend, making it fully decentralized. Reading through the setup docs, an `ipfs init` is required to build the initial `~/.ipfs` filesystem. There is a ipfs-go[6] in FreeBSD ports, but it doesn't seem to work, at least on arm64.
6: https://www.freshports.org/sysutils/ipfs-go/ (https://www.freshports.org)
To work around this, building ipfs-go[7] from source is doable in a few steps,
First, install a few required packages to compile the `go` binaries
$ doas pkg install gcc gmake go openssl
Next, clone the source of `go-ipfs` and checkout the latest stable branch, otherwise there might be a version mismatch error on startup,
$ git clone https://github.com/ipfs/go-ipfs.git $ cd go-ipfs $ git checkout tags/v0.11.0
Set a few environment vars to compile with `gcc` and use `openssl`,
$ export PATH=$PATH:/usr/local/go/bin $ export PATH=$PATH:$GOPATH/bin $ export CGO_ENABLED=1 $ export GOTAGS=openssl
Build from source using `gmake`
$ doas gmake install go version go1.17.5 freebsd/arm64 bin/check_go_version 1.15.2 plugin/loader/preload.sh > plugin/loader/preload.go go fmt plugin/loader/preload.go >/dev/null go install "-asmflags=all='-trimpath='" "-gcflags=all='-trimpath='" -ldflags="-X "github.com/ipfs/go-ipfs".CurrentCommit=67220edaa" ./cmd/ipfs
After the build is finished, copy the binary to `~/bin` and export it into the `$PATH` ,
$ cp ~/go/bin/ipfs ~/bin $ export PATH="~/bin:$PATH"
Initialize `~/.ipfs` and set profile config to lowpower for running on a RaspberryPi
$ ipfs init --profile=lowpower
Building Superhighway84
With IPFS initialized, build Superhighway84 and copy the binary to `~/bin`. There are binary releases[8] for FreeBSD arm64, but compiling it from source is relatively easy as well.
$ git clone https://github.com/mrusme/superhighway84.git $ cd superhighway84 $ go build . $ cp superhighway64 ~/bin
Start up `superhighway84`, and wait a few minutes to fully sync. Using a "light" terminal theme is not recommened as it's difficult to read, and I recommended switching to a darker terminal theme.
$ superhighway84
Tags
smolweb
ipfs
____________________________________________________________________
Response: 20 (Success), text/gemini
| Original URL | gemini://rawtext.club/~ecliptik/_posts/2022-01-17-Superhi... |
|---|---|
| Status Code | 20 (Success) |
| Content-Type | text/gemini; charset=utf-8; lang=en |