In StorJ culture: each directory in cmd can be built into an executable binary. For our purpose, we only need to care about 3 main server side projects: storj/storj, storj/gateway-st, storj/edge (also called gateway-mt – multi-tenant).
Q: What the different between single and multi tenant?
First, let’s establish some jargon:
gateway: a bridge between you and the network, allowing you using HTTP to interact with your data (instead of using uplink library to interact directly with the network).
tenant mean: end user (not satellite).
Q: What should I use? gateway-st or edge?
gateway-st: can connect from 1 user to 1 satellite.
edge: can connect from multiple users to multiple satellites.
Personally, I don’t see any point in using single tenant, unless of course, you are the only user in your own deployment, I’m not going to focus on that.
Turn out, single tenant is extremely important, because data is decrypted right on gateway, so it can read anything, multi-tenant mean you have to trust the gateway not to read your key and your data.
To build all the binary, I’ve a script for you, put this script under the root dir of storj/storj and storj/edge, it will loop through ./cmd/ and build all binaries it can find and place it under ./bin/
#!/usr/bin/env bash
set -euo pipefail
ROOT="./cmd"
BIN_DIR="./bin"
mkdir -p "$BIN_DIR"
find "$ROOT" -type d | while read -r dir; do
if find "$dir" -maxdepth 1 -type f -name '*.go' | grep -q . &&
grep -q '^package main$' "$dir"/*.go 2>/dev/null; then
name="$(basename "$dir")"
echo "Building $name from $dir"
go build -trimpath -buildvcs=false -ldflags="-s -w" -o "$BIN_DIR/$name" "./${dir#./}"
fi
done
# for gateway-st - simply go to it root dir and run
go build -trimpath -buildvcs=false -ldflags="-s -w" -o gateway-st .
List of binaries as of today:
# storj/storj
certificates okprog
connect-test om-license
convert-node-id piecestore-benchmark
crashcollect placement-test
diskstat satellite
failprog segment-verify
filewalker-benchmark spanner-key-parser
identity storagenode
is-valid-sj1-blob storagenode-benchmark
jobq storagenode-updater
jobqtool storj-admin
metabase-listing-performance storj-sim
metabase-minimize-listing-csv tag-signer
metabase-verify uplink
metric-receiver verify-graceful-exit-receipt
migrate-encryption-master-key versioncontrol
migrate-public-ids write-hashtbl
multinode
# storj/edge
authservice certmagic-admin linksharing simplegateway
authservice-admin gateway-mt mcp-server
# storj/gateway-st
gateway-st
Ideally, you put that in a jenkins job, but I’m not going to show you how to do it here (unless of course if the demand is high, please comment below).
Updated
See [Tutorial] Run your own satellite (part 4) - Building storj binaries - #13 by kocoten1992
See you in part 5.