You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix PendingRequest and refund cleanup
* fix lint
* remove duplicate payer info from storage
* fix PAYMENT-RESPONSE field ordering
* clean up comments
* consolidate ProcessSettlementWithExtensions into ProcessSettlement
Copy file name to clipboardExpand all lines: examples/go/clients/batch-settlement/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Batch-Settlement Client (Go)
2
2
3
-
Go port of [`examples/typescript/clients/batch-settlement`](../../../typescript/clients/batch-settlement). Sequential batch-settlement payment client. Opens a payment channel on the first request (deposit) and pays subsequent requests with off-chain vouchers that update the cumulative claimable amount.
3
+
Sequential batch-settlement payment client. Opens a payment channel on the first request (deposit) and pays subsequent requests with off-chain vouchers that update the cumulative claimable amount.
4
4
5
5
## Run
6
6
@@ -11,7 +11,7 @@ cp .env-example .env
11
11
go run .
12
12
```
13
13
14
-
The companion server is in `examples/go/servers/batch-settlement` and the facilitator is in `examples/go/facilitator/batch-settlement`. The Go and TS clients share the same env keys, default route (`/weather`), and behavior — point the same `.env` at either binary.
14
+
The companion server is in `examples/go/servers/batch-settlement` and the facilitator is in `examples/go/facilitator/batch-settlement`.
Copy file name to clipboardExpand all lines: examples/go/servers/batch-settlement/README.md
+2-14Lines changed: 2 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Batch-Settlement Server (Go)
2
2
3
-
Go port of [`examples/typescript/servers/batch-settlement`](../../../typescript/servers/batch-settlement). Demo resource server using the batch-settlement scheme: a client opens a payment channel with a single deposit; subsequent paid requests update an off-chain voucher. The `ChannelManager` periodically claims and settles onchain.
3
+
Demo resource server using the batch-settlement scheme: a client opens a payment channel with a single deposit; subsequent paid requests update an off-chain voucher. The `ChannelManager` periodically claims and settles onchain.
4
4
5
5
The route demonstrates **dynamic pricing**: the client authorizes up to `$0.01` per request, and the handler bills a random fraction of that via `Settlement-Overrides`.
6
6
@@ -15,18 +15,6 @@ go run .
15
15
16
16
The server listens on `http://localhost:4021` and exposes `GET /weather`. Pair with `examples/go/clients/batch-settlement` and `examples/go/facilitator/batch-settlement`.
17
17
18
-
### Cross-SDK local testing
19
-
20
-
The Go and TS servers share the same `.env-example` keys, route (`GET /weather`), response shape (`{report: {weather, temperature}}`), and channel-manager cadences, so you can swap one for the other without changing client config:
21
-
22
-
```bash
23
-
# Go server
24
-
EVM_ADDRESS=0x... FACILITATOR_URL=http://localhost:4022 go run .
25
-
26
-
# TS server (same .env)
27
-
cd examples/typescript/servers/batch-settlement && pnpm dev
28
-
```
29
-
30
18
## Environment
31
19
32
20
| Variable | Required | Description |
@@ -39,7 +27,7 @@ cd examples/typescript/servers/batch-settlement && pnpm dev
39
27
40
28
## Auto-settlement
41
29
42
-
The example wires up a `ChannelManager` with the same triggers as the TS demo:
30
+
The example wires up a `ChannelManager` with simple local-demo triggers:
43
31
44
32
-**Claim** every 60 s.
45
33
-**Settle** every 120 s (sweeps claimed funds to `payTo`).
0 commit comments