Skip to content

Commit

Permalink
refactor(rpc): deprecate httpAgent and httpsAgent
Browse files Browse the repository at this point in the history
  • Loading branch information
homura committed Nov 27, 2023
1 parent 6380e04 commit f275e8c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 0 additions & 2 deletions packages/rpc/src/types/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ export namespace CKBComponents {
export type Since = string;
export interface Node {
url: string;
httpAgent?: any;
httpsAgent?: any;
}
export interface Method {
name: string;
Expand Down
15 changes: 15 additions & 0 deletions website/docs/migrations/migrate-to-v0.21.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Migrate to Lumos v0.21

### Deprecated the `httpAgent` and `httpsAgent` in `RPC.setNode`

Please use the `fetch` option in `RPC` constructor instead.

```diff
-const rpc = new RPC(url)
+const rpc = new RPC(
+ url,
+ { fetch: (request, init) => originalFetch(request, { ...init, keepalive: true }) },
+)
-rpc.setNode({ url, httpAgent, httpsAgent })
+rpc.setNode({ url })
```

0 comments on commit f275e8c

Please sign in to comment.