Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@start9labs/start-sdk/prettier.config.json"
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ARCHES := x86 arm
# overrides to s9pk.mk must precede the include statement
# The type check also runs test/, which checks the networks against satd-init.
TS_CHECK := npm run check
include node_modules/@start9labs/start-sdk/s9pk.mk
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ entrypoint: two oneshots run before the daemon on every start.
| `satd` | `satd --datadir --chain …` | `satd` | The node. `--rpcauth` is appended once the RPC credential has been set. |

`satd-init` is driven by environment: `NETWORK`, `SATD_P2P_PORT`,
`SATD_STACK_SUBNET` (the container bridge, rendered as `rpcallowip`),
`SATD_MCP=1`, `SATD_MCP_ALLOWED_HOSTS` and `SATD_TLS_HOSTNAME=satd.startos`.

## Volume and Data Layout
Expand Down Expand Up @@ -99,7 +98,7 @@ Being a flavor, this package satisfies no other service's dependency on
matches `#satd:…`, so Lightning, electrs, Mempool and the rest report Bitcoin
as unsatisfied while satd is installed. satd publishes no `rawblock` /
`rawtx` ZMQ topics, so that is correct rather than conservative; a dependent
that has verified itself against satd can opt in with `|| #satd:>=0.5.2:0`.
that has verified itself against satd can opt in with `|| #satd:>=0.6.1:0`.

## Network Access and Interfaces

Expand All @@ -111,7 +110,7 @@ that has verified itself against satd can opt in with `|| #satd:>=0.5.2:0`.
| `mcp` | `api` | 8339 | HTTPS, rewrapped by the OS | The MCP server. Bearer token required; `Host` must be listed under **MCP Hostnames**. |
| `peer` | `p2p` | 8333 / 38333 / 48333 / 18333 / 18444 | raw TCP | Inbound Bitcoin P2P. The port follows the network. |

satd's own TLS listeners (8336, 50002, 3001) are left unexported. MCP is
satd's own TLS listeners (8336, 50002, 3001, 9336) are left unexported. MCP is
the one listener satd insists on serving over its own TLS off-loopback, so the
OS terminates the client's connection and opens a fresh one inward with
certificate validation disabled — the inward leg presents a certificate from
Expand Down Expand Up @@ -148,9 +147,10 @@ everything implementation-specific is rebuilt from it:
default configuration. **This direction has not been run.**

The switch is a full reindex: satd validates every block again and rebuilds
the transaction and address indices. On mainnet that is days, not hours. Do
not stop the service, reboot, or run an action that restarts satd while it
runs — see Limitations.
the transaction and address indices. On mainnet that is days, not hours.
Stopping the service, a reboot or an action that restarts satd interrupts
it safely: satd flushes and exits on SIGTERM, and the next start continues
the reindex from the block files on disk, downloading nothing.

## Actions

Expand Down Expand Up @@ -220,11 +220,11 @@ network once started.

## Limitations and Differences

1. **A flavor switch that is interrupted re-downloads the rest of the chain.** satd ignores SIGTERM while connecting blocks, so a stop during the reindex becomes a kill after `sigtermTimeout`; on the next start satd does not resume from the block files already on disk but goes back to network IBD from the last flushed tip, writing the re-downloaded blocks into new `blk*.dat` files beside the originals. Both are upstream defects; until they are fixed the switch must run uninterrupted.
1. **The flavor switch is slow.** The reindex replays recent large blocks at a few hundred a minute at the default `dbcache`, so a mainnet switch takes days. It can be stopped and restarted (since satd 0.6.1); the speed is an upstream item for a later release.
2. **No pruning.** Electrum and Esplora both require the transaction and address indices, which are incompatible with pruning; the upstream template runs fully indexed.
3. **Not a drop-in for Core or Knots.** satd speaks Core's JSON-RPC but publishes no `rawblock` / `rawtx` ZMQ topics; see Dependencies for what that means for other services.
4. **No wallet.** satd is a node; wallets connect through the Electrum interface.
5. **satd's own TLS listeners are not exported**, and its metrics endpoint (9332) is not exposed at all.
5. **satd's own TLS listeners are not exported**, and its metrics endpoints (9332 and 9336) are not exposed at all.
6. **One RPC credential**, with the fixed username `satd`; there is no multi-user `rpcauth` management.

---
Expand All @@ -245,7 +245,6 @@ file_models:
startos_managed_env_vars:
- NETWORK
- SATD_MCP
- SATD_STACK_SUBNET
- SATD_TLS_HOSTNAME
- SATD_MCP_ALLOWED_HOSTS
- SATD_P2P_PORT
Expand Down
4 changes: 2 additions & 2 deletions UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Upstream is tracked as a prebuilt Docker image, `ghcr.io/epochbtc/satd`, pinned
and update `test/upstream/SOURCE`; `npm run check` fails if the network list or a P2P port
moved.
4. Diff `contrib/stack/satd/satd.conf.tmpl` and `satd-init` between the two tags for anything
`startos/main.ts` relies on: the `NETWORK`, `SATD_P2P_PORT`, `SATD_STACK_SUBNET`,
`SATD_MCP`, `SATD_MCP_ALLOWED_HOSTS` and `SATD_TLS_HOSTNAME` variables, the fixed listener
`startos/main.ts` relies on: the `NETWORK`, `SATD_P2P_PORT`, `SATD_MCP`,
`SATD_MCP_ALLOWED_HOSTS` and `SATD_TLS_HOSTNAME` variables, the fixed listener
ports in `startos/utils.ts`, the `secrets/mcp-token` path, and the `rpc-cookie` symlink
`sat-cli` is pointed at. Check `docs/manual/src/config-reference.md` for `rpcauth`, which
the package passes on the command line.
Expand Down
7 changes: 3 additions & 4 deletions instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ installed. If you rely on any of them, this is not the node for you.

Switching from Core or Knots keeps the block files you already have and rebuilds
the rest: satd re-validates every block and builds its own indices, which on
mainnet takes days. **Do not stop the service, restart it, reboot, or change its
settings while that runs** — an interrupted rebuild starts downloading the
remaining chain from the network instead. Switching back to Core or Knots is the
same kind of rebuild on their side.
mainnet takes days. Stopping, restarting or rebooting while it runs is safe:
the next start continues the rebuild from the block files on disk. Switching
back to Core or Knots is the same kind of rebuild on their side.

This node runs fully indexed — Electrum and Esplora both need the transaction
and address indices, and pruning is incompatible with them — so budget for the
Expand Down
Loading