@weaveprotocol/cli 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -0
- package/dist/weave.mjs +4619 -962
- package/package.json +5 -2
- package/pay/dist/walletconnect.js +13708 -0
package/README.md
CHANGED
|
@@ -87,6 +87,67 @@ gates as any peer. It is an **anchor, not a host** — uptime, no authority.
|
|
|
87
87
|
For a server, `bun build.ts` makes single-file binaries for this machine,
|
|
88
88
|
`linux-x64` and `linux-arm64`; `weave-node.service` is a systemd unit.
|
|
89
89
|
|
|
90
|
+
## Hosting other people's spaces
|
|
91
|
+
|
|
92
|
+
`weave host` is a hosting service in one process. It carries every paying
|
|
93
|
+
account's spaces — sealed, as they travel — and serves them over sockets and a
|
|
94
|
+
relay, like `weave run`. It holds no account and no space key.
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Try it on this machine: every subscription counts as paid
|
|
98
|
+
weave host --free --port 8787
|
|
99
|
+
|
|
100
|
+
# Host only yourself and your family, on a server: the accounts named, and nobody else
|
|
101
|
+
weave host --free --host 0.0.0.0 --allow did:key:zDnae… --allow did:key:zDnae…
|
|
102
|
+
|
|
103
|
+
# As a service: Stripe for payments, R2 (or any S3) for storage
|
|
104
|
+
STRIPE_SECRET_KEY=sk_live_… STRIPE_WEBHOOK_SECRET=whsec_… \
|
|
105
|
+
STRIPE_PRICE_MONTHLY=price_… STRIPE_PRICE_YEARLY=price_… \
|
|
106
|
+
WEAVE_S3_ENDPOINT=https://<account>.r2.cloudflarestorage.com WEAVE_S3_BUCKET=weave-host \
|
|
107
|
+
WEAVE_S3_ACCESS_KEY_ID=… WEAVE_S3_SECRET_ACCESS_KEY=… \
|
|
108
|
+
weave host --host 0.0.0.0 --port 8787 --data /var/lib/weave-host
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
- `--free` on an address others can reach needs `--allow` (or
|
|
112
|
+
`WEAVE_HOST_ALLOW`, comma separated): otherwise anyone who found it could
|
|
113
|
+
fill its disk. An account's DID is under its name in the account home's
|
|
114
|
+
Settings, with a Copy button. `--allow` works on a paying host too.
|
|
115
|
+
- The host's key is made once, in `--data` (`host-key`, readable by you alone).
|
|
116
|
+
A new key is a new host: every account would hand its spaces over again.
|
|
117
|
+
- Point Stripe's webhook at `https://<host>/host/billing/webhook`, sending
|
|
118
|
+
`checkout.session.completed` and `invoice.paid`.
|
|
119
|
+
- Every host serves its own **pay page** at `/pay`. Homes know nothing about
|
|
120
|
+
payment: they open that page in a new tab with a link signed for the
|
|
121
|
+
subscription, and read the status the host signs. Say who you are with
|
|
122
|
+
`WEAVE_HOST_NAME`, `WEAVE_HOST_PRICE` (text, like "$4 a month"),
|
|
123
|
+
`WEAVE_HOST_TERMS` and `WEAVE_HOST_URL` (your public https:// address,
|
|
124
|
+
where Stripe sends people back to). It's all at
|
|
125
|
+
`/.well-known/weave-host`.
|
|
126
|
+
- Crypto wallets pay with no company in between: USDC on Base, sent straight
|
|
127
|
+
to your address. Next to Stripe, or instead of it:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
WEAVE_WALLET_ADDRESS=0x… WEAVE_WALLET_MONTHLY=4 WEAVE_WALLET_YEARLY=36 \
|
|
131
|
+
weave host --host 0.0.0.0 --port 8787 --data /var/lib/weave-host
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
The pay page asks the person's browser wallet (MetaMask, Coinbase Wallet,
|
|
135
|
+
Rabby…) to send the plan's price plus a fraction of a cent that marks it as
|
|
136
|
+
theirs; the host reads the network to see it arrive, then adds a month or a
|
|
137
|
+
year. Time is paid up front. `WEAVE_WALLET_NETWORK=base-sepolia` tries it
|
|
138
|
+
with test USDC; `WEAVE_WALLET_RPC` points at a network node of your own or a
|
|
139
|
+
provider's (default: the network's public one). Keep the address's private
|
|
140
|
+
key off the host — it only needs to receive.
|
|
141
|
+
- Phone wallets and every other wallet, by QR code: set
|
|
142
|
+
`WEAVE_WALLETCONNECT_PROJECT_ID` (free at dashboard.reown.com) and build the
|
|
143
|
+
WalletConnect bundle once with `npm run bundle:pay` in `cli/` (the published
|
|
144
|
+
package has it built).
|
|
145
|
+
- With a bucket, the disk is only a cache: lose it, start on the same key and
|
|
146
|
+
bucket, and every subscription and space comes back.
|
|
147
|
+
- Put it behind something that terminates TLS (Caddy does it in two lines).
|
|
148
|
+
The account home offers it under **Keep my spaces online** when built with
|
|
149
|
+
`VITE_WEAVE_HOST=https://<host>`.
|
|
150
|
+
|
|
90
151
|
## Agents
|
|
91
152
|
|
|
92
153
|
In an app, choose **Connect an agent** in the account menu. It shows one
|