main
ARRR Scripts
This repository contains helper tooling to bootstrap the Pirate Chain daemon stack and expose an ARRRwallet friendly gRPC endpoint. The primary entry point is setup-arrr-lightwalletd.sh, which compiles the upstream projects, configures systemd services, and (optionally) wires nginx/Certbot for TLS termination and gRPC proxying.
What the script does
- Installs development/runtime dependencies, Go, and cloning
Piratepluslightwalletd. - Builds Pirate Chain (
pirated) andlightwalletd, links them under/usr/local/bin, and writes aPIRATE.conffor RPC access. - Sets up nginx when you pass
--hostname:- First writes a minimal HTTP-only nginx site serving
/.well-known/acme-challenge/so Certbot can start without certs. - Requests certificates via
certbot certonly --webroot, then rewrites the nginx site with the full HTTPS/gRPC proxy block (including/etc/letsencryptincludes and gRPC headers). - Ensures nginx is tested and reloaded after each stage.
- First writes a minimal HTTP-only nginx site serving
- Creates systemd units for
piratedandlited(the lightwalletd binary), wiring logs, data directories, and capabilities. - If you opt out of nginx, the script runs
litedwith the provided TLS cert/key (or--no-tls-very-insecurewhen not supplied) directly on the host.
Usage
./setup-arrr-lightwalletd.sh \
--hostname <your-domain> \
--email admin@example.com \
--lets-encrypt \
--bind-addr 127.0.0.1:9067 \
--http-bind-addr 127.0.0.1:9068 \
--data-dir /var/lib/lightwalletd
--hostnameenables nginx/Certbot and proxies127.0.0.1:9067(or your--bind-addr) over gRPC.--lets-encryptpairs with--emailsocertbot certonly --webrootcan obtain certs. The script keeps nginx challenge locations intact while the final config relies on/etc/letsencrypt/live/<hostname>.- Without
--hostname, nginx isn’t installed andlitedruns with the TLS arguments you provide (--tls-cert/--tls-key) or falls back to--no-tls-very-insecure. --go-version,--data-dir, and bind addresses are all optional overrides. The defaults are documented in the script.
After the run
systemctl status pirated litedshows the daemon status; logs live under/var/log/lited.sudo certbot certificatesconfirms the issued certificate for your hostname.- Let’s Encrypt installs its own renew timer, so nothing else is required for automatic renewal.
Troubleshooting
- If nginx reports
hostvariable errors, ensure the generated config keeps\$host/\$request_uriescaped; the script already does this in the heredoc. - You can rerun the script after DNS is live—Certbot’s webroot challenge will reuse the shared
/var/www/certbotdirectory and nginx rewrites happen in-place.
Description
Languages
Shell
100%