@xyo-network/xl1-rpc-server 1.28.0 → 1.28.2
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 +92 -6
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,24 +1,110 @@
|
|
|
1
|
+
[![logo][]][logo-link]
|
|
2
|
+
|
|
1
3
|
# @xyo-network/xl1-rpc-server
|
|
2
4
|
|
|
3
|
-
[![npm
|
|
4
|
-
[![license
|
|
5
|
+
[![npm-badge][]][npm-link]
|
|
6
|
+
[![license-badge][]][license-link]
|
|
7
|
+
|
|
8
|
+
> Drop-in HTTP JSON-RPC server for an XL1 connection — bring your own provider stack, get a working endpoint.
|
|
9
|
+
|
|
10
|
+
## About
|
|
11
|
+
|
|
12
|
+
This package gives Node.js services a turnkey HTTP front-end for the XL1 RPC engine. You pass it an `XyoConnection` (composed from [`@xyo-network/xl1-providers`](https://www.npmjs.com/package/@xyo-network/xl1-providers) or [`@xyo-network/xl1-sdk`](https://www.npmjs.com/package/@xyo-network/xl1-sdk)), and you get an HTTP server that auto-validates requests against the XL1 RPC schema registry, dispatches to the right viewer/runner, and returns serialized results.
|
|
5
13
|
|
|
6
|
-
|
|
14
|
+
It's the simplest way to expose an XL1 node, indexer, or test fixture to RPC clients.
|
|
7
15
|
|
|
8
16
|
## Install
|
|
9
17
|
|
|
18
|
+
Using npm:
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
npm i --save @xyo-network/xl1-rpc-server
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Using yarn:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
yarn add @xyo-network/xl1-rpc-server
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Using pnpm:
|
|
31
|
+
|
|
10
32
|
```sh
|
|
11
|
-
|
|
33
|
+
pnpm add @xyo-network/xl1-rpc-server
|
|
12
34
|
```
|
|
13
35
|
|
|
36
|
+
Using bun:
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
bun add @xyo-network/xl1-rpc-server
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## What's Inside
|
|
43
|
+
|
|
44
|
+
- **`createRpcHttpServer`** — creates an HTTP server bound to a JSON-RPC engine derived from your `XyoConnection`
|
|
45
|
+
- **`createRpcRequestHandler`** — lower-level request handler for plugging into an existing HTTP framework (Express, Fastify, etc.)
|
|
46
|
+
|
|
47
|
+
## Quick Start
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import { createRpcHttpServer } from '@xyo-network/xl1-rpc-server'
|
|
51
|
+
|
|
52
|
+
const server = createRpcHttpServer({ connection /* your XyoConnection */ })
|
|
53
|
+
server.listen(8080, () => {
|
|
54
|
+
console.log('XL1 RPC server listening on :8080')
|
|
55
|
+
})
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Point a client (e.g. `HttpRpcTransport` from [`@xyo-network/xl1-rpc`](https://www.npmjs.com/package/@xyo-network/xl1-rpc), or `GatewayBuilder().rpcUrl(...)` from [`@xyo-network/xl1-gateway`](https://www.npmjs.com/package/@xyo-network/xl1-gateway)) at `http://localhost:8080/rpc` and you're done.
|
|
59
|
+
|
|
60
|
+
## Building Locally
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
xy build @xyo-network/xl1-rpc-server
|
|
64
|
+
xy test @xyo-network/xl1-rpc-server
|
|
65
|
+
xy lint @xyo-network/xl1-rpc-server
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Maintainers
|
|
69
|
+
|
|
70
|
+
<table>
|
|
71
|
+
<tr>
|
|
72
|
+
<td align="center" valign="top" width="120">
|
|
73
|
+
<a href="https://github.com/arietrouw">
|
|
74
|
+
<img src="https://github.com/arietrouw.png" width="80" height="80" alt="Arie Trouw" /><br />
|
|
75
|
+
<sub><b>Arie Trouw</b></sub>
|
|
76
|
+
</a>
|
|
77
|
+
<br />
|
|
78
|
+
<a href="https://arietrouw.com">arietrouw.com</a>
|
|
79
|
+
</td>
|
|
80
|
+
<td align="center" valign="top" width="120">
|
|
81
|
+
<a href="https://github.com/jonesmac">
|
|
82
|
+
<img src="https://github.com/jonesmac.png" width="80" height="80" alt="Matt Jones" /><br />
|
|
83
|
+
<sub><b>Matt Jones</b></sub>
|
|
84
|
+
</a>
|
|
85
|
+
</td>
|
|
86
|
+
<td align="center" valign="top" width="120">
|
|
87
|
+
<a href="https://github.com/JoelBCarter">
|
|
88
|
+
<img src="https://github.com/JoelBCarter.png" width="80" height="80" alt="Joel Carter" /><br />
|
|
89
|
+
<sub><b>Joel Carter</b></sub>
|
|
90
|
+
</a>
|
|
91
|
+
</td>
|
|
92
|
+
</tr>
|
|
93
|
+
</table>
|
|
14
94
|
|
|
15
95
|
## License
|
|
16
96
|
|
|
17
|
-
See the [LICENSE](LICENSE) file
|
|
97
|
+
See the [LICENSE](./LICENSE) file (LGPL-3.0-only).
|
|
98
|
+
|
|
99
|
+
## Credits
|
|
18
100
|
|
|
101
|
+
[Made with 🔥 and ❄️ by XYO](https://xyo.network)
|
|
19
102
|
|
|
103
|
+
[logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
|
|
104
|
+
[logo-link]: https://xyo.network
|
|
20
105
|
|
|
21
106
|
[npm-badge]: https://img.shields.io/npm/v/@xyo-network/xl1-rpc-server.svg
|
|
22
107
|
[npm-link]: https://www.npmjs.com/package/@xyo-network/xl1-rpc-server
|
|
108
|
+
|
|
23
109
|
[license-badge]: https://img.shields.io/npm/l/@xyo-network/xl1-rpc-server.svg
|
|
24
|
-
[license-link]:
|
|
110
|
+
[license-link]: ./LICENSE
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@xyo-network/xl1-rpc-server",
|
|
4
|
-
"version": "1.28.
|
|
4
|
+
"version": "1.28.2",
|
|
5
5
|
"description": "XYO Layer One RPC HTTP Server",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
],
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@metamask/json-rpc-engine": "^10.3.0",
|
|
39
|
-
"@xylabs/toolchain": "~7.13.
|
|
40
|
-
"@xylabs/tsconfig": "~7.13.
|
|
39
|
+
"@xylabs/toolchain": "~7.13.13",
|
|
40
|
+
"@xylabs/tsconfig": "~7.13.13",
|
|
41
41
|
"eslint": "^10.3.0",
|
|
42
42
|
"typescript": "~5.9.3",
|
|
43
43
|
"vite": "^8.0.10",
|
|
44
44
|
"vitest": "~4.1.5"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@metamask/json-rpc-engine": "
|
|
47
|
+
"@metamask/json-rpc-engine": "^10.3"
|
|
48
48
|
},
|
|
49
49
|
"engines": {
|
|
50
50
|
"node": ">=22.3"
|